diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a7775cf4064a..8ce1fbe98620 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,17 +1,35 @@ { "packages/gapic-node-templating": "0.0.0", "packages/google-api-apikeys": "0.1.1", - "packages/google-cloud-batch": "0.1.2", + "packages/google-cloud-batch": "0.2.0", "packages/google-cloud-beyondcorp-appconnections": "0.2.1", "packages/google-cloud-beyondcorp-appconnectors": "0.3.1", "packages/google-cloud-beyondcorp-appgateways": "0.2.1", "packages/google-cloud-beyondcorp-clientconnectorservices": "0.2.1", "packages/google-cloud-beyondcorp-clientgateways": "0.2.1", + "packages/google-cloud-bigquery-analyticshub": "0.1.0", + "packages/google-cloud-bigquery-dataexchange": "0.3.0", + "packages/google-cloud-bigquery-datapolicies": "0.1.0", + "packages/google-cloud-bigquery-datatransfer": "3.1.3", + "packages/google-cloud-bigquery-reservation": "2.0.2", + "packages/google-cloud-gkeconnect-gateway": "2.0.3", + "packages/google-cloud-deploy": "2.2.0", + "packages/google-cloud-dataplex": "2.2.0", + "packages/google-cloud-certificatemanager": "0.6.0", "packages/google-cloud-gkemulticloud": "0.1.2", + "packages/google-cloud-language": "5.1.0", + "packages/google-cloud-memcache": "2.1.2", + "packages/google-cloud-oslogin": "4.0.2", + "packages/google-cloud-phishingprotection": "3.0.4", + "packages/google-cloud-policytroubleshooter": "2.0.4", + "packages/google-cloud-recommender": "5.0.2", "packages/google-cloud-redis": "3.1.3", + "packages/google-cloud-resourcemanager": "4.1.1", "packages/google-cloud-security-publicca": "0.1.1", + "packages/google-cloud-shell": "2.0.2", "packages/google-devtools-artifactregistry": "2.0.0", - "packages/google-iam": "0.1.1", - "packages/typeless-sample-bot": "1.0.0", - "packages/google-cloud-bigquery-analyticshub": "0.1.0" + "packages/google-iam": "0.2.0", + "packages/google-maps-routing": "0.1.1", + "packages/google-monitoring-dashboard": "2.7.1", + "packages/typeless-sample-bot": "1.0.0" } diff --git a/bin/delete-everything-split-repo.sh b/bin/delete-everything-split-repo.sh new file mode 100755 index 000000000000..b2e0202ee92a --- /dev/null +++ b/bin/delete-everything-split-repo.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# Copyright 2022 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. + +set -e + +if [ $# -lt 2 ] +then + echo "Usage: $0 " + exit 1 +fi + +# repo name (e.g. nodejs-asset) +SPLIT_REPO=$1 +# destination directory (e.g. google-cloud-asset) +ARTIFACT_NAME=$2 + +rm -rf "/tmp/${SPLIT_REPO}" +git clone "git@github.com:googleapis/${SPLIT_REPO}.git" "/tmp/${SPLIT_REPO}" + +cd "/tmp/${SPLIT_REPO}" + +git checkout -b 'deleteMostOfLibrary' + + +# Delete everything first that's not the samples, README.md, .kokoro folder, and git folder +ls | grep -v 'samples\|README.md\|.git' | xargs rm -rf +rm -rf "/tmp/${SPLIT_REPO}/.[!.git]*" +rm -rf "/tmp/${SPLIT_REPO}/.github" +rm -rf "/tmp/${SPLIT_REPO}/.kokoro" + +git checkout "/tmp/${SPLIT_REPO}/.kokoro/presubmit/node12/common.cfg" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/presubmit/node12/samples-test.cfg" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/presubmit/node12/system-test.cfg" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/presubmit/node12/test.cfg" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/common.cfg" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/populate-secrets.sh" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/trampoline.sh" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/trampoline_v2.sh" +git checkout "/tmp/${SPLIT_REPO}/.kokoro/.gitattributes" + +IGNORE_README_TXT="# Copyright 2022 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. +import synthtool.languages.node as node +node.owlbot_main(templates_excludes=[ +'README.md' +])" + +OWLBOT_PY="/tmp/${SPLIT_REPO}/owlbot.py" + +echo "$IGNORE_README_TXT" >> "$OWLBOT_PY" + +SAMPLES_CFG_TXT="#!/bin/bash +# Copyright 2022 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. +set -eo pipefail +export NPM_CONFIG_PREFIX=\${HOME}/.npm-global +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=\${KOKORO_GFILE_DIR}/service-account.json +export GCLOUD_PROJECT=long-door-651 +cd \$(dirname \$0)/.. +# Run a pre-test hook, if a pre-samples-test.sh is in the project +if [ -f .kokoro/pre-samples-test.sh ]; then + set +x + . .kokoro/pre-samples-test.sh + set -x +fi +if [ -f samples/package.json ]; then + # Install and link samples + cd samples/ + npm install + # If tests are running against main branch, configure flakybot + # to open issues on failures: + if [[ \$KOKORO_BUILD_ARTIFACTS_SUBDIR = *\"continuous\"* ]] || [[ \$KOKORO_BUILD_ARTIFACTS_SUBDIR = *\"nightly\"* ]]; then + export MOCHA_REPORTER_OUTPUT=test_output_sponge_log.xml + export MOCHA_REPORTER=xunit + cleanup() { + chmod +x \$KOKORO_GFILE_DIR/linux_amd64/flakybot + \$KOKORO_GFILE_DIR/linux_amd64/flakybot + } + trap cleanup EXIT HUP + fi + npm run test +fi +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=12 +if npx check-node-version@3.3.0 --silent --node \$COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f \"\$NYC_BIN\" ]; then + \$NYC_BIN report || true + fi + bash \$KOKORO_GFILE_DIR/codecov.sh +else + echo \"coverage is only reported for Node \$COVERAGE_NODE\" +fi" + +SYSTEM_TEST_CFG_TXT="#!/bin/bash +# Copyright 2022 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. +set -eo pipefail +echo \"no-op\" +" + +echo "$SAMPLES_CFG_TXT" >> "/tmp/${SPLIT_REPO}/.kokoro/samples-test.sh" +echo "$SYSTEM_TEST_CFG_TXT" >> "/tmp/${SPLIT_REPO}/.kokoro/system-test.sh" +chmod u+x "/tmp/${SPLIT_REPO}/.kokoro/samples-test.sh" +chmod u+x "/tmp/${SPLIT_REPO}/.kokoro/system-test.sh" + +# Update the README +README_MD="/tmp/${SPLIT_REPO}/README.md" + +README_CONTENT=$(cat $README_MD) +echo -e "**_THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO [GOOGLE-CLOUD-NODE](https://github.com/googleapis/google-cloud-node/tree/main/packages/${ARTIFACT_NAME})_**\n\n$README_CONTENT" > "$README_MD" + +git add . +git commit -m 'build: update README for deprecation notice and delete all files except samples' + +git push -f --set-upstream origin deleteMostOfLibrary + +# create pull request +if gh --help > /dev/null +then + gh pr create --title "build: update README for deprecation notice and delete all files except samples" +else + hub pull-request -m "build: update README for deprecation notice and delete all files except samples" +fi + +rm -rf "/tmp/${SPLIT_REPO}" diff --git a/bin/migrate-split-repo.sh b/bin/migrate-split-repo.sh index f80db1c522b4..df85fc33d3f8 100755 --- a/bin/migrate-split-repo.sh +++ b/bin/migrate-split-repo.sh @@ -40,4 +40,8 @@ ${SCRIPT_DIR}/migrate-git-history.sh \ "" \ "${PACKAGE_PATH}" \ ".kokoro,.github,.trampolinerc,SECURITY.md,renovate.json,samples" \ - ".github/.OwlBot.yaml,samples/quickstart.js,samples/test/quickstart.js,samples/test/quickstart.test.js,system-test/test/quickstart.test.js,system-test/test/quickstart.js,samples/README.md,samples/package.json,samples/generated" + ".github/.OwlBot.yaml,samples/quickstart.js,samples/test/quickstart.js,samples/.eslintrc.yml,samples/test/sample.test.js,samples/test/quickstart.test.js,system-test/test/quickstart.test.js,system-test/test/quickstart.js,samples/README.md,samples/package.json,samples/generated" + +# run the script to update the split repo and either delete all the samples or just update the README +${SCRIPT_DIR}/delete-everything-split-repo.sh "${SPLIT_REPO}" "${ARTIFACT_NAME}" +${SCRIPT_DIR}/update-readme-only-split-repo.sh "${SPLIT_REPO}"" "${ARTIFACT_NAME}" diff --git a/bin/update-readme-only-split-repo.sh b/bin/update-readme-only-split-repo.sh new file mode 100755 index 000000000000..895363c22b4d --- /dev/null +++ b/bin/update-readme-only-split-repo.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# Copyright 2022 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. + +set -e + +if [ $# -lt 2 ] +then + echo "Usage: $0 " + exit 1 +fi + +# repo name (e.g. nodejs-asset) +SPLIT_REPO=$1 +# destination directory (e.g. google-cloud-asset) +ARTIFACT_NAME=$2 + +rm -rf "/tmp/${SPLIT_REPO}" +git clone "git@github.com:googleapis/${SPLIT_REPO}.git" "/tmp/${SPLIT_REPO}" + +cd "/tmp/${SPLIT_REPO}" + +git checkout -b 'removeOwlBotAndUpdateREADME' + +shopt -s extglob + +OWLBOT_PY="/tmp/${SPLIT_REPO}/owlbot.py" +# Delete owlbot.yaml +rm -rf "$OWLBOT_PY" + +IGNORE_README_TXT="# Copyright 2022 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. +import synthtool.languages.node as node +node.owlbot_main(templates_excludes=[ +'README.md' +])" + +echo "$IGNORE_README_TXT" >> "$OWLBOT_PY" + +# Update the README +README_MD="/tmp/${SPLIT_REPO}/README.md" +README_CONTENT=$(cat $README_MD) +echo -e "**_THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO [GOOGLE-CLOUD-NODE](https://github.com/googleapis/google-cloud-node/tree/main/packages/${ARTIFACT_NAME})_**\n\n$README_CONTENT" > "$README_MD" + +git add . +git commit -m 'build: update README for deprecation notice' + +git push -f --set-upstream origin removeOwlBotAndUpdateREADME + +# create pull request +if gh --help > /dev/null +then + gh pr create --title "build: update README for deprecation notice" +else + hub pull-request -m "build: update README for deprecation notice" +fi + +rm -rf "/tmp/${SPLIT_REPO}" \ No newline at end of file diff --git a/ci/cloudbuild.yaml b/ci/cloudbuild.yaml index 1e5f8198d6ab..95d5af844d2c 100644 --- a/ci/cloudbuild.yaml +++ b/ci/cloudbuild.yaml @@ -24,7 +24,7 @@ logsBucket: 'gs://${_LOGS_BUCKET}/logs/google-cloud-node/${_BUILD_TYPE}/${COMMIT timeout: 7200s steps: - - name: 'gcr.io/kaniko-project/executor:v1.9.0' + - name: 'gcr.io/kaniko-project/executor:v1.9.1' args: [ '--log-format=text', '--context=dir:///workspace/testing', diff --git a/packages/google-cloud-batch/CHANGELOG.md b/packages/google-cloud-batch/CHANGELOG.md index 67e2b766c245..a559c4c0f879 100644 --- a/packages/google-cloud-batch/CHANGELOG.md +++ b/packages/google-cloud-batch/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/batch-v0.1.2...batch-v0.2.0) (2022-10-18) + + +### Features + +* Enable install_gpu_drivers flag in v1 proto ([37c3db1](https://github.com/googleapis/google-cloud-node/commit/37c3db12dea1c18ba1d3d40f346cf7460fe9b3cb)) + ## [0.1.2](https://github.com/googleapis/google-cloud-node/compare/batch-v0.1.1...batch-v0.1.2) (2022-09-28) diff --git a/packages/google-cloud-batch/package.json b/packages/google-cloud-batch/package.json index 49c27772c568..36b51c575378 100644 --- a/packages/google-cloud-batch/package.json +++ b/packages/google-cloud-batch/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/batch", - "version": "0.1.2", + "version": "0.2.0", "description": "Batch client for Node.js", "repository": "googleapis/google-cloud-node", "license": "Apache-2.0", diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto index 9c746ebea342..69305e41cce9 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto @@ -274,7 +274,9 @@ message AllocationPolicy { } // Device name that the guest operating system will see. - // If not specified, this is default to the disk name. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. string device_name = 3; } @@ -287,6 +289,7 @@ message AllocationPolicy { // The number of accelerators of this type. int64 count = 2; + // Deprecated: please use instances[0].install_gpu_drivers instead. bool install_gpu_drivers = 3 [deprecated = true]; } @@ -325,6 +328,12 @@ message AllocationPolicy { // c++ keyword conflict. string instance_template = 2; } + + // Set this field true if users want Batch to help fetch drivers from a + // third party location and install them for GPUs specified in + // policy.accelerators or instance_template on their behalf. Default is + // false. + bool install_gpu_drivers = 3; } // A network interface. @@ -378,6 +387,9 @@ message AllocationPolicy { // Only instances[0] is supported now. repeated InstancePolicyOrTemplate instances = 8; + // Service account that VMs will run as. + ServiceAccount service_account = 9; + // Labels applied to all VM instances and other resources // created by AllocationPolicy. // Labels could be user provided or system generated. @@ -443,3 +455,12 @@ message TaskGroup { // VMs running the Batch tasks in the same TaskGroup. bool permissive_ssh = 12; } + +// Carries information about a Google Cloud service account. +message ServiceAccount { + // Email address of the service account. If not specified, the default + // Compute Engine service account for the project will be used. If instance + // template is being used, the service account has to be specified in the + // instance template and it has to match the email field here. + string email = 1; +} diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto index b313d2910c0b..dc224aa4328c 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto @@ -92,7 +92,7 @@ message Job { // Output only. Job status. It is read only for users. JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Job notification. + // Deprecated: please use notifications instead. JobNotification notification = 10 [deprecated = true]; // Output only. When the Job was created. @@ -329,7 +329,9 @@ message AllocationPolicy { } // Device name that the guest operating system will see. - // If not specified, this is default to the disk name. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. string device_name = 3; } @@ -342,12 +344,14 @@ message AllocationPolicy { // The number of accelerators of this type. int64 count = 2; + // Deprecated: please use instances[0].install_gpu_drivers instead. bool install_gpu_drivers = 3 [deprecated = true]; } // InstancePolicy describes an instance type and resources attached to each VM // created by this InstancePolicy. message InstancePolicy { + // Deprecated: please use machine_type instead. repeated string allowed_machine_types = 1 [deprecated = true]; // The Compute Engine machine type. @@ -383,6 +387,10 @@ message AllocationPolicy { string instance_template = 2; } + // Set this field true if users want Batch to help fetch drivers from a + // third party location and install them for GPUs specified in + // policy.accelerators or instance_template on their behalf. Default is + // false. bool install_gpu_drivers = 3; } @@ -433,29 +441,23 @@ message AllocationPolicy { // Location where compute resources should be allocated for the Job. LocationPolicy location = 1; - // Create only instances allowed by this policy. + // Deprecated: please use instances[0].policy instead. InstancePolicy instance = 2 [deprecated = true]; // Describe instances that can be created by this AllocationPolicy. // Only instances[0] is supported now. repeated InstancePolicyOrTemplate instances = 8; - // Instance templates that are used to VMs. - // If specified, only instance_templates[0] is used. + // Deprecated: please use instances[0].template instead. repeated string instance_templates = 3 [deprecated = true]; - // Create only instances in the listed provisiong models. - // Default to allow all. - // - // Currently only the first model of the provisioning_models list will be - // considered; specifying additional models (e.g., 2nd, 3rd, etc.) is a no-op. + // Deprecated: please use instances[i].policy.provisioning_model instead. repeated ProvisioningModel provisioning_models = 4 [deprecated = true]; - // Email of the service account that VMs will run as. + // Deprecated: please use service_account instead. string service_account_email = 5 [deprecated = true]; // Service account that VMs will run as. - // Not yet implemented. ServiceAccount service_account = 9; // Labels applied to all VM instances and other resources @@ -551,10 +553,12 @@ message TaskGroup { // Carries information about a Google Cloud service account. message ServiceAccount { // Email address of the service account. If not specified, the default - // Compute Engine service account for the project will be used. + // Compute Engine service account for the project will be used. If instance + // template is being used, the service account has to be specified in the + // instance template and it has to match the email field here. string email = 1; // List of scopes to be enabled for this service account on the VM, in // addition to the cloud-platform API scope that will be added by default. - repeated string scopes = 2; + repeated string scopes = 2 [deprecated = true]; } diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index 59b318da9846..f167e5d41108 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -2017,6 +2017,9 @@ export namespace google { /** AllocationPolicy instances */ instances?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]|null); + /** AllocationPolicy serviceAccount */ + serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + /** AllocationPolicy labels */ labels?: ({ [k: string]: string }|null); @@ -2039,6 +2042,9 @@ export namespace google { /** AllocationPolicy instances. */ public instances: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]; + /** AllocationPolicy serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + /** AllocationPolicy labels. */ public labels: { [k: string]: string }; @@ -2696,6 +2702,9 @@ export namespace google { /** InstancePolicyOrTemplate instanceTemplate */ instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers */ + installGpuDrivers?: (boolean|null); } /** Represents an InstancePolicyOrTemplate. */ @@ -2713,6 +2722,9 @@ export namespace google { /** InstancePolicyOrTemplate instanceTemplate. */ public instanceTemplate?: (string|null); + /** InstancePolicyOrTemplate installGpuDrivers. */ + public installGpuDrivers: boolean; + /** InstancePolicyOrTemplate policyTemplate. */ public policyTemplate?: ("policy"|"instanceTemplate"); @@ -3148,6 +3160,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IServiceAccount); + + /** ServiceAccount email. */ + public email: string; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.batch.v1.IServiceAccount): google.cloud.batch.v1.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ComputeResource. */ interface IComputeResource { diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index 18bcb6d92371..92c97ea3295a 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -5101,6 +5101,7 @@ * @interface IAllocationPolicy * @property {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location * @property {Array.|null} [instances] AllocationPolicy instances + * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount * @property {Object.|null} [labels] AllocationPolicy labels * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network */ @@ -5138,6 +5139,14 @@ */ AllocationPolicy.prototype.instances = $util.emptyArray; + /** + * AllocationPolicy serviceAccount. + * @member {google.cloud.batch.v1.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccount = null; + /** * AllocationPolicy labels. * @member {Object.} labels @@ -5188,6 +5197,8 @@ if (message.instances != null && message.instances.length) for (var i = 0; i < message.instances.length; ++i) $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -5232,6 +5243,10 @@ message.instances.push($root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); break; } + case 9: { + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.decode(reader, reader.uint32()); + break; + } case 6: { if (message.labels === $util.emptyObject) message.labels = {}; @@ -5308,6 +5323,11 @@ return "instances." + error; } } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -5351,6 +5371,11 @@ message.instances[i] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); } } + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.fromObject(object.serviceAccount); + } if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.cloud.batch.v1.AllocationPolicy.labels: object expected"); @@ -5386,6 +5411,7 @@ if (options.defaults) { object.location = null; object.network = null; + object.serviceAccount = null; } if (message.location != null && message.hasOwnProperty("location")) object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); @@ -5402,6 +5428,8 @@ for (var j = 0; j < message.instances.length; ++j) object.instances[j] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); return object; }; @@ -6900,6 +6928,7 @@ * @interface IInstancePolicyOrTemplate * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate + * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers */ /** @@ -6933,6 +6962,14 @@ */ InstancePolicyOrTemplate.prototype.instanceTemplate = null; + /** + * InstancePolicyOrTemplate installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6975,6 +7012,8 @@ $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); return writer; }; @@ -7017,6 +7056,10 @@ message.instanceTemplate = reader.string(); break; } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -7068,6 +7111,9 @@ if (!$util.isString(message.instanceTemplate)) return "instanceTemplate: string expected"; } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; return null; }; @@ -7090,6 +7136,8 @@ } if (object.instanceTemplate != null) message.instanceTemplate = String(object.instanceTemplate); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); return message; }; @@ -7106,6 +7154,8 @@ if (!options) options = {}; var object = {}; + if (options.defaults) + object.installGpuDrivers = false; if (message.policy != null && message.hasOwnProperty("policy")) { object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); if (options.oneofs) @@ -7116,6 +7166,8 @@ if (options.oneofs) object.policyTemplate = "instanceTemplate"; } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; return object; }; @@ -8077,6 +8129,209 @@ return TaskGroup; })(); + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.batch.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(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]]; + } + + /** + * ServiceAccount email. + * @member {string} email + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = ""; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.batch.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + v1.ComputeResource = (function() { /** diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index a00ce697ba9f..27e3c3e470e9 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -560,6 +560,10 @@ "type": "InstancePolicyOrTemplate", "id": 8 }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 9 + }, "labels": { "keyType": "string", "type": "string", @@ -698,6 +702,10 @@ "instanceTemplate": { "type": "string", "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3 } } }, @@ -783,6 +791,14 @@ } } }, + "ServiceAccount": { + "fields": { + "email": { + "type": "string", + "id": 1 + } + } + }, "ComputeResource": { "fields": { "cpuMilli": { @@ -2020,7 +2036,10 @@ "scopes": { "rule": "repeated", "type": "string", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } } } }, diff --git a/packages/google-cloud-batch/samples/package.json b/packages/google-cloud-batch/samples/package.json index c085f40e4187..4aeca40eb3e5 100644 --- a/packages/google-cloud-batch/samples/package.json +++ b/packages/google-cloud-batch/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/batch": "^0.1.2" + "@google-cloud/batch": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-bigquery-analyticshub/.jsdoc.js b/packages/google-cloud-bigquery-analyticshub/.jsdoc.js index f38242309983..6543945df220 100644 --- a/packages/google-cloud-bigquery-analyticshub/.jsdoc.js +++ b/packages/google-cloud-bigquery-analyticshub/.jsdoc.js @@ -43,7 +43,7 @@ module.exports = { copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, - systemName: '@google-cloud/analyticshub', + systemName: '@google-cloud/bigquery-analyticshub', theme: 'lumen', default: { outputSourceFiles: false diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js index dccea1c22387..6cc7a304ed48 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js @@ -47,7 +47,7 @@ function main(parent, dataExchangeId, dataExchange) { // const dataExchange = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js index eabc0a773a4c..b270349c410d 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js @@ -47,7 +47,7 @@ function main(parent, listingId, listing) { // const listing = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js index e559897b72ca..b28c04c54440 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js @@ -35,7 +35,7 @@ function main(name) { // const name = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js index fa216b60654b..b09296e5478c 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js @@ -35,7 +35,7 @@ function main(name) { // const name = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js index 6c524cb3a751..bf3e73fba0ec 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js @@ -35,7 +35,7 @@ function main(name) { // const name = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js index 7e538477759e..1314d7212dbe 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js @@ -40,7 +40,7 @@ function main(resource) { // const options = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js index 2116b0bf5d34..fa7bcdb3a918 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js @@ -35,7 +35,7 @@ function main(name) { // const name = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js index 957dbc5d87ed..bd210c9e369c 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js @@ -45,7 +45,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js index dafc3d0afad7..dc79406f7afa 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js @@ -45,7 +45,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js index f48400bde63a..8ee7afbbb460 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js @@ -45,7 +45,7 @@ function main(organization) { // const pageToken = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js index fee60688ebb1..6e91603bfb82 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js @@ -49,7 +49,7 @@ function main(resource, policy) { // const updateMask = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js index 5be224bb994e..5511f5e0ebde 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js @@ -39,7 +39,7 @@ function main(name) { // const name = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js index 5d6b9306953f..90ce570da8ae 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js @@ -42,7 +42,7 @@ function main(resource, permissions) { // const permissions = 'abc123' // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js index 4f593ce16d38..b8a0ad21e5d8 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js @@ -40,7 +40,7 @@ function main(updateMask, dataExchange) { // const dataExchange = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js index 8a70b9865c76..d4b881a1f6f5 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js @@ -40,7 +40,7 @@ function main(updateMask, listing) { // const listing = {} // Imports the Analyticshub library - const {AnalyticsHubServiceClient} = require('@google-cloud/analyticshub').v1; + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-analyticshub').v1; // Instantiates a client const analyticshubClient = new AnalyticsHubServiceClient(); diff --git a/packages/google-cloud-bigquery-analyticshub/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-analyticshub/src/v1/gapic_metadata.json index aff0479a3b48..3b8ec2e26c02 100644 --- a/packages/google-cloud-bigquery-analyticshub/src/v1/gapic_metadata.json +++ b/packages/google-cloud-bigquery-analyticshub/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.bigquery.analyticshub.v1", - "libraryPackage": "@google-cloud/analyticshub", + "libraryPackage": "@google-cloud/bigquery-analyticshub", "services": { "AnalyticsHubService": { "clients": { diff --git a/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts b/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts index 291fc72ce9f1..9d6165fb0be9 100644 --- a/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts +++ b/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts @@ -252,9 +252,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('GetDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -284,9 +285,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('GetDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -332,9 +334,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('GetDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -364,9 +367,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('GetDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -386,9 +390,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateDataExchangeRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -419,9 +424,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateDataExchangeRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -467,9 +473,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateDataExchangeRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -499,9 +506,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateDataExchangeRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -522,10 +530,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest() ); request.dataExchange ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateDataExchangeRequest', [ - 'dataExchange', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); request.dataExchange.name = defaultValue1; const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -557,10 +565,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest() ); request.dataExchange ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateDataExchangeRequest', [ - 'dataExchange', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); request.dataExchange.name = defaultValue1; const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -607,10 +615,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest() ); request.dataExchange ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateDataExchangeRequest', [ - 'dataExchange', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); request.dataExchange.name = defaultValue1; const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -641,10 +649,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest() ); request.dataExchange ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateDataExchangeRequest', [ - 'dataExchange', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); request.dataExchange.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -664,9 +672,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -697,9 +706,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -745,9 +755,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -777,9 +788,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteDataExchangeRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -799,7 +811,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetListingRequest() ); - const defaultValue1 = getTypeDefaultValue('GetListingRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -829,7 +844,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetListingRequest() ); - const defaultValue1 = getTypeDefaultValue('GetListingRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -875,7 +893,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetListingRequest() ); - const defaultValue1 = getTypeDefaultValue('GetListingRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -905,7 +926,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.GetListingRequest() ); - const defaultValue1 = getTypeDefaultValue('GetListingRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.GetListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -925,9 +949,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateListingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateListingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateListingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -957,9 +982,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateListingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateListingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateListingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1005,9 +1031,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateListingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateListingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateListingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1037,9 +1064,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.CreateListingRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateListingRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.CreateListingRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1060,10 +1088,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest() ); request.listing ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateListingRequest', [ - 'listing', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest', + ['listing', 'name'] + ); request.listing.name = defaultValue1; const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1094,10 +1122,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest() ); request.listing ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateListingRequest', [ - 'listing', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest', + ['listing', 'name'] + ); request.listing.name = defaultValue1; const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1144,10 +1172,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest() ); request.listing ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateListingRequest', [ - 'listing', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest', + ['listing', 'name'] + ); request.listing.name = defaultValue1; const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1178,10 +1206,10 @@ describe('v1.AnalyticsHubServiceClient', () => { new protos.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest() ); request.listing ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateListingRequest', [ - 'listing', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.UpdateListingRequest', + ['listing', 'name'] + ); request.listing.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1201,9 +1229,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1233,9 +1262,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1281,9 +1311,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1313,9 +1344,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.DeleteListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1335,9 +1367,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest() ); - const defaultValue1 = getTypeDefaultValue('SubscribeListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1367,9 +1400,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest() ); - const defaultValue1 = getTypeDefaultValue('SubscribeListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1415,9 +1449,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest() ); - const defaultValue1 = getTypeDefaultValue('SubscribeListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1447,9 +1482,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest() ); - const defaultValue1 = getTypeDefaultValue('SubscribeListingRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1469,9 +1505,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1501,9 +1538,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1549,9 +1587,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1581,9 +1620,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.GetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1603,9 +1643,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1635,9 +1676,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1683,9 +1725,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1715,9 +1758,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.SetIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1737,9 +1781,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1770,9 +1815,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1818,9 +1864,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1850,9 +1897,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsRequest() ); - const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1872,9 +1920,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1912,9 +1961,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1970,9 +2020,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2002,9 +2053,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2066,9 +2118,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2119,9 +2172,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2170,9 +2224,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDataExchangesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2214,9 +2269,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedResponse = [ @@ -2255,9 +2311,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedResponse = [ @@ -2313,9 +2370,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2345,9 +2403,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedResponse = [ @@ -2409,9 +2468,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2462,9 +2522,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedResponse = [ @@ -2513,9 +2574,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListOrgDataExchangesRequest', [ - 'organization', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest', + ['organization'] + ); request.organization = defaultValue1; const expectedHeaderRequestParams = `organization=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2557,9 +2619,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2597,9 +2660,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2655,9 +2719,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2687,9 +2752,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2749,9 +2815,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2802,9 +2869,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2853,9 +2921,10 @@ describe('v1.AnalyticsHubServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.ListListingsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListListingsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.analyticshub.v1.ListListingsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-bigquery-dataexchange/.OwlBot.yaml b/packages/google-cloud-bigquery-dataexchange/.OwlBot.yaml new file mode 100644 index 000000000000..2b4b17af881d --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/bigquery/dataexchange/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-dataexchange/$1 diff --git a/packages/google-cloud-bigquery-dataexchange/.eslintignore b/packages/google-cloud-bigquery-dataexchange/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-bigquery-dataexchange/.eslintrc.json b/packages/google-cloud-bigquery-dataexchange/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-dataexchange/.gitattributes b/packages/google-cloud-bigquery-dataexchange/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-bigquery-dataexchange/.gitignore b/packages/google-cloud-bigquery-dataexchange/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.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/packages/google-cloud-bigquery-dataexchange/.jsdoc.js b/packages/google-cloud-bigquery-dataexchange/.jsdoc.js new file mode 100644 index 000000000000..58252758d09a --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-data-exchange', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-dataexchange/.mocharc.js b/packages/google-cloud-bigquery-dataexchange/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-bigquery-dataexchange/.nycrc b/packages/google-cloud-bigquery-dataexchange/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-dataexchange/.prettierignore b/packages/google-cloud-bigquery-dataexchange/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-dataexchange/.prettierrc.js b/packages/google-cloud-bigquery-dataexchange/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-dataexchange/.repo-metadata.json b/packages/google-cloud-bigquery-dataexchange/.repo-metadata.json new file mode 100644 index 000000000000..1f4f6fd52180 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "analyticshub", + "name_pretty": "Analytics Hub API", + "product_documentation": "https://cloud.google.com/analytics-hub", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-data-exchange/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/bigquery-data-exchange", + "api_id": "analyticshub.googleapis.com", + "default_version": "v1beta1", + "requires_billing": true, + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md b/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md new file mode 100644 index 000000000000..c0131b386b01 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +## [0.3.0](https://github.com/googleapis/nodejs-bigquery-data-exchange/compare/v0.2.1...v0.3.0) (2022-09-26) + + +### ⚠ BREAKING CHANGES + +* refactor references to Category message +* refresh current dataexchange/v1beta1/* directory to include recent change in protos. Removed + +### Features + +* update BigQuery Analytics Hub API v1beta1 client ([fe3d671](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/fe3d671d2cecbdb1285975dc273fc17cfebf6538)) + + +### Bug Fixes + +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/1553)) ([#23](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/23)) ([c2bd811](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/c2bd811802e7ae10d21eba8d901bcbbf528f003e)) +* refactor references to Category message ([fe3d671](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/fe3d671d2cecbdb1285975dc273fc17cfebf6538)) +* use google-gax v3.3.0 ([c2bd811](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/c2bd811802e7ae10d21eba8d901bcbbf528f003e)) + +## [0.2.1](https://github.com/googleapis/nodejs-bigquery-data-exchange/compare/v0.2.0...v0.2.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#19](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/19)) ([de4f51f](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/de4f51ff6e053732c5e190b96f9e68e88603048c)) +* change import long to require ([#20](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/20)) ([7a9eb42](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/7a9eb42279f185d95003df7c713666e84ec94c65)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/1546)) ([#22](https://github.com/googleapis/nodejs-bigquery-data-exchange/issues/22)) ([34013d3](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/34013d3984966bb6922475d98047e21e104f6547)) + +## [0.2.0](https://github.com/googleapis/nodejs-bigquery-data-exchange/compare/v0.1.0...v0.2.0) (2022-07-04) + + +### Features + +* support regapic LRO ([e4e9083](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/e4e90832a8d3b33284c176d89196511e9f3739d9)) + +## 0.1.0 (2022-05-30) + + +### Features + +* initial generation of library ([27f990f](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/27f990f0fe4b135c32b0f1406dfb3ec28fc4695c)) +* initial stub of library ([000fd64](https://github.com/googleapis/nodejs-bigquery-data-exchange/commit/000fd640e68fda5b2432d13c5d8a1f7de7247562)) diff --git a/packages/google-cloud-bigquery-dataexchange/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-dataexchange/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-bigquery-dataexchange/CONTRIBUTING.md b/packages/google-cloud-bigquery-dataexchange/CONTRIBUTING.md new file mode 100644 index 000000000000..258e23ceaf7a --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Analytics Hub API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticshub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-dataexchange/LICENSE b/packages/google-cloud-bigquery-dataexchange/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-bigquery-dataexchange/README.md b/packages/google-cloud-bigquery-dataexchange/README.md new file mode 100644 index 000000000000..6d5368f71cc1 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/README.md @@ -0,0 +1,196 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Analytics Hub API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-data-exchange.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-exchange) + + + + +analyticshub client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Analytics Hub API Node.js Client API Reference][client-docs] +* [Analytics Hub API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Analytics Hub API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigquery-data-exchange +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The parent resource path of the DataExchanges. + * e.g. `projects/myproject/locations/US`. + */ +// const parent = 'abc123' +/** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ +// const pageSize = 1234 +/** + * Page token, returned by a previous call, to request the next page of + * results. + */ +// const pageToken = 'abc123' + +// Imports the Dataexchange library +const {AnalyticsHubServiceClient} = + require('@google-cloud/bigquery-data-exchange').v1beta1; + +// Instantiates a client +const dataexchangeClient = new AnalyticsHubServiceClient(); + +async function callListDataExchanges() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataexchangeClient.listDataExchangesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListDataExchanges(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Analytics_hub_service.create_data_exchange | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js,samples/README.md) | +| Analytics_hub_service.create_listing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js,samples/README.md) | +| Analytics_hub_service.delete_data_exchange | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js,samples/README.md) | +| Analytics_hub_service.delete_listing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js,samples/README.md) | +| Analytics_hub_service.get_data_exchange | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js,samples/README.md) | +| Analytics_hub_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js,samples/README.md) | +| Analytics_hub_service.get_listing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js,samples/README.md) | +| Analytics_hub_service.list_data_exchanges | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js,samples/README.md) | +| Analytics_hub_service.list_listings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js,samples/README.md) | +| Analytics_hub_service.list_org_data_exchanges | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js,samples/README.md) | +| Analytics_hub_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js,samples/README.md) | +| Analytics_hub_service.subscribe_listing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js,samples/README.md) | +| Analytics_hub_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js,samples/README.md) | +| Analytics_hub_service.update_data_exchange | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js,samples/README.md) | +| Analytics_hub_service.update_listing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js,samples/README.md) | + + + +The [Analytics Hub API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigquery-data-exchange@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-data-exchange/latest +[product-docs]: https://cloud.google.com/analytics-hub +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticshub.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-dataexchange/linkinator.config.json b/packages/google-cloud-bigquery-dataexchange/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-bigquery-dataexchange/package.json b/packages/google-cloud-bigquery-dataexchange/package.json new file mode 100644 index 000000000000..8b6d87e31286 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/bigquery-data-exchange", + "version": "0.3.0", + "description": "analyticshub client for Node.js", + "repository": "googleapis/nodejs-bigquery-data-exchange", + "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 analyticshub", + "analyticshub", + "analyticshub service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm install", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.2.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=v12.0.0" + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/common/common.proto b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/common/common.proto new file mode 100644 index 000000000000..07c7fef9b663 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/common/common.proto @@ -0,0 +1,68 @@ +// Copyright 2022 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.cloud.bigquery.dataexchange.common; + +option csharp_namespace = "Google.Cloud.BigQuery.DataExchange.Common"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/dataexchange/common;common"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.bigquery.dataexchange.common"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataExchange\\Common"; +option ruby_package = "Google::Cloud::Bigquery::DataExchange::Common"; + +// Listing categories. +enum Category { + CATEGORY_UNSPECIFIED = 0; + + CATEGORY_OTHERS = 1; + + CATEGORY_ADVERTISING_AND_MARKETING = 2; + + CATEGORY_COMMERCE = 3; + + CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + + CATEGORY_DEMOGRAPHICS = 5; + + CATEGORY_ECONOMICS = 6; + + CATEGORY_EDUCATION = 7; + + CATEGORY_ENERGY = 8; + + CATEGORY_FINANCIAL = 9; + + CATEGORY_GAMING = 10; + + CATEGORY_GEOSPATIAL = 11; + + CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + + CATEGORY_MEDIA = 13; + + CATEGORY_PUBLIC_SECTOR = 14; + + CATEGORY_RETAIL = 15; + + CATEGORY_SPORTS = 16; + + CATEGORY_SCIENCE_AND_RESEARCH = 17; + + CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + + CATEGORY_TRAVEL_AND_TOURISM = 19; +} diff --git a/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto new file mode 100644 index 000000000000..f18a0e49e09f --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto @@ -0,0 +1,651 @@ +// Copyright 2022 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.cloud.bigquery.dataexchange.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataExchange.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/dataexchange/v1beta1;dataexchange"; +option java_multiple_files = true; +option java_outer_classname = "DataExchangeProto"; +option java_package = "com.google.cloud.bigquery.dataexchange.v1beta1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataExchange\\V1beta1"; +option ruby_package = "Google::Cloud::Bigquery::DataExchange::V1beta1"; +option (google.api.resource_definition) = { + type: "bigquery.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" +}; + +// The `AnalyticsHubService` API facilitates data sharing within and across +// organizations. It allows data providers to publish listings that reference +// shared datasets. With Analytics Hub, users can discover and search for +// listings that they have access to. Subscribers can view and subscribe to +// listings. When you subscribe to a listing, Analytics Hub creates a linked +// dataset in your project. +service AnalyticsHubService { + option (google.api.default_host) = "analyticshub.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all data exchanges in a given project and location. + rpc ListDataExchanges(ListDataExchangesRequest) returns (ListDataExchangesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/dataExchanges" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists all data exchanges from projects in a given organization and + // location. + rpc ListOrgDataExchanges(ListOrgDataExchangesRequest) returns (ListOrgDataExchangesResponse) { + option (google.api.http) = { + get: "/v1beta1/{organization=organizations/*/locations/*}/dataExchanges" + }; + option (google.api.method_signature) = "organization"; + } + + // Gets the details of a data exchange. + rpc GetDataExchange(GetDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new data exchange. + rpc CreateDataExchange(CreateDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/dataExchanges" + body: "data_exchange" + }; + option (google.api.method_signature) = "parent,data_exchange"; + } + + // Updates an existing data exchange. + rpc UpdateDataExchange(UpdateDataExchangeRequest) returns (DataExchange) { + option (google.api.http) = { + patch: "/v1beta1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}" + body: "data_exchange" + }; + option (google.api.method_signature) = "data_exchange,update_mask"; + } + + // Deletes an existing data exchange. + rpc DeleteDataExchange(DeleteDataExchangeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all listings in a given project and location. + rpc ListListings(ListListingsRequest) returns (ListListingsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a listing. + rpc GetListing(GetListingRequest) returns (Listing) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new listing. + rpc CreateListing(CreateListingRequest) returns (Listing) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings" + body: "listing" + }; + option (google.api.method_signature) = "parent,listing"; + } + + // Updates an existing listing. + rpc UpdateListing(UpdateListingRequest) returns (Listing) { + option (google.api.http) = { + patch: "/v1beta1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}" + body: "listing" + }; + option (google.api.method_signature) = "listing,update_mask"; + } + + // Deletes a listing. + rpc DeleteListing(DeleteListingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Subscribes to a listing. + // + // Currently, with Analytics Hub, you can create listings that + // reference only BigQuery datasets. + // Upon subscription to a listing for a BigQuery dataset, Analytics Hub + // creates a linked dataset in the subscriber's project. + rpc SubscribeListing(SubscribeListingRequest) returns (SubscribeListingResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the IAM policy. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy" + body: "*" + } + }; + } + + // Sets the IAM policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy" + body: "*" + } + }; + } + + // Returns the permissions that a caller has. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A data exchange is a container that lets you share data. Along with the +// descriptive information about the data exchange, it contains listings that +// reference shared datasets. +message DataExchange { + option (google.api.resource) = { + type: "analyticshub.googleapis.com/DataExchange" + pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}" + }; + + // Output only. The resource name of the data exchange. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name of the data exchange. The display name must + // contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), + // spaces ( ), ampersands (&) and must not start or end with spaces. + // Default value is an empty string. + // Max length: 63 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the data exchange. The description must not contain Unicode + // non-characters as well as C0 and C1 control codes except tabs (HT), + // new lines (LF), carriage returns (CR), and page breaks (FF). + // Default value is an empty string. + // Max length: 2000 bytes. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the primary point of contact of the data exchange. + // Max Length: 1000 bytes. + string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation describing the data exchange. + string documentation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Number of listings contained in the data exchange. + int32 listing_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB + // Expected image dimensions are 512x512 pixels, however the API only + // performs validation on size of the encoded data. + // Note: For byte fields, the content of the fields are base64-encoded (which + // increases the size of the data by 33-36%) when using JSON on the wire. + bytes icon = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains details of the data provider. +message DataProvider { + // Optional. Name of the data provider. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the data provider. + // Max Length: 1000 bytes. + string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains details of the listing publisher. +message Publisher { + // Optional. Name of the listing publisher. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the listing publisher. + // Max Length: 1000 bytes. + string primary_contact = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains the reference that identifies a destination bigquery dataset. +message DestinationDatasetReference { + // Required. A unique ID for this dataset, without the project name. The ID + // must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + // The maximum length is 1,024 characters. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the project containing this dataset. + string project_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Defines the destination bigquery dataset. +message DestinationDataset { + // Required. A reference that identifies the destination dataset. + DestinationDatasetReference dataset_reference = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A descriptive name for the dataset. + google.protobuf.StringValue friendly_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A user-friendly description of the dataset. + google.protobuf.StringValue description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels associated with this dataset. You can use these + // to organize and group your datasets. + // You can set this property when inserting or updating a dataset. + // See https://cloud.google.com/resource-manager/docs/creating-managing-labels + // for more information. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The geographic location where the dataset should reside. See + // https://cloud.google.com/bigquery/docs/locations for supported + // locations. + string location = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// A listing is what gets published into a data exchange that a subscriber can +// subscribe to. It contains a reference to the data source along with +// descriptive information that will help subscribers find and subscribe the +// data. +message Listing { + option (google.api.resource) = { + type: "analyticshub.googleapis.com/Listing" + pattern: "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + }; + + // A reference to a shared dataset. It is an existing BigQuery dataset with a + // collection of objects such as tables and views that you want to share + // with subscribers. + // When subscriber's subscribe to a listing, Analytics Hub creates a linked + // dataset in + // the subscriber's project. A Linked dataset is an opaque, read-only BigQuery + // dataset that serves as a _symbolic link_ to a shared dataset. + message BigQueryDatasetSource { + // Resource name of the dataset source for this listing. + // e.g. `projects/myproject/datasets/123` + string dataset = 1 [(google.api.resource_reference) = { + type: "bigquery.googleapis.com/Dataset" + }]; + } + + // State of the listing. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // Subscribable state. Users with dataexchange.listings.subscribe permission + // can subscribe to this listing. + ACTIVE = 1; + } + + // Listing categories. + enum Category { + CATEGORY_UNSPECIFIED = 0; + + CATEGORY_OTHERS = 1; + + CATEGORY_ADVERTISING_AND_MARKETING = 2; + + CATEGORY_COMMERCE = 3; + + CATEGORY_CLIMATE_AND_ENVIRONMENT = 4; + + CATEGORY_DEMOGRAPHICS = 5; + + CATEGORY_ECONOMICS = 6; + + CATEGORY_EDUCATION = 7; + + CATEGORY_ENERGY = 8; + + CATEGORY_FINANCIAL = 9; + + CATEGORY_GAMING = 10; + + CATEGORY_GEOSPATIAL = 11; + + CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12; + + CATEGORY_MEDIA = 13; + + CATEGORY_PUBLIC_SECTOR = 14; + + CATEGORY_RETAIL = 15; + + CATEGORY_SPORTS = 16; + + CATEGORY_SCIENCE_AND_RESEARCH = 17; + + CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18; + + CATEGORY_TRAVEL_AND_TOURISM = 19; + } + + // Listing source. + oneof source { + // Required. Shared dataset i.e. BigQuery dataset source. + BigQueryDatasetSource bigquery_dataset = 6 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The resource name of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Human-readable display name of the listing. The display name must contain + // only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces + // ( ), ampersands (&) and can't start or end with spaces. + // Default value is an empty string. + // Max length: 63 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Short description of the listing. The description must not contain + // Unicode non-characters and C0 and C1 control codes except tabs (HT), + // new lines (LF), carriage returns (CR), and page breaks (FF). + // Default value is an empty string. + // Max length: 2000 bytes. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the primary point of contact of the listing. + // Max Length: 1000 bytes. + string primary_contact = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Documentation describing the listing. + string documentation = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the listing. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB + // Expected image dimensions are 512x512 pixels, however the API only + // performs validation on size of the encoded data. + // Note: For byte fields, the contents of the field are base64-encoded (which + // increases the size of the data by 33-36%) when using JSON on the wire. + bytes icon = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Details of the data provider who owns the source data. + DataProvider data_provider = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Categories of the listing. Up to two categories are allowed. + repeated Category categories = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Details of the publisher who owns the listing and who can share + // the source data. + Publisher publisher = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email or URL of the request access of the listing. + // Subscribers can use this reference to request access. + // Max Length: 1000 bytes. + string request_access = 12 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting the list of data exchanges. +message ListDataExchangesRequest { + // Required. The parent resource path of the data exchanges. + // e.g. `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to the list of data exchanges. +message ListDataExchangesResponse { + // The list of data exchanges. + repeated DataExchange data_exchanges = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for requesting the list of data exchanges from projects in an +// organization and location. +message ListOrgDataExchangesRequest { + // Required. The organization resource path of the projects containing DataExchanges. + // e.g. `organizations/myorg/locations/US`. + string organization = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to listing data exchanges in an organization and +// location. +message ListOrgDataExchangesResponse { + // The list of data exchanges. + repeated DataExchange data_exchanges = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for getting a data exchange. +message GetDataExchangeRequest { + // Required. The resource name of the data exchange. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; +} + +// Message for creating a data exchange. +message CreateDataExchangeRequest { + // Required. The parent resource path of the data exchange. + // e.g. `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ID of the data exchange. + // Must contain only Unicode letters, numbers (0-9), underscores (_). + // Should not use characters that require URL-escaping, or characters + // outside of ASCII, spaces. + // Max length: 100 bytes. + string data_exchange_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The data exchange to create. + DataExchange data_exchange = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a data exchange. +message UpdateDataExchangeRequest { + // Required. Field mask specifies the fields to update in the data exchange + // resource. The fields specified in the + // `updateMask` are relative to the resource and are not a full request. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The data exchange to update. + DataExchange data_exchange = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a data exchange. +message DeleteDataExchangeRequest { + // Required. The full name of the data exchange resource that you want to delete. + // For example, `projects/myproject/locations/US/dataExchanges/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; +} + +// Message for requesting the list of listings. +message ListListingsRequest { + // Required. The parent resource path of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 2; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 3; +} + +// Message for response to the list of Listings. +message ListListingsResponse { + // The list of Listing. + repeated Listing listings = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Message for getting a listing. +message GetListingRequest { + // Required. The resource name of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for creating a listing. +message CreateListingRequest { + // Required. The parent resource path of the listing. + // e.g. `projects/myproject/locations/US/dataExchanges/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/DataExchange" + } + ]; + + // Required. The ID of the listing to create. + // Must contain only Unicode letters, numbers (0-9), underscores (_). + // Should not use characters that require URL-escaping, or characters + // outside of ASCII, spaces. + // Max length: 100 bytes. + string listing_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The listing to create. + Listing listing = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a Listing. +message UpdateListingRequest { + // Required. Field mask specifies the fields to update in the listing resource. The + // fields specified in the `updateMask` are relative to the resource and are + // not a full request. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The listing to update. + Listing listing = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a listing. +message DeleteListingRequest { + // Required. Resource name of the listing to delete. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for subscribing to a listing. +message SubscribeListingRequest { + // Resulting destination of the listing that you subscribed to. + oneof destination { + // BigQuery destination dataset to create for the subscriber. + DestinationDataset destination_dataset = 3; + } + + // Required. Resource name of the listing that you want to subscribe to. + // e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticshub.googleapis.com/Listing" + } + ]; +} + +// Message for response when you subscribe to a listing. +message SubscribeListingResponse { + +} diff --git a/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts b/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts new file mode 100644 index 000000000000..1252b71e3ce7 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts @@ -0,0 +1,9431 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace dataexchange. */ + namespace dataexchange { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents an AnalyticsHubService */ + class AnalyticsHubService extends $protobuf.rpc.Service { + + /** + * Constructs a new AnalyticsHubService 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 AnalyticsHubService 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): AnalyticsHubService; + + /** + * Calls ListDataExchanges. + * @param request ListDataExchangesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataExchangesResponse + */ + public listDataExchanges(request: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListDataExchangesCallback): void; + + /** + * Calls ListDataExchanges. + * @param request ListDataExchangesRequest message or plain object + * @returns Promise + */ + public listDataExchanges(request: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest): Promise; + + /** + * Calls ListOrgDataExchanges. + * @param request ListOrgDataExchangesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOrgDataExchangesResponse + */ + public listOrgDataExchanges(request: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListOrgDataExchangesCallback): void; + + /** + * Calls ListOrgDataExchanges. + * @param request ListOrgDataExchangesRequest message or plain object + * @returns Promise + */ + public listOrgDataExchanges(request: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest): Promise; + + /** + * Calls GetDataExchange. + * @param request GetDataExchangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataExchange + */ + public getDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetDataExchangeCallback): void; + + /** + * Calls GetDataExchange. + * @param request GetDataExchangeRequest message or plain object + * @returns Promise + */ + public getDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest): Promise; + + /** + * Calls CreateDataExchange. + * @param request CreateDataExchangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataExchange + */ + public createDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateDataExchangeCallback): void; + + /** + * Calls CreateDataExchange. + * @param request CreateDataExchangeRequest message or plain object + * @returns Promise + */ + public createDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest): Promise; + + /** + * Calls UpdateDataExchange. + * @param request UpdateDataExchangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataExchange + */ + public updateDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateDataExchangeCallback): void; + + /** + * Calls UpdateDataExchange. + * @param request UpdateDataExchangeRequest message or plain object + * @returns Promise + */ + public updateDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest): Promise; + + /** + * Calls DeleteDataExchange. + * @param request DeleteDataExchangeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteDataExchangeCallback): void; + + /** + * Calls DeleteDataExchange. + * @param request DeleteDataExchangeRequest message or plain object + * @returns Promise + */ + public deleteDataExchange(request: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest): Promise; + + /** + * Calls ListListings. + * @param request ListListingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListListingsResponse + */ + public listListings(request: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListListingsCallback): void; + + /** + * Calls ListListings. + * @param request ListListingsRequest message or plain object + * @returns Promise + */ + public listListings(request: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest): Promise; + + /** + * Calls GetListing. + * @param request GetListingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Listing + */ + public getListing(request: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetListingCallback): void; + + /** + * Calls GetListing. + * @param request GetListingRequest message or plain object + * @returns Promise + */ + public getListing(request: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest): Promise; + + /** + * Calls CreateListing. + * @param request CreateListingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Listing + */ + public createListing(request: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateListingCallback): void; + + /** + * Calls CreateListing. + * @param request CreateListingRequest message or plain object + * @returns Promise + */ + public createListing(request: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest): Promise; + + /** + * Calls UpdateListing. + * @param request UpdateListingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Listing + */ + public updateListing(request: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateListingCallback): void; + + /** + * Calls UpdateListing. + * @param request UpdateListingRequest message or plain object + * @returns Promise + */ + public updateListing(request: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest): Promise; + + /** + * Calls DeleteListing. + * @param request DeleteListingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteListing(request: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteListingCallback): void; + + /** + * Calls DeleteListing. + * @param request DeleteListingRequest message or plain object + * @returns Promise + */ + public deleteListing(request: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest): Promise; + + /** + * Calls SubscribeListing. + * @param request SubscribeListingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SubscribeListingResponse + */ + public subscribeListing(request: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SubscribeListingCallback): void; + + /** + * Calls SubscribeListing. + * @param request SubscribeListingRequest message or plain object + * @returns Promise + */ + public subscribeListing(request: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace AnalyticsHubService { + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listDataExchanges}. + * @param error Error, if any + * @param [response] ListDataExchangesResponse + */ + type ListDataExchangesCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listOrgDataExchanges}. + * @param error Error, if any + * @param [response] ListOrgDataExchangesResponse + */ + type ListOrgDataExchangesCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getDataExchange}. + * @param error Error, if any + * @param [response] DataExchange + */ + type GetDataExchangeCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.DataExchange) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|createDataExchange}. + * @param error Error, if any + * @param [response] DataExchange + */ + type CreateDataExchangeCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.DataExchange) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|updateDataExchange}. + * @param error Error, if any + * @param [response] DataExchange + */ + type UpdateDataExchangeCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.DataExchange) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|deleteDataExchange}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDataExchangeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listListings}. + * @param error Error, if any + * @param [response] ListListingsResponse + */ + type ListListingsCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getListing}. + * @param error Error, if any + * @param [response] Listing + */ + type GetListingCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.Listing) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|createListing}. + * @param error Error, if any + * @param [response] Listing + */ + type CreateListingCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.Listing) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|updateListing}. + * @param error Error, if any + * @param [response] Listing + */ + type UpdateListingCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.Listing) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|deleteListing}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteListingCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|subscribeListing}. + * @param error Error, if any + * @param [response] SubscribeListingResponse + */ + type SubscribeListingCallback = (error: (Error|null), response?: google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a DataExchange. */ + interface IDataExchange { + + /** DataExchange name */ + name?: (string|null); + + /** DataExchange displayName */ + displayName?: (string|null); + + /** DataExchange description */ + description?: (string|null); + + /** DataExchange primaryContact */ + primaryContact?: (string|null); + + /** DataExchange documentation */ + documentation?: (string|null); + + /** DataExchange listingCount */ + listingCount?: (number|null); + + /** DataExchange icon */ + icon?: (Uint8Array|string|null); + } + + /** Represents a DataExchange. */ + class DataExchange implements IDataExchange { + + /** + * Constructs a new DataExchange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange); + + /** DataExchange name. */ + public name: string; + + /** DataExchange displayName. */ + public displayName: string; + + /** DataExchange description. */ + public description: string; + + /** DataExchange primaryContact. */ + public primaryContact: string; + + /** DataExchange documentation. */ + public documentation: string; + + /** DataExchange listingCount. */ + public listingCount: number; + + /** DataExchange icon. */ + public icon: (Uint8Array|string); + + /** + * Creates a new DataExchange instance using the specified properties. + * @param [properties] Properties to set + * @returns DataExchange instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange): google.cloud.bigquery.dataexchange.v1beta1.DataExchange; + + /** + * Encodes the specified DataExchange message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify|verify} messages. + * @param message DataExchange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataExchange message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify|verify} messages. + * @param message DataExchange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataExchange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DataExchange; + + /** + * Decodes a DataExchange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DataExchange; + + /** + * Verifies a DataExchange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataExchange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataExchange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DataExchange; + + /** + * Creates a plain object from a DataExchange message. Also converts values to other types if specified. + * @param message DataExchange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DataExchange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataExchange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataExchange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataProvider. */ + interface IDataProvider { + + /** DataProvider name */ + name?: (string|null); + + /** DataProvider primaryContact */ + primaryContact?: (string|null); + } + + /** Represents a DataProvider. */ + class DataProvider implements IDataProvider { + + /** + * Constructs a new DataProvider. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDataProvider); + + /** DataProvider name. */ + public name: string; + + /** DataProvider primaryContact. */ + public primaryContact: string; + + /** + * Creates a new DataProvider instance using the specified properties. + * @param [properties] Properties to set + * @returns DataProvider instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDataProvider): google.cloud.bigquery.dataexchange.v1beta1.DataProvider; + + /** + * Encodes the specified DataProvider message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataProvider.verify|verify} messages. + * @param message DataProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDataProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataProvider message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataProvider.verify|verify} messages. + * @param message DataProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDataProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataProvider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DataProvider; + + /** + * Decodes a DataProvider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DataProvider; + + /** + * Verifies a DataProvider message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataProvider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataProvider + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DataProvider; + + /** + * Creates a plain object from a DataProvider message. Also converts values to other types if specified. + * @param message DataProvider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DataProvider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataProvider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataProvider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publisher. */ + interface IPublisher { + + /** Publisher name */ + name?: (string|null); + + /** Publisher primaryContact */ + primaryContact?: (string|null); + } + + /** Represents a Publisher. */ + class Publisher implements IPublisher { + + /** + * Constructs a new Publisher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IPublisher); + + /** Publisher name. */ + public name: string; + + /** Publisher primaryContact. */ + public primaryContact: string; + + /** + * Creates a new Publisher instance using the specified properties. + * @param [properties] Properties to set + * @returns Publisher instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IPublisher): google.cloud.bigquery.dataexchange.v1beta1.Publisher; + + /** + * Encodes the specified Publisher message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Publisher.verify|verify} messages. + * @param message Publisher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IPublisher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publisher message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Publisher.verify|verify} messages. + * @param message Publisher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IPublisher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publisher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publisher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.Publisher; + + /** + * Decodes a Publisher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publisher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.Publisher; + + /** + * Verifies a Publisher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publisher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publisher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.Publisher; + + /** + * Creates a plain object from a Publisher message. Also converts values to other types if specified. + * @param message Publisher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.Publisher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publisher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publisher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestinationDatasetReference. */ + interface IDestinationDatasetReference { + + /** DestinationDatasetReference datasetId */ + datasetId?: (string|null); + + /** DestinationDatasetReference projectId */ + projectId?: (string|null); + } + + /** Represents a DestinationDatasetReference. */ + class DestinationDatasetReference implements IDestinationDatasetReference { + + /** + * Constructs a new DestinationDatasetReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference); + + /** DestinationDatasetReference datasetId. */ + public datasetId: string; + + /** DestinationDatasetReference projectId. */ + public projectId: string; + + /** + * Creates a new DestinationDatasetReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationDatasetReference instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference): google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference; + + /** + * Encodes the specified DestinationDatasetReference message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.verify|verify} messages. + * @param message DestinationDatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationDatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.verify|verify} messages. + * @param message DestinationDatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationDatasetReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference; + + /** + * Decodes a DestinationDatasetReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference; + + /** + * Verifies a DestinationDatasetReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DestinationDatasetReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationDatasetReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference; + + /** + * Creates a plain object from a DestinationDatasetReference message. Also converts values to other types if specified. + * @param message DestinationDatasetReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationDatasetReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationDatasetReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestinationDataset. */ + interface IDestinationDataset { + + /** DestinationDataset datasetReference */ + datasetReference?: (google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference|null); + + /** DestinationDataset friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** DestinationDataset description */ + description?: (google.protobuf.IStringValue|null); + + /** DestinationDataset labels */ + labels?: ({ [k: string]: string }|null); + + /** DestinationDataset location */ + location?: (string|null); + } + + /** Represents a DestinationDataset. */ + class DestinationDataset implements IDestinationDataset { + + /** + * Constructs a new DestinationDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset); + + /** DestinationDataset datasetReference. */ + public datasetReference?: (google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference|null); + + /** DestinationDataset friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** DestinationDataset description. */ + public description?: (google.protobuf.IStringValue|null); + + /** DestinationDataset labels. */ + public labels: { [k: string]: string }; + + /** DestinationDataset location. */ + public location: string; + + /** + * Creates a new DestinationDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationDataset instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset): google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset; + + /** + * Encodes the specified DestinationDataset message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.verify|verify} messages. + * @param message DestinationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationDataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.verify|verify} messages. + * @param message DestinationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset; + + /** + * Decodes a DestinationDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset; + + /** + * Verifies a DestinationDataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DestinationDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset; + + /** + * Creates a plain object from a DestinationDataset message. Also converts values to other types if specified. + * @param message DestinationDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Listing. */ + interface IListing { + + /** Listing bigqueryDataset */ + bigqueryDataset?: (google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource|null); + + /** Listing name */ + name?: (string|null); + + /** Listing displayName */ + displayName?: (string|null); + + /** Listing description */ + description?: (string|null); + + /** Listing primaryContact */ + primaryContact?: (string|null); + + /** Listing documentation */ + documentation?: (string|null); + + /** Listing state */ + state?: (google.cloud.bigquery.dataexchange.v1beta1.Listing.State|keyof typeof google.cloud.bigquery.dataexchange.v1beta1.Listing.State|null); + + /** Listing icon */ + icon?: (Uint8Array|string|null); + + /** Listing dataProvider */ + dataProvider?: (google.cloud.bigquery.dataexchange.v1beta1.IDataProvider|null); + + /** Listing categories */ + categories?: (google.cloud.bigquery.dataexchange.v1beta1.Listing.Category[]|null); + + /** Listing publisher */ + publisher?: (google.cloud.bigquery.dataexchange.v1beta1.IPublisher|null); + + /** Listing requestAccess */ + requestAccess?: (string|null); + } + + /** Represents a Listing. */ + class Listing implements IListing { + + /** + * Constructs a new Listing. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListing); + + /** Listing bigqueryDataset. */ + public bigqueryDataset?: (google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource|null); + + /** Listing name. */ + public name: string; + + /** Listing displayName. */ + public displayName: string; + + /** Listing description. */ + public description: string; + + /** Listing primaryContact. */ + public primaryContact: string; + + /** Listing documentation. */ + public documentation: string; + + /** Listing state. */ + public state: (google.cloud.bigquery.dataexchange.v1beta1.Listing.State|keyof typeof google.cloud.bigquery.dataexchange.v1beta1.Listing.State); + + /** Listing icon. */ + public icon: (Uint8Array|string); + + /** Listing dataProvider. */ + public dataProvider?: (google.cloud.bigquery.dataexchange.v1beta1.IDataProvider|null); + + /** Listing categories. */ + public categories: google.cloud.bigquery.dataexchange.v1beta1.Listing.Category[]; + + /** Listing publisher. */ + public publisher?: (google.cloud.bigquery.dataexchange.v1beta1.IPublisher|null); + + /** Listing requestAccess. */ + public requestAccess: string; + + /** Listing source. */ + public source?: "bigqueryDataset"; + + /** + * Creates a new Listing instance using the specified properties. + * @param [properties] Properties to set + * @returns Listing instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListing): google.cloud.bigquery.dataexchange.v1beta1.Listing; + + /** + * Encodes the specified Listing message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.verify|verify} messages. + * @param message Listing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Listing message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.verify|verify} messages. + * @param message Listing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Listing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Listing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.Listing; + + /** + * Decodes a Listing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Listing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.Listing; + + /** + * Verifies a Listing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Listing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Listing + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.Listing; + + /** + * Creates a plain object from a Listing message. Also converts values to other types if specified. + * @param message Listing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.Listing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Listing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Listing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Listing { + + /** Properties of a BigQueryDatasetSource. */ + interface IBigQueryDatasetSource { + + /** BigQueryDatasetSource dataset */ + dataset?: (string|null); + } + + /** Represents a BigQueryDatasetSource. */ + class BigQueryDatasetSource implements IBigQueryDatasetSource { + + /** + * Constructs a new BigQueryDatasetSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource); + + /** BigQueryDatasetSource dataset. */ + public dataset: string; + + /** + * Creates a new BigQueryDatasetSource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDatasetSource instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource): google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource; + + /** + * Encodes the specified BigQueryDatasetSource message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.verify|verify} messages. + * @param message BigQueryDatasetSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDatasetSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.verify|verify} messages. + * @param message BigQueryDatasetSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDatasetSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource; + + /** + * Decodes a BigQueryDatasetSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource; + + /** + * Verifies a BigQueryDatasetSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDatasetSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDatasetSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource; + + /** + * Creates a plain object from a BigQueryDatasetSource message. Also converts values to other types if specified. + * @param message BigQueryDatasetSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDatasetSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDatasetSource + * @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 + } + + /** Category enum. */ + enum Category { + CATEGORY_UNSPECIFIED = 0, + CATEGORY_OTHERS = 1, + CATEGORY_ADVERTISING_AND_MARKETING = 2, + CATEGORY_COMMERCE = 3, + CATEGORY_CLIMATE_AND_ENVIRONMENT = 4, + CATEGORY_DEMOGRAPHICS = 5, + CATEGORY_ECONOMICS = 6, + CATEGORY_EDUCATION = 7, + CATEGORY_ENERGY = 8, + CATEGORY_FINANCIAL = 9, + CATEGORY_GAMING = 10, + CATEGORY_GEOSPATIAL = 11, + CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE = 12, + CATEGORY_MEDIA = 13, + CATEGORY_PUBLIC_SECTOR = 14, + CATEGORY_RETAIL = 15, + CATEGORY_SPORTS = 16, + CATEGORY_SCIENCE_AND_RESEARCH = 17, + CATEGORY_TRANSPORTATION_AND_LOGISTICS = 18, + CATEGORY_TRAVEL_AND_TOURISM = 19 + } + } + + /** Properties of a ListDataExchangesRequest. */ + interface IListDataExchangesRequest { + + /** ListDataExchangesRequest parent */ + parent?: (string|null); + + /** ListDataExchangesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataExchangesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDataExchangesRequest. */ + class ListDataExchangesRequest implements IListDataExchangesRequest { + + /** + * Constructs a new ListDataExchangesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest); + + /** ListDataExchangesRequest parent. */ + public parent: string; + + /** ListDataExchangesRequest pageSize. */ + public pageSize: number; + + /** ListDataExchangesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDataExchangesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataExchangesRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest; + + /** + * Encodes the specified ListDataExchangesRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest.verify|verify} messages. + * @param message ListDataExchangesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataExchangesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest.verify|verify} messages. + * @param message ListDataExchangesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataExchangesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest; + + /** + * Decodes a ListDataExchangesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest; + + /** + * Verifies a ListDataExchangesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataExchangesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataExchangesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest; + + /** + * Creates a plain object from a ListDataExchangesRequest message. Also converts values to other types if specified. + * @param message ListDataExchangesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataExchangesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataExchangesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataExchangesResponse. */ + interface IListDataExchangesResponse { + + /** ListDataExchangesResponse dataExchanges */ + dataExchanges?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[]|null); + + /** ListDataExchangesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataExchangesResponse. */ + class ListDataExchangesResponse implements IListDataExchangesResponse { + + /** + * Constructs a new ListDataExchangesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse); + + /** ListDataExchangesResponse dataExchanges. */ + public dataExchanges: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[]; + + /** ListDataExchangesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataExchangesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataExchangesResponse instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse; + + /** + * Encodes the specified ListDataExchangesResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.verify|verify} messages. + * @param message ListDataExchangesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataExchangesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.verify|verify} messages. + * @param message ListDataExchangesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataExchangesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse; + + /** + * Decodes a ListDataExchangesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse; + + /** + * Verifies a ListDataExchangesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataExchangesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataExchangesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse; + + /** + * Creates a plain object from a ListDataExchangesResponse message. Also converts values to other types if specified. + * @param message ListDataExchangesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataExchangesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataExchangesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOrgDataExchangesRequest. */ + interface IListOrgDataExchangesRequest { + + /** ListOrgDataExchangesRequest organization */ + organization?: (string|null); + + /** ListOrgDataExchangesRequest pageSize */ + pageSize?: (number|null); + + /** ListOrgDataExchangesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOrgDataExchangesRequest. */ + class ListOrgDataExchangesRequest implements IListOrgDataExchangesRequest { + + /** + * Constructs a new ListOrgDataExchangesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest); + + /** ListOrgDataExchangesRequest organization. */ + public organization: string; + + /** ListOrgDataExchangesRequest pageSize. */ + public pageSize: number; + + /** ListOrgDataExchangesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOrgDataExchangesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOrgDataExchangesRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest; + + /** + * Encodes the specified ListOrgDataExchangesRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest.verify|verify} messages. + * @param message ListOrgDataExchangesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOrgDataExchangesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest.verify|verify} messages. + * @param message ListOrgDataExchangesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOrgDataExchangesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOrgDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest; + + /** + * Decodes a ListOrgDataExchangesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOrgDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest; + + /** + * Verifies a ListOrgDataExchangesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOrgDataExchangesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOrgDataExchangesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest; + + /** + * Creates a plain object from a ListOrgDataExchangesRequest message. Also converts values to other types if specified. + * @param message ListOrgDataExchangesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOrgDataExchangesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOrgDataExchangesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOrgDataExchangesResponse. */ + interface IListOrgDataExchangesResponse { + + /** ListOrgDataExchangesResponse dataExchanges */ + dataExchanges?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[]|null); + + /** ListOrgDataExchangesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOrgDataExchangesResponse. */ + class ListOrgDataExchangesResponse implements IListOrgDataExchangesResponse { + + /** + * Constructs a new ListOrgDataExchangesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse); + + /** ListOrgDataExchangesResponse dataExchanges. */ + public dataExchanges: google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[]; + + /** ListOrgDataExchangesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOrgDataExchangesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOrgDataExchangesResponse instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse; + + /** + * Encodes the specified ListOrgDataExchangesResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.verify|verify} messages. + * @param message ListOrgDataExchangesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOrgDataExchangesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.verify|verify} messages. + * @param message ListOrgDataExchangesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOrgDataExchangesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOrgDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse; + + /** + * Decodes a ListOrgDataExchangesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOrgDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse; + + /** + * Verifies a ListOrgDataExchangesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOrgDataExchangesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOrgDataExchangesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse; + + /** + * Creates a plain object from a ListOrgDataExchangesResponse message. Also converts values to other types if specified. + * @param message ListOrgDataExchangesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOrgDataExchangesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOrgDataExchangesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataExchangeRequest. */ + interface IGetDataExchangeRequest { + + /** GetDataExchangeRequest name */ + name?: (string|null); + } + + /** Represents a GetDataExchangeRequest. */ + class GetDataExchangeRequest implements IGetDataExchangeRequest { + + /** + * Constructs a new GetDataExchangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest); + + /** GetDataExchangeRequest name. */ + public name: string; + + /** + * Creates a new GetDataExchangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataExchangeRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest): google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest; + + /** + * Encodes the specified GetDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest.verify|verify} messages. + * @param message GetDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest.verify|verify} messages. + * @param message GetDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataExchangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest; + + /** + * Decodes a GetDataExchangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest; + + /** + * Verifies a GetDataExchangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataExchangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest; + + /** + * Creates a plain object from a GetDataExchangeRequest message. Also converts values to other types if specified. + * @param message GetDataExchangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataExchangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataExchangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDataExchangeRequest. */ + interface ICreateDataExchangeRequest { + + /** CreateDataExchangeRequest parent */ + parent?: (string|null); + + /** CreateDataExchangeRequest dataExchangeId */ + dataExchangeId?: (string|null); + + /** CreateDataExchangeRequest dataExchange */ + dataExchange?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null); + } + + /** Represents a CreateDataExchangeRequest. */ + class CreateDataExchangeRequest implements ICreateDataExchangeRequest { + + /** + * Constructs a new CreateDataExchangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest); + + /** CreateDataExchangeRequest parent. */ + public parent: string; + + /** CreateDataExchangeRequest dataExchangeId. */ + public dataExchangeId: string; + + /** CreateDataExchangeRequest dataExchange. */ + public dataExchange?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null); + + /** + * Creates a new CreateDataExchangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDataExchangeRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest): google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest; + + /** + * Encodes the specified CreateDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest.verify|verify} messages. + * @param message CreateDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest.verify|verify} messages. + * @param message CreateDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDataExchangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest; + + /** + * Decodes a CreateDataExchangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest; + + /** + * Verifies a CreateDataExchangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDataExchangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest; + + /** + * Creates a plain object from a CreateDataExchangeRequest message. Also converts values to other types if specified. + * @param message CreateDataExchangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDataExchangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDataExchangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataExchangeRequest. */ + interface IUpdateDataExchangeRequest { + + /** UpdateDataExchangeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataExchangeRequest dataExchange */ + dataExchange?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null); + } + + /** Represents an UpdateDataExchangeRequest. */ + class UpdateDataExchangeRequest implements IUpdateDataExchangeRequest { + + /** + * Constructs a new UpdateDataExchangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest); + + /** UpdateDataExchangeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataExchangeRequest dataExchange. */ + public dataExchange?: (google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null); + + /** + * Creates a new UpdateDataExchangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataExchangeRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest): google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest; + + /** + * Encodes the specified UpdateDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.verify|verify} messages. + * @param message UpdateDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.verify|verify} messages. + * @param message UpdateDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataExchangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest; + + /** + * Decodes an UpdateDataExchangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest; + + /** + * Verifies an UpdateDataExchangeRequest message. + * @param message Plain 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 UpdateDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataExchangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest; + + /** + * Creates a plain object from an UpdateDataExchangeRequest message. Also converts values to other types if specified. + * @param message UpdateDataExchangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataExchangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataExchangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDataExchangeRequest. */ + interface IDeleteDataExchangeRequest { + + /** DeleteDataExchangeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDataExchangeRequest. */ + class DeleteDataExchangeRequest implements IDeleteDataExchangeRequest { + + /** + * Constructs a new DeleteDataExchangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest); + + /** DeleteDataExchangeRequest name. */ + public name: string; + + /** + * Creates a new DeleteDataExchangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDataExchangeRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest): google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest; + + /** + * Encodes the specified DeleteDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest.verify|verify} messages. + * @param message DeleteDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest.verify|verify} messages. + * @param message DeleteDataExchangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDataExchangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest; + + /** + * Decodes a DeleteDataExchangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest; + + /** + * Verifies a DeleteDataExchangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDataExchangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest; + + /** + * Creates a plain object from a DeleteDataExchangeRequest message. Also converts values to other types if specified. + * @param message DeleteDataExchangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDataExchangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDataExchangeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListListingsRequest. */ + interface IListListingsRequest { + + /** ListListingsRequest parent */ + parent?: (string|null); + + /** ListListingsRequest pageSize */ + pageSize?: (number|null); + + /** ListListingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListListingsRequest. */ + class ListListingsRequest implements IListListingsRequest { + + /** + * Constructs a new ListListingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest); + + /** ListListingsRequest parent. */ + public parent: string; + + /** ListListingsRequest pageSize. */ + public pageSize: number; + + /** ListListingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListListingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListListingsRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest): google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest; + + /** + * Encodes the specified ListListingsRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest.verify|verify} messages. + * @param message ListListingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListListingsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest.verify|verify} messages. + * @param message ListListingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListListingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListListingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest; + + /** + * Decodes a ListListingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListListingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest; + + /** + * Verifies a ListListingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListListingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListListingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest; + + /** + * Creates a plain object from a ListListingsRequest message. Also converts values to other types if specified. + * @param message ListListingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListListingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListListingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListListingsResponse. */ + interface IListListingsResponse { + + /** ListListingsResponse listings */ + listings?: (google.cloud.bigquery.dataexchange.v1beta1.IListing[]|null); + + /** ListListingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListListingsResponse. */ + class ListListingsResponse implements IListListingsResponse { + + /** + * Constructs a new ListListingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse); + + /** ListListingsResponse listings. */ + public listings: google.cloud.bigquery.dataexchange.v1beta1.IListing[]; + + /** ListListingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListListingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListListingsResponse instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse): google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse; + + /** + * Encodes the specified ListListingsResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.verify|verify} messages. + * @param message ListListingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListListingsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.verify|verify} messages. + * @param message ListListingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListListingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListListingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse; + + /** + * Decodes a ListListingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListListingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse; + + /** + * Verifies a ListListingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListListingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListListingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse; + + /** + * Creates a plain object from a ListListingsResponse message. Also converts values to other types if specified. + * @param message ListListingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListListingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListListingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetListingRequest. */ + interface IGetListingRequest { + + /** GetListingRequest name */ + name?: (string|null); + } + + /** Represents a GetListingRequest. */ + class GetListingRequest implements IGetListingRequest { + + /** + * Constructs a new GetListingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest); + + /** GetListingRequest name. */ + public name: string; + + /** + * Creates a new GetListingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetListingRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest): google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest; + + /** + * Encodes the specified GetListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest.verify|verify} messages. + * @param message GetListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest.verify|verify} messages. + * @param message GetListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetListingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest; + + /** + * Decodes a GetListingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest; + + /** + * Verifies a GetListingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetListingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetListingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest; + + /** + * Creates a plain object from a GetListingRequest message. Also converts values to other types if specified. + * @param message GetListingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetListingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetListingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateListingRequest. */ + interface ICreateListingRequest { + + /** CreateListingRequest parent */ + parent?: (string|null); + + /** CreateListingRequest listingId */ + listingId?: (string|null); + + /** CreateListingRequest listing */ + listing?: (google.cloud.bigquery.dataexchange.v1beta1.IListing|null); + } + + /** Represents a CreateListingRequest. */ + class CreateListingRequest implements ICreateListingRequest { + + /** + * Constructs a new CreateListingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest); + + /** CreateListingRequest parent. */ + public parent: string; + + /** CreateListingRequest listingId. */ + public listingId: string; + + /** CreateListingRequest listing. */ + public listing?: (google.cloud.bigquery.dataexchange.v1beta1.IListing|null); + + /** + * Creates a new CreateListingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateListingRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest): google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest; + + /** + * Encodes the specified CreateListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest.verify|verify} messages. + * @param message CreateListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest.verify|verify} messages. + * @param message CreateListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateListingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest; + + /** + * Decodes a CreateListingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest; + + /** + * Verifies a CreateListingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateListingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateListingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest; + + /** + * Creates a plain object from a CreateListingRequest message. Also converts values to other types if specified. + * @param message CreateListingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateListingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateListingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateListingRequest. */ + interface IUpdateListingRequest { + + /** UpdateListingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateListingRequest listing */ + listing?: (google.cloud.bigquery.dataexchange.v1beta1.IListing|null); + } + + /** Represents an UpdateListingRequest. */ + class UpdateListingRequest implements IUpdateListingRequest { + + /** + * Constructs a new UpdateListingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest); + + /** UpdateListingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateListingRequest listing. */ + public listing?: (google.cloud.bigquery.dataexchange.v1beta1.IListing|null); + + /** + * Creates a new UpdateListingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateListingRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest): google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest; + + /** + * Encodes the specified UpdateListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.verify|verify} messages. + * @param message UpdateListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.verify|verify} messages. + * @param message UpdateListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateListingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest; + + /** + * Decodes an UpdateListingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest; + + /** + * Verifies an UpdateListingRequest message. + * @param message Plain 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 UpdateListingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateListingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest; + + /** + * Creates a plain object from an UpdateListingRequest message. Also converts values to other types if specified. + * @param message UpdateListingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateListingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateListingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteListingRequest. */ + interface IDeleteListingRequest { + + /** DeleteListingRequest name */ + name?: (string|null); + } + + /** Represents a DeleteListingRequest. */ + class DeleteListingRequest implements IDeleteListingRequest { + + /** + * Constructs a new DeleteListingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest); + + /** DeleteListingRequest name. */ + public name: string; + + /** + * Creates a new DeleteListingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteListingRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest): google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest; + + /** + * Encodes the specified DeleteListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest.verify|verify} messages. + * @param message DeleteListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest.verify|verify} messages. + * @param message DeleteListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteListingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest; + + /** + * Decodes a DeleteListingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest; + + /** + * Verifies a DeleteListingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteListingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteListingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest; + + /** + * Creates a plain object from a DeleteListingRequest message. Also converts values to other types if specified. + * @param message DeleteListingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteListingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteListingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscribeListingRequest. */ + interface ISubscribeListingRequest { + + /** SubscribeListingRequest destinationDataset */ + destinationDataset?: (google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset|null); + + /** SubscribeListingRequest name */ + name?: (string|null); + } + + /** Represents a SubscribeListingRequest. */ + class SubscribeListingRequest implements ISubscribeListingRequest { + + /** + * Constructs a new SubscribeListingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest); + + /** SubscribeListingRequest destinationDataset. */ + public destinationDataset?: (google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset|null); + + /** SubscribeListingRequest name. */ + public name: string; + + /** SubscribeListingRequest destination. */ + public destination?: "destinationDataset"; + + /** + * Creates a new SubscribeListingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscribeListingRequest instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest; + + /** + * Encodes the specified SubscribeListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest.verify|verify} messages. + * @param message SubscribeListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscribeListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest.verify|verify} messages. + * @param message SubscribeListingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscribeListingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscribeListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest; + + /** + * Decodes a SubscribeListingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscribeListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest; + + /** + * Verifies a SubscribeListingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscribeListingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscribeListingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest; + + /** + * Creates a plain object from a SubscribeListingRequest message. Also converts values to other types if specified. + * @param message SubscribeListingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscribeListingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscribeListingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscribeListingResponse. */ + interface ISubscribeListingResponse { + } + + /** Represents a SubscribeListingResponse. */ + class SubscribeListingResponse implements ISubscribeListingResponse { + + /** + * Constructs a new SubscribeListingResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse); + + /** + * Creates a new SubscribeListingResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscribeListingResponse instance + */ + public static create(properties?: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse; + + /** + * Encodes the specified SubscribeListingResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse.verify|verify} messages. + * @param message SubscribeListingResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscribeListingResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse.verify|verify} messages. + * @param message SubscribeListingResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscribeListingResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscribeListingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse; + + /** + * Decodes a SubscribeListingResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscribeListingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse; + + /** + * Verifies a SubscribeListingResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscribeListingResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscribeListingResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse; + + /** + * Creates a plain object from a SubscribeListingResponse message. Also converts values to other types if specified. + * @param message SubscribeListingResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscribeListingResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscribeListingResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 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 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 DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/protos/protos.js b/packages/google-cloud-bigquery-dataexchange/protos/protos.js new file mode 100644 index 000000000000..97fe4c55c96e --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/protos/protos.js @@ -0,0 +1,23519 @@ +// Copyright 2022 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_bigquery_data_exchange_protos || ($protobuf.roots._google_cloud_bigquery_data_exchange_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.dataexchange = (function() { + + /** + * Namespace dataexchange. + * @memberof google.cloud.bigquery + * @namespace + */ + var dataexchange = {}; + + dataexchange.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.bigquery.dataexchange + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AnalyticsHubService = (function() { + + /** + * Constructs a new AnalyticsHubService service. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents an AnalyticsHubService + * @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 AnalyticsHubService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AnalyticsHubService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AnalyticsHubService; + + /** + * Creates new AnalyticsHubService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @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 {AnalyticsHubService} RPC service. Useful where requests and/or responses are streamed. + */ + AnalyticsHubService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listDataExchanges}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef ListDataExchangesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} [response] ListDataExchangesResponse + */ + + /** + * Calls ListDataExchanges. + * @function listDataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest} request ListDataExchangesRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListDataExchangesCallback} callback Node-style callback called with the error, if any, and ListDataExchangesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.listDataExchanges = function listDataExchanges(request, callback) { + return this.rpcCall(listDataExchanges, $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse, request, callback); + }, "name", { value: "ListDataExchanges" }); + + /** + * Calls ListDataExchanges. + * @function listDataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest} request ListDataExchangesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listOrgDataExchanges}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef ListOrgDataExchangesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} [response] ListOrgDataExchangesResponse + */ + + /** + * Calls ListOrgDataExchanges. + * @function listOrgDataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest} request ListOrgDataExchangesRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListOrgDataExchangesCallback} callback Node-style callback called with the error, if any, and ListOrgDataExchangesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.listOrgDataExchanges = function listOrgDataExchanges(request, callback) { + return this.rpcCall(listOrgDataExchanges, $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse, request, callback); + }, "name", { value: "ListOrgDataExchanges" }); + + /** + * Calls ListOrgDataExchanges. + * @function listOrgDataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest} request ListOrgDataExchangesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getDataExchange}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef GetDataExchangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} [response] DataExchange + */ + + /** + * Calls GetDataExchange. + * @function getDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest} request GetDataExchangeRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetDataExchangeCallback} callback Node-style callback called with the error, if any, and DataExchange + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.getDataExchange = function getDataExchange(request, callback) { + return this.rpcCall(getDataExchange, $root.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange, request, callback); + }, "name", { value: "GetDataExchange" }); + + /** + * Calls GetDataExchange. + * @function getDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest} request GetDataExchangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|createDataExchange}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef CreateDataExchangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} [response] DataExchange + */ + + /** + * Calls CreateDataExchange. + * @function createDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest} request CreateDataExchangeRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateDataExchangeCallback} callback Node-style callback called with the error, if any, and DataExchange + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.createDataExchange = function createDataExchange(request, callback) { + return this.rpcCall(createDataExchange, $root.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange, request, callback); + }, "name", { value: "CreateDataExchange" }); + + /** + * Calls CreateDataExchange. + * @function createDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest} request CreateDataExchangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|updateDataExchange}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef UpdateDataExchangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} [response] DataExchange + */ + + /** + * Calls UpdateDataExchange. + * @function updateDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest} request UpdateDataExchangeRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateDataExchangeCallback} callback Node-style callback called with the error, if any, and DataExchange + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.updateDataExchange = function updateDataExchange(request, callback) { + return this.rpcCall(updateDataExchange, $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange, request, callback); + }, "name", { value: "UpdateDataExchange" }); + + /** + * Calls UpdateDataExchange. + * @function updateDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest} request UpdateDataExchangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|deleteDataExchange}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef DeleteDataExchangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataExchange. + * @function deleteDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest} request DeleteDataExchangeRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteDataExchangeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.deleteDataExchange = function deleteDataExchange(request, callback) { + return this.rpcCall(deleteDataExchange, $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataExchange" }); + + /** + * Calls DeleteDataExchange. + * @function deleteDataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest} request DeleteDataExchangeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|listListings}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef ListListingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} [response] ListListingsResponse + */ + + /** + * Calls ListListings. + * @function listListings + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest} request ListListingsRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListListingsCallback} callback Node-style callback called with the error, if any, and ListListingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.listListings = function listListings(request, callback) { + return this.rpcCall(listListings, $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse, request, callback); + }, "name", { value: "ListListings" }); + + /** + * Calls ListListings. + * @function listListings + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest} request ListListingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getListing}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef GetListingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} [response] Listing + */ + + /** + * Calls GetListing. + * @function getListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest} request GetListingRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetListingCallback} callback Node-style callback called with the error, if any, and Listing + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.getListing = function getListing(request, callback) { + return this.rpcCall(getListing, $root.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.Listing, request, callback); + }, "name", { value: "GetListing" }); + + /** + * Calls GetListing. + * @function getListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest} request GetListingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|createListing}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef CreateListingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} [response] Listing + */ + + /** + * Calls CreateListing. + * @function createListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest} request CreateListingRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateListingCallback} callback Node-style callback called with the error, if any, and Listing + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.createListing = function createListing(request, callback) { + return this.rpcCall(createListing, $root.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.Listing, request, callback); + }, "name", { value: "CreateListing" }); + + /** + * Calls CreateListing. + * @function createListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest} request CreateListingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|updateListing}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef UpdateListingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} [response] Listing + */ + + /** + * Calls UpdateListing. + * @function updateListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest} request UpdateListingRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateListingCallback} callback Node-style callback called with the error, if any, and Listing + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.updateListing = function updateListing(request, callback) { + return this.rpcCall(updateListing, $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.Listing, request, callback); + }, "name", { value: "UpdateListing" }); + + /** + * Calls UpdateListing. + * @function updateListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest} request UpdateListingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|deleteListing}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef DeleteListingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteListing. + * @function deleteListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest} request DeleteListingRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteListingCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.deleteListing = function deleteListing(request, callback) { + return this.rpcCall(deleteListing, $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteListing" }); + + /** + * Calls DeleteListing. + * @function deleteListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest} request DeleteListingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|subscribeListing}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef SubscribeListingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} [response] SubscribeListingResponse + */ + + /** + * Calls SubscribeListing. + * @function subscribeListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest} request SubscribeListingRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SubscribeListingCallback} callback Node-style callback called with the error, if any, and SubscribeListingResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.subscribeListing = function subscribeListing(request, callback) { + return this.rpcCall(subscribeListing, $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest, $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse, request, callback); + }, "name", { value: "SubscribeListing" }); + + /** + * Calls SubscribeListing. + * @function subscribeListing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest} request SubscribeListingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|getIamPolicy}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|setIamPolicy}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService|testIamPermissions}. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnalyticsHubService.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AnalyticsHubService; + })(); + + v1beta1.DataExchange = (function() { + + /** + * Properties of a DataExchange. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDataExchange + * @property {string|null} [name] DataExchange name + * @property {string|null} [displayName] DataExchange displayName + * @property {string|null} [description] DataExchange description + * @property {string|null} [primaryContact] DataExchange primaryContact + * @property {string|null} [documentation] DataExchange documentation + * @property {number|null} [listingCount] DataExchange listingCount + * @property {Uint8Array|null} [icon] DataExchange icon + */ + + /** + * Constructs a new DataExchange. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DataExchange. + * @implements IDataExchange + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange=} [properties] Properties to set + */ + function DataExchange(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]]; + } + + /** + * DataExchange name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.name = ""; + + /** + * DataExchange displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.displayName = ""; + + /** + * DataExchange description. + * @member {string} description + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.description = ""; + + /** + * DataExchange primaryContact. + * @member {string} primaryContact + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.primaryContact = ""; + + /** + * DataExchange documentation. + * @member {string} documentation + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.documentation = ""; + + /** + * DataExchange listingCount. + * @member {number} listingCount + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.listingCount = 0; + + /** + * DataExchange icon. + * @member {Uint8Array} icon + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + */ + DataExchange.prototype.icon = $util.newBuffer([]); + + /** + * Creates a new DataExchange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} DataExchange instance + */ + DataExchange.create = function create(properties) { + return new DataExchange(properties); + }; + + /** + * Encodes the specified DataExchange message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange} message DataExchange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataExchange.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.primaryContact != null && Object.hasOwnProperty.call(message, "primaryContact")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryContact); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentation); + if (message.listingCount != null && Object.hasOwnProperty.call(message, "listingCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.listingCount); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.icon); + return writer; + }; + + /** + * Encodes the specified DataExchange message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange} message DataExchange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataExchange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataExchange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} DataExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataExchange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.primaryContact = reader.string(); + break; + } + case 5: { + message.documentation = reader.string(); + break; + } + case 6: { + message.listingCount = reader.int32(); + break; + } + case 7: { + message.icon = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataExchange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} DataExchange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataExchange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataExchange message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataExchange.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + if (!$util.isString(message.primaryContact)) + return "primaryContact: string expected"; + if (message.documentation != null && message.hasOwnProperty("documentation")) + if (!$util.isString(message.documentation)) + return "documentation: string expected"; + if (message.listingCount != null && message.hasOwnProperty("listingCount")) + if (!$util.isInteger(message.listingCount)) + return "listingCount: integer expected"; + if (message.icon != null && message.hasOwnProperty("icon")) + if (!(message.icon && typeof message.icon.length === "number" || $util.isString(message.icon))) + return "icon: buffer expected"; + return null; + }; + + /** + * Creates a DataExchange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} DataExchange + */ + DataExchange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.primaryContact != null) + message.primaryContact = String(object.primaryContact); + if (object.documentation != null) + message.documentation = String(object.documentation); + if (object.listingCount != null) + message.listingCount = object.listingCount | 0; + if (object.icon != null) + if (typeof object.icon === "string") + $util.base64.decode(object.icon, message.icon = $util.newBuffer($util.base64.length(object.icon)), 0); + else if (object.icon.length >= 0) + message.icon = object.icon; + return message; + }; + + /** + * Creates a plain object from a DataExchange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} message DataExchange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataExchange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.primaryContact = ""; + object.documentation = ""; + object.listingCount = 0; + if (options.bytes === String) + object.icon = ""; + else { + object.icon = []; + if (options.bytes !== Array) + object.icon = $util.newBuffer(object.icon); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + object.primaryContact = message.primaryContact; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = message.documentation; + if (message.listingCount != null && message.hasOwnProperty("listingCount")) + object.listingCount = message.listingCount; + if (message.icon != null && message.hasOwnProperty("icon")) + object.icon = options.bytes === String ? $util.base64.encode(message.icon, 0, message.icon.length) : options.bytes === Array ? Array.prototype.slice.call(message.icon) : message.icon; + return object; + }; + + /** + * Converts this DataExchange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @instance + * @returns {Object.} JSON object + */ + DataExchange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataExchange + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataExchange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataExchange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DataExchange"; + }; + + return DataExchange; + })(); + + v1beta1.DataProvider = (function() { + + /** + * Properties of a DataProvider. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDataProvider + * @property {string|null} [name] DataProvider name + * @property {string|null} [primaryContact] DataProvider primaryContact + */ + + /** + * Constructs a new DataProvider. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DataProvider. + * @implements IDataProvider + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider=} [properties] Properties to set + */ + function DataProvider(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]]; + } + + /** + * DataProvider name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @instance + */ + DataProvider.prototype.name = ""; + + /** + * DataProvider primaryContact. + * @member {string} primaryContact + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @instance + */ + DataProvider.prototype.primaryContact = ""; + + /** + * Creates a new DataProvider instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataProvider} DataProvider instance + */ + DataProvider.create = function create(properties) { + return new DataProvider(properties); + }; + + /** + * Encodes the specified DataProvider message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataProvider.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider} message DataProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataProvider.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.primaryContact != null && Object.hasOwnProperty.call(message, "primaryContact")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryContact); + return writer; + }; + + /** + * Encodes the specified DataProvider message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DataProvider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider} message DataProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataProvider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataProvider message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataProvider} DataProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataProvider.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.primaryContact = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataProvider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataProvider} DataProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataProvider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataProvider message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataProvider.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.primaryContact != null && message.hasOwnProperty("primaryContact")) + if (!$util.isString(message.primaryContact)) + return "primaryContact: string expected"; + return null; + }; + + /** + * Creates a DataProvider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DataProvider} DataProvider + */ + DataProvider.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider(); + if (object.name != null) + message.name = String(object.name); + if (object.primaryContact != null) + message.primaryContact = String(object.primaryContact); + return message; + }; + + /** + * Creates a plain object from a DataProvider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataProvider} message DataProvider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataProvider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.primaryContact = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + object.primaryContact = message.primaryContact; + return object; + }; + + /** + * Converts this DataProvider to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @instance + * @returns {Object.} JSON object + */ + DataProvider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataProvider + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DataProvider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DataProvider"; + }; + + return DataProvider; + })(); + + v1beta1.Publisher = (function() { + + /** + * Properties of a Publisher. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IPublisher + * @property {string|null} [name] Publisher name + * @property {string|null} [primaryContact] Publisher primaryContact + */ + + /** + * Constructs a new Publisher. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a Publisher. + * @implements IPublisher + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IPublisher=} [properties] Properties to set + */ + function Publisher(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]]; + } + + /** + * Publisher name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @instance + */ + Publisher.prototype.name = ""; + + /** + * Publisher primaryContact. + * @member {string} primaryContact + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @instance + */ + Publisher.prototype.primaryContact = ""; + + /** + * Creates a new Publisher instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IPublisher=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Publisher} Publisher instance + */ + Publisher.create = function create(properties) { + return new Publisher(properties); + }; + + /** + * Encodes the specified Publisher message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Publisher.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IPublisher} message Publisher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publisher.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.primaryContact != null && Object.hasOwnProperty.call(message, "primaryContact")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryContact); + return writer; + }; + + /** + * Encodes the specified Publisher message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Publisher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IPublisher} message Publisher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publisher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publisher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Publisher} Publisher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publisher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.primaryContact = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publisher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Publisher} Publisher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publisher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publisher message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publisher.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.primaryContact != null && message.hasOwnProperty("primaryContact")) + if (!$util.isString(message.primaryContact)) + return "primaryContact: string expected"; + return null; + }; + + /** + * Creates a Publisher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Publisher} Publisher + */ + Publisher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher(); + if (object.name != null) + message.name = String(object.name); + if (object.primaryContact != null) + message.primaryContact = String(object.primaryContact); + return message; + }; + + /** + * Creates a plain object from a Publisher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Publisher} message Publisher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publisher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.primaryContact = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + object.primaryContact = message.primaryContact; + return object; + }; + + /** + * Converts this Publisher to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @instance + * @returns {Object.} JSON object + */ + Publisher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publisher + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Publisher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publisher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.Publisher"; + }; + + return Publisher; + })(); + + v1beta1.DestinationDatasetReference = (function() { + + /** + * Properties of a DestinationDatasetReference. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDestinationDatasetReference + * @property {string|null} [datasetId] DestinationDatasetReference datasetId + * @property {string|null} [projectId] DestinationDatasetReference projectId + */ + + /** + * Constructs a new DestinationDatasetReference. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DestinationDatasetReference. + * @implements IDestinationDatasetReference + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference=} [properties] Properties to set + */ + function DestinationDatasetReference(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]]; + } + + /** + * DestinationDatasetReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @instance + */ + DestinationDatasetReference.prototype.datasetId = ""; + + /** + * DestinationDatasetReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @instance + */ + DestinationDatasetReference.prototype.projectId = ""; + + /** + * Creates a new DestinationDatasetReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference} DestinationDatasetReference instance + */ + DestinationDatasetReference.create = function create(properties) { + return new DestinationDatasetReference(properties); + }; + + /** + * Encodes the specified DestinationDatasetReference message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference} message DestinationDatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationDatasetReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DestinationDatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference} message DestinationDatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationDatasetReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationDatasetReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference} DestinationDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationDatasetReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.datasetId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationDatasetReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference} DestinationDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationDatasetReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationDatasetReference message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationDatasetReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DestinationDatasetReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference} DestinationDatasetReference + */ + DestinationDatasetReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference(); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DestinationDatasetReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference} message DestinationDatasetReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationDatasetReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datasetId = ""; + object.projectId = ""; + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DestinationDatasetReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @instance + * @returns {Object.} JSON object + */ + DestinationDatasetReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationDatasetReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationDatasetReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference"; + }; + + return DestinationDatasetReference; + })(); + + v1beta1.DestinationDataset = (function() { + + /** + * Properties of a DestinationDataset. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDestinationDataset + * @property {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference|null} [datasetReference] DestinationDataset datasetReference + * @property {google.protobuf.IStringValue|null} [friendlyName] DestinationDataset friendlyName + * @property {google.protobuf.IStringValue|null} [description] DestinationDataset description + * @property {Object.|null} [labels] DestinationDataset labels + * @property {string|null} [location] DestinationDataset location + */ + + /** + * Constructs a new DestinationDataset. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DestinationDataset. + * @implements IDestinationDataset + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset=} [properties] Properties to set + */ + function DestinationDataset(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]]; + } + + /** + * DestinationDataset datasetReference. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDatasetReference|null|undefined} datasetReference + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + */ + DestinationDataset.prototype.datasetReference = null; + + /** + * DestinationDataset friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + */ + DestinationDataset.prototype.friendlyName = null; + + /** + * DestinationDataset description. + * @member {google.protobuf.IStringValue|null|undefined} description + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + */ + DestinationDataset.prototype.description = null; + + /** + * DestinationDataset labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + */ + DestinationDataset.prototype.labels = $util.emptyObject; + + /** + * DestinationDataset location. + * @member {string} location + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + */ + DestinationDataset.prototype.location = ""; + + /** + * Creates a new DestinationDataset instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} DestinationDataset instance + */ + DestinationDataset.create = function create(properties) { + return new DestinationDataset(properties); + }; + + /** + * Encodes the specified DestinationDataset message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset} message DestinationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationDataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) + $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.encode(message.datasetReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.protobuf.StringValue.encode(message.description, 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(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.location); + return writer; + }; + + /** + * Encodes the specified DestinationDataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset} message DestinationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} DestinationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationDataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.datasetReference = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.decode(reader, reader.uint32()); + break; + } + case 2: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); + break; + } + case 3: { + message.description = $root.google.protobuf.StringValue.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; + } + case 5: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} DestinationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationDataset message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationDataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasetReference != null && message.hasOwnProperty("datasetReference")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.verify(message.datasetReference); + if (error) + return "datasetReference." + error; + } + if (message.friendlyName != null && message.hasOwnProperty("friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName); + if (error) + return "friendlyName." + error; + } + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.google.protobuf.StringValue.verify(message.description); + if (error) + return "description." + 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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a DestinationDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} DestinationDataset + */ + DestinationDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset(); + if (object.datasetReference != null) { + if (typeof object.datasetReference !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.datasetReference: object expected"); + message.datasetReference = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.fromObject(object.datasetReference); + } + if (object.friendlyName != null) { + if (typeof object.friendlyName !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName); + } + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.description: object expected"); + message.description = $root.google.protobuf.StringValue.fromObject(object.description); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.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.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a DestinationDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} message DestinationDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.datasetReference = null; + object.friendlyName = null; + object.description = null; + object.location = ""; + } + if (message.datasetReference != null && message.hasOwnProperty("datasetReference")) + object.datasetReference = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDatasetReference.toObject(message.datasetReference, options); + if (message.friendlyName != null && message.hasOwnProperty("friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.google.protobuf.StringValue.toObject(message.description, 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.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this DestinationDataset to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @instance + * @returns {Object.} JSON object + */ + DestinationDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationDataset + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset"; + }; + + return DestinationDataset; + })(); + + v1beta1.Listing = (function() { + + /** + * Properties of a Listing. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListing + * @property {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource|null} [bigqueryDataset] Listing bigqueryDataset + * @property {string|null} [name] Listing name + * @property {string|null} [displayName] Listing displayName + * @property {string|null} [description] Listing description + * @property {string|null} [primaryContact] Listing primaryContact + * @property {string|null} [documentation] Listing documentation + * @property {google.cloud.bigquery.dataexchange.v1beta1.Listing.State|null} [state] Listing state + * @property {Uint8Array|null} [icon] Listing icon + * @property {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider|null} [dataProvider] Listing dataProvider + * @property {Array.|null} [categories] Listing categories + * @property {google.cloud.bigquery.dataexchange.v1beta1.IPublisher|null} [publisher] Listing publisher + * @property {string|null} [requestAccess] Listing requestAccess + */ + + /** + * Constructs a new Listing. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a Listing. + * @implements IListing + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListing=} [properties] Properties to set + */ + function Listing(properties) { + this.categories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Listing bigqueryDataset. + * @member {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource|null|undefined} bigqueryDataset + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.bigqueryDataset = null; + + /** + * Listing name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.name = ""; + + /** + * Listing displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.displayName = ""; + + /** + * Listing description. + * @member {string} description + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.description = ""; + + /** + * Listing primaryContact. + * @member {string} primaryContact + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.primaryContact = ""; + + /** + * Listing documentation. + * @member {string} documentation + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.documentation = ""; + + /** + * Listing state. + * @member {google.cloud.bigquery.dataexchange.v1beta1.Listing.State} state + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.state = 0; + + /** + * Listing icon. + * @member {Uint8Array} icon + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.icon = $util.newBuffer([]); + + /** + * Listing dataProvider. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IDataProvider|null|undefined} dataProvider + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.dataProvider = null; + + /** + * Listing categories. + * @member {Array.} categories + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.categories = $util.emptyArray; + + /** + * Listing publisher. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IPublisher|null|undefined} publisher + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.publisher = null; + + /** + * Listing requestAccess. + * @member {string} requestAccess + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Listing.prototype.requestAccess = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Listing source. + * @member {"bigqueryDataset"|undefined} source + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + */ + Object.defineProperty(Listing.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["bigqueryDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Listing instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListing=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing} Listing instance + */ + Listing.create = function create(properties) { + return new Listing(properties); + }; + + /** + * Encodes the specified Listing message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListing} message Listing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Listing.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.primaryContact != null && Object.hasOwnProperty.call(message, "primaryContact")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryContact); + if (message.documentation != null && Object.hasOwnProperty.call(message, "documentation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentation); + if (message.bigqueryDataset != null && Object.hasOwnProperty.call(message, "bigqueryDataset")) + $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.encode(message.bigqueryDataset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.icon); + if (message.dataProvider != null && Object.hasOwnProperty.call(message, "dataProvider")) + $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider.encode(message.dataProvider, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.categories != null && message.categories.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.categories.length; ++i) + writer.int32(message.categories[i]); + writer.ldelim(); + } + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher.encode(message.publisher, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.requestAccess != null && Object.hasOwnProperty.call(message, "requestAccess")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.requestAccess); + return writer; + }; + + /** + * Encodes the specified Listing message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListing} message Listing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Listing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Listing message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing} Listing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Listing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Listing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.bigqueryDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.primaryContact = reader.string(); + break; + } + case 5: { + message.documentation = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.icon = reader.bytes(); + break; + } + case 9: { + message.dataProvider = $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.categories && message.categories.length)) + message.categories = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.categories.push(reader.int32()); + } else + message.categories.push(reader.int32()); + break; + } + case 11: { + message.publisher = $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher.decode(reader, reader.uint32()); + break; + } + case 12: { + message.requestAccess = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Listing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing} Listing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Listing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Listing message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Listing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigqueryDataset != null && message.hasOwnProperty("bigqueryDataset")) { + properties.source = 1; + { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.verify(message.bigqueryDataset); + if (error) + return "bigqueryDataset." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + if (!$util.isString(message.primaryContact)) + return "primaryContact: string expected"; + if (message.documentation != null && message.hasOwnProperty("documentation")) + if (!$util.isString(message.documentation)) + return "documentation: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + break; + } + if (message.icon != null && message.hasOwnProperty("icon")) + if (!(message.icon && typeof message.icon.length === "number" || $util.isString(message.icon))) + return "icon: buffer expected"; + if (message.dataProvider != null && message.hasOwnProperty("dataProvider")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider.verify(message.dataProvider); + if (error) + return "dataProvider." + error; + } + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) + switch (message.categories[i]) { + default: + return "categories: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + break; + } + } + if (message.publisher != null && message.hasOwnProperty("publisher")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher.verify(message.publisher); + if (error) + return "publisher." + error; + } + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) + if (!$util.isString(message.requestAccess)) + return "requestAccess: string expected"; + return null; + }; + + /** + * Creates a Listing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing} Listing + */ + Listing.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.Listing) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Listing(); + if (object.bigqueryDataset != null) { + if (typeof object.bigqueryDataset !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.Listing.bigqueryDataset: object expected"); + message.bigqueryDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.fromObject(object.bigqueryDataset); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.primaryContact != null) + message.primaryContact = String(object.primaryContact); + if (object.documentation != null) + message.documentation = String(object.documentation); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + } + if (object.icon != null) + if (typeof object.icon === "string") + $util.base64.decode(object.icon, message.icon = $util.newBuffer($util.base64.length(object.icon)), 0); + else if (object.icon.length >= 0) + message.icon = object.icon; + if (object.dataProvider != null) { + if (typeof object.dataProvider !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.Listing.dataProvider: object expected"); + message.dataProvider = $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider.fromObject(object.dataProvider); + } + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.Listing.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) + switch (object.categories[i]) { + default: + case "CATEGORY_UNSPECIFIED": + case 0: + message.categories[i] = 0; + break; + case "CATEGORY_OTHERS": + case 1: + message.categories[i] = 1; + break; + case "CATEGORY_ADVERTISING_AND_MARKETING": + case 2: + message.categories[i] = 2; + break; + case "CATEGORY_COMMERCE": + case 3: + message.categories[i] = 3; + break; + case "CATEGORY_CLIMATE_AND_ENVIRONMENT": + case 4: + message.categories[i] = 4; + break; + case "CATEGORY_DEMOGRAPHICS": + case 5: + message.categories[i] = 5; + break; + case "CATEGORY_ECONOMICS": + case 6: + message.categories[i] = 6; + break; + case "CATEGORY_EDUCATION": + case 7: + message.categories[i] = 7; + break; + case "CATEGORY_ENERGY": + case 8: + message.categories[i] = 8; + break; + case "CATEGORY_FINANCIAL": + case 9: + message.categories[i] = 9; + break; + case "CATEGORY_GAMING": + case 10: + message.categories[i] = 10; + break; + case "CATEGORY_GEOSPATIAL": + case 11: + message.categories[i] = 11; + break; + case "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE": + case 12: + message.categories[i] = 12; + break; + case "CATEGORY_MEDIA": + case 13: + message.categories[i] = 13; + break; + case "CATEGORY_PUBLIC_SECTOR": + case 14: + message.categories[i] = 14; + break; + case "CATEGORY_RETAIL": + case 15: + message.categories[i] = 15; + break; + case "CATEGORY_SPORTS": + case 16: + message.categories[i] = 16; + break; + case "CATEGORY_SCIENCE_AND_RESEARCH": + case 17: + message.categories[i] = 17; + break; + case "CATEGORY_TRANSPORTATION_AND_LOGISTICS": + case 18: + message.categories[i] = 18; + break; + case "CATEGORY_TRAVEL_AND_TOURISM": + case 19: + message.categories[i] = 19; + break; + } + } + if (object.publisher != null) { + if (typeof object.publisher !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.Listing.publisher: object expected"); + message.publisher = $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher.fromObject(object.publisher); + } + if (object.requestAccess != null) + message.requestAccess = String(object.requestAccess); + return message; + }; + + /** + * Creates a plain object from a Listing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} message Listing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Listing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.categories = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.primaryContact = ""; + object.documentation = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.icon = ""; + else { + object.icon = []; + if (options.bytes !== Array) + object.icon = $util.newBuffer(object.icon); + } + object.dataProvider = null; + object.publisher = null; + object.requestAccess = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.primaryContact != null && message.hasOwnProperty("primaryContact")) + object.primaryContact = message.primaryContact; + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = message.documentation; + if (message.bigqueryDataset != null && message.hasOwnProperty("bigqueryDataset")) { + object.bigqueryDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.toObject(message.bigqueryDataset, options); + if (options.oneofs) + object.source = "bigqueryDataset"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.State[message.state] : message.state; + if (message.icon != null && message.hasOwnProperty("icon")) + object.icon = options.bytes === String ? $util.base64.encode(message.icon, 0, message.icon.length) : options.bytes === Array ? Array.prototype.slice.call(message.icon) : message.icon; + if (message.dataProvider != null && message.hasOwnProperty("dataProvider")) + object.dataProvider = $root.google.cloud.bigquery.dataexchange.v1beta1.DataProvider.toObject(message.dataProvider, options); + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = options.enums === String ? $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.Category[message.categories[j]] : message.categories[j]; + } + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = $root.google.cloud.bigquery.dataexchange.v1beta1.Publisher.toObject(message.publisher, options); + if (message.requestAccess != null && message.hasOwnProperty("requestAccess")) + object.requestAccess = message.requestAccess; + return object; + }; + + /** + * Converts this Listing to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @instance + * @returns {Object.} JSON object + */ + Listing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Listing + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Listing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.Listing"; + }; + + Listing.BigQueryDatasetSource = (function() { + + /** + * Properties of a BigQueryDatasetSource. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @interface IBigQueryDatasetSource + * @property {string|null} [dataset] BigQueryDatasetSource dataset + */ + + /** + * Constructs a new BigQueryDatasetSource. + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing + * @classdesc Represents a BigQueryDatasetSource. + * @implements IBigQueryDatasetSource + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource=} [properties] Properties to set + */ + function BigQueryDatasetSource(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]]; + } + + /** + * BigQueryDatasetSource dataset. + * @member {string} dataset + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @instance + */ + BigQueryDatasetSource.prototype.dataset = ""; + + /** + * Creates a new BigQueryDatasetSource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource} BigQueryDatasetSource instance + */ + BigQueryDatasetSource.create = function create(properties) { + return new BigQueryDatasetSource(properties); + }; + + /** + * Encodes the specified BigQueryDatasetSource message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource} message BigQueryDatasetSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDatasetSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + return writer; + }; + + /** + * Encodes the specified BigQueryDatasetSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing.IBigQueryDatasetSource} message BigQueryDatasetSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDatasetSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDatasetSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource} BigQueryDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDatasetSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDatasetSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource} BigQueryDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDatasetSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDatasetSource message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDatasetSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + return null; + }; + + /** + * Creates a BigQueryDatasetSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource} BigQueryDatasetSource + */ + BigQueryDatasetSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource(); + if (object.dataset != null) + message.dataset = String(object.dataset); + return message; + }; + + /** + * Creates a plain object from a BigQueryDatasetSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource} message BigQueryDatasetSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDatasetSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataset = ""; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + return object; + }; + + /** + * Converts this BigQueryDatasetSource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @instance + * @returns {Object.} JSON object + */ + BigQueryDatasetSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDatasetSource + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDatasetSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.Listing.BigQueryDatasetSource"; + }; + + return BigQueryDatasetSource; + })(); + + /** + * State enum. + * @name google.cloud.bigquery.dataexchange.v1beta1.Listing.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + */ + Listing.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + return values; + })(); + + /** + * Category enum. + * @name google.cloud.bigquery.dataexchange.v1beta1.Listing.Category + * @enum {number} + * @property {number} CATEGORY_UNSPECIFIED=0 CATEGORY_UNSPECIFIED value + * @property {number} CATEGORY_OTHERS=1 CATEGORY_OTHERS value + * @property {number} CATEGORY_ADVERTISING_AND_MARKETING=2 CATEGORY_ADVERTISING_AND_MARKETING value + * @property {number} CATEGORY_COMMERCE=3 CATEGORY_COMMERCE value + * @property {number} CATEGORY_CLIMATE_AND_ENVIRONMENT=4 CATEGORY_CLIMATE_AND_ENVIRONMENT value + * @property {number} CATEGORY_DEMOGRAPHICS=5 CATEGORY_DEMOGRAPHICS value + * @property {number} CATEGORY_ECONOMICS=6 CATEGORY_ECONOMICS value + * @property {number} CATEGORY_EDUCATION=7 CATEGORY_EDUCATION value + * @property {number} CATEGORY_ENERGY=8 CATEGORY_ENERGY value + * @property {number} CATEGORY_FINANCIAL=9 CATEGORY_FINANCIAL value + * @property {number} CATEGORY_GAMING=10 CATEGORY_GAMING value + * @property {number} CATEGORY_GEOSPATIAL=11 CATEGORY_GEOSPATIAL value + * @property {number} CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE=12 CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE value + * @property {number} CATEGORY_MEDIA=13 CATEGORY_MEDIA value + * @property {number} CATEGORY_PUBLIC_SECTOR=14 CATEGORY_PUBLIC_SECTOR value + * @property {number} CATEGORY_RETAIL=15 CATEGORY_RETAIL value + * @property {number} CATEGORY_SPORTS=16 CATEGORY_SPORTS value + * @property {number} CATEGORY_SCIENCE_AND_RESEARCH=17 CATEGORY_SCIENCE_AND_RESEARCH value + * @property {number} CATEGORY_TRANSPORTATION_AND_LOGISTICS=18 CATEGORY_TRANSPORTATION_AND_LOGISTICS value + * @property {number} CATEGORY_TRAVEL_AND_TOURISM=19 CATEGORY_TRAVEL_AND_TOURISM value + */ + Listing.Category = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CATEGORY_OTHERS"] = 1; + values[valuesById[2] = "CATEGORY_ADVERTISING_AND_MARKETING"] = 2; + values[valuesById[3] = "CATEGORY_COMMERCE"] = 3; + values[valuesById[4] = "CATEGORY_CLIMATE_AND_ENVIRONMENT"] = 4; + values[valuesById[5] = "CATEGORY_DEMOGRAPHICS"] = 5; + values[valuesById[6] = "CATEGORY_ECONOMICS"] = 6; + values[valuesById[7] = "CATEGORY_EDUCATION"] = 7; + values[valuesById[8] = "CATEGORY_ENERGY"] = 8; + values[valuesById[9] = "CATEGORY_FINANCIAL"] = 9; + values[valuesById[10] = "CATEGORY_GAMING"] = 10; + values[valuesById[11] = "CATEGORY_GEOSPATIAL"] = 11; + values[valuesById[12] = "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE"] = 12; + values[valuesById[13] = "CATEGORY_MEDIA"] = 13; + values[valuesById[14] = "CATEGORY_PUBLIC_SECTOR"] = 14; + values[valuesById[15] = "CATEGORY_RETAIL"] = 15; + values[valuesById[16] = "CATEGORY_SPORTS"] = 16; + values[valuesById[17] = "CATEGORY_SCIENCE_AND_RESEARCH"] = 17; + values[valuesById[18] = "CATEGORY_TRANSPORTATION_AND_LOGISTICS"] = 18; + values[valuesById[19] = "CATEGORY_TRAVEL_AND_TOURISM"] = 19; + return values; + })(); + + return Listing; + })(); + + v1beta1.ListDataExchangesRequest = (function() { + + /** + * Properties of a ListDataExchangesRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListDataExchangesRequest + * @property {string|null} [parent] ListDataExchangesRequest parent + * @property {number|null} [pageSize] ListDataExchangesRequest pageSize + * @property {string|null} [pageToken] ListDataExchangesRequest pageToken + */ + + /** + * Constructs a new ListDataExchangesRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListDataExchangesRequest. + * @implements IListDataExchangesRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest=} [properties] Properties to set + */ + function ListDataExchangesRequest(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]]; + } + + /** + * ListDataExchangesRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @instance + */ + ListDataExchangesRequest.prototype.parent = ""; + + /** + * ListDataExchangesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @instance + */ + ListDataExchangesRequest.prototype.pageSize = 0; + + /** + * ListDataExchangesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @instance + */ + ListDataExchangesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDataExchangesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest} ListDataExchangesRequest instance + */ + ListDataExchangesRequest.create = function create(properties) { + return new ListDataExchangesRequest(properties); + }; + + /** + * Encodes the specified ListDataExchangesRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest} message ListDataExchangesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataExchangesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDataExchangesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest} message ListDataExchangesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataExchangesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataExchangesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest} ListDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataExchangesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataExchangesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest} ListDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataExchangesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataExchangesRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataExchangesRequest.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.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 ListDataExchangesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest} ListDataExchangesRequest + */ + ListDataExchangesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDataExchangesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest} message ListDataExchangesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataExchangesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListDataExchangesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataExchangesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataExchangesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataExchangesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest"; + }; + + return ListDataExchangesRequest; + })(); + + v1beta1.ListDataExchangesResponse = (function() { + + /** + * Properties of a ListDataExchangesResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListDataExchangesResponse + * @property {Array.|null} [dataExchanges] ListDataExchangesResponse dataExchanges + * @property {string|null} [nextPageToken] ListDataExchangesResponse nextPageToken + */ + + /** + * Constructs a new ListDataExchangesResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListDataExchangesResponse. + * @implements IListDataExchangesResponse + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse=} [properties] Properties to set + */ + function ListDataExchangesResponse(properties) { + this.dataExchanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataExchangesResponse dataExchanges. + * @member {Array.} dataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @instance + */ + ListDataExchangesResponse.prototype.dataExchanges = $util.emptyArray; + + /** + * ListDataExchangesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @instance + */ + ListDataExchangesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataExchangesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} ListDataExchangesResponse instance + */ + ListDataExchangesResponse.create = function create(properties) { + return new ListDataExchangesResponse(properties); + }; + + /** + * Encodes the specified ListDataExchangesResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse} message ListDataExchangesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataExchangesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataExchanges != null && message.dataExchanges.length) + for (var i = 0; i < message.dataExchanges.length; ++i) + $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.encode(message.dataExchanges[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 ListDataExchangesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse} message ListDataExchangesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataExchangesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataExchangesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} ListDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataExchangesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataExchanges && message.dataExchanges.length)) + message.dataExchanges = []; + message.dataExchanges.push($root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataExchangesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} ListDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataExchangesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataExchangesResponse message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataExchangesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataExchanges != null && message.hasOwnProperty("dataExchanges")) { + if (!Array.isArray(message.dataExchanges)) + return "dataExchanges: array expected"; + for (var i = 0; i < message.dataExchanges.length; ++i) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify(message.dataExchanges[i]); + if (error) + return "dataExchanges." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataExchangesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} ListDataExchangesResponse + */ + ListDataExchangesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse(); + if (object.dataExchanges) { + if (!Array.isArray(object.dataExchanges)) + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.dataExchanges: array expected"); + message.dataExchanges = []; + for (var i = 0; i < object.dataExchanges.length; ++i) { + if (typeof object.dataExchanges[i] !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse.dataExchanges: object expected"); + message.dataExchanges[i] = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.fromObject(object.dataExchanges[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataExchangesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse} message ListDataExchangesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataExchangesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataExchanges = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataExchanges && message.dataExchanges.length) { + object.dataExchanges = []; + for (var j = 0; j < message.dataExchanges.length; ++j) + object.dataExchanges[j] = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.toObject(message.dataExchanges[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataExchangesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataExchangesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataExchangesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataExchangesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse"; + }; + + return ListDataExchangesResponse; + })(); + + v1beta1.ListOrgDataExchangesRequest = (function() { + + /** + * Properties of a ListOrgDataExchangesRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListOrgDataExchangesRequest + * @property {string|null} [organization] ListOrgDataExchangesRequest organization + * @property {number|null} [pageSize] ListOrgDataExchangesRequest pageSize + * @property {string|null} [pageToken] ListOrgDataExchangesRequest pageToken + */ + + /** + * Constructs a new ListOrgDataExchangesRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListOrgDataExchangesRequest. + * @implements IListOrgDataExchangesRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest=} [properties] Properties to set + */ + function ListOrgDataExchangesRequest(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]]; + } + + /** + * ListOrgDataExchangesRequest organization. + * @member {string} organization + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @instance + */ + ListOrgDataExchangesRequest.prototype.organization = ""; + + /** + * ListOrgDataExchangesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @instance + */ + ListOrgDataExchangesRequest.prototype.pageSize = 0; + + /** + * ListOrgDataExchangesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @instance + */ + ListOrgDataExchangesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOrgDataExchangesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest} ListOrgDataExchangesRequest instance + */ + ListOrgDataExchangesRequest.create = function create(properties) { + return new ListOrgDataExchangesRequest(properties); + }; + + /** + * Encodes the specified ListOrgDataExchangesRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest} message ListOrgDataExchangesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOrgDataExchangesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.organization); + 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 ListOrgDataExchangesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest} message ListOrgDataExchangesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOrgDataExchangesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOrgDataExchangesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest} ListOrgDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOrgDataExchangesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.organization = 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 ListOrgDataExchangesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest} ListOrgDataExchangesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOrgDataExchangesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOrgDataExchangesRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOrgDataExchangesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: 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 ListOrgDataExchangesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest} ListOrgDataExchangesRequest + */ + ListOrgDataExchangesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest(); + if (object.organization != null) + message.organization = String(object.organization); + 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 ListOrgDataExchangesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest} message ListOrgDataExchangesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOrgDataExchangesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organization = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + 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 ListOrgDataExchangesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @instance + * @returns {Object.} JSON object + */ + ListOrgDataExchangesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOrgDataExchangesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOrgDataExchangesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest"; + }; + + return ListOrgDataExchangesRequest; + })(); + + v1beta1.ListOrgDataExchangesResponse = (function() { + + /** + * Properties of a ListOrgDataExchangesResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListOrgDataExchangesResponse + * @property {Array.|null} [dataExchanges] ListOrgDataExchangesResponse dataExchanges + * @property {string|null} [nextPageToken] ListOrgDataExchangesResponse nextPageToken + */ + + /** + * Constructs a new ListOrgDataExchangesResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListOrgDataExchangesResponse. + * @implements IListOrgDataExchangesResponse + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse=} [properties] Properties to set + */ + function ListOrgDataExchangesResponse(properties) { + this.dataExchanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOrgDataExchangesResponse dataExchanges. + * @member {Array.} dataExchanges + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @instance + */ + ListOrgDataExchangesResponse.prototype.dataExchanges = $util.emptyArray; + + /** + * ListOrgDataExchangesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @instance + */ + ListOrgDataExchangesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOrgDataExchangesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} ListOrgDataExchangesResponse instance + */ + ListOrgDataExchangesResponse.create = function create(properties) { + return new ListOrgDataExchangesResponse(properties); + }; + + /** + * Encodes the specified ListOrgDataExchangesResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse} message ListOrgDataExchangesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOrgDataExchangesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataExchanges != null && message.dataExchanges.length) + for (var i = 0; i < message.dataExchanges.length; ++i) + $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.encode(message.dataExchanges[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 ListOrgDataExchangesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse} message ListOrgDataExchangesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOrgDataExchangesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOrgDataExchangesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} ListOrgDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOrgDataExchangesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataExchanges && message.dataExchanges.length)) + message.dataExchanges = []; + message.dataExchanges.push($root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOrgDataExchangesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} ListOrgDataExchangesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOrgDataExchangesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOrgDataExchangesResponse message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOrgDataExchangesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataExchanges != null && message.hasOwnProperty("dataExchanges")) { + if (!Array.isArray(message.dataExchanges)) + return "dataExchanges: array expected"; + for (var i = 0; i < message.dataExchanges.length; ++i) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify(message.dataExchanges[i]); + if (error) + return "dataExchanges." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOrgDataExchangesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} ListOrgDataExchangesResponse + */ + ListOrgDataExchangesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse(); + if (object.dataExchanges) { + if (!Array.isArray(object.dataExchanges)) + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.dataExchanges: array expected"); + message.dataExchanges = []; + for (var i = 0; i < object.dataExchanges.length; ++i) { + if (typeof object.dataExchanges[i] !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse.dataExchanges: object expected"); + message.dataExchanges[i] = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.fromObject(object.dataExchanges[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOrgDataExchangesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse} message ListOrgDataExchangesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOrgDataExchangesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataExchanges = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataExchanges && message.dataExchanges.length) { + object.dataExchanges = []; + for (var j = 0; j < message.dataExchanges.length; ++j) + object.dataExchanges[j] = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.toObject(message.dataExchanges[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOrgDataExchangesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @instance + * @returns {Object.} JSON object + */ + ListOrgDataExchangesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOrgDataExchangesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOrgDataExchangesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse"; + }; + + return ListOrgDataExchangesResponse; + })(); + + v1beta1.GetDataExchangeRequest = (function() { + + /** + * Properties of a GetDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IGetDataExchangeRequest + * @property {string|null} [name] GetDataExchangeRequest name + */ + + /** + * Constructs a new GetDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a GetDataExchangeRequest. + * @implements IGetDataExchangeRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest=} [properties] Properties to set + */ + function GetDataExchangeRequest(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]]; + } + + /** + * GetDataExchangeRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @instance + */ + GetDataExchangeRequest.prototype.name = ""; + + /** + * Creates a new GetDataExchangeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest} GetDataExchangeRequest instance + */ + GetDataExchangeRequest.create = function create(properties) { + return new GetDataExchangeRequest(properties); + }; + + /** + * Encodes the specified GetDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest} message GetDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataExchangeRequest.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 GetDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest} message GetDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataExchangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataExchangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest} GetDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataExchangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest(); + 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 GetDataExchangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest} GetDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataExchangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataExchangeRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataExchangeRequest.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 GetDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest} GetDataExchangeRequest + */ + GetDataExchangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataExchangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest} message GetDataExchangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataExchangeRequest.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 GetDataExchangeRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataExchangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataExchangeRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataExchangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest"; + }; + + return GetDataExchangeRequest; + })(); + + v1beta1.CreateDataExchangeRequest = (function() { + + /** + * Properties of a CreateDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface ICreateDataExchangeRequest + * @property {string|null} [parent] CreateDataExchangeRequest parent + * @property {string|null} [dataExchangeId] CreateDataExchangeRequest dataExchangeId + * @property {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null} [dataExchange] CreateDataExchangeRequest dataExchange + */ + + /** + * Constructs a new CreateDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a CreateDataExchangeRequest. + * @implements ICreateDataExchangeRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest=} [properties] Properties to set + */ + function CreateDataExchangeRequest(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]]; + } + + /** + * CreateDataExchangeRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @instance + */ + CreateDataExchangeRequest.prototype.parent = ""; + + /** + * CreateDataExchangeRequest dataExchangeId. + * @member {string} dataExchangeId + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @instance + */ + CreateDataExchangeRequest.prototype.dataExchangeId = ""; + + /** + * CreateDataExchangeRequest dataExchange. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null|undefined} dataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @instance + */ + CreateDataExchangeRequest.prototype.dataExchange = null; + + /** + * Creates a new CreateDataExchangeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest} CreateDataExchangeRequest instance + */ + CreateDataExchangeRequest.create = function create(properties) { + return new CreateDataExchangeRequest(properties); + }; + + /** + * Encodes the specified CreateDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest} message CreateDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataExchangeRequest.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.dataExchangeId != null && Object.hasOwnProperty.call(message, "dataExchangeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataExchangeId); + if (message.dataExchange != null && Object.hasOwnProperty.call(message, "dataExchange")) + $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.encode(message.dataExchange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest} message CreateDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataExchangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDataExchangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest} CreateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataExchangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataExchangeId = reader.string(); + break; + } + case 3: { + message.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDataExchangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest} CreateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataExchangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDataExchangeRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDataExchangeRequest.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.dataExchangeId != null && message.hasOwnProperty("dataExchangeId")) + if (!$util.isString(message.dataExchangeId)) + return "dataExchangeId: string expected"; + if (message.dataExchange != null && message.hasOwnProperty("dataExchange")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify(message.dataExchange); + if (error) + return "dataExchange." + error; + } + return null; + }; + + /** + * Creates a CreateDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest} CreateDataExchangeRequest + */ + CreateDataExchangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataExchangeId != null) + message.dataExchangeId = String(object.dataExchangeId); + if (object.dataExchange != null) { + if (typeof object.dataExchange !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest.dataExchange: object expected"); + message.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.fromObject(object.dataExchange); + } + return message; + }; + + /** + * Creates a plain object from a CreateDataExchangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest} message CreateDataExchangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDataExchangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataExchangeId = ""; + object.dataExchange = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataExchangeId != null && message.hasOwnProperty("dataExchangeId")) + object.dataExchangeId = message.dataExchangeId; + if (message.dataExchange != null && message.hasOwnProperty("dataExchange")) + object.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.toObject(message.dataExchange, options); + return object; + }; + + /** + * Converts this CreateDataExchangeRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDataExchangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDataExchangeRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDataExchangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest"; + }; + + return CreateDataExchangeRequest; + })(); + + v1beta1.UpdateDataExchangeRequest = (function() { + + /** + * Properties of an UpdateDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IUpdateDataExchangeRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataExchangeRequest updateMask + * @property {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null} [dataExchange] UpdateDataExchangeRequest dataExchange + */ + + /** + * Constructs a new UpdateDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents an UpdateDataExchangeRequest. + * @implements IUpdateDataExchangeRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest=} [properties] Properties to set + */ + function UpdateDataExchangeRequest(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]]; + } + + /** + * UpdateDataExchangeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @instance + */ + UpdateDataExchangeRequest.prototype.updateMask = null; + + /** + * UpdateDataExchangeRequest dataExchange. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IDataExchange|null|undefined} dataExchange + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @instance + */ + UpdateDataExchangeRequest.prototype.dataExchange = null; + + /** + * Creates a new UpdateDataExchangeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest} UpdateDataExchangeRequest instance + */ + UpdateDataExchangeRequest.create = function create(properties) { + return new UpdateDataExchangeRequest(properties); + }; + + /** + * Encodes the specified UpdateDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest} message UpdateDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataExchangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataExchange != null && Object.hasOwnProperty.call(message, "dataExchange")) + $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.encode(message.dataExchange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest} message UpdateDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataExchangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataExchangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest} UpdateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataExchangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataExchangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest} UpdateDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataExchangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataExchangeRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataExchangeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.dataExchange != null && message.hasOwnProperty("dataExchange")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.verify(message.dataExchange); + if (error) + return "dataExchange." + error; + } + return null; + }; + + /** + * Creates an UpdateDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest} UpdateDataExchangeRequest + */ + UpdateDataExchangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.dataExchange != null) { + if (typeof object.dataExchange !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest.dataExchange: object expected"); + message.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.fromObject(object.dataExchange); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDataExchangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest} message UpdateDataExchangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataExchangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.dataExchange = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.dataExchange != null && message.hasOwnProperty("dataExchange")) + object.dataExchange = $root.google.cloud.bigquery.dataexchange.v1beta1.DataExchange.toObject(message.dataExchange, options); + return object; + }; + + /** + * Converts this UpdateDataExchangeRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataExchangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataExchangeRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataExchangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest"; + }; + + return UpdateDataExchangeRequest; + })(); + + v1beta1.DeleteDataExchangeRequest = (function() { + + /** + * Properties of a DeleteDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDeleteDataExchangeRequest + * @property {string|null} [name] DeleteDataExchangeRequest name + */ + + /** + * Constructs a new DeleteDataExchangeRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DeleteDataExchangeRequest. + * @implements IDeleteDataExchangeRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest=} [properties] Properties to set + */ + function DeleteDataExchangeRequest(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]]; + } + + /** + * DeleteDataExchangeRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @instance + */ + DeleteDataExchangeRequest.prototype.name = ""; + + /** + * Creates a new DeleteDataExchangeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest} DeleteDataExchangeRequest instance + */ + DeleteDataExchangeRequest.create = function create(properties) { + return new DeleteDataExchangeRequest(properties); + }; + + /** + * Encodes the specified DeleteDataExchangeRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest} message DeleteDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataExchangeRequest.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 DeleteDataExchangeRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest} message DeleteDataExchangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataExchangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDataExchangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest} DeleteDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataExchangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest(); + 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 DeleteDataExchangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest} DeleteDataExchangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataExchangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDataExchangeRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDataExchangeRequest.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 DeleteDataExchangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest} DeleteDataExchangeRequest + */ + DeleteDataExchangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDataExchangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest} message DeleteDataExchangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDataExchangeRequest.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 DeleteDataExchangeRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDataExchangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDataExchangeRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDataExchangeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest"; + }; + + return DeleteDataExchangeRequest; + })(); + + v1beta1.ListListingsRequest = (function() { + + /** + * Properties of a ListListingsRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListListingsRequest + * @property {string|null} [parent] ListListingsRequest parent + * @property {number|null} [pageSize] ListListingsRequest pageSize + * @property {string|null} [pageToken] ListListingsRequest pageToken + */ + + /** + * Constructs a new ListListingsRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListListingsRequest. + * @implements IListListingsRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest=} [properties] Properties to set + */ + function ListListingsRequest(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]]; + } + + /** + * ListListingsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @instance + */ + ListListingsRequest.prototype.parent = ""; + + /** + * ListListingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @instance + */ + ListListingsRequest.prototype.pageSize = 0; + + /** + * ListListingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @instance + */ + ListListingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListListingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest} ListListingsRequest instance + */ + ListListingsRequest.create = function create(properties) { + return new ListListingsRequest(properties); + }; + + /** + * Encodes the specified ListListingsRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest} message ListListingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListListingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListListingsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest} message ListListingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListListingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListListingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest} ListListingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListListingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListListingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest} ListListingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListListingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListListingsRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListListingsRequest.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.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 ListListingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest} ListListingsRequest + */ + ListListingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListListingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest} message ListListingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListListingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListListingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListListingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListListingsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListListingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest"; + }; + + return ListListingsRequest; + })(); + + v1beta1.ListListingsResponse = (function() { + + /** + * Properties of a ListListingsResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IListListingsResponse + * @property {Array.|null} [listings] ListListingsResponse listings + * @property {string|null} [nextPageToken] ListListingsResponse nextPageToken + */ + + /** + * Constructs a new ListListingsResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a ListListingsResponse. + * @implements IListListingsResponse + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse=} [properties] Properties to set + */ + function ListListingsResponse(properties) { + this.listings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListListingsResponse listings. + * @member {Array.} listings + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @instance + */ + ListListingsResponse.prototype.listings = $util.emptyArray; + + /** + * ListListingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @instance + */ + ListListingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListListingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} ListListingsResponse instance + */ + ListListingsResponse.create = function create(properties) { + return new ListListingsResponse(properties); + }; + + /** + * Encodes the specified ListListingsResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse} message ListListingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListListingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.listings != null && message.listings.length) + for (var i = 0; i < message.listings.length; ++i) + $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.encode(message.listings[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 ListListingsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse} message ListListingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListListingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListListingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} ListListingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListListingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.listings && message.listings.length)) + message.listings = []; + message.listings.push($root.google.cloud.bigquery.dataexchange.v1beta1.Listing.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListListingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} ListListingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListListingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListListingsResponse message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListListingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.listings != null && message.hasOwnProperty("listings")) { + if (!Array.isArray(message.listings)) + return "listings: array expected"; + for (var i = 0; i < message.listings.length; ++i) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.verify(message.listings[i]); + if (error) + return "listings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListListingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} ListListingsResponse + */ + ListListingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse(); + if (object.listings) { + if (!Array.isArray(object.listings)) + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.listings: array expected"); + message.listings = []; + for (var i = 0; i < object.listings.length; ++i) { + if (typeof object.listings[i] !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse.listings: object expected"); + message.listings[i] = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.fromObject(object.listings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListListingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse} message ListListingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListListingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.listings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.listings && message.listings.length) { + object.listings = []; + for (var j = 0; j < message.listings.length; ++j) + object.listings[j] = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.toObject(message.listings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListListingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListListingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListListingsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListListingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse"; + }; + + return ListListingsResponse; + })(); + + v1beta1.GetListingRequest = (function() { + + /** + * Properties of a GetListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IGetListingRequest + * @property {string|null} [name] GetListingRequest name + */ + + /** + * Constructs a new GetListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a GetListingRequest. + * @implements IGetListingRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest=} [properties] Properties to set + */ + function GetListingRequest(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]]; + } + + /** + * GetListingRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @instance + */ + GetListingRequest.prototype.name = ""; + + /** + * Creates a new GetListingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest} GetListingRequest instance + */ + GetListingRequest.create = function create(properties) { + return new GetListingRequest(properties); + }; + + /** + * Encodes the specified GetListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest} message GetListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetListingRequest.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 GetListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest} message GetListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetListingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetListingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest} GetListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetListingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest(); + 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 GetListingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest} GetListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetListingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetListingRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetListingRequest.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 GetListingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest} GetListingRequest + */ + GetListingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetListingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest} message GetListingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetListingRequest.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 GetListingRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @instance + * @returns {Object.} JSON object + */ + GetListingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetListingRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetListingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest"; + }; + + return GetListingRequest; + })(); + + v1beta1.CreateListingRequest = (function() { + + /** + * Properties of a CreateListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface ICreateListingRequest + * @property {string|null} [parent] CreateListingRequest parent + * @property {string|null} [listingId] CreateListingRequest listingId + * @property {google.cloud.bigquery.dataexchange.v1beta1.IListing|null} [listing] CreateListingRequest listing + */ + + /** + * Constructs a new CreateListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a CreateListingRequest. + * @implements ICreateListingRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest=} [properties] Properties to set + */ + function CreateListingRequest(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]]; + } + + /** + * CreateListingRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @instance + */ + CreateListingRequest.prototype.parent = ""; + + /** + * CreateListingRequest listingId. + * @member {string} listingId + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @instance + */ + CreateListingRequest.prototype.listingId = ""; + + /** + * CreateListingRequest listing. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IListing|null|undefined} listing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @instance + */ + CreateListingRequest.prototype.listing = null; + + /** + * Creates a new CreateListingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest} CreateListingRequest instance + */ + CreateListingRequest.create = function create(properties) { + return new CreateListingRequest(properties); + }; + + /** + * Encodes the specified CreateListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest} message CreateListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateListingRequest.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.listingId != null && Object.hasOwnProperty.call(message, "listingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.listingId); + if (message.listing != null && Object.hasOwnProperty.call(message, "listing")) + $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.encode(message.listing, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest} message CreateListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateListingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateListingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest} CreateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateListingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.listingId = reader.string(); + break; + } + case 3: { + message.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateListingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest} CreateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateListingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateListingRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateListingRequest.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.listingId != null && message.hasOwnProperty("listingId")) + if (!$util.isString(message.listingId)) + return "listingId: string expected"; + if (message.listing != null && message.hasOwnProperty("listing")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.verify(message.listing); + if (error) + return "listing." + error; + } + return null; + }; + + /** + * Creates a CreateListingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest} CreateListingRequest + */ + CreateListingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.listingId != null) + message.listingId = String(object.listingId); + if (object.listing != null) { + if (typeof object.listing !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest.listing: object expected"); + message.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.fromObject(object.listing); + } + return message; + }; + + /** + * Creates a plain object from a CreateListingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest} message CreateListingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateListingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.listingId = ""; + object.listing = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.listingId != null && message.hasOwnProperty("listingId")) + object.listingId = message.listingId; + if (message.listing != null && message.hasOwnProperty("listing")) + object.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.toObject(message.listing, options); + return object; + }; + + /** + * Converts this CreateListingRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateListingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateListingRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateListingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest"; + }; + + return CreateListingRequest; + })(); + + v1beta1.UpdateListingRequest = (function() { + + /** + * Properties of an UpdateListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IUpdateListingRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateListingRequest updateMask + * @property {google.cloud.bigquery.dataexchange.v1beta1.IListing|null} [listing] UpdateListingRequest listing + */ + + /** + * Constructs a new UpdateListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents an UpdateListingRequest. + * @implements IUpdateListingRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest=} [properties] Properties to set + */ + function UpdateListingRequest(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]]; + } + + /** + * UpdateListingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @instance + */ + UpdateListingRequest.prototype.updateMask = null; + + /** + * UpdateListingRequest listing. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IListing|null|undefined} listing + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @instance + */ + UpdateListingRequest.prototype.listing = null; + + /** + * Creates a new UpdateListingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest} UpdateListingRequest instance + */ + UpdateListingRequest.create = function create(properties) { + return new UpdateListingRequest(properties); + }; + + /** + * Encodes the specified UpdateListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest} message UpdateListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateListingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.listing != null && Object.hasOwnProperty.call(message, "listing")) + $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.encode(message.listing, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest} message UpdateListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateListingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateListingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest} UpdateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateListingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateListingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest} UpdateListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateListingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateListingRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateListingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.listing != null && message.hasOwnProperty("listing")) { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.verify(message.listing); + if (error) + return "listing." + error; + } + return null; + }; + + /** + * Creates an UpdateListingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest} UpdateListingRequest + */ + UpdateListingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.listing != null) { + if (typeof object.listing !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest.listing: object expected"); + message.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.fromObject(object.listing); + } + return message; + }; + + /** + * Creates a plain object from an UpdateListingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest} message UpdateListingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateListingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.listing = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.listing != null && message.hasOwnProperty("listing")) + object.listing = $root.google.cloud.bigquery.dataexchange.v1beta1.Listing.toObject(message.listing, options); + return object; + }; + + /** + * Converts this UpdateListingRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateListingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateListingRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateListingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest"; + }; + + return UpdateListingRequest; + })(); + + v1beta1.DeleteListingRequest = (function() { + + /** + * Properties of a DeleteListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface IDeleteListingRequest + * @property {string|null} [name] DeleteListingRequest name + */ + + /** + * Constructs a new DeleteListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a DeleteListingRequest. + * @implements IDeleteListingRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest=} [properties] Properties to set + */ + function DeleteListingRequest(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]]; + } + + /** + * DeleteListingRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @instance + */ + DeleteListingRequest.prototype.name = ""; + + /** + * Creates a new DeleteListingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest} DeleteListingRequest instance + */ + DeleteListingRequest.create = function create(properties) { + return new DeleteListingRequest(properties); + }; + + /** + * Encodes the specified DeleteListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest} message DeleteListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteListingRequest.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 DeleteListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest} message DeleteListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteListingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteListingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest} DeleteListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteListingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest(); + 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 DeleteListingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest} DeleteListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteListingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteListingRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteListingRequest.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 DeleteListingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest} DeleteListingRequest + */ + DeleteListingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteListingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest} message DeleteListingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteListingRequest.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 DeleteListingRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteListingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteListingRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteListingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest"; + }; + + return DeleteListingRequest; + })(); + + v1beta1.SubscribeListingRequest = (function() { + + /** + * Properties of a SubscribeListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface ISubscribeListingRequest + * @property {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset|null} [destinationDataset] SubscribeListingRequest destinationDataset + * @property {string|null} [name] SubscribeListingRequest name + */ + + /** + * Constructs a new SubscribeListingRequest. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a SubscribeListingRequest. + * @implements ISubscribeListingRequest + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest=} [properties] Properties to set + */ + function SubscribeListingRequest(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]]; + } + + /** + * SubscribeListingRequest destinationDataset. + * @member {google.cloud.bigquery.dataexchange.v1beta1.IDestinationDataset|null|undefined} destinationDataset + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @instance + */ + SubscribeListingRequest.prototype.destinationDataset = null; + + /** + * SubscribeListingRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @instance + */ + SubscribeListingRequest.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscribeListingRequest destination. + * @member {"destinationDataset"|undefined} destination + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @instance + */ + Object.defineProperty(SubscribeListingRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscribeListingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest} SubscribeListingRequest instance + */ + SubscribeListingRequest.create = function create(properties) { + return new SubscribeListingRequest(properties); + }; + + /** + * Encodes the specified SubscribeListingRequest message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest} message SubscribeListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeListingRequest.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.destinationDataset != null && Object.hasOwnProperty.call(message, "destinationDataset")) + $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.encode(message.destinationDataset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscribeListingRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest} message SubscribeListingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeListingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeListingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest} SubscribeListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeListingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.destinationDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeListingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest} SubscribeListingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeListingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeListingRequest message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeListingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destinationDataset != null && message.hasOwnProperty("destinationDataset")) { + properties.destination = 1; + { + var error = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.verify(message.destinationDataset); + if (error) + return "destinationDataset." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a SubscribeListingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest} SubscribeListingRequest + */ + SubscribeListingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest) + return object; + var message = new $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest(); + if (object.destinationDataset != null) { + if (typeof object.destinationDataset !== "object") + throw TypeError(".google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest.destinationDataset: object expected"); + message.destinationDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.fromObject(object.destinationDataset); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a SubscribeListingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest} message SubscribeListingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeListingRequest.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; + if (message.destinationDataset != null && message.hasOwnProperty("destinationDataset")) { + object.destinationDataset = $root.google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset.toObject(message.destinationDataset, options); + if (options.oneofs) + object.destination = "destinationDataset"; + } + return object; + }; + + /** + * Converts this SubscribeListingRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @instance + * @returns {Object.} JSON object + */ + SubscribeListingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscribeListingRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscribeListingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest"; + }; + + return SubscribeListingRequest; + })(); + + v1beta1.SubscribeListingResponse = (function() { + + /** + * Properties of a SubscribeListingResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @interface ISubscribeListingResponse + */ + + /** + * Constructs a new SubscribeListingResponse. + * @memberof google.cloud.bigquery.dataexchange.v1beta1 + * @classdesc Represents a SubscribeListingResponse. + * @implements ISubscribeListingResponse + * @constructor + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse=} [properties] Properties to set + */ + function SubscribeListingResponse(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 SubscribeListingResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} SubscribeListingResponse instance + */ + SubscribeListingResponse.create = function create(properties) { + return new SubscribeListingResponse(properties); + }; + + /** + * Encodes the specified SubscribeListingResponse message. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse} message SubscribeListingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeListingResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SubscribeListingResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse} message SubscribeListingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeListingResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeListingResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} SubscribeListingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeListingResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeListingResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} SubscribeListingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeListingResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeListingResponse message. + * @function verify + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeListingResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SubscribeListingResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} SubscribeListingResponse + */ + SubscribeListingResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse) + return object; + return new $root.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse(); + }; + + /** + * Creates a plain object from a SubscribeListingResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse} message SubscribeListingResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeListingResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SubscribeListingResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @instance + * @returns {Object.} JSON object + */ + SubscribeListingResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscribeListingResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscribeListingResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse"; + }; + + return SubscribeListingResponse; + })(); + + return v1beta1; + })(); + + return dataexchange; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.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.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.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(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]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + 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 a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(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]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(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]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-dataexchange/protos/protos.json b/packages/google-cloud-bigquery-dataexchange/protos/protos.json new file mode 100644 index 000000000000..31dbbb40dd5c --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/protos/protos.json @@ -0,0 +1,2442 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "dataexchange": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.DataExchange.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/dataexchange/v1beta1;dataexchange", + "java_multiple_files": true, + "java_outer_classname": "DataExchangeProto", + "java_package": "com.google.cloud.bigquery.dataexchange.v1beta1", + "php_namespace": "Google\\Cloud\\BigQuery\\DataExchange\\V1beta1", + "ruby_package": "Google::Cloud::Bigquery::DataExchange::V1beta1", + "(google.api.resource_definition).type": "bigquery.googleapis.com/Dataset", + "(google.api.resource_definition).pattern": "projects/{project}/datasets/{dataset}" + }, + "nested": { + "AnalyticsHubService": { + "options": { + "(google.api.default_host)": "analyticshub.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListDataExchanges": { + "requestType": "ListDataExchangesRequest", + "responseType": "ListDataExchangesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/dataExchanges", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/dataExchanges" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListOrgDataExchanges": { + "requestType": "ListOrgDataExchangesRequest", + "responseType": "ListOrgDataExchangesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{organization=organizations/*/locations/*}/dataExchanges", + "(google.api.method_signature)": "organization" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{organization=organizations/*/locations/*}/dataExchanges" + } + }, + { + "(google.api.method_signature)": "organization" + } + ] + }, + "GetDataExchange": { + "requestType": "GetDataExchangeRequest", + "responseType": "DataExchange", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDataExchange": { + "requestType": "CreateDataExchangeRequest", + "responseType": "DataExchange", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/dataExchanges", + "(google.api.http).body": "data_exchange", + "(google.api.method_signature)": "parent,data_exchange" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/dataExchanges", + "body": "data_exchange" + } + }, + { + "(google.api.method_signature)": "parent,data_exchange" + } + ] + }, + "UpdateDataExchange": { + "requestType": "UpdateDataExchangeRequest", + "responseType": "DataExchange", + "options": { + "(google.api.http).patch": "/v1beta1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}", + "(google.api.http).body": "data_exchange", + "(google.api.method_signature)": "data_exchange,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{data_exchange.name=projects/*/locations/*/dataExchanges/*}", + "body": "data_exchange" + } + }, + { + "(google.api.method_signature)": "data_exchange,update_mask" + } + ] + }, + "DeleteDataExchange": { + "requestType": "DeleteDataExchangeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListListings": { + "requestType": "ListListingsRequest", + "responseType": "ListListingsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetListing": { + "requestType": "GetListingRequest", + "responseType": "Listing", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateListing": { + "requestType": "CreateListingRequest", + "responseType": "Listing", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings", + "(google.api.http).body": "listing", + "(google.api.method_signature)": "parent,listing" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/dataExchanges/*}/listings", + "body": "listing" + } + }, + { + "(google.api.method_signature)": "parent,listing" + } + ] + }, + "UpdateListing": { + "requestType": "UpdateListingRequest", + "responseType": "Listing", + "options": { + "(google.api.http).patch": "/v1beta1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}", + "(google.api.http).body": "listing", + "(google.api.method_signature)": "listing,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{listing.name=projects/*/locations/*/dataExchanges/*/listings/*}", + "body": "listing" + } + }, + { + "(google.api.method_signature)": "listing,update_mask" + } + ] + }, + "DeleteListing": { + "requestType": "DeleteListingRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SubscribeListing": { + "requestType": "SubscribeListingRequest", + "responseType": "SubscribeListingResponse", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:getIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy", + "body": "*" + } + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:setIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy", + "body": "*" + } + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*}:testIamPermissions", + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:testIamPermissions", + "body": "*" + } + } + } + ] + } + } + }, + "DataExchange": { + "options": { + "(google.api.resource).type": "analyticshub.googleapis.com/DataExchange", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataExchanges/{data_exchange}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "primaryContact": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "listingCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "icon": { + "type": "bytes", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DataProvider": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "primaryContact": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Publisher": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "primaryContact": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DestinationDatasetReference": { + "fields": { + "datasetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DestinationDataset": { + "fields": { + "datasetReference": { + "type": "DestinationDatasetReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "google.protobuf.StringValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Listing": { + "options": { + "(google.api.resource).type": "analyticshub.googleapis.com/Listing", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}" + }, + "oneofs": { + "source": { + "oneof": [ + "bigqueryDataset" + ] + } + }, + "fields": { + "bigqueryDataset": { + "type": "BigQueryDatasetSource", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "primaryContact": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentation": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "icon": { + "type": "bytes", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataProvider": { + "type": "DataProvider", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "categories": { + "rule": "repeated", + "type": "Category", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "publisher": { + "type": "Publisher", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestAccess": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BigQueryDatasetSource": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "bigquery.googleapis.com/Dataset" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1 + } + }, + "Category": { + "values": { + "CATEGORY_UNSPECIFIED": 0, + "CATEGORY_OTHERS": 1, + "CATEGORY_ADVERTISING_AND_MARKETING": 2, + "CATEGORY_COMMERCE": 3, + "CATEGORY_CLIMATE_AND_ENVIRONMENT": 4, + "CATEGORY_DEMOGRAPHICS": 5, + "CATEGORY_ECONOMICS": 6, + "CATEGORY_EDUCATION": 7, + "CATEGORY_ENERGY": 8, + "CATEGORY_FINANCIAL": 9, + "CATEGORY_GAMING": 10, + "CATEGORY_GEOSPATIAL": 11, + "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE": 12, + "CATEGORY_MEDIA": 13, + "CATEGORY_PUBLIC_SECTOR": 14, + "CATEGORY_RETAIL": 15, + "CATEGORY_SPORTS": 16, + "CATEGORY_SCIENCE_AND_RESEARCH": 17, + "CATEGORY_TRANSPORTATION_AND_LOGISTICS": 18, + "CATEGORY_TRAVEL_AND_TOURISM": 19 + } + } + } + }, + "ListDataExchangesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDataExchangesResponse": { + "fields": { + "dataExchanges": { + "rule": "repeated", + "type": "DataExchange", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListOrgDataExchangesRequest": { + "fields": { + "organization": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOrgDataExchangesResponse": { + "fields": { + "dataExchanges": { + "rule": "repeated", + "type": "DataExchange", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDataExchangeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/DataExchange" + } + } + } + }, + "CreateDataExchangeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "dataExchangeId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataExchange": { + "type": "DataExchange", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDataExchangeRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataExchange": { + "type": "DataExchange", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDataExchangeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/DataExchange" + } + } + } + }, + "ListListingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/DataExchange" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListListingsResponse": { + "fields": { + "listings": { + "rule": "repeated", + "type": "Listing", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetListingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/Listing" + } + } + } + }, + "CreateListingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/DataExchange" + } + }, + "listingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "listing": { + "type": "Listing", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateListingRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "listing": { + "type": "Listing", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteListingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/Listing" + } + } + } + }, + "SubscribeListingRequest": { + "oneofs": { + "destination": { + "oneof": [ + "destinationDataset" + ] + } + }, + "fields": { + "destinationDataset": { + "type": "DestinationDataset", + "id": 3 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "analyticshub.googleapis.com/Listing" + } + } + } + }, + "SubscribeListingResponse": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-dataexchange/samples/README.md b/packages/google-cloud-bigquery-dataexchange/samples/README.md new file mode 100644 index 000000000000..bbb673db1398 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/README.md @@ -0,0 +1,338 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Analytics Hub API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Analytics_hub_service.create_data_exchange](#analytics_hub_service.create_data_exchange) + * [Analytics_hub_service.create_listing](#analytics_hub_service.create_listing) + * [Analytics_hub_service.delete_data_exchange](#analytics_hub_service.delete_data_exchange) + * [Analytics_hub_service.delete_listing](#analytics_hub_service.delete_listing) + * [Analytics_hub_service.get_data_exchange](#analytics_hub_service.get_data_exchange) + * [Analytics_hub_service.get_iam_policy](#analytics_hub_service.get_iam_policy) + * [Analytics_hub_service.get_listing](#analytics_hub_service.get_listing) + * [Analytics_hub_service.list_data_exchanges](#analytics_hub_service.list_data_exchanges) + * [Analytics_hub_service.list_listings](#analytics_hub_service.list_listings) + * [Analytics_hub_service.list_org_data_exchanges](#analytics_hub_service.list_org_data_exchanges) + * [Analytics_hub_service.set_iam_policy](#analytics_hub_service.set_iam_policy) + * [Analytics_hub_service.subscribe_listing](#analytics_hub_service.subscribe_listing) + * [Analytics_hub_service.test_iam_permissions](#analytics_hub_service.test_iam_permissions) + * [Analytics_hub_service.update_data_exchange](#analytics_hub_service.update_data_exchange) + * [Analytics_hub_service.update_listing](#analytics_hub_service.update_listing) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Analytics_hub_service.create_data_exchange + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js` + + +----- + + + + +### Analytics_hub_service.create_listing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js` + + +----- + + + + +### Analytics_hub_service.delete_data_exchange + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js` + + +----- + + + + +### Analytics_hub_service.delete_listing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js` + + +----- + + + + +### Analytics_hub_service.get_data_exchange + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js` + + +----- + + + + +### Analytics_hub_service.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js` + + +----- + + + + +### Analytics_hub_service.get_listing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js` + + +----- + + + + +### Analytics_hub_service.list_data_exchanges + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js` + + +----- + + + + +### Analytics_hub_service.list_listings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js` + + +----- + + + + +### Analytics_hub_service.list_org_data_exchanges + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js` + + +----- + + + + +### Analytics_hub_service.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js` + + +----- + + + + +### Analytics_hub_service.subscribe_listing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js` + + +----- + + + + +### Analytics_hub_service.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js` + + +----- + + + + +### Analytics_hub_service.update_data_exchange + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js` + + +----- + + + + +### Analytics_hub_service.update_listing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/analytics-hub diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js new file mode 100644 index 000000000000..c17c1185f61c --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js @@ -0,0 +1,76 @@ +// Copyright 2022 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'; + +function main(parent, dataExchangeId, dataExchange) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + */ + // const dataExchangeId = 'abc123' + /** + * Required. The data exchange to create. + */ + // const dataExchange = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callCreateDataExchange() { + // Construct request + const request = { + parent, + dataExchangeId, + dataExchange, + }; + + // Run request + const response = await dataexchangeClient.createDataExchange(request); + console.log(response); + } + + callCreateDataExchange(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js new file mode 100644 index 000000000000..ca90ad731783 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js @@ -0,0 +1,76 @@ +// Copyright 2022 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'; + +function main(parent, listingId, listing) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + */ + // const listingId = 'abc123' + /** + * Required. The listing to create. + */ + // const listing = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callCreateListing() { + // Construct request + const request = { + parent, + listingId, + listing, + }; + + // Run request + const response = await dataexchangeClient.createListing(request); + console.log(response); + } + + callCreateListing(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js new file mode 100644 index 000000000000..2524dc6d7553 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + */ + // const name = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callDeleteDataExchange() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataexchangeClient.deleteDataExchange(request); + console.log(response); + } + + callDeleteDataExchange(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js new file mode 100644 index 000000000000..c59efecda28c --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + */ + // const name = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callDeleteListing() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataexchangeClient.deleteListing(request); + console.log(response); + } + + callDeleteListing(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js new file mode 100644 index 000000000000..6dd52af87a2b --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + */ + // const name = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callGetDataExchange() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataexchangeClient.getDataExchange(request); + console.log(response); + } + + callGetDataExchange(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js new file mode 100644 index 000000000000..1c9517d4f3a7 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await dataexchangeClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js new file mode 100644 index 000000000000..c12e1d6b63b3 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + */ + // const name = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callGetListing() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataexchangeClient.getListing(request); + console.log(response); + } + + callGetListing(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js new file mode 100644 index 000000000000..526b76206d53 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ + // const pageSize = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callListDataExchanges() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataexchangeClient.listDataExchangesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataExchanges(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js new file mode 100644 index 000000000000..198024de91f5 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ + // const pageSize = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callListListings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataexchangeClient.listListingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListListings(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js new file mode 100644 index 000000000000..73fd6f2b697e --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(organization) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + */ + // const organization = 'abc123' + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ + // const pageSize = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callListOrgDataExchanges() { + // Construct request + const request = { + organization, + }; + + // Run request + const iterable = await dataexchangeClient.listOrgDataExchangesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOrgDataExchanges(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js new file mode 100644 index 000000000000..4321af1d2686 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await dataexchangeClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js new file mode 100644 index 000000000000..54fb5dc50de5 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(name) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * BigQuery destination dataset to create for the subscriber. + */ + // const destinationDataset = {} + /** + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + */ + // const name = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callSubscribeListing() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataexchangeClient.subscribeListing(request); + console.log(response); + } + + callSubscribeListing(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js new file mode 100644 index 000000000000..c4fa1a3620bc --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await dataexchangeClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js new file mode 100644 index 000000000000..fda5528d611e --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(updateMask, dataExchange) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + */ + // const updateMask = {} + /** + * Required. The data exchange to update. + */ + // const dataExchange = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callUpdateDataExchange() { + // Construct request + const request = { + updateMask, + dataExchange, + }; + + // Run request + const response = await dataexchangeClient.updateDataExchange(request); + console.log(response); + } + + callUpdateDataExchange(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js new file mode 100644 index 000000000000..4b2872ec7470 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(updateMask, listing) { + // [START analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + */ + // const updateMask = {} + /** + * Required. The listing to update. + */ + // const listing = {} + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callUpdateListing() { + // Construct request + const request = { + updateMask, + listing, + }; + + // Run request + const response = await dataexchangeClient.updateListing(request); + console.log(response); + } + + callUpdateListing(); + // [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json new file mode 100644 index 000000000000..573bc0f2f803 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json @@ -0,0 +1,683 @@ +{ + "clientLibrary": { + "name": "nodejs-dataexchange", + "version": "0.3.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.dataexchange.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_async", + "title": "AnalyticsHubService listDataExchanges Sample", + "origin": "API_DEFINITION", + "description": " Lists all data exchanges in a given project and location.", + "canonical": true, + "file": "analytics_hub_service.list_data_exchanges.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataExchanges", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListDataExchanges", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesResponse", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "ListDataExchanges", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListDataExchanges", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_async", + "title": "AnalyticsHubService listOrgDataExchanges Sample", + "origin": "API_DEFINITION", + "description": " Lists all data exchanges from projects in a given organization and location.", + "canonical": true, + "file": "analytics_hub_service.list_org_data_exchanges.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOrgDataExchanges", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListOrgDataExchanges", + "async": true, + "parameters": [ + { + "name": "organization", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesResponse", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "ListOrgDataExchanges", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListOrgDataExchanges", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_async", + "title": "AnalyticsHubService getDataExchange Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a data exchange.", + "canonical": true, + "file": "analytics_hub_service.get_data_exchange.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetDataExchange", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.DataExchange", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "GetDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetDataExchange", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_async", + "title": "AnalyticsHubService createDataExchange Sample", + "origin": "API_DEFINITION", + "description": " Creates a new data exchange.", + "canonical": true, + "file": "analytics_hub_service.create_data_exchange.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateDataExchange", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_exchange_id", + "type": "TYPE_STRING" + }, + { + "name": "data_exchange", + "type": ".google.cloud.bigquery.dataexchange.v1beta1.DataExchange" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.DataExchange", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "CreateDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateDataExchange", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_async", + "title": "AnalyticsHubService updateDataExchange Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing data exchange.", + "canonical": true, + "file": "analytics_hub_service.update_data_exchange.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateDataExchange", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "data_exchange", + "type": ".google.cloud.bigquery.dataexchange.v1beta1.DataExchange" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.DataExchange", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "UpdateDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateDataExchange", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async", + "title": "AnalyticsHubService deleteDataExchange Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing data exchange.", + "canonical": true, + "file": "analytics_hub_service.delete_data_exchange.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteDataExchange", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "DeleteDataExchange", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteDataExchange", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_async", + "title": "AnalyticsHubService listListings Sample", + "origin": "API_DEFINITION", + "description": " Lists all listings in a given project and location.", + "canonical": true, + "file": "analytics_hub_service.list_listings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListListings", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListListings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.ListListingsResponse", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "ListListings", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.ListListings", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_async", + "title": "AnalyticsHubService getListing Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a listing.", + "canonical": true, + "file": "analytics_hub_service.get_listing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetListing", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.Listing", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "GetListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetListing", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_async", + "title": "AnalyticsHubService createListing Sample", + "origin": "API_DEFINITION", + "description": " Creates a new listing.", + "canonical": true, + "file": "analytics_hub_service.create_listing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateListing", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "listing_id", + "type": "TYPE_STRING" + }, + { + "name": "listing", + "type": ".google.cloud.bigquery.dataexchange.v1beta1.Listing" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.Listing", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "CreateListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.CreateListing", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_async", + "title": "AnalyticsHubService updateListing Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing listing.", + "canonical": true, + "file": "analytics_hub_service.update_listing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateListing", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "listing", + "type": ".google.cloud.bigquery.dataexchange.v1beta1.Listing" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.Listing", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "UpdateListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.UpdateListing", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_async", + "title": "AnalyticsHubService deleteListing Sample", + "origin": "API_DEFINITION", + "description": " Deletes a listing.", + "canonical": true, + "file": "analytics_hub_service.delete_listing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteListing", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "DeleteListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.DeleteListing", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_async", + "title": "AnalyticsHubService subscribeListing Sample", + "origin": "API_DEFINITION", + "description": " Subscribes to a listing. Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.", + "canonical": true, + "file": "analytics_hub_service.subscribe_listing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SubscribeListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SubscribeListing", + "async": true, + "parameters": [ + { + "name": "destination_dataset", + "type": ".google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "SubscribeListing", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SubscribeListing", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_async", + "title": "AnalyticsHubService getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM policy.", + "canonical": true, + "file": "analytics_hub_service.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.GetIamPolicy", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_async", + "title": "AnalyticsHubService setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM policy.", + "canonical": true, + "file": "analytics_hub_service.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.SetIamPolicy", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + }, + { + "regionTag": "analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_async", + "title": "AnalyticsHubService testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has.", + "canonical": true, + "file": "analytics_hub_service.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "AnalyticsHubServiceClient", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubServiceClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService.TestIamPermissions", + "service": { + "shortName": "AnalyticsHubService", + "fullName": "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-dataexchange/samples/package.json b/packages/google-cloud-bigquery-dataexchange/samples/package.json new file mode 100644 index 000000000000..43c6368162de --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-analyticshub-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/bigquery-data-exchange": "^0.3.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^10.0.0" + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/samples/quickstart.js b/packages/google-cloud-bigquery-dataexchange/samples/quickstart.js new file mode 100644 index 000000000000..449f401ab61c --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/quickstart.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START analyticshub_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource path of the DataExchanges. + * e.g. `projects/myproject/locations/US`. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ + // const pageSize = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + + // Imports the Dataexchange library + const {AnalyticsHubServiceClient} = + require('@google-cloud/bigquery-data-exchange').v1beta1; + + // Instantiates a client + const dataexchangeClient = new AnalyticsHubServiceClient(); + + async function callListDataExchanges() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataexchangeClient.listDataExchangesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataExchanges(); + // [END analyticshub_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js b/packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js new file mode 100644 index 000000000000..fb84b59ad82b --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/samples/test/quickstart.js @@ -0,0 +1,45 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const {AnalyticsHubServiceClient} = + require('@google-cloud/bigquery-data-exchange').v1beta1; + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new AnalyticsHubServiceClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + // Should have 0 exit code, and therefore not throw: + execSync(`node ./quickstart.js projects/${projectId}`, { + cwd, + }); + }); +}); diff --git a/packages/google-cloud-bigquery-dataexchange/src/index.ts b/packages/google-cloud-bigquery-dataexchange/src/index.ts new file mode 100644 index 000000000000..8aba57547e3a --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; + +const AnalyticsHubServiceClient = v1beta1.AnalyticsHubServiceClient; +type AnalyticsHubServiceClient = v1beta1.AnalyticsHubServiceClient; + +export {v1beta1, AnalyticsHubServiceClient}; +export default {v1beta1, AnalyticsHubServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts new file mode 100644 index 000000000000..52addd6d3e1d --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts @@ -0,0 +1,2408 @@ +// Copyright 2022 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, + LocationsClient, + LocationProtos, +} 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/v1beta1/analytics_hub_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './analytics_hub_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The `AnalyticsHubService` API facilitates data sharing within and across + * organizations. It allows data providers to publish listings that reference + * shared datasets. With Analytics Hub, users can discover and search for + * listings that they have access to. Subscribers can view and subscribe to + * listings. When you subscribe to a listing, Analytics Hub creates a linked + * dataset in your project. + * @class + * @memberof v1beta1 + */ +export class AnalyticsHubServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + analyticsHubServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AnalyticsHubServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 AnalyticsHubServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AnalyticsHubServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + dataExchangePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}' + ), + listingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listDataExchanges: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataExchanges' + ), + listOrgDataExchanges: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataExchanges' + ), + listListings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'listings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService', + 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.analyticsHubServiceStub) { + return this.analyticsHubServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService. + this.analyticsHubServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.dataexchange.v1beta1 + .AnalyticsHubService, + 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 analyticsHubServiceStubMethods = [ + 'listDataExchanges', + 'listOrgDataExchanges', + 'getDataExchange', + 'createDataExchange', + 'updateDataExchange', + 'deleteDataExchange', + 'listListings', + 'getListing', + 'createListing', + 'updateListing', + 'deleteListing', + 'subscribeListing', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of analyticsHubServiceStubMethods) { + const callPromise = this.analyticsHubServiceStub.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.analyticsHubServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'analyticshub.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'analyticshub.googleapis.com'; + } + + /** + * 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/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + 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 -- + // ------------------- + /** + * Gets the details of a data exchange. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the data exchange. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_async + */ + getDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | undefined + ), + {} | undefined + ] + >; + getDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | 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.getDataExchange(request, options, callback); + } + /** + * Creates a new data exchange. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource path of the data exchange. + * e.g. `projects/myproject/locations/US`. + * @param {string} request.dataExchangeId + * Required. The ID of the data exchange. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} request.dataExchange + * Required. The data exchange to create. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_async + */ + createDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | undefined + ), + {} | undefined + ] + >; + createDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | 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.createDataExchange(request, options, callback); + } + /** + * Updates an existing data exchange. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask specifies the fields to update in the data exchange + * resource. The fields specified in the + * `updateMask` are relative to the resource and are not a full request. + * @param {google.cloud.bigquery.dataexchange.v1beta1.DataExchange} request.dataExchange + * Required. The data exchange to update. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_async + */ + updateDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | undefined + ), + {} | undefined + ] + >; + updateDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | 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({ + 'data_exchange.name': request.dataExchange!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataExchange(request, options, callback); + } + /** + * Deletes an existing data exchange. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the data exchange resource that you want to delete. + * For example, `projects/myproject/locations/US/dataExchanges/123`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async + */ + deleteDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | undefined + ), + {} | undefined + ] + >; + deleteDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataExchange( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataExchange( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | 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.deleteDataExchange(request, options, callback); + } + /** + * Gets the details of a listing. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @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 [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.get_listing.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_async + */ + getListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | undefined + ), + {} | undefined + ] + >; + getListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | 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.getListing(request, options, callback); + } + /** + * Creates a new listing. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param {string} request.listingId + * Required. The ID of the listing to create. + * Must contain only Unicode letters, numbers (0-9), underscores (_). + * Should not use characters that require URL-escaping, or characters + * outside of ASCII, spaces. + * Max length: 100 bytes. + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} request.listing + * Required. The listing to create. + * @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 [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.create_listing.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_async + */ + createListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | undefined + ), + {} | undefined + ] + >; + createListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | 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.createListing(request, options, callback); + } + /** + * Updates an existing listing. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask specifies the fields to update in the listing resource. The + * fields specified in the `updateMask` are relative to the resource and are + * not a full request. + * @param {google.cloud.bigquery.dataexchange.v1beta1.Listing} request.listing + * Required. The listing to update. + * @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 [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.update_listing.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_async + */ + updateListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | undefined + ), + {} | undefined + ] + >; + updateListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | 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({ + 'listing.name': request.listing!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateListing(request, options, callback); + } + /** + * Deletes a listing. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the listing to delete. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.delete_listing.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_async + */ + deleteListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | undefined + ), + {} | undefined + ] + >; + deleteListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | 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.deleteListing(request, options, callback); + } + /** + * Subscribes to a listing. + * + * Currently, with Analytics Hub, you can create listings that + * reference only BigQuery datasets. + * Upon subscription to a listing for a BigQuery dataset, Analytics Hub + * creates a linked dataset in the subscriber's project. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.dataexchange.v1beta1.DestinationDataset} request.destinationDataset + * BigQuery destination dataset to create for the subscriber. + * @param {string} request.name + * Required. Resource name of the listing that you want to subscribe to. + * e.g. `projects/myproject/locations/US/dataExchanges/123/listings/456`. + * @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 [SubscribeListingResponse]{@link google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_async + */ + subscribeListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | undefined + ), + {} | undefined + ] + >; + subscribeListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + subscribeListing( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, + callback: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + subscribeListing( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | 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.subscribeListing(request, options, callback); + } + /** + * Gets the IAM policy. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the IAM policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the permissions that a caller has. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Lists all data exchanges in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. + * 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 `listDataExchangesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataExchanges( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + ] + >; + listDataExchanges( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): void; + listDataExchanges( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): void; + listDataExchanges( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + ] + > | 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.listDataExchanges(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 parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange} 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 `listDataExchangesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataExchangesStream( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + 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['listDataExchanges']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataExchanges.createStream( + this.innerApiCalls.listDataExchanges as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataExchanges`, 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 parent resource path of the data exchanges. + * e.g. `projects/myproject/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_async + */ + listDataExchangesAsync( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + 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['listDataExchanges']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataExchanges.asyncIterate( + this.innerApiCalls['listDataExchanges'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all data exchanges from projects in a given organization and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.organization + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. + * 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 `listOrgDataExchangesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listOrgDataExchanges( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + ] + >; + listOrgDataExchanges( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): void; + listOrgDataExchanges( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): void; + listOrgDataExchanges( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + ] + > | 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({ + organization: request.organization ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOrgDataExchanges(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.organization + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange} 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 `listOrgDataExchangesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listOrgDataExchangesStream( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + 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({ + organization: request.organization ?? '', + }); + const defaultCallSettings = this._defaults['listOrgDataExchanges']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOrgDataExchanges.createStream( + this.innerApiCalls.listOrgDataExchanges as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOrgDataExchanges`, 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.organization + * Required. The organization resource path of the projects containing DataExchanges. + * e.g. `organizations/myorg/locations/US`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataExchange]{@link google.cloud.bigquery.dataexchange.v1beta1.DataExchange}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_async + */ + listOrgDataExchangesAsync( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + 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({ + organization: request.organization ?? '', + }); + const defaultCallSettings = this._defaults['listOrgDataExchanges']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOrgDataExchanges.asyncIterate( + this.innerApiCalls['listOrgDataExchanges'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all listings in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing}. + * 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 `listListingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listListings( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + ] + >; + listListings( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing + > + ): void; + listListings( + request: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing + > + ): void; + listListings( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing + > + ): Promise< + [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + ] + > | 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.listListings(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 parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing} 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 `listListingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listListingsStream( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + 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['listListings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listListings.createStream( + this.innerApiCalls.listListings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listListings`, 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 parent resource path of the listing. + * e.g. `projects/myproject/locations/US/dataExchanges/123`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Listing]{@link google.cloud.bigquery.dataexchange.v1beta1.Listing}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/analytics_hub_service.list_listings.js + * region_tag:analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_async + */ + listListingsAsync( + request?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + 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['listListings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listListings.asyncIterate( + this.innerApiCalls['listListings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified dataExchange resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_exchange + * @returns {string} Resource name string. + */ + dataExchangePath(project: string, location: string, dataExchange: string) { + return this.pathTemplates.dataExchangePathTemplate.render({ + project: project, + location: location, + data_exchange: dataExchange, + }); + } + + /** + * Parse the project from DataExchange resource. + * + * @param {string} dataExchangeName + * A fully-qualified path representing DataExchange resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataExchangeName(dataExchangeName: string) { + return this.pathTemplates.dataExchangePathTemplate.match(dataExchangeName) + .project; + } + + /** + * Parse the location from DataExchange resource. + * + * @param {string} dataExchangeName + * A fully-qualified path representing DataExchange resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataExchangeName(dataExchangeName: string) { + return this.pathTemplates.dataExchangePathTemplate.match(dataExchangeName) + .location; + } + + /** + * Parse the data_exchange from DataExchange resource. + * + * @param {string} dataExchangeName + * A fully-qualified path representing DataExchange resource. + * @returns {string} A string representing the data_exchange. + */ + matchDataExchangeFromDataExchangeName(dataExchangeName: string) { + return this.pathTemplates.dataExchangePathTemplate.match(dataExchangeName) + .data_exchange; + } + + /** + * Return a fully-qualified listing resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_exchange + * @param {string} listing + * @returns {string} Resource name string. + */ + listingPath( + project: string, + location: string, + dataExchange: string, + listing: string + ) { + return this.pathTemplates.listingPathTemplate.render({ + project: project, + location: location, + data_exchange: dataExchange, + listing: listing, + }); + } + + /** + * Parse the project from Listing resource. + * + * @param {string} listingName + * A fully-qualified path representing Listing resource. + * @returns {string} A string representing the project. + */ + matchProjectFromListingName(listingName: string) { + return this.pathTemplates.listingPathTemplate.match(listingName).project; + } + + /** + * Parse the location from Listing resource. + * + * @param {string} listingName + * A fully-qualified path representing Listing resource. + * @returns {string} A string representing the location. + */ + matchLocationFromListingName(listingName: string) { + return this.pathTemplates.listingPathTemplate.match(listingName).location; + } + + /** + * Parse the data_exchange from Listing resource. + * + * @param {string} listingName + * A fully-qualified path representing Listing resource. + * @returns {string} A string representing the data_exchange. + */ + matchDataExchangeFromListingName(listingName: string) { + return this.pathTemplates.listingPathTemplate.match(listingName) + .data_exchange; + } + + /** + * Parse the listing from Listing resource. + * + * @param {string} listingName + * A fully-qualified path representing Listing resource. + * @returns {string} A string representing the listing. + */ + matchListingFromListingName(listingName: string) { + return this.pathTemplates.listingPathTemplate.match(listingName).listing; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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.analyticsHubServiceStub && !this._terminated) { + return this.analyticsHubServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client_config.json b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client_config.json new file mode 100644 index 000000000000..a3ed0687cd41 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client_config.json @@ -0,0 +1,110 @@ +{ + "interfaces": { + "google.cloud.bigquery.dataexchange.v1beta1.AnalyticsHubService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "ListDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListOrgDataExchanges": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteDataExchange": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "ListListings": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetListing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateListing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "UpdateListing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "DeleteListing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "SubscribeListing": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_proto_list.json b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_proto_list.json new file mode 100644 index 000000000000..182836966ea5 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto" +] diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/gapic_metadata.json b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..f75d8d83a901 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/gapic_metadata.json @@ -0,0 +1,185 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.dataexchange.v1beta1", + "libraryPackage": "@google-cloud/bigquery-data-exchange", + "services": { + "AnalyticsHubService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsHubServiceClient", + "rpcs": { + "GetDataExchange": { + "methods": [ + "getDataExchange" + ] + }, + "CreateDataExchange": { + "methods": [ + "createDataExchange" + ] + }, + "UpdateDataExchange": { + "methods": [ + "updateDataExchange" + ] + }, + "DeleteDataExchange": { + "methods": [ + "deleteDataExchange" + ] + }, + "GetListing": { + "methods": [ + "getListing" + ] + }, + "CreateListing": { + "methods": [ + "createListing" + ] + }, + "UpdateListing": { + "methods": [ + "updateListing" + ] + }, + "DeleteListing": { + "methods": [ + "deleteListing" + ] + }, + "SubscribeListing": { + "methods": [ + "subscribeListing" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListDataExchanges": { + "methods": [ + "listDataExchanges", + "listDataExchangesStream", + "listDataExchangesAsync" + ] + }, + "ListOrgDataExchanges": { + "methods": [ + "listOrgDataExchanges", + "listOrgDataExchangesStream", + "listOrgDataExchangesAsync" + ] + }, + "ListListings": { + "methods": [ + "listListings", + "listListingsStream", + "listListingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AnalyticsHubServiceClient", + "rpcs": { + "GetDataExchange": { + "methods": [ + "getDataExchange" + ] + }, + "CreateDataExchange": { + "methods": [ + "createDataExchange" + ] + }, + "UpdateDataExchange": { + "methods": [ + "updateDataExchange" + ] + }, + "DeleteDataExchange": { + "methods": [ + "deleteDataExchange" + ] + }, + "GetListing": { + "methods": [ + "getListing" + ] + }, + "CreateListing": { + "methods": [ + "createListing" + ] + }, + "UpdateListing": { + "methods": [ + "updateListing" + ] + }, + "DeleteListing": { + "methods": [ + "deleteListing" + ] + }, + "SubscribeListing": { + "methods": [ + "subscribeListing" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListDataExchanges": { + "methods": [ + "listDataExchanges", + "listDataExchangesStream", + "listDataExchangesAsync" + ] + }, + "ListOrgDataExchanges": { + "methods": [ + "listOrgDataExchanges", + "listOrgDataExchangesStream", + "listOrgDataExchangesAsync" + ] + }, + "ListListings": { + "methods": [ + "listListings", + "listListingsStream", + "listListingsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts new file mode 100644 index 000000000000..c384e09d3d0e --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {AnalyticsHubServiceClient} from './analytics_hub_service_client'; diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..f09733ca8357 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dataexchange = require('@google-cloud/bigquery-data-exchange'); + +function main() { + const analyticsHubServiceClient = + new dataexchange.AnalyticsHubServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..c7f5e50af3a7 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 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 {AnalyticsHubServiceClient} from '@google-cloud/bigquery-data-exchange'; + +// check that the client class type name can be used +function doStuffWithAnalyticsHubServiceClient( + client: AnalyticsHubServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const analyticsHubServiceClient = new AnalyticsHubServiceClient(); + doStuffWithAnalyticsHubServiceClient(analyticsHubServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/install.ts b/packages/google-cloud-bigquery-dataexchange/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts b/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts new file mode 100644 index 000000000000..29adae00d161 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts @@ -0,0 +1,3283 @@ +// Copyright 2022 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 analyticshubserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LocationProtos} 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('v1beta1.AnalyticsHubServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.analyticsHubServiceStub, undefined); + await client.initialize(); + assert(client.analyticsHubServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.analyticsHubServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.analyticsHubServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + 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 analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + 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('getDataExchange', () => { + it('invokes getDataExchange without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.getDataExchange = stubSimpleCall(expectedResponse); + const [response] = await client.getDataExchange(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataExchange without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.getDataExchange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataExchange( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataExchange with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataExchange = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataExchange(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataExchange with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataExchange(request), expectedError); + }); + }); + + describe('createDataExchange', () => { + it('invokes createDataExchange without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.createDataExchange = + stubSimpleCall(expectedResponse); + const [response] = await client.createDataExchange(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataExchange without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.createDataExchange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataExchange( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataExchange with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataExchange = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataExchange(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataExchange with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateDataExchangeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataExchange(request), expectedError); + }); + }); + + describe('updateDataExchange', () => { + it('invokes updateDataExchange without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest() + ); + request.dataExchange ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); + request.dataExchange.name = defaultValue1; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.updateDataExchange = + stubSimpleCall(expectedResponse); + const [response] = await client.updateDataExchange(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataExchange without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest() + ); + request.dataExchange ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); + request.dataExchange.name = defaultValue1; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ); + client.innerApiCalls.updateDataExchange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataExchange( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataExchange with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest() + ); + request.dataExchange ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); + request.dataExchange.name = defaultValue1; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataExchange = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataExchange(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataExchange with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest() + ); + request.dataExchange ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateDataExchangeRequest', + ['dataExchange', 'name'] + ); + request.dataExchange.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataExchange(request), expectedError); + }); + }); + + describe('deleteDataExchange', () => { + it('invokes deleteDataExchange without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataExchange = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataExchange(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataExchange without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataExchange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataExchange( + 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.deleteDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataExchange with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataExchange = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataExchange(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataExchange as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataExchange as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataExchange with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteDataExchangeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDataExchange(request), expectedError); + }); + }); + + describe('getListing', () => { + it('invokes getListing without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.getListing = stubSimpleCall(expectedResponse); + const [response] = await client.getListing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getListing without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.getListing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getListing( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListing | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getListing with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getListing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getListing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getListing with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.GetListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getListing(request), expectedError); + }); + }); + + describe('createListing', () => { + it('invokes createListing without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.createListing = stubSimpleCall(expectedResponse); + const [response] = await client.createListing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createListing without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.createListing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createListing( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListing | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createListing with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createListing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createListing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createListing with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.CreateListingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createListing(request), expectedError); + }); + }); + + describe('updateListing', () => { + it('invokes updateListing without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest() + ); + request.listing ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest', + ['listing', 'name'] + ); + request.listing.name = defaultValue1; + const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.updateListing = stubSimpleCall(expectedResponse); + const [response] = await client.updateListing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateListing without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest() + ); + request.listing ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest', + ['listing', 'name'] + ); + request.listing.name = defaultValue1; + const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ); + client.innerApiCalls.updateListing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateListing( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.IListing | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateListing with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest() + ); + request.listing ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest', + ['listing', 'name'] + ); + request.listing.name = defaultValue1; + const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateListing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateListing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateListing with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest() + ); + request.listing ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.UpdateListingRequest', + ['listing', 'name'] + ); + request.listing.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateListing(request), expectedError); + }); + }); + + describe('deleteListing', () => { + it('invokes deleteListing without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteListing = stubSimpleCall(expectedResponse); + const [response] = await client.deleteListing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteListing without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteListing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteListing( + 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.deleteListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteListing with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteListing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteListing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteListing with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.DeleteListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteListing(request), expectedError); + }); + }); + + describe('subscribeListing', () => { + it('invokes subscribeListing without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse() + ); + client.innerApiCalls.subscribeListing = stubSimpleCall(expectedResponse); + const [response] = await client.subscribeListing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes subscribeListing without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse() + ); + client.innerApiCalls.subscribeListing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.subscribeListing( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes subscribeListing with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.subscribeListing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.subscribeListing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.subscribeListing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes subscribeListing with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.subscribeListing(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('listDataExchanges', () => { + it('invokes listDataExchanges without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.innerApiCalls.listDataExchanges = stubSimpleCall(expectedResponse); + const [response] = await client.listDataExchanges(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataExchanges without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.innerApiCalls.listDataExchanges = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataExchanges( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataExchanges with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataExchanges = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataExchanges(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataExchangesStream without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.descriptors.page.listDataExchanges.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataExchangesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange + ) => { + 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.listDataExchanges.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataExchanges, request) + ); + assert( + (client.descriptors.page.listDataExchanges.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataExchangesStream with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataExchanges.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataExchangesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataExchanges.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataExchanges, request) + ); + assert( + (client.descriptors.page.listDataExchanges.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataExchanges without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.descriptors.page.listDataExchanges.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] = + []; + const iterable = client.listDataExchangesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataExchanges.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataExchanges.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataExchanges with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListDataExchangesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataExchanges.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataExchangesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataExchanges.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataExchanges.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOrgDataExchanges', () => { + it('invokes listOrgDataExchanges without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.innerApiCalls.listOrgDataExchanges = + stubSimpleCall(expectedResponse); + const [response] = await client.listOrgDataExchanges(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOrgDataExchanges without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.innerApiCalls.listOrgDataExchanges = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOrgDataExchanges( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOrgDataExchanges with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOrgDataExchanges = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listOrgDataExchanges(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOrgDataExchanges as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOrgDataExchangesStream without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.descriptors.page.listOrgDataExchanges.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOrgDataExchangesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange + ) => { + 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.listOrgDataExchanges.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listOrgDataExchanges, request) + ); + assert( + (client.descriptors.page.listOrgDataExchanges.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOrgDataExchangesStream with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOrgDataExchanges.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listOrgDataExchangesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listOrgDataExchanges.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listOrgDataExchanges, request) + ); + assert( + (client.descriptors.page.listOrgDataExchanges.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOrgDataExchanges without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() + ), + ]; + client.descriptors.page.listOrgDataExchanges.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] = + []; + const iterable = client.listOrgDataExchangesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listOrgDataExchanges.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listOrgDataExchanges.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOrgDataExchanges with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListOrgDataExchangesRequest', + ['organization'] + ); + request.organization = defaultValue1; + const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOrgDataExchanges.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOrgDataExchangesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listOrgDataExchanges.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listOrgDataExchanges.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listListings', () => { + it('invokes listListings without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + ]; + client.innerApiCalls.listListings = stubSimpleCall(expectedResponse); + const [response] = await client.listListings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listListings without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + ]; + client.innerApiCalls.listListings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listListings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listListings with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listListings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listListings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listListings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listListingsStream without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + ]; + client.descriptors.page.listListings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listListingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.Listing[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.Listing + ) => { + 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.listListings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listListings, request) + ); + assert( + (client.descriptors.page.listListings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listListingsStream with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listListings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listListingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.Listing[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.dataexchange.v1beta1.Listing + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listListings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listListings, request) + ); + assert( + (client.descriptors.page.listListings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listListings without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() + ), + ]; + client.descriptors.page.listListings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[] = + []; + const iterable = client.listListingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listListings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listListings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listListings with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.dataexchange.v1beta1.ListListingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listListings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listListingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listListings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listListings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('dataExchange', () => { + const fakePath = '/rendered/path/dataExchange'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_exchange: 'dataExchangeValue', + }; + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataExchangePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataExchangePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataExchangePath', () => { + const result = client.dataExchangePath( + 'projectValue', + 'locationValue', + 'dataExchangeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataExchangePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataExchangeName', () => { + const result = client.matchProjectFromDataExchangeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataExchangePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataExchangeName', () => { + const result = client.matchLocationFromDataExchangeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataExchangePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataExchangeFromDataExchangeName', () => { + const result = client.matchDataExchangeFromDataExchangeName(fakePath); + assert.strictEqual(result, 'dataExchangeValue'); + assert( + (client.pathTemplates.dataExchangePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('listing', () => { + const fakePath = '/rendered/path/listing'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_exchange: 'dataExchangeValue', + listing: 'listingValue', + }; + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.listingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.listingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('listingPath', () => { + const result = client.listingPath( + 'projectValue', + 'locationValue', + 'dataExchangeValue', + 'listingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.listingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromListingName', () => { + const result = client.matchProjectFromListingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.listingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromListingName', () => { + const result = client.matchLocationFromListingName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.listingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataExchangeFromListingName', () => { + const result = client.matchDataExchangeFromListingName(fakePath); + assert.strictEqual(result, 'dataExchangeValue'); + assert( + (client.pathTemplates.listingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchListingFromListingName', () => { + const result = client.matchListingFromListingName(fakePath); + assert.strictEqual(result, 'listingValue'); + assert( + (client.pathTemplates.listingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new analyticshubserviceModule.v1beta1.AnalyticsHubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-dataexchange/tsconfig.json b/packages/google-cloud-bigquery-dataexchange/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/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/packages/google-cloud-bigquery-dataexchange/webpack.config.js b/packages/google-cloud-bigquery-dataexchange/webpack.config.js new file mode 100644 index 000000000000..9c92421a85d3 --- /dev/null +++ b/packages/google-cloud-bigquery-dataexchange/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: 'AnalyticsHubService', + filename: './analytics-hub-service.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/packages/google-cloud-bigquery-datapolicies/.OwlBot.yaml b/packages/google-cloud-bigquery-datapolicies/.OwlBot.yaml new file mode 100644 index 000000000000..3fd772caa466 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.OwlBot.yaml @@ -0,0 +1,17 @@ +# Copyright 2022 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. + +deep-copy-regex: + - source: /google/cloud/bigquery/datapolicies/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-datapolicies/$1 \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datapolicies/.eslintignore b/packages/google-cloud-bigquery-datapolicies/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-bigquery-datapolicies/.eslintrc.json b/packages/google-cloud-bigquery-datapolicies/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-datapolicies/.gitattributes b/packages/google-cloud-bigquery-datapolicies/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-bigquery-datapolicies/.gitignore b/packages/google-cloud-bigquery-datapolicies/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.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/packages/google-cloud-bigquery-datapolicies/.jsdoc.js b/packages/google-cloud-bigquery-datapolicies/.jsdoc.js new file mode 100644 index 000000000000..ae9e5b7afcdd --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-datapolicies', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-datapolicies/.mocharc.js b/packages/google-cloud-bigquery-datapolicies/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-bigquery-datapolicies/.nycrc b/packages/google-cloud-bigquery-datapolicies/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-datapolicies/.prettierignore b/packages/google-cloud-bigquery-datapolicies/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-datapolicies/.prettierrc.js b/packages/google-cloud-bigquery-datapolicies/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-datapolicies/.repo-metadata.json b/packages/google-cloud-bigquery-datapolicies/.repo-metadata.json new file mode 100644 index 000000000000..100c2944457d --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "datapolicies", + "name_pretty": "", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/datapolicies/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/bigquery-datapolicies", + "api_id": "google.cloud.bigquery.datapolicies.v1beta1", + "default_version": "v1beta1", + "requires_billing": true, + "library_type": "GAPIC_AUTO" +} + diff --git a/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md b/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md new file mode 100644 index 000000000000..07fde9e24a12 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2022-09-30) + + +### Features + +* Add initial files for google.cloud.bigquery.datapolicies.v1beta1 ([#3362](https://github.com/googleapis/google-cloud-node/issues/3362)) ([c456c72](https://github.com/googleapis/google-cloud-node/commit/c456c7225ed77862cd281e977db8267edb9fd506)) diff --git a/packages/google-cloud-bigquery-datapolicies/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-datapolicies/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datapolicies/CONTRIBUTING.md b/packages/google-cloud-bigquery-datapolicies/CONTRIBUTING.md new file mode 100644 index 000000000000..b5182835f0ab --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=google.cloud.bigquery.datapolicies.v1beta1 +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datapolicies/LICENSE b/packages/google-cloud-bigquery-datapolicies/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-bigquery-datapolicies/README.md b/packages/google-cloud-bigquery-datapolicies/README.md new file mode 100644 index 000000000000..aaf5b4989a3f --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/README.md @@ -0,0 +1,194 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-datapolicies.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-datapolicies) + + + + + client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [ Node.js Client API Reference][client-docs] + +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigquery-datapolicies +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + */ +// const parent = 'abc123' +/** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + */ +// const pageSize = 1234 +/** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + */ +// const pageToken = 'abc123' + +// Imports the Datapolicies library +const {DataPolicyServiceClient} = + require('@google-cloud/bigquery-datapolicies').v1beta1; + +// Instantiates a client +const datapoliciesClient = new DataPolicyServiceClient(); + +async function callListDataPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datapoliciesClient.listDataPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListDataPolicies(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Data_policy_service.create_data_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js,samples/README.md) | +| Data_policy_service.delete_data_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js,samples/README.md) | +| Data_policy_service.get_data_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js,samples/README.md) | +| Data_policy_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js,samples/README.md) | +| Data_policy_service.list_data_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js,samples/README.md) | +| Data_policy_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js,samples/README.md) | +| Data_policy_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js,samples/README.md) | +| Data_policy_service.update_data_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js,samples/README.md) | + + + +The [ Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigquery-datapolicies@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/datapolicies/latest + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=google.cloud.bigquery.datapolicies.v1beta1 +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-datapolicies/linkinator.config.json b/packages/google-cloud-bigquery-datapolicies/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-bigquery-datapolicies/package.json b/packages/google-cloud-bigquery-datapolicies/package.json new file mode 100644 index 000000000000..cc0230f2205b --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/bigquery-datapolicies", + "version": "0.1.0", + "description": " client for Node.js", + "repository": "googleapis/google-cloud-node", + "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 datapolicies", + "datapolicies", + "" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.0.1" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto new file mode 100644 index 000000000000..363f15c5ce94 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto @@ -0,0 +1,287 @@ +// Copyright 2022 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.cloud.bigquery.datapolicies.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataPolicies.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datapolicies/v1beta1;datapolicies"; +option java_multiple_files = true; +option java_outer_classname = "DataPolicyProto"; +option java_package = "com.google.cloud.bigquery.datapolicies.v1beta1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataPolicies\\V1beta1"; +option ruby_package = "Google::Cloud::Bigquery::DataPolicies::V1beta1"; + +// Data Policy Service provides APIs for managing the label-policy bindings. +service DataPolicyService { + option (google.api.default_host) = "bigquerydatapolicy.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new data policy under a project with the given `dataPolicyId` + // (used as the display name), policy tag, and data policy type. + rpc CreateDataPolicy(CreateDataPolicyRequest) returns (DataPolicy) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/dataPolicies" + body: "data_policy" + }; + option (google.api.method_signature) = "parent,data_policy"; + } + + // Updates the metadata for an existing data policy. The target data policy + // can be specified by the resource name. + rpc UpdateDataPolicy(UpdateDataPolicyRequest) returns (DataPolicy) { + option (google.api.http) = { + patch: "/v1beta1/{data_policy.name=projects/*/locations/*/dataPolicies/*}" + body: "data_policy" + }; + option (google.api.method_signature) = "data_policy,update_mask"; + } + + // Deletes the data policy specified by its resource name. + rpc DeleteDataPolicy(DeleteDataPolicyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the data policy specified by its resource name. + rpc GetDataPolicy(GetDataPolicyRequest) returns (DataPolicy) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all of the data policies in the specified parent project. + rpc ListDataPolicies(ListDataPoliciesRequest) returns (ListDataPoliciesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/dataPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the IAM policy for the specified data policy. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:getIamPolicy" + body: "*" + }; + } + + // Sets the IAM policy for the specified data policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:setIamPolicy" + body: "*" + }; + } + + // Returns the caller's permission on the specified data policy resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:testIamPermissions" + body: "*" + }; + } +} + +// Request message for the CreateDataPolicy method. +message CreateDataPolicyRequest { + // Required. Resource name of the project that the data policy will belong to. The + // format is `projects/{project_number}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatapolicy.googleapis.com/DataPolicy" + } + ]; + + // Required. The data policy to create. The `name` field does not need to be + // provided for the data policy creation. + DataPolicy data_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for the UpdateDataPolicy method. +message UpdateDataPolicyRequest { + // Required. Update the data policy's metadata. + // + // The target data policy is determined by the `name` field. + // Other fields are updated to the specified values based on the field masks. + DataPolicy data_policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + // If not set, defaults to all of the fields that are allowed to update. + // + // Updates to the `name` and `dataPolicyId` fields are not allowed. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for the DeleteDataPolicy method. +message DeleteDataPolicyRequest { + // Required. Resource name of the data policy to delete. Format is + // `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatapolicy.googleapis.com/DataPolicy" + } + ]; +} + +// Request message for the GetDataPolicy method. +message GetDataPolicyRequest { + // Required. Resource name of the requested data policy. Format is + // `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatapolicy.googleapis.com/DataPolicy" + } + ]; +} + +// Request message for the ListDataPolicies method. +message ListDataPoliciesRequest { + // Required. Resource name of the project for which to list data policies. Format is + // `projects/{project_number}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatapolicy.googleapis.com/DataPolicy" + } + ]; + + // The maximum number of data policies to return. Must be a value between 1 + // and 1000. + // If not set, defaults to 50. + int32 page_size = 2; + + // The `nextPageToken` value returned from a previous list request, if any. If + // not set, defaults to an empty string. + string page_token = 3; +} + +// Response message for the ListDataPolicies method. +message ListDataPoliciesResponse { + // Data policies that belong to the requested project. + repeated DataPolicy data_policies = 1; + + // Token used to retrieve the next page of results, or empty if there are no + // more results. + string next_page_token = 2; +} + +// Represents the label-policy binding. +message DataPolicy { + option (google.api.resource) = { + type: "bigquerydatapolicy.googleapis.com/DataPolicy" + pattern: "projects/{project}/locations/{location}/dataPolicies/{data_policy}" + }; + + // A list of supported data policy types. + enum DataPolicyType { + // Default value for the data policy type. This should not be used. + DATA_POLICY_TYPE_UNSPECIFIED = 0; + + // Used to create a data policy for column-level security, without data + // masking. + COLUMN_LEVEL_SECURITY_POLICY = 3; + + // Used to create a data policy for data masking. + DATA_MASKING_POLICY = 2; + } + + // Label that is bound to this data policy. + oneof matching_label { + // Policy tag resource name, in the format of + // `projects/{project_number}/locations/{location_id}/taxonomies/{taxonomy_id}/policyTags/{policyTag_id}`. + string policy_tag = 4; + } + + // The policy that is bound to this data policy. + oneof policy { + // The data masking policy that specifies the data masking rule to use. + DataMaskingPolicy data_masking_policy = 5; + } + + // Output only. Resource name of this data policy, in the format of + // `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Type of data policy. + DataPolicyType data_policy_type = 2; + + // User-assigned (human readable) ID of the data policy that needs to be + // unique within a project. Used as {data_policy_id} in part of the resource + // name. + string data_policy_id = 3; +} + +// The data masking policy that is used to specify data masking rule. +message DataMaskingPolicy { + // The available masking rules. Learn more here: + // https://cloud.google.com/bigquery/docs/column-data-masking-intro#masking_options. + enum PredefinedExpression { + // Default, unspecified predefined expression. No masking will take place + // since no expression is specified. + PREDEFINED_EXPRESSION_UNSPECIFIED = 0; + + // Masking expression to replace data with SHA-256 hash. + SHA256 = 3; + + // Masking expression to replace data with NULLs. + ALWAYS_NULL = 5; + + // Masking expression to replace data with their default masking values. + // The default masking values for each type listed as below: + // + // * STRING: "" + // * BYTES: b'' + // * INTEGER: 0 + // * FLOAT: 0.0 + // * NUMERIC: 0 + // * BOOLEAN: FALSE + // * TIMESTAMP: 0001-01-01 00:00:00 UTC + // * DATE: 0001-01-01 + // * TIME: 00:00:00 + // * DATETIME: 0001-01-01T00:00:00 + // * GEOGRAPHY: POINT(0 0) + // * BIGNUMERIC: 0 + // * ARRAY: [] + // * STRUCT: NOT_APPLICABLE + // * JSON: NULL + DEFAULT_MASKING_VALUE = 7; + } + + // A masking expression to bind to the data masking rule. + oneof masking_expression { + // A predefined masking expression. + PredefinedExpression predefined_expression = 1; + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts b/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts new file mode 100644 index 000000000000..d15efec9b56e --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts @@ -0,0 +1,6767 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace datapolicies. */ + namespace datapolicies { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a DataPolicyService */ + class DataPolicyService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataPolicyService 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 DataPolicyService 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): DataPolicyService; + + /** + * Calls CreateDataPolicy. + * @param request CreateDataPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataPolicy + */ + public createDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.CreateDataPolicyCallback): void; + + /** + * Calls CreateDataPolicy. + * @param request CreateDataPolicyRequest message or plain object + * @returns Promise + */ + public createDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest): Promise; + + /** + * Calls UpdateDataPolicy. + * @param request UpdateDataPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataPolicy + */ + public updateDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.UpdateDataPolicyCallback): void; + + /** + * Calls UpdateDataPolicy. + * @param request UpdateDataPolicyRequest message or plain object + * @returns Promise + */ + public updateDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest): Promise; + + /** + * Calls DeleteDataPolicy. + * @param request DeleteDataPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.DeleteDataPolicyCallback): void; + + /** + * Calls DeleteDataPolicy. + * @param request DeleteDataPolicyRequest message or plain object + * @returns Promise + */ + public deleteDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest): Promise; + + /** + * Calls GetDataPolicy. + * @param request GetDataPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataPolicy + */ + public getDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetDataPolicyCallback): void; + + /** + * Calls GetDataPolicy. + * @param request GetDataPolicyRequest message or plain object + * @returns Promise + */ + public getDataPolicy(request: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest): Promise; + + /** + * Calls ListDataPolicies. + * @param request ListDataPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataPoliciesResponse + */ + public listDataPolicies(request: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.ListDataPoliciesCallback): void; + + /** + * Calls ListDataPolicies. + * @param request ListDataPoliciesRequest message or plain object + * @returns Promise + */ + public listDataPolicies(request: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace DataPolicyService { + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|createDataPolicy}. + * @param error Error, if any + * @param [response] DataPolicy + */ + type CreateDataPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.datapolicies.v1beta1.DataPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|updateDataPolicy}. + * @param error Error, if any + * @param [response] DataPolicy + */ + type UpdateDataPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.datapolicies.v1beta1.DataPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|deleteDataPolicy}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDataPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|getDataPolicy}. + * @param error Error, if any + * @param [response] DataPolicy + */ + type GetDataPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.datapolicies.v1beta1.DataPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|listDataPolicies}. + * @param error Error, if any + * @param [response] ListDataPoliciesResponse + */ + type ListDataPoliciesCallback = (error: (Error|null), response?: google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a CreateDataPolicyRequest. */ + interface ICreateDataPolicyRequest { + + /** CreateDataPolicyRequest parent */ + parent?: (string|null); + + /** CreateDataPolicyRequest dataPolicy */ + dataPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null); + } + + /** Represents a CreateDataPolicyRequest. */ + class CreateDataPolicyRequest implements ICreateDataPolicyRequest { + + /** + * Constructs a new CreateDataPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest); + + /** CreateDataPolicyRequest parent. */ + public parent: string; + + /** CreateDataPolicyRequest dataPolicy. */ + public dataPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null); + + /** + * Creates a new CreateDataPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDataPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest): google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest; + + /** + * Encodes the specified CreateDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest.verify|verify} messages. + * @param message CreateDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest.verify|verify} messages. + * @param message CreateDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDataPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest; + + /** + * Decodes a CreateDataPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest; + + /** + * Verifies a CreateDataPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDataPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest; + + /** + * Creates a plain object from a CreateDataPolicyRequest message. Also converts values to other types if specified. + * @param message CreateDataPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDataPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDataPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataPolicyRequest. */ + interface IUpdateDataPolicyRequest { + + /** UpdateDataPolicyRequest dataPolicy */ + dataPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null); + + /** UpdateDataPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDataPolicyRequest. */ + class UpdateDataPolicyRequest implements IUpdateDataPolicyRequest { + + /** + * Constructs a new UpdateDataPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest); + + /** UpdateDataPolicyRequest dataPolicy. */ + public dataPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null); + + /** UpdateDataPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDataPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest): google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest; + + /** + * Encodes the specified UpdateDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.verify|verify} messages. + * @param message UpdateDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.verify|verify} messages. + * @param message UpdateDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest; + + /** + * Decodes an UpdateDataPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest; + + /** + * Verifies an UpdateDataPolicyRequest message. + * @param message Plain 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 UpdateDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest; + + /** + * Creates a plain object from an UpdateDataPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateDataPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDataPolicyRequest. */ + interface IDeleteDataPolicyRequest { + + /** DeleteDataPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDataPolicyRequest. */ + class DeleteDataPolicyRequest implements IDeleteDataPolicyRequest { + + /** + * Constructs a new DeleteDataPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest); + + /** DeleteDataPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteDataPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDataPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest): google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest; + + /** + * Encodes the specified DeleteDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest.verify|verify} messages. + * @param message DeleteDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest.verify|verify} messages. + * @param message DeleteDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDataPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest; + + /** + * Decodes a DeleteDataPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest; + + /** + * Verifies a DeleteDataPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDataPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest; + + /** + * Creates a plain object from a DeleteDataPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteDataPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDataPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDataPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataPolicyRequest. */ + interface IGetDataPolicyRequest { + + /** GetDataPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetDataPolicyRequest. */ + class GetDataPolicyRequest implements IGetDataPolicyRequest { + + /** + * Constructs a new GetDataPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest); + + /** GetDataPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetDataPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest): google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest; + + /** + * Encodes the specified GetDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest.verify|verify} messages. + * @param message GetDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest.verify|verify} messages. + * @param message GetDataPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest; + + /** + * Decodes a GetDataPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest; + + /** + * Verifies a GetDataPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest; + + /** + * Creates a plain object from a GetDataPolicyRequest message. Also converts values to other types if specified. + * @param message GetDataPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataPoliciesRequest. */ + interface IListDataPoliciesRequest { + + /** ListDataPoliciesRequest parent */ + parent?: (string|null); + + /** ListDataPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDataPoliciesRequest. */ + class ListDataPoliciesRequest implements IListDataPoliciesRequest { + + /** + * Constructs a new ListDataPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest); + + /** ListDataPoliciesRequest parent. */ + public parent: string; + + /** ListDataPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListDataPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDataPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataPoliciesRequest instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest; + + /** + * Encodes the specified ListDataPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest.verify|verify} messages. + * @param message ListDataPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest.verify|verify} messages. + * @param message ListDataPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest; + + /** + * Decodes a ListDataPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest; + + /** + * Verifies a ListDataPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest; + + /** + * Creates a plain object from a ListDataPoliciesRequest message. Also converts values to other types if specified. + * @param message ListDataPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataPoliciesResponse. */ + interface IListDataPoliciesResponse { + + /** ListDataPoliciesResponse dataPolicies */ + dataPolicies?: (google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[]|null); + + /** ListDataPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataPoliciesResponse. */ + class ListDataPoliciesResponse implements IListDataPoliciesResponse { + + /** + * Constructs a new ListDataPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse); + + /** ListDataPoliciesResponse dataPolicies. */ + public dataPolicies: google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[]; + + /** ListDataPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataPoliciesResponse instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse; + + /** + * Encodes the specified ListDataPoliciesResponse message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.verify|verify} messages. + * @param message ListDataPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.verify|verify} messages. + * @param message ListDataPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse; + + /** + * Decodes a ListDataPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse; + + /** + * Verifies a ListDataPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse; + + /** + * Creates a plain object from a ListDataPoliciesResponse message. Also converts values to other types if specified. + * @param message ListDataPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataPolicy. */ + interface IDataPolicy { + + /** DataPolicy policyTag */ + policyTag?: (string|null); + + /** DataPolicy dataMaskingPolicy */ + dataMaskingPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy|null); + + /** DataPolicy name */ + name?: (string|null); + + /** DataPolicy dataPolicyType */ + dataPolicyType?: (google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType|keyof typeof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType|null); + + /** DataPolicy dataPolicyId */ + dataPolicyId?: (string|null); + } + + /** Represents a DataPolicy. */ + class DataPolicy implements IDataPolicy { + + /** + * Constructs a new DataPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy); + + /** DataPolicy policyTag. */ + public policyTag?: (string|null); + + /** DataPolicy dataMaskingPolicy. */ + public dataMaskingPolicy?: (google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy|null); + + /** DataPolicy name. */ + public name: string; + + /** DataPolicy dataPolicyType. */ + public dataPolicyType: (google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType|keyof typeof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType); + + /** DataPolicy dataPolicyId. */ + public dataPolicyId: string; + + /** DataPolicy matchingLabel. */ + public matchingLabel?: "policyTag"; + + /** DataPolicy policy. */ + public policy?: "dataMaskingPolicy"; + + /** + * Creates a new DataPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DataPolicy instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy): google.cloud.bigquery.datapolicies.v1beta1.DataPolicy; + + /** + * Encodes the specified DataPolicy message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify|verify} messages. + * @param message DataPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify|verify} messages. + * @param message DataPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.DataPolicy; + + /** + * Decodes a DataPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.DataPolicy; + + /** + * Verifies a DataPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.DataPolicy; + + /** + * Creates a plain object from a DataPolicy message. Also converts values to other types if specified. + * @param message DataPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.DataPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataPolicy { + + /** DataPolicyType enum. */ + enum DataPolicyType { + DATA_POLICY_TYPE_UNSPECIFIED = 0, + COLUMN_LEVEL_SECURITY_POLICY = 3, + DATA_MASKING_POLICY = 2 + } + } + + /** Properties of a DataMaskingPolicy. */ + interface IDataMaskingPolicy { + + /** DataMaskingPolicy predefinedExpression */ + predefinedExpression?: (google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|keyof typeof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|null); + } + + /** Represents a DataMaskingPolicy. */ + class DataMaskingPolicy implements IDataMaskingPolicy { + + /** + * Constructs a new DataMaskingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy); + + /** DataMaskingPolicy predefinedExpression. */ + public predefinedExpression?: (google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|keyof typeof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|null); + + /** DataMaskingPolicy maskingExpression. */ + public maskingExpression?: "predefinedExpression"; + + /** + * Creates a new DataMaskingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DataMaskingPolicy instance + */ + public static create(properties?: google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy): google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy; + + /** + * Encodes the specified DataMaskingPolicy message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.verify|verify} messages. + * @param message DataMaskingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataMaskingPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.verify|verify} messages. + * @param message DataMaskingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataMaskingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataMaskingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy; + + /** + * Decodes a DataMaskingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataMaskingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy; + + /** + * Verifies a DataMaskingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataMaskingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataMaskingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy; + + /** + * Creates a plain object from a DataMaskingPolicy message. Also converts values to other types if specified. + * @param message DataMaskingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataMaskingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataMaskingPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataMaskingPolicy { + + /** PredefinedExpression enum. */ + enum PredefinedExpression { + PREDEFINED_EXPRESSION_UNSPECIFIED = 0, + SHA256 = 3, + ALWAYS_NULL = 5, + DEFAULT_MASKING_VALUE = 7 + } + } + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 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 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; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/protos/protos.js b/packages/google-cloud-bigquery-datapolicies/protos/protos.js new file mode 100644 index 000000000000..d15def552a51 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/protos/protos.js @@ -0,0 +1,17423 @@ +// Copyright 2022 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_bigquery_datapolicies_protos || ($protobuf.roots._google_cloud_bigquery_datapolicies_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.datapolicies = (function() { + + /** + * Namespace datapolicies. + * @memberof google.cloud.bigquery + * @namespace + */ + var datapolicies = {}; + + datapolicies.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.bigquery.datapolicies + * @namespace + */ + var v1beta1 = {}; + + v1beta1.DataPolicyService = (function() { + + /** + * Constructs a new DataPolicyService service. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a DataPolicyService + * @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 DataPolicyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataPolicyService; + + /** + * Creates new DataPolicyService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @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 {DataPolicyService} RPC service. Useful where requests and/or responses are streamed. + */ + DataPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|createDataPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef CreateDataPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} [response] DataPolicy + */ + + /** + * Calls CreateDataPolicy. + * @function createDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest} request CreateDataPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.CreateDataPolicyCallback} callback Node-style callback called with the error, if any, and DataPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.createDataPolicy = function createDataPolicy(request, callback) { + return this.rpcCall(createDataPolicy, $root.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest, $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy, request, callback); + }, "name", { value: "CreateDataPolicy" }); + + /** + * Calls CreateDataPolicy. + * @function createDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest} request CreateDataPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|updateDataPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef UpdateDataPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} [response] DataPolicy + */ + + /** + * Calls UpdateDataPolicy. + * @function updateDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest} request UpdateDataPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.UpdateDataPolicyCallback} callback Node-style callback called with the error, if any, and DataPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.updateDataPolicy = function updateDataPolicy(request, callback) { + return this.rpcCall(updateDataPolicy, $root.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest, $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy, request, callback); + }, "name", { value: "UpdateDataPolicy" }); + + /** + * Calls UpdateDataPolicy. + * @function updateDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest} request UpdateDataPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|deleteDataPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef DeleteDataPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataPolicy. + * @function deleteDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest} request DeleteDataPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.DeleteDataPolicyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.deleteDataPolicy = function deleteDataPolicy(request, callback) { + return this.rpcCall(deleteDataPolicy, $root.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataPolicy" }); + + /** + * Calls DeleteDataPolicy. + * @function deleteDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest} request DeleteDataPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|getDataPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef GetDataPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} [response] DataPolicy + */ + + /** + * Calls GetDataPolicy. + * @function getDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest} request GetDataPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetDataPolicyCallback} callback Node-style callback called with the error, if any, and DataPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.getDataPolicy = function getDataPolicy(request, callback) { + return this.rpcCall(getDataPolicy, $root.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest, $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy, request, callback); + }, "name", { value: "GetDataPolicy" }); + + /** + * Calls GetDataPolicy. + * @function getDataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest} request GetDataPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|listDataPolicies}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef ListDataPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} [response] ListDataPoliciesResponse + */ + + /** + * Calls ListDataPolicies. + * @function listDataPolicies + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest} request ListDataPoliciesRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.ListDataPoliciesCallback} callback Node-style callback called with the error, if any, and ListDataPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.listDataPolicies = function listDataPolicies(request, callback) { + return this.rpcCall(listDataPolicies, $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest, $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse, request, callback); + }, "name", { value: "ListDataPolicies" }); + + /** + * Calls ListDataPolicies. + * @function listDataPolicies + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest} request ListDataPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|getIamPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|setIamPolicy}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService|testIamPermissions}. + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataPolicyService.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataPolicyService; + })(); + + v1beta1.CreateDataPolicyRequest = (function() { + + /** + * Properties of a CreateDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface ICreateDataPolicyRequest + * @property {string|null} [parent] CreateDataPolicyRequest parent + * @property {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null} [dataPolicy] CreateDataPolicyRequest dataPolicy + */ + + /** + * Constructs a new CreateDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a CreateDataPolicyRequest. + * @implements ICreateDataPolicyRequest + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest=} [properties] Properties to set + */ + function CreateDataPolicyRequest(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]]; + } + + /** + * CreateDataPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @instance + */ + CreateDataPolicyRequest.prototype.parent = ""; + + /** + * CreateDataPolicyRequest dataPolicy. + * @member {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null|undefined} dataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @instance + */ + CreateDataPolicyRequest.prototype.dataPolicy = null; + + /** + * Creates a new CreateDataPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest} CreateDataPolicyRequest instance + */ + CreateDataPolicyRequest.create = function create(properties) { + return new CreateDataPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest} message CreateDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPolicyRequest.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.dataPolicy != null && Object.hasOwnProperty.call(message, "dataPolicy")) + $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.encode(message.dataPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest} message CreateDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDataPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDataPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest} CreateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDataPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest} CreateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDataPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDataPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDataPolicyRequest.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.dataPolicy != null && message.hasOwnProperty("dataPolicy")) { + var error = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify(message.dataPolicy); + if (error) + return "dataPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest} CreateDataPolicyRequest + */ + CreateDataPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataPolicy != null) { + if (typeof object.dataPolicy !== "object") + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest.dataPolicy: object expected"); + message.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.fromObject(object.dataPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateDataPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest} message CreateDataPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDataPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataPolicy != null && message.hasOwnProperty("dataPolicy")) + object.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.toObject(message.dataPolicy, options); + return object; + }; + + /** + * Converts this CreateDataPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDataPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDataPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDataPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest"; + }; + + return CreateDataPolicyRequest; + })(); + + v1beta1.UpdateDataPolicyRequest = (function() { + + /** + * Properties of an UpdateDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IUpdateDataPolicyRequest + * @property {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null} [dataPolicy] UpdateDataPolicyRequest dataPolicy + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataPolicyRequest updateMask + */ + + /** + * Constructs a new UpdateDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents an UpdateDataPolicyRequest. + * @implements IUpdateDataPolicyRequest + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest=} [properties] Properties to set + */ + function UpdateDataPolicyRequest(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]]; + } + + /** + * UpdateDataPolicyRequest dataPolicy. + * @member {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy|null|undefined} dataPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @instance + */ + UpdateDataPolicyRequest.prototype.dataPolicy = null; + + /** + * UpdateDataPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @instance + */ + UpdateDataPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDataPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest} UpdateDataPolicyRequest instance + */ + UpdateDataPolicyRequest.create = function create(properties) { + return new UpdateDataPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest} message UpdateDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPolicy != null && Object.hasOwnProperty.call(message, "dataPolicy")) + $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.encode(message.dataPolicy, 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 UpdateDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest} message UpdateDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest} UpdateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.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 UpdateDataPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest} UpdateDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPolicy != null && message.hasOwnProperty("dataPolicy")) { + var error = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify(message.dataPolicy); + if (error) + return "dataPolicy." + 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 UpdateDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest} UpdateDataPolicyRequest + */ + UpdateDataPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest(); + if (object.dataPolicy != null) { + if (typeof object.dataPolicy !== "object") + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.dataPolicy: object expected"); + message.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.fromObject(object.dataPolicy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDataPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest} message UpdateDataPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataPolicy = null; + object.updateMask = null; + } + if (message.dataPolicy != null && message.hasOwnProperty("dataPolicy")) + object.dataPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.toObject(message.dataPolicy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDataPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest"; + }; + + return UpdateDataPolicyRequest; + })(); + + v1beta1.DeleteDataPolicyRequest = (function() { + + /** + * Properties of a DeleteDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IDeleteDataPolicyRequest + * @property {string|null} [name] DeleteDataPolicyRequest name + */ + + /** + * Constructs a new DeleteDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a DeleteDataPolicyRequest. + * @implements IDeleteDataPolicyRequest + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest=} [properties] Properties to set + */ + function DeleteDataPolicyRequest(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]]; + } + + /** + * DeleteDataPolicyRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @instance + */ + DeleteDataPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteDataPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest} DeleteDataPolicyRequest instance + */ + DeleteDataPolicyRequest.create = function create(properties) { + return new DeleteDataPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest} message DeleteDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataPolicyRequest.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 DeleteDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest} message DeleteDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDataPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDataPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest} DeleteDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest(); + 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 DeleteDataPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest} DeleteDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDataPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDataPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDataPolicyRequest.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 DeleteDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest} DeleteDataPolicyRequest + */ + DeleteDataPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDataPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest} message DeleteDataPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDataPolicyRequest.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 DeleteDataPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDataPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDataPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDataPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest"; + }; + + return DeleteDataPolicyRequest; + })(); + + v1beta1.GetDataPolicyRequest = (function() { + + /** + * Properties of a GetDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IGetDataPolicyRequest + * @property {string|null} [name] GetDataPolicyRequest name + */ + + /** + * Constructs a new GetDataPolicyRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a GetDataPolicyRequest. + * @implements IGetDataPolicyRequest + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest=} [properties] Properties to set + */ + function GetDataPolicyRequest(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]]; + } + + /** + * GetDataPolicyRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @instance + */ + GetDataPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetDataPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest} GetDataPolicyRequest instance + */ + GetDataPolicyRequest.create = function create(properties) { + return new GetDataPolicyRequest(properties); + }; + + /** + * Encodes the specified GetDataPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest} message GetDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataPolicyRequest.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 GetDataPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest} message GetDataPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest} GetDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest(); + 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 GetDataPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest} GetDataPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataPolicyRequest.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 GetDataPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest} GetDataPolicyRequest + */ + GetDataPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest} message GetDataPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataPolicyRequest.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 GetDataPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest"; + }; + + return GetDataPolicyRequest; + })(); + + v1beta1.ListDataPoliciesRequest = (function() { + + /** + * Properties of a ListDataPoliciesRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IListDataPoliciesRequest + * @property {string|null} [parent] ListDataPoliciesRequest parent + * @property {number|null} [pageSize] ListDataPoliciesRequest pageSize + * @property {string|null} [pageToken] ListDataPoliciesRequest pageToken + */ + + /** + * Constructs a new ListDataPoliciesRequest. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a ListDataPoliciesRequest. + * @implements IListDataPoliciesRequest + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest=} [properties] Properties to set + */ + function ListDataPoliciesRequest(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]]; + } + + /** + * ListDataPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @instance + */ + ListDataPoliciesRequest.prototype.parent = ""; + + /** + * ListDataPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @instance + */ + ListDataPoliciesRequest.prototype.pageSize = 0; + + /** + * ListDataPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @instance + */ + ListDataPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDataPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest} ListDataPoliciesRequest instance + */ + ListDataPoliciesRequest.create = function create(properties) { + return new ListDataPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListDataPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest} message ListDataPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDataPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest} message ListDataPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest} ListDataPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest} ListDataPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataPoliciesRequest message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataPoliciesRequest.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.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 ListDataPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest} ListDataPoliciesRequest + */ + ListDataPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDataPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest} message ListDataPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListDataPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest"; + }; + + return ListDataPoliciesRequest; + })(); + + v1beta1.ListDataPoliciesResponse = (function() { + + /** + * Properties of a ListDataPoliciesResponse. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IListDataPoliciesResponse + * @property {Array.|null} [dataPolicies] ListDataPoliciesResponse dataPolicies + * @property {string|null} [nextPageToken] ListDataPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListDataPoliciesResponse. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a ListDataPoliciesResponse. + * @implements IListDataPoliciesResponse + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse=} [properties] Properties to set + */ + function ListDataPoliciesResponse(properties) { + this.dataPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataPoliciesResponse dataPolicies. + * @member {Array.} dataPolicies + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @instance + */ + ListDataPoliciesResponse.prototype.dataPolicies = $util.emptyArray; + + /** + * ListDataPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @instance + */ + ListDataPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} ListDataPoliciesResponse instance + */ + ListDataPoliciesResponse.create = function create(properties) { + return new ListDataPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListDataPoliciesResponse message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse} message ListDataPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPolicies != null && message.dataPolicies.length) + for (var i = 0; i < message.dataPolicies.length; ++i) + $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.encode(message.dataPolicies[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 ListDataPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse} message ListDataPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} ListDataPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataPolicies && message.dataPolicies.length)) + message.dataPolicies = []; + message.dataPolicies.push($root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} ListDataPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataPoliciesResponse message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPolicies != null && message.hasOwnProperty("dataPolicies")) { + if (!Array.isArray(message.dataPolicies)) + return "dataPolicies: array expected"; + for (var i = 0; i < message.dataPolicies.length; ++i) { + var error = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify(message.dataPolicies[i]); + if (error) + return "dataPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} ListDataPoliciesResponse + */ + ListDataPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse(); + if (object.dataPolicies) { + if (!Array.isArray(object.dataPolicies)) + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.dataPolicies: array expected"); + message.dataPolicies = []; + for (var i = 0; i < object.dataPolicies.length; ++i) { + if (typeof object.dataPolicies[i] !== "object") + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse.dataPolicies: object expected"); + message.dataPolicies[i] = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.fromObject(object.dataPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse} message ListDataPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataPolicies && message.dataPolicies.length) { + object.dataPolicies = []; + for (var j = 0; j < message.dataPolicies.length; ++j) + object.dataPolicies[j] = $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.toObject(message.dataPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse"; + }; + + return ListDataPoliciesResponse; + })(); + + v1beta1.DataPolicy = (function() { + + /** + * Properties of a DataPolicy. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IDataPolicy + * @property {string|null} [policyTag] DataPolicy policyTag + * @property {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy|null} [dataMaskingPolicy] DataPolicy dataMaskingPolicy + * @property {string|null} [name] DataPolicy name + * @property {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType|null} [dataPolicyType] DataPolicy dataPolicyType + * @property {string|null} [dataPolicyId] DataPolicy dataPolicyId + */ + + /** + * Constructs a new DataPolicy. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a DataPolicy. + * @implements IDataPolicy + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy=} [properties] Properties to set + */ + function DataPolicy(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]]; + } + + /** + * DataPolicy policyTag. + * @member {string|null|undefined} policyTag + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + DataPolicy.prototype.policyTag = null; + + /** + * DataPolicy dataMaskingPolicy. + * @member {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy|null|undefined} dataMaskingPolicy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + DataPolicy.prototype.dataMaskingPolicy = null; + + /** + * DataPolicy name. + * @member {string} name + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + DataPolicy.prototype.name = ""; + + /** + * DataPolicy dataPolicyType. + * @member {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType} dataPolicyType + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + DataPolicy.prototype.dataPolicyType = 0; + + /** + * DataPolicy dataPolicyId. + * @member {string} dataPolicyId + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + DataPolicy.prototype.dataPolicyId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataPolicy matchingLabel. + * @member {"policyTag"|undefined} matchingLabel + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + Object.defineProperty(DataPolicy.prototype, "matchingLabel", { + get: $util.oneOfGetter($oneOfFields = ["policyTag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataPolicy policy. + * @member {"dataMaskingPolicy"|undefined} policy + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + */ + Object.defineProperty(DataPolicy.prototype, "policy", { + get: $util.oneOfGetter($oneOfFields = ["dataMaskingPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} DataPolicy instance + */ + DataPolicy.create = function create(properties) { + return new DataPolicy(properties); + }; + + /** + * Encodes the specified DataPolicy message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy} message DataPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicy.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.dataPolicyType != null && Object.hasOwnProperty.call(message, "dataPolicyType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataPolicyType); + if (message.dataPolicyId != null && Object.hasOwnProperty.call(message, "dataPolicyId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataPolicyId); + if (message.policyTag != null && Object.hasOwnProperty.call(message, "policyTag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyTag); + if (message.dataMaskingPolicy != null && Object.hasOwnProperty.call(message, "dataMaskingPolicy")) + $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.encode(message.dataMaskingPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy} message DataPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} DataPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.policyTag = reader.string(); + break; + } + case 5: { + message.dataMaskingPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataPolicyType = reader.int32(); + break; + } + case 3: { + message.dataPolicyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} DataPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataPolicy message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) { + properties.matchingLabel = 1; + if (!$util.isString(message.policyTag)) + return "policyTag: string expected"; + } + if (message.dataMaskingPolicy != null && message.hasOwnProperty("dataMaskingPolicy")) { + properties.policy = 1; + { + var error = $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.verify(message.dataMaskingPolicy); + if (error) + return "dataMaskingPolicy." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.dataPolicyType != null && message.hasOwnProperty("dataPolicyType")) + switch (message.dataPolicyType) { + default: + return "dataPolicyType: enum value expected"; + case 0: + case 3: + case 2: + break; + } + if (message.dataPolicyId != null && message.hasOwnProperty("dataPolicyId")) + if (!$util.isString(message.dataPolicyId)) + return "dataPolicyId: string expected"; + return null; + }; + + /** + * Creates a DataPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} DataPolicy + */ + DataPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy(); + if (object.policyTag != null) + message.policyTag = String(object.policyTag); + if (object.dataMaskingPolicy != null) { + if (typeof object.dataMaskingPolicy !== "object") + throw TypeError(".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.dataMaskingPolicy: object expected"); + message.dataMaskingPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.fromObject(object.dataMaskingPolicy); + } + if (object.name != null) + message.name = String(object.name); + switch (object.dataPolicyType) { + case "DATA_POLICY_TYPE_UNSPECIFIED": + case 0: + message.dataPolicyType = 0; + break; + case "COLUMN_LEVEL_SECURITY_POLICY": + case 3: + message.dataPolicyType = 3; + break; + case "DATA_MASKING_POLICY": + case 2: + message.dataPolicyType = 2; + break; + } + if (object.dataPolicyId != null) + message.dataPolicyId = String(object.dataPolicyId); + return message; + }; + + /** + * Creates a plain object from a DataPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} message DataPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dataPolicyType = options.enums === String ? "DATA_POLICY_TYPE_UNSPECIFIED" : 0; + object.dataPolicyId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataPolicyType != null && message.hasOwnProperty("dataPolicyType")) + object.dataPolicyType = options.enums === String ? $root.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType[message.dataPolicyType] : message.dataPolicyType; + if (message.dataPolicyId != null && message.hasOwnProperty("dataPolicyId")) + object.dataPolicyId = message.dataPolicyId; + if (message.policyTag != null && message.hasOwnProperty("policyTag")) { + object.policyTag = message.policyTag; + if (options.oneofs) + object.matchingLabel = "policyTag"; + } + if (message.dataMaskingPolicy != null && message.hasOwnProperty("dataMaskingPolicy")) { + object.dataMaskingPolicy = $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.toObject(message.dataMaskingPolicy, options); + if (options.oneofs) + object.policy = "dataMaskingPolicy"; + } + return object; + }; + + /** + * Converts this DataPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @instance + * @returns {Object.} JSON object + */ + DataPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.DataPolicy"; + }; + + /** + * DataPolicyType enum. + * @name google.cloud.bigquery.datapolicies.v1beta1.DataPolicy.DataPolicyType + * @enum {number} + * @property {number} DATA_POLICY_TYPE_UNSPECIFIED=0 DATA_POLICY_TYPE_UNSPECIFIED value + * @property {number} COLUMN_LEVEL_SECURITY_POLICY=3 COLUMN_LEVEL_SECURITY_POLICY value + * @property {number} DATA_MASKING_POLICY=2 DATA_MASKING_POLICY value + */ + DataPolicy.DataPolicyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_POLICY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[3] = "COLUMN_LEVEL_SECURITY_POLICY"] = 3; + values[valuesById[2] = "DATA_MASKING_POLICY"] = 2; + return values; + })(); + + return DataPolicy; + })(); + + v1beta1.DataMaskingPolicy = (function() { + + /** + * Properties of a DataMaskingPolicy. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @interface IDataMaskingPolicy + * @property {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|null} [predefinedExpression] DataMaskingPolicy predefinedExpression + */ + + /** + * Constructs a new DataMaskingPolicy. + * @memberof google.cloud.bigquery.datapolicies.v1beta1 + * @classdesc Represents a DataMaskingPolicy. + * @implements IDataMaskingPolicy + * @constructor + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy=} [properties] Properties to set + */ + function DataMaskingPolicy(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]]; + } + + /** + * DataMaskingPolicy predefinedExpression. + * @member {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression|null|undefined} predefinedExpression + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @instance + */ + DataMaskingPolicy.prototype.predefinedExpression = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataMaskingPolicy maskingExpression. + * @member {"predefinedExpression"|undefined} maskingExpression + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @instance + */ + Object.defineProperty(DataMaskingPolicy.prototype, "maskingExpression", { + get: $util.oneOfGetter($oneOfFields = ["predefinedExpression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataMaskingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy} DataMaskingPolicy instance + */ + DataMaskingPolicy.create = function create(properties) { + return new DataMaskingPolicy(properties); + }; + + /** + * Encodes the specified DataMaskingPolicy message. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy} message DataMaskingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMaskingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predefinedExpression != null && Object.hasOwnProperty.call(message, "predefinedExpression")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.predefinedExpression); + return writer; + }; + + /** + * Encodes the specified DataMaskingPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.IDataMaskingPolicy} message DataMaskingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMaskingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataMaskingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy} DataMaskingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMaskingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.predefinedExpression = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataMaskingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy} DataMaskingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMaskingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataMaskingPolicy message. + * @function verify + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataMaskingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.predefinedExpression != null && message.hasOwnProperty("predefinedExpression")) { + properties.maskingExpression = 1; + switch (message.predefinedExpression) { + default: + return "predefinedExpression: enum value expected"; + case 0: + case 3: + case 5: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a DataMaskingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy} DataMaskingPolicy + */ + DataMaskingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy) + return object; + var message = new $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy(); + switch (object.predefinedExpression) { + case "PREDEFINED_EXPRESSION_UNSPECIFIED": + case 0: + message.predefinedExpression = 0; + break; + case "SHA256": + case 3: + message.predefinedExpression = 3; + break; + case "ALWAYS_NULL": + case 5: + message.predefinedExpression = 5; + break; + case "DEFAULT_MASKING_VALUE": + case 7: + message.predefinedExpression = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataMaskingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy} message DataMaskingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataMaskingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.predefinedExpression != null && message.hasOwnProperty("predefinedExpression")) { + object.predefinedExpression = options.enums === String ? $root.google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression[message.predefinedExpression] : message.predefinedExpression; + if (options.oneofs) + object.maskingExpression = "predefinedExpression"; + } + return object; + }; + + /** + * Converts this DataMaskingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @instance + * @returns {Object.} JSON object + */ + DataMaskingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataMaskingPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataMaskingPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy"; + }; + + /** + * PredefinedExpression enum. + * @name google.cloud.bigquery.datapolicies.v1beta1.DataMaskingPolicy.PredefinedExpression + * @enum {number} + * @property {number} PREDEFINED_EXPRESSION_UNSPECIFIED=0 PREDEFINED_EXPRESSION_UNSPECIFIED value + * @property {number} SHA256=3 SHA256 value + * @property {number} ALWAYS_NULL=5 ALWAYS_NULL value + * @property {number} DEFAULT_MASKING_VALUE=7 DEFAULT_MASKING_VALUE value + */ + DataMaskingPolicy.PredefinedExpression = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREDEFINED_EXPRESSION_UNSPECIFIED"] = 0; + values[valuesById[3] = "SHA256"] = 3; + values[valuesById[5] = "ALWAYS_NULL"] = 5; + values[valuesById[7] = "DEFAULT_MASKING_VALUE"] = 7; + return values; + })(); + + return DataMaskingPolicy; + })(); + + return v1beta1; + })(); + + return datapolicies; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.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.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; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(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]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + 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 a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(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]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(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]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-datapolicies/protos/protos.json b/packages/google-cloud-bigquery-datapolicies/protos/protos.json new file mode 100644 index 000000000000..d946eec2d461 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/protos/protos.json @@ -0,0 +1,1832 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "datapolicies": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.DataPolicies.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/datapolicies/v1beta1;datapolicies", + "java_multiple_files": true, + "java_outer_classname": "DataPolicyProto", + "java_package": "com.google.cloud.bigquery.datapolicies.v1beta1", + "php_namespace": "Google\\Cloud\\BigQuery\\DataPolicies\\V1beta1", + "ruby_package": "Google::Cloud::Bigquery::DataPolicies::V1beta1" + }, + "nested": { + "DataPolicyService": { + "options": { + "(google.api.default_host)": "bigquerydatapolicy.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataPolicy": { + "requestType": "CreateDataPolicyRequest", + "responseType": "DataPolicy", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/dataPolicies", + "(google.api.http).body": "data_policy", + "(google.api.method_signature)": "parent,data_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/dataPolicies", + "body": "data_policy" + } + }, + { + "(google.api.method_signature)": "parent,data_policy" + } + ] + }, + "UpdateDataPolicy": { + "requestType": "UpdateDataPolicyRequest", + "responseType": "DataPolicy", + "options": { + "(google.api.http).patch": "/v1beta1/{data_policy.name=projects/*/locations/*/dataPolicies/*}", + "(google.api.http).body": "data_policy", + "(google.api.method_signature)": "data_policy,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{data_policy.name=projects/*/locations/*/dataPolicies/*}", + "body": "data_policy" + } + }, + { + "(google.api.method_signature)": "data_policy,update_mask" + } + ] + }, + "DeleteDataPolicy": { + "requestType": "DeleteDataPolicyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetDataPolicy": { + "requestType": "GetDataPolicyRequest", + "responseType": "DataPolicy", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/dataPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataPolicies": { + "requestType": "ListDataPoliciesRequest", + "responseType": "ListDataPoliciesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/dataPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/dataPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:getIamPolicy", + "body": "*" + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:setIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/dataPolicies/*}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "CreateDataPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatapolicy.googleapis.com/DataPolicy" + } + }, + "dataPolicy": { + "type": "DataPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDataPolicyRequest": { + "fields": { + "dataPolicy": { + "type": "DataPolicy", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteDataPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatapolicy.googleapis.com/DataPolicy" + } + } + } + }, + "GetDataPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatapolicy.googleapis.com/DataPolicy" + } + } + } + }, + "ListDataPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatapolicy.googleapis.com/DataPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDataPoliciesResponse": { + "fields": { + "dataPolicies": { + "rule": "repeated", + "type": "DataPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DataPolicy": { + "options": { + "(google.api.resource).type": "bigquerydatapolicy.googleapis.com/DataPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataPolicies/{data_policy}" + }, + "oneofs": { + "matchingLabel": { + "oneof": [ + "policyTag" + ] + }, + "policy": { + "oneof": [ + "dataMaskingPolicy" + ] + } + }, + "fields": { + "policyTag": { + "type": "string", + "id": 4 + }, + "dataMaskingPolicy": { + "type": "DataMaskingPolicy", + "id": 5 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataPolicyType": { + "type": "DataPolicyType", + "id": 2 + }, + "dataPolicyId": { + "type": "string", + "id": 3 + } + }, + "nested": { + "DataPolicyType": { + "values": { + "DATA_POLICY_TYPE_UNSPECIFIED": 0, + "COLUMN_LEVEL_SECURITY_POLICY": 3, + "DATA_MASKING_POLICY": 2 + } + } + } + }, + "DataMaskingPolicy": { + "oneofs": { + "maskingExpression": { + "oneof": [ + "predefinedExpression" + ] + } + }, + "fields": { + "predefinedExpression": { + "type": "PredefinedExpression", + "id": 1 + } + }, + "nested": { + "PredefinedExpression": { + "values": { + "PREDEFINED_EXPRESSION_UNSPECIFIED": 0, + "SHA256": 3, + "ALWAYS_NULL": 5, + "DEFAULT_MASKING_VALUE": 7 + } + } + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datapolicies/samples/README.md b/packages/google-cloud-bigquery-datapolicies/samples/README.md new file mode 100644 index 000000000000..723ffa5c7c69 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/README.md @@ -0,0 +1,212 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Data_policy_service.create_data_policy](#data_policy_service.create_data_policy) + * [Data_policy_service.delete_data_policy](#data_policy_service.delete_data_policy) + * [Data_policy_service.get_data_policy](#data_policy_service.get_data_policy) + * [Data_policy_service.get_iam_policy](#data_policy_service.get_iam_policy) + * [Data_policy_service.list_data_policies](#data_policy_service.list_data_policies) + * [Data_policy_service.set_iam_policy](#data_policy_service.set_iam_policy) + * [Data_policy_service.test_iam_permissions](#data_policy_service.test_iam_permissions) + * [Data_policy_service.update_data_policy](#data_policy_service.update_data_policy) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Data_policy_service.create_data_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js` + + +----- + + + + +### Data_policy_service.delete_data_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js` + + +----- + + + + +### Data_policy_service.get_data_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js` + + +----- + + + + +### Data_policy_service.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js` + + +----- + + + + +### Data_policy_service.list_data_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js` + + +----- + + + + +### Data_policy_service.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js` + + +----- + + + + +### Data_policy_service.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js` + + +----- + + + + +### Data_policy_service.update_data_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js new file mode 100644 index 000000000000..1395d4d52ad2 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(parent, dataPolicy) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project that the data policy will belong to. The + * format is `projects/{project_number}/locations/{location_id}`. + */ + // const parent = 'abc123' + /** + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + */ + // const dataPolicy = {} + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callCreateDataPolicy() { + // Construct request + const request = { + parent, + dataPolicy, + }; + + // Run request + const response = await datapoliciesClient.createDataPolicy(request); + console.log(response); + } + + callCreateDataPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js new file mode 100644 index 000000000000..725fc48db768 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + */ + // const name = 'abc123' + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callDeleteDataPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datapoliciesClient.deleteDataPolicy(request); + console.log(response); + } + + callDeleteDataPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js new file mode 100644 index 000000000000..bb0937a2785a --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + */ + // const name = 'abc123' + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callGetDataPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datapoliciesClient.getDataPolicy(request); + console.log(response); + } + + callGetDataPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js new file mode 100644 index 000000000000..b79008c0854a --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await datapoliciesClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js new file mode 100644 index 000000000000..d801a990835e --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js @@ -0,0 +1,75 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + */ + // const parent = 'abc123' + /** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + */ + // const pageSize = 1234 + /** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + */ + // const pageToken = 'abc123' + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callListDataPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datapoliciesClient.listDataPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataPolicies(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js new file mode 100644 index 000000000000..08643b6765f8 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await datapoliciesClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js new file mode 100644 index 000000000000..c8f523274424 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await datapoliciesClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js new file mode 100644 index 000000000000..61c136e0dcd5 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js @@ -0,0 +1,71 @@ +// Copyright 2022 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'; + +function main(dataPolicy) { + // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Update the data policy's metadata. + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + */ + // const dataPolicy = {} + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * Updates to the `name` and `dataPolicyId` fields are not allowed. + */ + // const updateMask = {} + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callUpdateDataPolicy() { + // Construct request + const request = { + dataPolicy, + }; + + // Run request + const response = await datapoliciesClient.updateDataPolicy(request); + console.log(response); + } + + callUpdateDataPolicy(); + // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.datapolicies.v1beta1.json b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.datapolicies.v1beta1.json new file mode 100644 index 000000000000..8435b51e1803 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.datapolicies.v1beta1.json @@ -0,0 +1,367 @@ +{ + "clientLibrary": { + "name": "nodejs-datapolicies", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.datapolicies.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async", + "title": "DataPolicyService createDataPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new data policy under a project with the given `dataPolicyId` (used as the display name), policy tag, and data policy type.", + "canonical": true, + "file": "data_policy_service.create_data_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.CreateDataPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_policy", + "type": ".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy" + } + ], + "resultType": ".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "CreateDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.CreateDataPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_async", + "title": "DataPolicyService updateDataPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.", + "canonical": true, + "file": "data_policy_service.update_data_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.UpdateDataPolicy", + "async": true, + "parameters": [ + { + "name": "data_policy", + "type": ".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "UpdateDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.UpdateDataPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_async", + "title": "DataPolicyService deleteDataPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes the data policy specified by its resource name.", + "canonical": true, + "file": "data_policy_service.delete_data_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.DeleteDataPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "DeleteDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.DeleteDataPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_async", + "title": "DataPolicyService getDataPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the data policy specified by its resource name.", + "canonical": true, + "file": "data_policy_service.get_data_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetDataPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datapolicies.v1beta1.DataPolicy", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "GetDataPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetDataPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_async", + "title": "DataPolicyService listDataPolicies Sample", + "origin": "API_DEFINITION", + "description": " List all of the data policies in the specified parent project.", + "canonical": true, + "file": "data_policy_service.list_data_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataPolicies", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.ListDataPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesResponse", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "ListDataPolicies", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.ListDataPolicies", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_async", + "title": "DataPolicyService getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM policy for the specified data policy.", + "canonical": true, + "file": "data_policy_service.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.GetIamPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_async", + "title": "DataPolicyService setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM policy for the specified data policy.", + "canonical": true, + "file": "data_policy_service.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.SetIamPolicy", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + }, + { + "regionTag": "bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_async", + "title": "DataPolicyService testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the caller's permission on the specified data policy resource.", + "canonical": true, + "file": "data_policy_service.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "DataPolicyServiceClient", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyServiceClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService.TestIamPermissions", + "service": { + "shortName": "DataPolicyService", + "fullName": "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datapolicies/samples/package.json b/packages/google-cloud-bigquery-datapolicies/samples/package.json new file mode 100644 index 000000000000..d00070617865 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "datapolicies-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/bigquery-datapolicies": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/samples/quickstart.js b/packages/google-cloud-bigquery-datapolicies/samples/quickstart.js new file mode 100644 index 000000000000..ed466228d180 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/quickstart.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatapolicy_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + */ + // const parent = 'abc123' + /** + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + */ + // const pageSize = 1234 + /** + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + */ + // const pageToken = 'abc123' + + // Imports the Datapolicies library + const {DataPolicyServiceClient} = + require('@google-cloud/bigquery-datapolicies').v1beta1; + + // Instantiates a client + const datapoliciesClient = new DataPolicyServiceClient(); + + async function callListDataPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datapoliciesClient.listDataPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataPolicies(); + // [END bigquerydatapolicy_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js b/packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js new file mode 100644 index 000000000000..cabf7dd02435 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/samples/test/quickstart.js @@ -0,0 +1,43 @@ +// Copyright 2022 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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {DataPolicyServiceClient} = + require('@google-cloud/bigquery-datapolicies').v1beta1; +const datapoliciesClient = new DataPolicyServiceClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await datapoliciesClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-bigquery-datapolicies/src/index.ts b/packages/google-cloud-bigquery-datapolicies/src/index.ts new file mode 100644 index 000000000000..f169154e1d00 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; + +const DataPolicyServiceClient = v1beta1.DataPolicyServiceClient; +type DataPolicyServiceClient = v1beta1.DataPolicyServiceClient; + +export {v1beta1, DataPolicyServiceClient}; +export default {v1beta1, DataPolicyServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts new file mode 100644 index 000000000000..03f197cac7bb --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts @@ -0,0 +1,1354 @@ +// Copyright 2022 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, +} 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/v1beta1/data_policy_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_policy_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Data Policy Service provides APIs for managing the label-policy bindings. + * @class + * @memberof v1beta1 + */ +export class DataPolicyServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + dataPolicyServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataPolicyServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 DataPolicyServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataPolicyServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + dataPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataPolicies/{data_policy}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listDataPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataPolicies' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService', + 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.dataPolicyServiceStub) { + return this.dataPolicyServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService. + this.dataPolicyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.datapolicies.v1beta1 + .DataPolicyService, + 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 dataPolicyServiceStubMethods = [ + 'createDataPolicy', + 'updateDataPolicy', + 'deleteDataPolicy', + 'getDataPolicy', + 'listDataPolicies', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of dataPolicyServiceStubMethods) { + const callPromise = this.dataPolicyServiceStub.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.dataPolicyServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'bigquerydatapolicy.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'bigquerydatapolicy.googleapis.com'; + } + + /** + * 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/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + 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 new data policy under a project with the given `dataPolicyId` + * (used as the display name), policy tag, and data policy type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project that the data policy will belong to. The + * format is `projects/{project_number}/locations/{location_id}`. + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} request.dataPolicy + * Required. The data policy to create. The `name` field does not need to be + * provided for the data policy creation. + * @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 [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.create_data_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async + */ + createDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | undefined + ), + {} | undefined + ] + >; + createDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | 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.createDataPolicy(request, options, callback); + } + /** + * Updates the metadata for an existing data policy. The target data policy + * can be specified by the resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} request.dataPolicy + * Required. Update the data policy's metadata. + * + * The target data policy is determined by the `name` field. + * Other fields are updated to the specified values based on the field masks. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * If not set, defaults to all of the fields that are allowed to update. + * + * Updates to the `name` and `dataPolicyId` fields are not allowed. + * @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 [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.update_data_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_async + */ + updateDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | undefined + ), + {} | undefined + ] + >; + updateDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | 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({ + 'data_policy.name': request.dataPolicy!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataPolicy(request, options, callback); + } + /** + * Deletes the data policy specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the data policy to delete. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.delete_data_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_async + */ + deleteDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | undefined + ), + {} | undefined + ] + >; + deleteDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | 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.deleteDataPolicy(request, options, callback); + } + /** + * Gets the data policy specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the requested data policy. Format is + * `projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}`. + * @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 [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.get_data_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_async + */ + getDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | undefined + ), + {} | undefined + ] + >; + getDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataPolicy( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataPolicy( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | 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.getDataPolicy(request, options, callback); + } + /** + * Gets the IAM policy for the specified data policy. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.get_iam_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the IAM policy for the specified data policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.set_iam_policy.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the caller's permission on the specified data policy resource. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.test_iam_permissions.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * List all of the data policies in the specified parent project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + * @param {number} request.pageSize + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @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 [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy}. + * 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 `listDataPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataPolicies( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[], + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest | null, + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + ] + >; + listDataPolicies( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy + > + ): void; + listDataPolicies( + request: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy + > + ): void; + listDataPolicies( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy + > + ): Promise< + [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[], + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest | null, + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + ] + > | 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.listDataPolicies(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. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + * @param {number} request.pageSize + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @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 [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy} 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 `listDataPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataPoliciesStream( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + 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['listDataPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataPolicies.createStream( + this.innerApiCalls.listDataPolicies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataPolicies`, 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. Resource name of the project for which to list data policies. Format is + * `projects/{project_number}/locations/{location_id}`. + * @param {number} request.pageSize + * The maximum number of data policies to return. Must be a value between 1 + * and 1000. + * If not set, defaults to 50. + * @param {string} request.pageToken + * The `nextPageToken` value returned from a previous list request, if any. If + * not set, defaults to an empty string. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataPolicy]{@link google.cloud.bigquery.datapolicies.v1beta1.DataPolicy}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/data_policy_service.list_data_policies.js + * region_tag:bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_async + */ + listDataPoliciesAsync( + request?: protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + 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['listDataPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataPolicies.asyncIterate( + this.innerApiCalls['listDataPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified dataPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_policy + * @returns {string} Resource name string. + */ + dataPolicyPath(project: string, location: string, dataPolicy: string) { + return this.pathTemplates.dataPolicyPathTemplate.render({ + project: project, + location: location, + data_policy: dataPolicy, + }); + } + + /** + * Parse the project from DataPolicy resource. + * + * @param {string} dataPolicyName + * A fully-qualified path representing DataPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataPolicyName(dataPolicyName: string) { + return this.pathTemplates.dataPolicyPathTemplate.match(dataPolicyName) + .project; + } + + /** + * Parse the location from DataPolicy resource. + * + * @param {string} dataPolicyName + * A fully-qualified path representing DataPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataPolicyName(dataPolicyName: string) { + return this.pathTemplates.dataPolicyPathTemplate.match(dataPolicyName) + .location; + } + + /** + * Parse the data_policy from DataPolicy resource. + * + * @param {string} dataPolicyName + * A fully-qualified path representing DataPolicy resource. + * @returns {string} A string representing the data_policy. + */ + matchDataPolicyFromDataPolicyName(dataPolicyName: string) { + return this.pathTemplates.dataPolicyPathTemplate.match(dataPolicyName) + .data_policy; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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; + } + + /** + * 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.dataPolicyServiceStub && !this._terminated) { + return this.dataPolicyServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client_config.json b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client_config.json new file mode 100644 index 000000000000..426ab638d197 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.bigquery.datapolicies.v1beta1.DataPolicyService": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDataPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDataPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_proto_list.json b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_proto_list.json new file mode 100644 index 000000000000..6e26fa8caca4 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto" +] diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/gapic_metadata.json b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..18fb9ed02a51 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/gapic_metadata.json @@ -0,0 +1,107 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.datapolicies.v1beta1", + "libraryPackage": "@google-cloud/bigquery-datapolicies", + "services": { + "DataPolicyService": { + "clients": { + "grpc": { + "libraryClient": "DataPolicyServiceClient", + "rpcs": { + "CreateDataPolicy": { + "methods": [ + "createDataPolicy" + ] + }, + "UpdateDataPolicy": { + "methods": [ + "updateDataPolicy" + ] + }, + "DeleteDataPolicy": { + "methods": [ + "deleteDataPolicy" + ] + }, + "GetDataPolicy": { + "methods": [ + "getDataPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListDataPolicies": { + "methods": [ + "listDataPolicies", + "listDataPoliciesStream", + "listDataPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataPolicyServiceClient", + "rpcs": { + "CreateDataPolicy": { + "methods": [ + "createDataPolicy" + ] + }, + "UpdateDataPolicy": { + "methods": [ + "updateDataPolicy" + ] + }, + "DeleteDataPolicy": { + "methods": [ + "deleteDataPolicy" + ] + }, + "GetDataPolicy": { + "methods": [ + "getDataPolicy" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListDataPolicies": { + "methods": [ + "listDataPolicies", + "listDataPoliciesStream", + "listDataPoliciesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts new file mode 100644 index 000000000000..81030a61690b --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {DataPolicyServiceClient} from './data_policy_service_client'; diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..250389f71e71 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datapolicies = require('@google-cloud/bigquery-datapolicies'); + +function main() { + const dataPolicyServiceClient = new datapolicies.DataPolicyServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..760641ee9494 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {DataPolicyServiceClient} from '@google-cloud/bigquery-datapolicies'; + +// check that the client class type name can be used +function doStuffWithDataPolicyServiceClient(client: DataPolicyServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataPolicyServiceClient = new DataPolicyServiceClient(); + doStuffWithDataPolicyServiceClient(dataPolicyServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/install.ts b/packages/google-cloud-bigquery-datapolicies/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts new file mode 100644 index 000000000000..7e89fb41497d --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts @@ -0,0 +1,1646 @@ +// Copyright 2022 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 datapolicyserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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('v1beta1.DataPolicyServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + datapolicyserviceModule.v1beta1.DataPolicyServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + datapolicyserviceModule.v1beta1.DataPolicyServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datapolicyserviceModule.v1beta1.DataPolicyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataPolicyServiceStub, undefined); + await client.initialize(); + assert(client.dataPolicyServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataPolicyServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataPolicyServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + 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 datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + 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('createDataPolicy', () => { + it('invokes createDataPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('CreateDataPolicyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.createDataPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.createDataPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('CreateDataPolicyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.createDataPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('CreateDataPolicyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.CreateDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('CreateDataPolicyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataPolicy(request), expectedError); + }); + }); + + describe('updateDataPolicy', () => { + it('invokes updateDataPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest() + ); + request.dataPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDataPolicyRequest', [ + 'dataPolicy', + 'name', + ]); + request.dataPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.updateDataPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest() + ); + request.dataPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDataPolicyRequest', [ + 'dataPolicy', + 'name', + ]); + request.dataPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.updateDataPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest() + ); + request.dataPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDataPolicyRequest', [ + 'dataPolicy', + 'name', + ]); + request.dataPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.UpdateDataPolicyRequest() + ); + request.dataPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDataPolicyRequest', [ + 'dataPolicy', + 'name', + ]); + request.dataPolicy.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataPolicy(request), expectedError); + }); + }); + + describe('deleteDataPolicy', () => { + it('invokes deleteDataPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('DeleteDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('DeleteDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDataPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataPolicy( + 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.deleteDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('DeleteDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DeleteDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('DeleteDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDataPolicy(request), expectedError); + }); + }); + + describe('getDataPolicy', () => { + it('invokes getDataPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.getDataPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getDataPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ); + client.innerApiCalls.getDataPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.GetDataPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetDataPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataPolicy(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('GetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue('SetIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue('TestIamPermissionsRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('listDataPolicies', () => { + it('invokes listDataPolicies without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + ]; + client.innerApiCalls.listDataPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listDataPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataPolicies without error using callback', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + ]; + client.innerApiCalls.listDataPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataPolicies( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataPolicies with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataPolicies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataPoliciesStream without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + ]; + client.descriptors.page.listDataPolicies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + ) => { + 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.listDataPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataPolicies, request) + ); + assert( + (client.descriptors.page.listDataPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataPoliciesStream with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataPolicies, request) + ); + assert( + (client.descriptors.page.listDataPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataPolicies without error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() + ), + ]; + client.descriptors.page.listDataPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[] = + []; + const iterable = client.listDataPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataPolicies with error', async () => { + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datapolicies.v1beta1.ListDataPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ListDataPoliciesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('dataPolicy', () => { + const fakePath = '/rendered/path/dataPolicy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_policy: 'dataPolicyValue', + }; + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataPolicyPath', () => { + const result = client.dataPolicyPath( + 'projectValue', + 'locationValue', + 'dataPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataPolicyName', () => { + const result = client.matchProjectFromDataPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataPolicyName', () => { + const result = client.matchLocationFromDataPolicyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataPolicyFromDataPolicyName', () => { + const result = client.matchDataPolicyFromDataPolicyName(fakePath); + assert.strictEqual(result, 'dataPolicyValue'); + assert( + (client.pathTemplates.dataPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new datapolicyserviceModule.v1beta1.DataPolicyServiceClient({ + 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) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-datapolicies/tsconfig.json b/packages/google-cloud-bigquery-datapolicies/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/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/packages/google-cloud-bigquery-datapolicies/webpack.config.js b/packages/google-cloud-bigquery-datapolicies/webpack.config.js new file mode 100644 index 000000000000..db9d9b24a111 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/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: 'DataPolicyService', + filename: './data-policy-service.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/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml b/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml new file mode 100644 index 000000000000..cd116fe219c1 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.OwlBot.yaml @@ -0,0 +1,21 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/bigquery/datatransfer/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-datatransfer/$1 + diff --git a/packages/google-cloud-bigquery-datatransfer/.eslintignore b/packages/google-cloud-bigquery-datatransfer/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-bigquery-datatransfer/.eslintrc.json b/packages/google-cloud-bigquery-datatransfer/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-datatransfer/.gitattributes b/packages/google-cloud-bigquery-datatransfer/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-bigquery-datatransfer/.gitignore b/packages/google-cloud-bigquery-datatransfer/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.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/packages/google-cloud-bigquery-datatransfer/.jsdoc.js b/packages/google-cloud-bigquery-datatransfer/.jsdoc.js new file mode 100644 index 000000000000..0996c76f575d --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-data-transfer', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-datatransfer/.mocharc.js b/packages/google-cloud-bigquery-datatransfer/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-bigquery-datatransfer/.mocharc.json b/packages/google-cloud-bigquery-datatransfer/.mocharc.json new file mode 100644 index 000000000000..670c5e2c24b7 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-bigquery-datatransfer/.nycrc b/packages/google-cloud-bigquery-datatransfer/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-datatransfer/.prettierignore b/packages/google-cloud-bigquery-datatransfer/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-datatransfer/.prettierrc.js b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json b/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json new file mode 100644 index 000000000000..d28eb8b234a2 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "default_version": "v1", + "release_level": "stable", + "requires_billing": true, + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-data-transfer/latest", + "codeowner_team": "@googleapis/api-bigquery", + "language": "nodejs", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", + "product_documentation": "https://cloud.google.com/bigquery/transfer/", + "name": "bigquery-data-transfer", + "distribution_name": "@google-cloud/bigquery-data-transfer", + "name_pretty": "Google BigQuery Data Transfer Service", + "api_id": "bigquerydatatransfer.googleapis.com", + "repo": "googleapis/google-cloud-node", + "api_shortname": "bigquerydatatransfer", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md new file mode 100644 index 000000000000..11c557879f25 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md @@ -0,0 +1,435 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/bigquery-data-transfer?activeTab=versions + +## [3.1.3](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.2...v3.1.3) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#566](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/566)) ([75603cc](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/75603cc30c64778a51aec8af92487d4ff32f7ef8)) + +## [3.1.2](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.1...v3.1.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#564](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/564)) ([06d6789](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/06d678906f1e78a2c8e14ac02a5c190e35045f1c)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/1553)) ([#563](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/563)) ([7cba4dd](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/7cba4dd5e29e0d46fa64ee607a7172f1e5ab3fc3)) + +## [3.1.1](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.1.0...v3.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#558](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/558)) ([14faf3b](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/14faf3bc851177c76550d042aa3da8fe47b55328)) +* change import long to require ([#559](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/559)) ([128b219](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/128b219fcf94bac10a1a4dc76c32dc525d92038e)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/1546)) ([#562](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/562)) ([f6e41bd](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/f6e41bd6dd4e4de8ebea1d6aca71264d05c9926b)) + +## [3.1.0](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v3.0.0...v3.1.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#550](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/550)) ([20e2d96](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/20e2d96389c9a49a40c1db7102bd2b0f3bef5c49)) + +## [3.0.0](https://github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.3.0...v3.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#545) + +### Features + +* add owner email to TransferConfig message feat: allow customer to enroll a datasource programmatically docs: improvements to various message and field descriptions ([#519](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/519)) ([028c61c](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/028c61c8488791371febc583fe2edf077a3a5052)) + + +### Build System + +* update library to use Node 12 ([#545](https://github.com/googleapis/nodejs-bigquery-data-transfer/issues/545)) ([6bfaefa](https://github.com/googleapis/nodejs-bigquery-data-transfer/commit/6bfaefa1148284ee986c36983cf3f5aaebb317ac)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.7...v2.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#490](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/490)) ([18eb020](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/18eb020441195ead30ccb867ab2c5cfc607fd1f2)) + +### [2.2.7](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.6...v2.2.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#487](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/487)) ([79fda9a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/79fda9aa1a3eb5e840d299201fdc599314018d6c)) + +### [2.2.6](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.5...v2.2.6) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#485](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/485)) ([023c672](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/023c672f38514833a6c426705ad15100197b0f21)) + +### [2.2.5](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.4...v2.2.5) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#477](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/477)) ([aa0e611](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/aa0e6115e861006b6eabf0e58d3de8033d365918)) + +### [2.2.4](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.3...v2.2.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#475](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/475)) ([5039af0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/5039af0c7bef6acf9b5a2c3ca0a876cfa1ea90ce)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.2...v2.2.3) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#472](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/472)) ([9f43f07](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9f43f07aa530741ee7690d4dcc0c6d15023e7cb1)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.1...v2.2.2) (2021-06-30) + + +### Bug Fixes + +* make request optional in all cases ([#467](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/467)) ([30a0585](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/30a05858eaff80ac57fc9b4d59c129750ee01082)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.0...v2.2.1) (2021-06-07) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#450](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/450)) ([8872637](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/88726378bab4349b653160b9dfcda7ed142c87d9)) +* GoogleAdsError missing using generator version after 1.3.0 ([#460](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/460)) ([585f7d8](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/585f7d89b879faa9ae5127eb2b53c233c9ba1028)) +* use require() to load JSON protos ([#453](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/453)) ([ceae869](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/ceae8690c4d1b2b1edf7255f484d7885edc1dbf1)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.2...v2.2.0) (2021-01-09) + + +### Features + +* introduce style enumeration ([#422](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/422)) ([f07e2a0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/f07e2a07db04138d7bfe268915e9ca0b60f7a8f3)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.1...v2.1.2) (2020-11-25) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#413](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/413)) ([c239061](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/c2390614214c4c0c95972f4400785deba0d15a22)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.1.0...v2.1.1) (2020-07-09) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#374](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/374)) ([f97cb56](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/f97cb56af111684f4c4f5d1a1da62decfdae5ea6)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.0.0...v2.1.0) (2020-06-15) + + +### Features + +* move ts target to es2018 from es2016 ([#363](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/363)) ([e731cd2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e731cd2875ab443565df5dd8af955a7618d8a35d)) + + +### Bug Fixes + +* proper fallback option handling ([e8ecb1d](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e8ecb1dcf415d5576f64ee46989939fe61bfe860)) +* regen protos and unit test ([#358](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/358)) ([74010a6](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/74010a6961c23d1d5d162df5ac151402749d01b6)) +* remove eslint, update gax, fix generated protos, run the generator ([#344](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/344)) ([886c3da](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/886c3da12770a16f762f348195939ca5a37ead38)) +* synth clean for src/index ([#357](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/357)) ([458ea3a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/458ea3a3e5adc964b5f695d8f68e3409a3f4d230)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.3...v2.0.0) (2020-04-10) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* move API to typescript code generation (#300) + +### Features + +* bump release level to GA ([#296](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/296)) ([8d1850a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/8d1850ad542efb7d6f5ceac245f6e69c6f0550ed)) +* deferred client initialization ([#321](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/321)) ([dc667b3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/dc667b31d22796946bf94a01ece0cb60d083049c)) +* drop node8 support, support for async iterators ([#335](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/335)) ([e9a9b24](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/e9a9b240159d9dd8e22e99bc733b5ff6a023b769)) +* export protos in src/index.ts ([7426c53](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/7426c53e19b040c60b2c12267eb494b5db90b32a)) +* move API to typescript code generation ([#300](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/300)) ([9094a74](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9094a74364a8b1a19dff53926453d4a777d5fb21)) +* use first party client oauth ([b687434](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/b687434b6f11e8f3539cc07b7bd8c8234211286a)) + + +### Bug Fixes + +* export explicit version from protos.js ([#339](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/339)) ([5ed9ed0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/5ed9ed0117e697711098602a0c7270faa99eb9d5)) +* pass x-goog-request-params header for streaming calls ([1af9266](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/1af926661ef293b920849562a9106799b212d793)) + +### [1.5.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.2...v1.5.3) (2020-01-21) + + +### Bug Fixes + +* proto resource annotation removed, no code change ([9e0873f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9e0873f62f925e7dad871b0e96edc074e833d151)) + +### [1.5.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.1...v1.5.2) (2019-12-09) + + +### Bug Fixes + +* change resource type TransferRun to Run to be consistent with gapic configs ([993eb79](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/993eb79b7398720b7882006f96b54b21ba365217)) + +### [1.5.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.5.0...v1.5.1) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([9e22425](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/9e22425c970f92348cab350c9b5604d0a406220e)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.4.1...v1.5.0) (2019-11-13) + + +### Features + +* **docs:** bump release level to beta ([#268](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/268)) ([90f199b](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/90f199b479e850bdf13a7e9a83e2c353866ac854)) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#266](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/266)) ([cbe1699](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/cbe1699dcc26f000cb5456fd44c3259b596a84cb)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.4.0...v1.4.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#261](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/261)) ([cefa817](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/cefa817cdab3dc2db527336408d971ede5541e2a)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.3.0...v1.4.0) (2019-10-08) + + +### Bug Fixes + +* use compatible version of google-gax ([0bacf46](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/0bacf46)) + + +### Features + +* support new proto field options ([#252](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/252)) ([261e075](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/261e075)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.5...v1.3.0) (2019-09-06) + + +### Features + +* load protos from JSON, grpc-fallback support ([86df420](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/86df420)) + +### [1.2.5](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.4...v1.2.5) (2019-08-26) + + +### Bug Fixes + +* populate correct version # in x-goog-api-client header ([937f1ac](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/937f1ac)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.3...v1.2.4) (2019-08-08) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([8fd5422](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/8fd5422)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.2...v1.2.3) (2019-07-16) + + +### Bug Fixes + +* update to the latest version of the service ([#232](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/232)) ([a08f503](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/a08f503)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.1...v1.2.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#229](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/229)) ([2ec1152](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/2ec1152)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.2.0...v1.2.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#225](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/225)) ([85726ce](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/85726ce)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.1.0...v1.2.0) (2019-06-07) + + +### Features + +* adds startManualTransferRuns, enableDataTransferService, and isDataTransferServiceEnabled methods ([4a45c8f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/4a45c8f)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v1.0.0...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#219](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/219)) ([c8e6ca0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/c8e6ca0)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v0.5.1...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#194) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#192](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/192)) ([417634a](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/417634a)) +* DEADLINE_EXCEEDED is no longer retried ([fb87d7c](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/fb87d7c)) +* DEADLINE_EXCEEDED retry code is idempotent ([#203](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/203)) ([d0ff039](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/d0ff039)) +* **deps:** update dependency google-gax to v1 ([#202](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/202)) ([245cf09](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/245cf09)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#194](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/194)) ([39eca4f](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/39eca4f)) + +## v0.5.1 + +03-12-2019 13:53 PDT + +This patch release contains a few bug fixes, dependency updates, and doc improvements. Enjoy! + +### Bug Fixes +- fix: throw on invalid credentials ([#167](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/167)) +- fix: do not require projectId for samples ([#147](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/147)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#158](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/158)) + +### Documentation +- docs: update comments on protos ([#172](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/172)) +- docs: update API doc comments ([#171](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/171)) +- docs: update links in contrib guide ([#169](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/169)) +- docs: update contributing path in README ([#164](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/164)) +- docs: move CONTRIBUTING.md to root ([#163](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/163)) +- docs: add lint/fix example to contributing guide ([#160](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/160)) + +### Internal / Testing Changes +- chore: update require statement code style +- build: Add docuploader credentials to node publish jobs ([#175](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/175)) +- build: use node10 to run samples-test, system-test etc ([#174](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/174)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#168](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/168)) +- build: create docs test npm scripts ([#166](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/166)) +- build: test using @grpc/grpc-js in CI ([#165](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/165)) +- refactor: improve generated code style ([#162](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/162)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#157](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/157)) +- chore: update the date in the copyright header. ([#156](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/156)) +- build(docs): ignore www.gstatic.com/bigquerydatatransfer link ([#152](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/152)) +- build: check broken links in generated docs ([#148](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/148)) +- nit: reordered message types + +## v0.5.0 + +12-21-2018 10:19 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#119](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/119)) +- refactor: remove unused deps ([#115](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/115)) +- chore(deps): update dependency through2 to v3 ([#113](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/113)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#83](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/83)) +- fix(deps): update dependency google-gax to ^0.19.0 ([#73](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/73)) +- fix(deps): update dependency google-gax to ^0.18.0 ([#63](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/63)) + +### Documentation +- docs: update readme badges ([#130](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/130)) +- fix(samples): fix the sample and add a system test ([#127](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/127)) +- docs(samples): updated samples code to use async await ([#124](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/124)) + +### Internal / Testing Changes +- refactor: modernize the sample tests ([#144](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/144)) +- chore(build): inject yoshi automation key ([#143](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/143)) +- chore: update nyc and eslint configs ([#142](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/142)) +- chore: fix publish.sh permission +x ([#140](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/140)) +- fix(build): fix Kokoro release script ([#139](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/139)) +- build: add Kokoro configs for autorelease ([#138](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/138)) +- chore: always nyc report before calling codecov ([#135](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/135)) +- chore: nyc ignore build/test by default ([#134](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/134)) +- chore: update license file ([#132](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/132)) +- fix(build): fix system key decryption ([#128](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/128)) +- chore: add a synth.metadata +- chore: update eslintignore config ([#118](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/118)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#117](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/117)) +- chore: drop contributors from multiple places ([#116](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/116)) +- chore: use latest npm on Windows ([#114](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/114)) +- chore: update CircleCI config ([#112](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/112)) +- chore: include build in eslintignore ([#109](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/109)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#105](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/105)) +- chore: update issue templates ([#104](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/104)) +- chore: remove old issue template ([#102](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/102)) +- build: run tests on node11 ([#101](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/101)) +- chores(build): do not collect sponge.xml from windows builds ([#100](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/100)) +- chores(build): run codecov on continuous builds ([#99](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/99)) +- chore: update new issue template ([#98](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/98)) +- build: fix codecov uploading on Kokoro ([#95](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/95)) +- Update kokoro config ([#93](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/93)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#92](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/92)) +- test: remove appveyor config ([#89](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/89)) +- Update the CI config ([#88](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/88)) +- Enable prefer-const in the eslint config ([#86](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/86)) +- Enable no-var in eslint ([#85](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/85)) +- Switch to let/const ([#84](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/84)) +- Update CI config ([#82](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/82)) +- Add templating to synth and update CI ([#80](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/80)) +- Retry npm install in CI ([#79](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/79)) +- Re-generate library using /synth.py ([#76](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/76)) +- chore(deps): update dependency nyc to v13 ([#74](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/74)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#72](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/72)) +- chore: do not use npm ci ([#71](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/71)) +- chore: ignore package-lock.json ([#68](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/68)) +- chore(deps): lock file maintenance ([#67](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/67)) +- chore(deps): lock file maintenance ([#66](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/66)) +- chore: update renovate config ([#65](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/65)) +- remove that whitespace ([#64](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/64)) +- chore(deps): lock file maintenance ([#62](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/62)) +- chore: move mocha options to mocha.opts ([#60](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/60)) +- chore: require node 8 for samples ([#61](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/61)) +- chore(deps): lock file maintenance ([#59](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/59)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#56](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/56)) +- test: use strictEqual in tests ([#57](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/57)) +- chore(deps): lock file maintenance ([#55](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/55)) +- fix(deps): update dependency @google-cloud/bigquery-data-transfer to ^0.4.0 ([#54](https://github.com/googleapis/nodejs-bigquery-data-transfer/pull/54)) + +## v0.4.0 + +### Implementation Changes +- Re-generate library using /synth.py (#51) + - Interal proto changes (additional bindings) + - DEPRECATION: transfer_type field option has no effect + - See: https://github.com/googleapis/googleapis/compare/abe00527f...master + +#### BREAKING CHANGE +In this version we dropped support for NodeJS 4.x and 9.x. Your code might break if you're using this library on non LTS versions. +- fix: drop support for node.js 4.x and 9.x (#47) + +### Dependencies +- chore(deps): update dependency eslint to v5 (#44) +- chore(package): update nyc to version 12.0.2 (#35) +- fix: update all dependencies (#33) + +### Internal / Testing Changes +- refactor: drop repo-tool as an exec wrapper (#42) +- fix: update linking for samples (#39) +- Configure Renovate (#37) +- update gax and synth.py (#43) +- chore(build): use `npm ci` instead of `npm install` (#49) +- chore: the ultimate fix for repo-tools EPERM (#31) +- chore: timeout for system test (#30) +- chore: test on node10 (#28) +- chore: one more workaround for repo-tools EPERM (#26) +- chore: workaround for repo-tools EPERM (#25) +- chore: make samples depend on the current version (#24) +- chore: setup nighty build in CircleCI (#23) diff --git a/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md b/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md new file mode 100644 index 000000000000..e5fee50feb60 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Data Transfer Service API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquerydatatransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/LICENSE b/packages/google-cloud-bigquery-datatransfer/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-bigquery-datatransfer/README.md b/packages/google-cloud-bigquery-datatransfer/README.md new file mode 100644 index 000000000000..5c3efbd1f3ca --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/README.md @@ -0,0 +1,192 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Data Transfer Service: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-data-transfer.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-transfer) + + + + +BigQuery Data Transfer API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google BigQuery Data Transfer Service Node.js Client API Reference][client-docs] +* [Google BigQuery Data Transfer Service Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Data Transfer Service API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigquery-data-transfer +``` + + +### Using the client library + +```javascript +const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer'); +const client = new bigqueryDataTransfer.v1.DataTransferServiceClient(); + +async function quickstart() { + const projectId = await client.getProjectId(); + + // Iterate over all elements. + const formattedParent = client.projectPath(projectId, 'us-central1'); + let nextRequest = {parent: formattedParent}; + const options = {autoPaginate: false}; + console.log('Data sources:'); + do { + // Fetch the next page. + const responses = await client.listDataSources(nextRequest, options); + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + resources.forEach(resource => { + console.log(` ${resource.name}`); + }); + } while (nextRequest); + + console.log('\n\n'); + console.log('Sources via stream:'); + + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(` ${element.name}`); + }); +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Data_transfer_service.check_valid_creds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js,samples/README.md) | +| Data_transfer_service.create_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js,samples/README.md) | +| Data_transfer_service.delete_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js,samples/README.md) | +| Data_transfer_service.delete_transfer_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js,samples/README.md) | +| Data_transfer_service.enroll_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js,samples/README.md) | +| Data_transfer_service.get_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js,samples/README.md) | +| Data_transfer_service.get_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js,samples/README.md) | +| Data_transfer_service.get_transfer_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js,samples/README.md) | +| Data_transfer_service.list_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js,samples/README.md) | +| Data_transfer_service.list_transfer_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js,samples/README.md) | +| Data_transfer_service.list_transfer_logs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js,samples/README.md) | +| Data_transfer_service.list_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js,samples/README.md) | +| Data_transfer_service.schedule_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js,samples/README.md) | +| Data_transfer_service.start_manual_transfer_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js,samples/README.md) | +| Data_transfer_service.update_transfer_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Google BigQuery Data Transfer Service Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigquery-data-transfer@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-data-transfer/latest +[product-docs]: https://cloud.google.com/bigquery/transfer/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquerydatatransfer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-datatransfer/linkinator.config.json b/packages/google-cloud-bigquery-datatransfer/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-bigquery-datatransfer/package.json b/packages/google-cloud-bigquery-datatransfer/package.json new file mode 100644 index 000000000000..2eb940fc2f40 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/bigquery-data-transfer", + "description": "BigQuery Data Transfer API client for Node.js", + "version": "3.1.3", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-bigquery-data-transfer", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google bigquerydatatransfer", + "bigquerydatatransfer", + "BigQuery Data Transfer API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "fix": "gts fix", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.2", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto new file mode 100644 index 000000000000..d7400a55935d --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datasource.proto @@ -0,0 +1,542 @@ +// Copyright 2019 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.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/cloud/bigquery/datatransfer/v1/datatransfer.proto"; +import "google/cloud/bigquery/datatransfer/v1/transfer.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/client.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; + +// The Google BigQuery Data Transfer API allows BigQuery users to +// configure transfer of their data from other Google Products into BigQuery. +// This service exposes methods that should be used by data source backend. +service DataSourceService { + option (google.api.default_host) = "bigquerydatatransfer.googleapis.com"; + + // Update a transfer run. If successful, resets + // data_source.update_deadline_seconds timer. + rpc UpdateTransferRun(UpdateTransferRunRequest) returns (TransferRun) { + option (google.api.http) = { + patch: "/v1/{transfer_run.name=projects/*/locations/*/transferConfigs/*/runs/*}" + body: "transfer_run" + }; + } + + // Log messages for a transfer run. If successful (at least 1 message), resets + // data_source.update_deadline_seconds timer. + rpc LogTransferRunMessages(LogTransferRunMessagesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:logMessages" + body: "*" + }; + } + + // Notify the Data Transfer Service that data is ready for loading. + // The Data Transfer Service will start and monitor multiple BigQuery Load + // jobs for a transfer run. Monitored jobs will be automatically retried + // and produce log messages when starting and finishing a job. + // Can be called multiple times for the same transfer run. + rpc StartBigQueryJobs(StartBigQueryJobsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:startBigQueryJobs" + body: "*" + }; + } + + // Notify the Data Transfer Service that the data source is done processing + // the run. No more status updates or requests to start/monitor jobs will be + // accepted. The run will be finalized by the Data Transfer Service when all + // monitored jobs are completed. + // Does not need to be called if the run is set to FAILED. + rpc FinishRun(FinishRunRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}:finishRun" + body: "*" + }; + } + + // Creates a data source definition. Calling this method will automatically + // use your credentials to create the following Google Cloud resources in + // YOUR Google Cloud project. + // 1. OAuth client + // 2. Pub/Sub Topics and Subscriptions in each supported_location_ids. e.g., + // projects/{project_id}/{topics|subscriptions}/bigquerydatatransfer.{data_source_id}.{location_id}.run + // The field data_source.client_id should be left empty in the input request, + // as the API will create a new OAuth client on behalf of the caller. On the + // other hand data_source.scopes usually need to be set when there are OAuth + // scopes that need to be granted by end users. + // 3. We need a longer deadline due to the 60 seconds SLO from Pub/Sub admin + // Operations. This also applies to update and delete data source definition. + rpc CreateDataSourceDefinition(CreateDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dataSourceDefinitions" + body: "data_source_definition" + }; + } + + // Updates an existing data source definition. If changing + // supported_location_ids, triggers same effects as mentioned in "Create a + // data source definition." + rpc UpdateDataSourceDefinition(UpdateDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + patch: "/v1/{data_source_definition.name=projects/*/locations/*/dataSourceDefinitions/*}" + body: "data_source_definition" + }; + } + + // Deletes a data source definition, all of the transfer configs associated + // with this data source definition (if any) must be deleted first by the user + // in ALL regions, in order to delete the data source definition. + // This method is primarily meant for deleting data sources created during + // testing stage. + // If the data source is referenced by transfer configs in the region + // specified in the request URL, the method will fail immediately. If in the + // current region (e.g., US) it's not used by any transfer configs, but in + // another region (e.g., EU) it is, then although the method will succeed in + // region US, but it will fail when the deletion operation is replicated to + // region EU. And eventually, the system will replicate the data source + // definition back from EU to US, in order to bring all regions to + // consistency. The final effect is that the data source appears to be + // 'undeleted' in the US region. + rpc DeleteDataSourceDefinition(DeleteDataSourceDefinitionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dataSourceDefinitions/*}" + }; + } + + // Retrieves an existing data source definition. + rpc GetDataSourceDefinition(GetDataSourceDefinitionRequest) returns (DataSourceDefinition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataSourceDefinitions/*}" + }; + } + + // Lists supported data source definitions. + rpc ListDataSourceDefinitions(ListDataSourceDefinitionsRequest) returns (ListDataSourceDefinitionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSourceDefinitions" + }; + } +} + +// Describes data which should be imported. +message ImportedDataInfo { + // Defines schema of a field in the imported data. + message FieldSchema { + // LINT.IfChange + // Field type. + enum Type { + // Illegal value. + TYPE_UNSPECIFIED = 0; + + // 64K, UTF8. + STRING = 1; + + // 64-bit signed. + INTEGER = 2; + + // 64-bit IEEE floating point. + FLOAT = 3; + + // Aggregate type. + RECORD = 4; + + // 64K, Binary. + BYTES = 5; + + // 2-valued. + BOOLEAN = 6; + + // 64-bit signed usec since UTC epoch. + TIMESTAMP = 7; + + // Civil date - Year, Month, Day. + DATE = 8; + + // Civil time - Hour, Minute, Second, Microseconds. + TIME = 9; + + // Combination of civil date and civil time. + DATETIME = 10; + + // Numeric type with 38 decimal digits of precision and 9 decimal digits + // of scale. + NUMERIC = 11; + + // Geography object (go/googlesql_geography). + GEOGRAPHY = 12; + } + + // Field name. Matches: [A-Za-z_][A-Za-z_0-9]{0,127} + string field_name = 1; + + // Field type + Type type = 2; + + // Is field repeated. + bool is_repeated = 3; + + // Description for this field. + string description = 4; + + // Present iff type == RECORD. + RecordSchema schema = 5; + } + + // Describes schema of the data to be ingested. + message RecordSchema { + // One field per column in the record. + repeated FieldSchema fields = 1; + } + + // External table definition. These tables can be referenced with 'name' + // in the query and can be read just like any other table. + message TableDefinition { + // CSV specific options. + message CsvOptions { + // The delimiter. We currently restrict this to U+0001 to U+00FF and + // apply additional constraints during validation. + google.protobuf.StringValue field_delimiter = 1; + + // Whether CSV files are allowed to have quoted newlines. If quoted + // newlines are allowed, we can't split CSV files. + google.protobuf.BoolValue allow_quoted_newlines = 2; + + // The quote character. We currently restrict this to U+0000 to U+00FF + // and apply additional constraints during validation. Set to '\0' to + // indicate no quote is used. + google.protobuf.StringValue quote_char = 3; + + // Number of leading rows to skip. + google.protobuf.Int64Value skip_leading_rows = 4; + + // Accept rows that are missing trailing optional columns. + google.protobuf.BoolValue allow_jagged_rows = 5; + } + + // BigQuery table_id (required). This will be used to reference this + // table in the query. + string table_id = 1; + + // URIs for the data to be imported. All URIs must be from the same storage + // system. + repeated string source_uris = 2; + + // Describes the format of the data in source_uri. + Format format = 3; + + // Specify the maximum number of bad records that can be ignored. + // If bad records exceed this threshold the query is aborted. + int32 max_bad_records = 4; + + // Character encoding of the input when applicable (CSV, JSON). + // Defaults to UTF8. + Encoding encoding = 5; + + // CSV specific options. + CsvOptions csv_options = 6; + + // Optional schema for the data. When not specified for JSON and CSV formats + // we will try to detect it automatically. + RecordSchema schema = 7; + + // Indicates if extra values that are not represented in the table schema is + // allowed. + google.protobuf.BoolValue ignore_unknown_values = 10; + } + + // Data format. + enum Format { + // Unspecified format. In this case, we have to infer the format from the + // data source. + FORMAT_UNSPECIFIED = 0; + + // CSV format. + CSV = 1; + + // Newline-delimited JSON. + JSON = 2; + + // Avro format. See http://avro.apache.org . + AVRO = 3; + + // RecordIO. + RECORDIO = 4; + + // ColumnIO. + COLUMNIO = 5; + + // Capacitor. + CAPACITOR = 6; + + // Parquet format. See https://parquet.apache.org . + PARQUET = 7; + + // ORC format. See https://orc.apache.org . + ORC = 8; + } + + // Encoding of input data in CSV/JSON format. + enum Encoding { + // Default encoding (UTF8). + ENCODING_UNSPECIFIED = 0; + + // ISO_8859_1 encoding. + ISO_8859_1 = 1; + + // UTF8 encoding. + UTF8 = 2; + } + + // SQL query to run. When empty, API checks that there is only one + // table_def specified and loads this table. Only Standard SQL queries + // are accepted. Legacy SQL is not allowed. + string sql = 1; + + // Table where results should be written. + string destination_table_id = 2; + + // The description of a destination table. This can be several sentences + // or paragraphs describing the table contents in detail. + string destination_table_description = 10; + + // When used WITHOUT the "sql" parameter, describes the schema of the + // destination table. + // When used WITH the "sql" parameter, describes tables with data stored + // outside of BigQuery. + repeated TableDefinition table_defs = 3; + + // Inline code for User-defined function resources. + // Ignored when "sql" parameter is empty. + repeated string user_defined_functions = 4; + + // Specifies the action if the destination table already exists. + WriteDisposition write_disposition = 6; +} + +// A request to update a transfer run. +message UpdateTransferRunRequest { + // Run name must be set and correspond to an already existing run. Only + // state, error_status, and data_version fields will be updated. All other + // fields will be ignored. + TransferRun transfer_run = 1; + + // Required list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} + +// A request to add transfer status messages to the run. +message LogTransferRunMessagesRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; + + // Messages to append. + repeated TransferMessage transfer_messages = 2; +} + +// A request to start and monitor a BigQuery load job. +message StartBigQueryJobsRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; + + // Import jobs which should be started and monitored. + repeated ImportedDataInfo imported_data = 2; + + // User credentials which should be used to start/monitor + // BigQuery jobs. If not specified, then jobs + // are started using data source service account credentials. + // This may be OAuth token or JWT token. + bytes user_credentials = 3; + + // The number of BQ Jobs that can run in parallel. + int32 max_parallelism = 8; +} + +// A request to finish a run. +message FinishRunRequest { + // Name of the resource in the form: + // "projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}" + string name = 1; +} + +// Represents the request of the CreateDataSourceDefinition method. +message CreateDataSourceDefinitionRequest { + // The BigQuery project id for which data source definition is associated. + // Must be in the form: `projects/{project_id}/locations/{location_id}` + string parent = 1; + + // Data source definition. + DataSourceDefinition data_source_definition = 2; +} + +// Represents the request of the UpdateDataSourceDefinition method. +message UpdateDataSourceDefinitionRequest { + // Data source definition. + DataSourceDefinition data_source_definition = 1; + + // Update field mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Represents the request of the DeleteDataSourceDefinition method. All transfer +// configs associated with the data source must be deleted first, before the +// data source can be deleted. +message DeleteDataSourceDefinitionRequest { + // The field will contain name of the resource requested, for example: + // `projects/{project_id}/locations/{location_id}/dataSourceDefinitions/{data_source_id}` + string name = 1; +} + +// Represents the request of the GetDataSourceDefinition method. +message GetDataSourceDefinitionRequest { + // The field will contain name of the resource requested. + string name = 1; +} + +// Options for writing to the table. +// The WRITE_EMPTY option is intentionally excluded from the enum and is not +// supported by the data transfer service. +enum WriteDisposition { + // The default writeDispostion + WRITE_DISPOSITION_UNSPECIFIED = 0; + + // overwrites the table data. + WRITE_TRUNCATE = 1; + + // the data is appended to the table. + // Note duplication might happen if this mode is used. + WRITE_APPEND = 2; +} + +// Represents the request of the ListDataSourceDefinitions method. +message ListDataSourceDefinitionsRequest { + // The BigQuery project id for which data sources should be returned. + // Must be in the form: `projects/{project_id}/locations/{location_id}` + string parent = 1; + + // Pagination token, which can be used to request a specific page + // of `ListDataSourceDefinitionsRequest` list results. For multiple-page + // results, `ListDataSourceDefinitionsResponse` outputs a `next_page` token, + // which can be used as the `page_token` value to request the next page of + // the list results. + string page_token = 2; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 3; +} + +// Returns a list of supported data source definitions. +message ListDataSourceDefinitionsResponse { + // List of supported data source definitions. + repeated DataSourceDefinition data_source_definitions = 1; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListDataSourceDefinitionsRequest.page_token` + // to request the next page of the list results. + string next_page_token = 2; +} + +// Represents the data source definition. +message DataSourceDefinition { + // The resource name of the data source definition. + // Data source definition names have the form + // `projects/{project_id}/locations/{location}/dataSourceDefinitions/{data_source_id}`. + string name = 21; + + // Data source metadata. + DataSource data_source = 1; + + // The Pub/Sub topic to be used for broadcasting a message when a transfer run + // is created. Both this topic and transfer_config_pubsub_topic can be + // set to a custom topic. By default, both topics are auto-generated if none + // of them is provided when creating the definition. However, if one topic is + // manually set, the other topic has to be manually set as well. The only + // difference is that transfer_run_pubsub_topic must be a non-empty Pub/Sub + // topic, but transfer_config_pubsub_topic can be set to empty. The comments + // about "{location}" for transfer_config_pubsub_topic apply here too. + string transfer_run_pubsub_topic = 13; + + // Duration which should be added to schedule_time to calculate + // run_time when job is scheduled. Only applicable for automatically + // scheduled transfer runs. Used to start a run early on a data source that + // supports continuous data refresh to compensate for unknown timezone + // offsets. Use a negative number to start a run late for data sources not + // supporting continuous data refresh. + google.protobuf.Duration run_time_offset = 16; + + // Support e-mail address of the OAuth client's Brand, which contains the + // consent screen data. + string support_email = 22; + + // When service account is specified, BigQuery will share created dataset + // with the given service account. Also, this service account will be + // eligible to perform status updates and message logging for data transfer + // runs for the corresponding data_source_id. + string service_account = 2; + + // Is data source disabled? If true, data_source is not visible. + // API will also stop returning any data transfer configs and/or runs + // associated with the data source. This setting has higher priority + // than whitelisted_project_ids. + bool disabled = 5; + + // The Pub/Sub topic to use for broadcasting a message for transfer config. If + // empty, a message will not be broadcasted. Both this topic and + // transfer_run_pubsub_topic are auto-generated if none of them is provided + // when creating the definition. It is recommended to provide + // transfer_config_pubsub_topic if a user-owned transfer_run_pubsub_topic is + // provided. Otherwise, it will be set to empty. If "{location}" is found in + // the value, then that means, data source wants to handle message separately + // for datasets in different regions. We will replace {location} with the + // actual dataset location, as the actual topic name. For example, + // projects/connector/topics/scheduler-{location} could become + // projects/connector/topics/scheduler-us. If "{location}" is not found, then + // we will use the input value as topic name. + string transfer_config_pubsub_topic = 12; + + // Supported location_ids used for deciding in which locations Pub/Sub topics + // need to be created. If custom Pub/Sub topics are used and they contains + // '{location}', the location_ids will be used for validating the topics by + // replacing the '{location}' with the individual location in the list. The + // valid values are the "location_id" field of the response of `GET + // https://bigquerydatatransfer.googleapis.com/v1/{name=projects/*}/locations` + // In addition, if the data source needs to support all available regions, + // supported_location_ids can be set to "global" (a single string element). + // When "global" is specified: + // 1) the data source implementation is supposed to stage the data in proper + // region of the destination dataset; + // 2) Data source developer should be aware of the implications (e.g., network + // traffic latency, potential charge associated with cross-region traffic, + // etc.) of supporting the "global" region; + repeated string supported_location_ids = 23; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto new file mode 100644 index 000000000000..28dd2d8e3557 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto @@ -0,0 +1,854 @@ +// 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 +// +// 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.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/datatransfer/v1/transfer.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "DataTransferProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; +option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1"; + +// This API allows users to manage their data transfers into BigQuery. +service DataTransferService { + option (google.api.default_host) = "bigquerydatatransfer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves a supported data source and returns its settings. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataSources/*}" + additional_bindings { + get: "/v1/{name=projects/*/dataSources/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists supported data sources and returns their settings. + rpc ListDataSources(ListDataSourcesRequest) returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSources" + additional_bindings { + get: "/v1/{parent=projects/*}/dataSources" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new data transfer configuration. + rpc CreateTransferConfig(CreateTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/transferConfigs" + body: "transfer_config" + additional_bindings { + post: "/v1/{parent=projects/*}/transferConfigs" + body: "transfer_config" + } + }; + option (google.api.method_signature) = "parent,transfer_config"; + } + + // Updates a data transfer configuration. + // All fields must be set, even if they are not updated. + rpc UpdateTransferConfig(UpdateTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + patch: "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}" + body: "transfer_config" + additional_bindings { + patch: "/v1/{transfer_config.name=projects/*/transferConfigs/*}" + body: "transfer_config" + } + }; + option (google.api.method_signature) = "transfer_config,update_mask"; + } + + // Deletes a data transfer configuration, including any associated transfer + // runs and logs. + rpc DeleteTransferConfig(DeleteTransferConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/transferConfigs/*}" + additional_bindings { + delete: "/v1/{name=projects/*/transferConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about a data transfer config. + rpc GetTransferConfig(GetTransferConfigRequest) returns (TransferConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/transferConfigs/*}" + additional_bindings { + get: "/v1/{name=projects/*/transferConfigs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about all transfer configs owned by a project in the + // specified location. + rpc ListTransferConfigs(ListTransferConfigsRequest) returns (ListTransferConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/transferConfigs" + additional_bindings { + get: "/v1/{parent=projects/*}/transferConfigs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Creates transfer runs for a time range [start_time, end_time]. + // For each date - or whatever granularity the data source supports - in the + // range, one transfer run is created. + // Note that runs are created per UTC time in the time range. + // DEPRECATED: use StartManualTransferRuns instead. + rpc ScheduleTransferRuns(ScheduleTransferRunsRequest) returns (ScheduleTransferRunsResponse) { + option deprecated = true; + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns" + body: "*" + } + }; + option (google.api.method_signature) = "parent,start_time,end_time"; + } + + // Start manual transfer runs to be executed now with schedule_time equal to + // current time. The transfer runs can be created for a time range where the + // run_time is between start_time (inclusive) and end_time (exclusive), or for + // a specific run_time. + rpc StartManualTransferRuns(StartManualTransferRunsRequest) returns (StartManualTransferRunsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns" + body: "*" + additional_bindings { + post: "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns" + body: "*" + } + }; + } + + // Returns information about the particular transfer run. + rpc GetTransferRun(GetTransferRunRequest) returns (TransferRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}" + additional_bindings { + get: "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified transfer run. + rpc DeleteTransferRun(DeleteTransferRunRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}" + additional_bindings { + delete: "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns information about running and completed transfer runs. + rpc ListTransferRuns(ListTransferRunsRequest) returns (ListTransferRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs" + additional_bindings { + get: "/v1/{parent=projects/*/transferConfigs/*}/runs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns log messages for the transfer run. + rpc ListTransferLogs(ListTransferLogsRequest) returns (ListTransferLogsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs" + additional_bindings { + get: "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns true if valid credentials exist for the given data source and + // requesting user. + rpc CheckValidCreds(CheckValidCredsRequest) returns (CheckValidCredsResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/dataSources/*}:checkValidCreds" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Enroll data sources in a user project. This allows users to create transfer + // configurations for these data sources. They will also appear in the + // ListDataSources RPC and as such, will appear in the BigQuery UI + // 'https://bigquery.cloud.google.com' (and the documents can be found at + // https://cloud.google.com/bigquery/bigquery-web-ui and + // https://cloud.google.com/bigquery/docs/working-with-transfers). + rpc EnrollDataSources(EnrollDataSourcesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*}:enrollDataSources" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*}:enrollDataSources" + body: "*" + } + }; + } +} + +// A parameter used to define custom fields in a data source definition. +message DataSourceParameter { + // Parameter type. + enum Type { + // Type unspecified. + TYPE_UNSPECIFIED = 0; + + // String parameter. + STRING = 1; + + // Integer parameter (64-bits). + // Will be serialized to json as string. + INTEGER = 2; + + // Double precision floating point parameter. + DOUBLE = 3; + + // Boolean parameter. + BOOLEAN = 4; + + // Deprecated. This field has no effect. + RECORD = 5; + + // Page ID for a Google+ Page. + PLUS_PAGE = 6; + } + + // Parameter identifier. + string param_id = 1; + + // Parameter display name in the user interface. + string display_name = 2; + + // Parameter description. + string description = 3; + + // Parameter type. + Type type = 4; + + // Is parameter required. + bool required = 5; + + // Deprecated. This field has no effect. + bool repeated = 6; + + // Regular expression which can be used for parameter validation. + string validation_regex = 7; + + // All possible values for the parameter. + repeated string allowed_values = 8; + + // For integer and double values specifies minimum allowed value. + google.protobuf.DoubleValue min_value = 9; + + // For integer and double values specifies maxminum allowed value. + google.protobuf.DoubleValue max_value = 10; + + // Deprecated. This field has no effect. + repeated DataSourceParameter fields = 11; + + // Description of the requirements for this field, in case the user input does + // not fulfill the regex pattern or min/max values. + string validation_description = 12; + + // URL to a help document to further explain the naming requirements. + string validation_help_url = 13; + + // Cannot be changed after initial creation. + bool immutable = 14; + + // Deprecated. This field has no effect. + bool recurse = 15; + + // If true, it should not be used in new transfers, and it should not be + // visible to users. + bool deprecated = 20; +} + +// Defines the properties and custom parameters for a data source. +message DataSource { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + pattern: "projects/{project}/dataSources/{data_source}" + pattern: "projects/{project}/locations/{location}/dataSources/{data_source}" + }; + + // The type of authorization needed for this data source. + enum AuthorizationType { + // Type unspecified. + AUTHORIZATION_TYPE_UNSPECIFIED = 0; + + // Use OAuth 2 authorization codes that can be exchanged + // for a refresh token on the backend. + AUTHORIZATION_CODE = 1; + + // Return an authorization code for a given Google+ page that can then be + // exchanged for a refresh token on the backend. + GOOGLE_PLUS_AUTHORIZATION_CODE = 2; + + // Use First Party OAuth. + FIRST_PARTY_OAUTH = 3; + } + + // Represents how the data source supports data auto refresh. + enum DataRefreshType { + // The data source won't support data auto refresh, which is default value. + DATA_REFRESH_TYPE_UNSPECIFIED = 0; + + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Does not allow custom values to be set for each + // transfer config. + SLIDING_WINDOW = 1; + + // The data source supports data auto refresh, and runs will be scheduled + // for the past few days. Allows custom values to be set for each transfer + // config. + CUSTOM_SLIDING_WINDOW = 2; + } + + // Output only. Data source resource name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data source id. + string data_source_id = 2; + + // User friendly data source name. + string display_name = 3; + + // User friendly data source description string. + string description = 4; + + // Data source client id which should be used to receive refresh token. + string client_id = 5; + + // Api auth scopes for which refresh token needs to be obtained. These are + // scopes needed by a data source to prepare data and ingest them into + // BigQuery, e.g., https://www.googleapis.com/auth/bigquery + repeated string scopes = 6; + + // Deprecated. This field has no effect. + TransferType transfer_type = 7 [deprecated = true]; + + // Deprecated. This field has no effect. + bool supports_multiple_transfers = 8 [deprecated = true]; + + // The number of seconds to wait for an update from the data source + // before the Data Transfer Service marks the transfer as FAILED. + int32 update_deadline_seconds = 9; + + // Default data transfer schedule. + // Examples of valid schedules include: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + string default_schedule = 10; + + // Specifies whether the data source supports a user defined schedule, or + // operates on the default schedule. + // When set to `true`, user can override default schedule. + bool supports_custom_schedule = 11; + + // Data source parameters. + repeated DataSourceParameter parameters = 12; + + // Url for the help document for this data source. + string help_url = 13; + + // Indicates the type of authorization. + AuthorizationType authorization_type = 14; + + // Specifies whether the data source supports automatic data refresh for the + // past few days, and how it's supported. + // For some data sources, data might not be complete until a few days later, + // so it's useful to refresh data automatically. + DataRefreshType data_refresh_type = 15; + + // Default data refresh window on days. + // Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + int32 default_data_refresh_window_days = 16; + + // Disables backfilling and manual run scheduling + // for the data source. + bool manual_runs_disabled = 17; + + // The minimum interval for scheduler to schedule runs. + google.protobuf.Duration minimum_schedule_interval = 18; +} + +// A request to get data source info. +message GetDataSourceRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; +} + +// Request to list supported data sources and their data transfer settings. +message ListDataSourcesRequest { + // Required. The BigQuery project id for which data sources should be returned. + // Must be in the form: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; + + // Pagination token, which can be used to request a specific page + // of `ListDataSourcesRequest` list results. For multiple-page + // results, `ListDataSourcesResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; +} + +// Returns list of supported data sources and their metadata. +message ListDataSourcesResponse { + // List of supported data sources and their transfer settings. + repeated DataSource data_sources = 1; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListDataSourcesRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to create a data transfer configuration. If new credentials are +// needed for this transfer configuration, an authorization code must be +// provided. If an authorization code is provided, the transfer configuration +// will be associated with the user id corresponding to the authorization code. +// Otherwise, the transfer configuration will be associated with the calling +// user. +message CreateTransferConfigRequest { + // Required. The BigQuery project id where the transfer configuration should be created. + // Must be in the format projects/{project_id}/locations/{location_id} or + // projects/{project_id}. If specified location and location of the + // destination bigquery dataset do not match - the request will fail. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // Required. Data transfer configuration to create. + TransferConfig transfer_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional OAuth2 authorization code to use with this transfer configuration. + // This is required if new credentials are needed, as indicated by + // `CheckValidCreds`. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + string authorization_code = 3; + + // Optional version info. If users want to find a very recent access token, + // that is, immediately after approving access, users have to set the + // version_info claim in the token request. To obtain the version_info, users + // must use the "none+gsession" response type. which be return a + // version_info back in the authorization response which be be put in a JWT + // claim in the token request. + string version_info = 5; + + // Optional service account name. If this field is set, transfer config will + // be created with this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; +} + +// A request to update a transfer configuration. To update the user id of the +// transfer configuration, an authorization code needs to be provided. +message UpdateTransferConfigRequest { + // Required. Data transfer configuration to create. + TransferConfig transfer_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional OAuth2 authorization code to use with this transfer configuration. + // If it is provided, the transfer configuration will be associated with the + // authorizing user. + // In order to obtain authorization_code, please make a + // request to + // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + // + // * client_id should be OAuth client_id of BigQuery DTS API for the given + // data source returned by ListDataSources method. + // * data_source_scopes are the scopes returned by ListDataSources method. + // * redirect_uri is an optional parameter. If not specified, then + // authorization code is posted to the opener of authorization flow window. + // Otherwise it will be sent to the redirect uri. A special value of + // urn:ietf:wg:oauth:2.0:oob means that authorization code should be + // returned in the title bar of the browser, with the page text prompting + // the user to copy the code and paste it in the application. + string authorization_code = 3; + + // Required. Required list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional version info. If users want to find a very recent access token, + // that is, immediately after approving access, users have to set the + // version_info claim in the token request. To obtain the version_info, users + // must use the "none+gsession" response type. which be return a + // version_info back in the authorization response which be be put in a JWT + // claim in the token request. + string version_info = 5; + + // Optional service account name. If this field is set and + // "service_account_name" is set in update_mask, transfer config will be + // updated to use this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; +} + +// A request to get data transfer information. +message GetTransferConfigRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; +} + +// A request to delete data transfer information. All associated transfer runs +// and log messages will be deleted as well. +message DeleteTransferConfigRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; +} + +// A request to get data transfer run information. +message GetTransferRunRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; +} + +// A request to delete data transfer run information. +message DeleteTransferRunRequest { + // Required. The field will contain name of the resource requested, for example: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; +} + +// A request to list data transfers configured for a BigQuery project. +message ListTransferConfigsRequest { + // Required. The BigQuery project id for which data sources + // should be returned: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // When specified, only configurations of requested data sources are returned. + repeated string data_source_ids = 2; + + // Pagination token, which can be used to request a specific page + // of `ListTransfersRequest` list results. For multiple-page + // results, `ListTransfersResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; +} + +// The returned list of pipelines in the project. +message ListTransferConfigsResponse { + // Output only. The stored pipeline transfer configurations. + repeated TransferConfig transfer_configs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferConfigsRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to list data transfer runs. +message ListTransferRunsRequest { + // Represents which runs should be pulled. + enum RunAttempt { + // All runs should be returned. + RUN_ATTEMPT_UNSPECIFIED = 0; + + // Only latest run per day should be returned. + LATEST = 1; + } + + // Required. Name of transfer configuration for which transfer runs should be retrieved. + // Format of transfer configuration resource name is: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; + + // When specified, only transfer runs with requested states are returned. + repeated TransferState states = 2; + + // Pagination token, which can be used to request a specific page + // of `ListTransferRunsRequest` list results. For multiple-page + // results, `ListTransferRunsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 3; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 4; + + // Indicates how run attempts are to be pulled. + RunAttempt run_attempt = 5; +} + +// The returned list of pipelines in the project. +message ListTransferRunsResponse { + // Output only. The stored pipeline transfer runs. + repeated TransferRun transfer_runs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `ListTransferRunsRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to get user facing log messages associated with data transfer run. +message ListTransferLogsRequest { + // Required. Transfer run name in the form: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/Run" + } + ]; + + // Pagination token, which can be used to request a specific page + // of `ListTransferLogsRequest` list results. For multiple-page + // results, `ListTransferLogsResponse` outputs + // a `next_page` token, which can be used as the + // `page_token` value to request the next page of list results. + string page_token = 4; + + // Page size. The default page size is the maximum value of 1000 results. + int32 page_size = 5; + + // Message types to return. If not populated - INFO, WARNING and ERROR + // messages are returned. + repeated TransferMessage.MessageSeverity message_types = 6; +} + +// The returned list transfer run messages. +message ListTransferLogsResponse { + // Output only. The stored pipeline transfer messages. + repeated TransferMessage transfer_messages = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The next-pagination token. For multiple-page list results, + // this token can be used as the + // `GetTransferRunLogRequest.page_token` + // to request the next page of list results. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to determine whether the user has valid credentials. This method +// is used to limit the number of OAuth popups in the user interface. The +// user id is inferred from the API call context. +// If the data source has the Google+ authorization type, this method +// returns false, as it cannot be determined whether the credentials are +// already valid merely based on the user id. +message CheckValidCredsRequest { + // Required. The data source in the form: + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/DataSource" + } + ]; +} + +// A response indicating whether the credentials exist and are valid. +message CheckValidCredsResponse { + // If set to `true`, the credentials exist and are valid. + bool has_valid_creds = 1; +} + +// A request to schedule transfer runs for a time range. +message ScheduleTransferRunsRequest { + // Required. Transfer configuration name in the form: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + } + ]; + + // Required. Start time of the range of transfer runs. For example, + // `"2017-05-25T00:00:00+00:00"`. + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. End time of the range of transfer runs. For example, + // `"2017-05-30T00:00:00+00:00"`. + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A response to schedule transfer runs for a time range. +message ScheduleTransferRunsResponse { + // The transfer runs that were scheduled. + repeated TransferRun runs = 1; +} + +// A request to start manual transfer runs. +message StartManualTransferRunsRequest { + // A specification for a time range, this will request transfer runs with + // run_time between start_time (inclusive) and end_time (exclusive). + message TimeRange { + // Start time of the range of transfer runs. For example, + // `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than + // the end_time. Creates transfer runs where run_time is in the range + // between start_time (inclusive) and end_time (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the range of transfer runs. For example, + // `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future. + // Creates transfer runs where run_time is in the range between start_time + // (inclusive) and end_time (exclusive). + google.protobuf.Timestamp end_time = 2; + } + + // Transfer configuration name in the form: + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + string parent = 1 [(google.api.resource_reference) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + }]; + + // The requested time specification - this can be a time range or a specific + // run_time. + oneof time { + // Time range for the transfer runs that should be started. + TimeRange requested_time_range = 3; + + // Specific run_time for a transfer run to be started. The + // requested_run_time must not be in the future. + google.protobuf.Timestamp requested_run_time = 4; + } +} + +// A response to start manual transfer runs. +message StartManualTransferRunsResponse { + // The transfer runs that were created. + repeated TransferRun runs = 1; +} + +// A request to enroll a set of data sources so they are visible in the +// BigQuery UI's `Transfer` tab. +message EnrollDataSourcesRequest { + // The name of the project resource in the form: + // `projects/{project_id}` + string name = 1; + + // Data sources that are enrolled. It is required to provide at least one + // data source id. + repeated string data_source_ids = 2; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto new file mode 100644 index 000000000000..dcc8db6e0d5f --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/resourcestate.proto @@ -0,0 +1,28 @@ +// Copyright 2019 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.cloud.bigquery.datatransfer.v1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "ResourceStateProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto new file mode 100644 index 000000000000..9092b4b9e539 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto @@ -0,0 +1,309 @@ +// 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 +// +// 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.cloud.bigquery.datatransfer.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer"; +option java_multiple_files = true; +option java_outer_classname = "TransferProto"; +option java_package = "com.google.cloud.bigquery.datatransfer.v1"; +option objc_class_prefix = "GCBDT"; +option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; +option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1"; + +// DEPRECATED. Represents data transfer type. +enum TransferType { + option deprecated = true; + + // Invalid or Unknown transfer type placeholder. + TRANSFER_TYPE_UNSPECIFIED = 0; + + // Batch data transfer. + BATCH = 1; + + // Streaming data transfer. Streaming data source currently doesn't + // support multiple transfer configs per project. + STREAMING = 2; +} + +// Represents data transfer run state. +enum TransferState { + // State placeholder (0). + TRANSFER_STATE_UNSPECIFIED = 0; + + // Data transfer is scheduled and is waiting to be picked up by + // data transfer backend (2). + PENDING = 2; + + // Data transfer is in progress (3). + RUNNING = 3; + + // Data transfer completed successfully (4). + SUCCEEDED = 4; + + // Data transfer failed (5). + FAILED = 5; + + // Data transfer is cancelled (6). + CANCELLED = 6; +} + +// Represents preferences for sending email notifications for transfer run +// events. +message EmailPreferences { + // If true, email notifications will be sent on transfer run failures. + bool enable_failure_email = 1; +} + +// Options customizing the data transfer schedule. +message ScheduleOptions { + // If true, automatic scheduling of data transfer runs for this configuration + // will be disabled. The runs can be started on ad-hoc basis using + // StartManualTransferRuns API. When automatic scheduling is disabled, the + // TransferConfig.schedule field will be ignored. + bool disable_auto_scheduling = 3; + + // Specifies time to start scheduling transfer runs. The first run will be + // scheduled at or after the start time according to a recurrence pattern + // defined in the schedule string. The start time can be changed at any + // moment. The time when a data transfer can be trigerred manually is not + // limited by this option. + google.protobuf.Timestamp start_time = 1; + + // Defines time to stop scheduling transfer runs. A transfer run cannot be + // scheduled at or after the end time. The end time can be changed at any + // moment. The time when a data transfer can be trigerred manually is not + // limited by this option. + google.protobuf.Timestamp end_time = 2; +} + +// Information about a user. +message UserInfo { + // E-mail address of the user. + optional string email = 1; +} + +// Represents a data transfer configuration. A transfer configuration +// contains all metadata needed to perform a data transfer. For example, +// `destination_dataset_id` specifies where data should be stored. +// When a new transfer configuration is created, the specified +// `destination_dataset_id` is created when needed and shared with the +// appropriate data source service account. +message TransferConfig { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/TransferConfig" + pattern: "projects/{project}/transferConfigs/{transfer_config}" + pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" + }; + + // The resource name of the transfer config. + // Transfer config names have the form + // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. + // Where `config_id` is usually a uuid, even though it is not + // guaranteed or required. The name is ignored when creating a transfer + // config. + string name = 1; + + // The desination of the transfer config. + oneof destination { + // The BigQuery target dataset id. + string destination_dataset_id = 2; + } + + // User specified display name for the data transfer. + string display_name = 3; + + // Data source id. Cannot be changed once data transfer is created. + string data_source_id = 5; + + // Parameters specific to each data source. For more information see the + // bq tab in the 'Setting up a data transfer' section for each data source. + // For example the parameters for Cloud Storage transfers are listed here: + // https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + google.protobuf.Struct params = 9; + + // Data transfer schedule. + // If the data source does not support a custom schedule, this should be + // empty. If it is empty, the default value for the data source will be + // used. + // The specified times are in UTC. + // Examples of valid format: + // `1st,3rd monday of month 15:30`, + // `every wed,fri of jan,jun 13:15`, and + // `first sunday of quarter 00:00`. + // See more explanation about the format here: + // https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + // + // NOTE: The minimum interval time between recurring transfers depends on the + // data source; refer to the documentation for your data source. + string schedule = 7; + + // Options customizing the data transfer schedule. + ScheduleOptions schedule_options = 24; + + // The number of days to look back to automatically refresh the data. + // For example, if `data_refresh_window_days = 10`, then every day + // BigQuery reingests data for [today-10, today-1], rather than ingesting data + // for just [today-1]. + // Only valid if the data source supports the feature. Set the value to 0 + // to use the default value. + int32 data_refresh_window_days = 12; + + // Is this config disabled. When set to true, no runs are scheduled + // for a given transfer. + bool disabled = 13; + + // Output only. Data transfer modification time. Ignored by server on input. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Next time when data transfer will run. + google.protobuf.Timestamp next_run_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the most recently updated transfer run. + TransferState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. Unique ID of the user on whose behalf transfer is done. + int64 user_id = 11; + + // Output only. Region in which BigQuery dataset is located. + string dataset_region = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Pub/Sub topic where notifications will be sent after transfer runs + // associated with this transfer config finish. + // + // The format for specifying a pubsub topic is: + // `projects/{project}/topics/{topic}` + string notification_pubsub_topic = 15; + + // Email notifications will be sent according to these preferences + // to the email address of the user who owns this transfer config. + EmailPreferences email_preferences = 18; + + // Output only. Information about the user whose credentials are used to transfer data. + // Populated only for `transferConfigs.get` requests. In case the user + // information is not available, this field will not be populated. + optional UserInfo owner_info = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a data transfer run. +message TransferRun { + option (google.api.resource) = { + type: "bigquerydatatransfer.googleapis.com/Run" + pattern: "projects/{project}/transferConfigs/{transfer_config}/runs/{run}" + pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" + }; + + // The resource name of the transfer run. + // Transfer run names have the form + // `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + // The name is ignored when creating a transfer run. + string name = 1; + + // Minimum time after which a transfer run can be started. + google.protobuf.Timestamp schedule_time = 3; + + // For batch transfer runs, specifies the date and time of the data should be + // ingested. + google.protobuf.Timestamp run_time = 10; + + // Status of the transfer run. + google.rpc.Status error_status = 21; + + // Output only. Time when transfer run was started. + // Parameter ignored by server for input requests. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when transfer run ended. + // Parameter ignored by server for input requests. + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last time the data transfer run state was updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Parameters specific to each data source. For more information see the + // bq tab in the 'Setting up a data transfer' section for each data source. + // For example the parameters for Cloud Storage transfers are listed here: + // https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq + google.protobuf.Struct params = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data transfer destination. + oneof destination { + // Output only. The BigQuery target dataset id. + string destination_dataset_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Data source id. + string data_source_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Data transfer run state. Ignored for input requests. + TransferState state = 8; + + // Deprecated. Unique ID of the user on whose behalf transfer is done. + int64 user_id = 11; + + // Output only. Describes the schedule of this transfer run if it was + // created as part of a regular schedule. For batch transfer runs that are + // scheduled manually, this is empty. + // NOTE: the system might choose to delay the schedule depending on the + // current load, so `schedule_time` doesn't always match this. + string schedule = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic where a notification will be sent after this + // transfer run finishes. + // + // The format for specifying a pubsub topic is: + // `projects/{project}/topics/{topic}` + string notification_pubsub_topic = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email notifications will be sent according to these + // preferences to the email address of the user who owns the transfer config + // this run was derived from. + EmailPreferences email_preferences = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a user facing message for a particular data transfer run. +message TransferMessage { + // Represents data transfer user facing message severity. + enum MessageSeverity { + // No severity specified. + MESSAGE_SEVERITY_UNSPECIFIED = 0; + + // Informational message. + INFO = 1; + + // Warning message. + WARNING = 2; + + // Error message. + ERROR = 3; + } + + // Time when message was logged. + google.protobuf.Timestamp message_time = 1; + + // Message severity. + MessageSeverity severity = 2; + + // Message text. + string message_text = 3; +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000000..56c9f800d5e3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts new file mode 100644 index 000000000000..de23889ab9dd --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts @@ -0,0 +1,9831 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace datatransfer. */ + namespace datatransfer { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a DataTransferService */ + class DataTransferService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataTransferService 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 DataTransferService 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): DataTransferService; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSource + */ + public getDataSource(request: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSourceCallback): void; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @returns Promise + */ + public getDataSource(request: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest): Promise; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse + */ + public listDataSources(request: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSourcesCallback): void; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @returns Promise + */ + public listDataSources(request: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest): Promise; + + /** + * Calls CreateTransferConfig. + * @param request CreateTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public createTransferConfig(request: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfigCallback): void; + + /** + * Calls CreateTransferConfig. + * @param request CreateTransferConfigRequest message or plain object + * @returns Promise + */ + public createTransferConfig(request: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest): Promise; + + /** + * Calls UpdateTransferConfig. + * @param request UpdateTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public updateTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfigCallback): void; + + /** + * Calls UpdateTransferConfig. + * @param request UpdateTransferConfigRequest message or plain object + * @returns Promise + */ + public updateTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest): Promise; + + /** + * Calls DeleteTransferConfig. + * @param request DeleteTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfigCallback): void; + + /** + * Calls DeleteTransferConfig. + * @param request DeleteTransferConfigRequest message or plain object + * @returns Promise + */ + public deleteTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest): Promise; + + /** + * Calls GetTransferConfig. + * @param request GetTransferConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferConfig + */ + public getTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfigCallback): void; + + /** + * Calls GetTransferConfig. + * @param request GetTransferConfigRequest message or plain object + * @returns Promise + */ + public getTransferConfig(request: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest): Promise; + + /** + * Calls ListTransferConfigs. + * @param request ListTransferConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferConfigsResponse + */ + public listTransferConfigs(request: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigsCallback): void; + + /** + * Calls ListTransferConfigs. + * @param request ListTransferConfigsRequest message or plain object + * @returns Promise + */ + public listTransferConfigs(request: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest): Promise; + + /** + * Calls ScheduleTransferRuns. + * @param request ScheduleTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScheduleTransferRunsResponse + */ + public scheduleTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRunsCallback): void; + + /** + * Calls ScheduleTransferRuns. + * @param request ScheduleTransferRunsRequest message or plain object + * @returns Promise + */ + public scheduleTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest): Promise; + + /** + * Calls StartManualTransferRuns. + * @param request StartManualTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StartManualTransferRunsResponse + */ + public startManualTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRunsCallback): void; + + /** + * Calls StartManualTransferRuns. + * @param request StartManualTransferRunsRequest message or plain object + * @returns Promise + */ + public startManualTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest): Promise; + + /** + * Calls GetTransferRun. + * @param request GetTransferRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferRun + */ + public getTransferRun(request: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRunCallback): void; + + /** + * Calls GetTransferRun. + * @param request GetTransferRunRequest message or plain object + * @returns Promise + */ + public getTransferRun(request: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest): Promise; + + /** + * Calls DeleteTransferRun. + * @param request DeleteTransferRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTransferRun(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRunCallback): void; + + /** + * Calls DeleteTransferRun. + * @param request DeleteTransferRunRequest message or plain object + * @returns Promise + */ + public deleteTransferRun(request: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest): Promise; + + /** + * Calls ListTransferRuns. + * @param request ListTransferRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferRunsResponse + */ + public listTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRunsCallback): void; + + /** + * Calls ListTransferRuns. + * @param request ListTransferRunsRequest message or plain object + * @returns Promise + */ + public listTransferRuns(request: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest): Promise; + + /** + * Calls ListTransferLogs. + * @param request ListTransferLogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferLogsResponse + */ + public listTransferLogs(request: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogsCallback): void; + + /** + * Calls ListTransferLogs. + * @param request ListTransferLogsRequest message or plain object + * @returns Promise + */ + public listTransferLogs(request: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest): Promise; + + /** + * Calls CheckValidCreds. + * @param request CheckValidCredsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckValidCredsResponse + */ + public checkValidCreds(request: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCredsCallback): void; + + /** + * Calls CheckValidCreds. + * @param request CheckValidCredsRequest message or plain object + * @returns Promise + */ + public checkValidCreds(request: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest): Promise; + + /** + * Calls EnrollDataSources. + * @param request EnrollDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public enrollDataSources(request: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, callback: google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSourcesCallback): void; + + /** + * Calls EnrollDataSources. + * @param request EnrollDataSourcesRequest message or plain object + * @returns Promise + */ + public enrollDataSources(request: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest): Promise; + } + + namespace DataTransferService { + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getDataSource}. + * @param error Error, if any + * @param [response] DataSource + */ + type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.DataSource) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listDataSources}. + * @param error Error, if any + * @param [response] ListDataSourcesResponse + */ + type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|createTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type CreateTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|updateTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type UpdateTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransferConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferConfig}. + * @param error Error, if any + * @param [response] TransferConfig + */ + type GetTransferConfigCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferConfig) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferConfigs}. + * @param error Error, if any + * @param [response] ListTransferConfigsResponse + */ + type ListTransferConfigsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|scheduleTransferRuns}. + * @param error Error, if any + * @param [response] ScheduleTransferRunsResponse + */ + type ScheduleTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|startManualTransferRuns}. + * @param error Error, if any + * @param [response] StartManualTransferRunsResponse + */ + type StartManualTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferRun}. + * @param error Error, if any + * @param [response] TransferRun + */ + type GetTransferRunCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.TransferRun) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferRun}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTransferRunCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferRuns}. + * @param error Error, if any + * @param [response] ListTransferRunsResponse + */ + type ListTransferRunsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferLogs}. + * @param error Error, if any + * @param [response] ListTransferLogsResponse + */ + type ListTransferLogsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|checkValidCreds}. + * @param error Error, if any + * @param [response] CheckValidCredsResponse + */ + type CheckValidCredsCallback = (error: (Error|null), response?: google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|enrollDataSources}. + * @param error Error, if any + * @param [response] Empty + */ + type EnrollDataSourcesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a DataSourceParameter. */ + interface IDataSourceParameter { + + /** DataSourceParameter paramId */ + paramId?: (string|null); + + /** DataSourceParameter displayName */ + displayName?: (string|null); + + /** DataSourceParameter description */ + description?: (string|null); + + /** DataSourceParameter type */ + type?: (google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|null); + + /** DataSourceParameter required */ + required?: (boolean|null); + + /** DataSourceParameter repeated */ + repeated?: (boolean|null); + + /** DataSourceParameter validationRegex */ + validationRegex?: (string|null); + + /** DataSourceParameter allowedValues */ + allowedValues?: (string[]|null); + + /** DataSourceParameter minValue */ + minValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter maxValue */ + maxValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter fields */ + fields?: (google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]|null); + + /** DataSourceParameter validationDescription */ + validationDescription?: (string|null); + + /** DataSourceParameter validationHelpUrl */ + validationHelpUrl?: (string|null); + + /** DataSourceParameter immutable */ + immutable?: (boolean|null); + + /** DataSourceParameter recurse */ + recurse?: (boolean|null); + + /** DataSourceParameter deprecated */ + deprecated?: (boolean|null); + } + + /** Represents a DataSourceParameter. */ + class DataSourceParameter implements IDataSourceParameter { + + /** + * Constructs a new DataSourceParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter); + + /** DataSourceParameter paramId. */ + public paramId: string; + + /** DataSourceParameter displayName. */ + public displayName: string; + + /** DataSourceParameter description. */ + public description: string; + + /** DataSourceParameter type. */ + public type: (google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type); + + /** DataSourceParameter required. */ + public required: boolean; + + /** DataSourceParameter repeated. */ + public repeated: boolean; + + /** DataSourceParameter validationRegex. */ + public validationRegex: string; + + /** DataSourceParameter allowedValues. */ + public allowedValues: string[]; + + /** DataSourceParameter minValue. */ + public minValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter maxValue. */ + public maxValue?: (google.protobuf.IDoubleValue|null); + + /** DataSourceParameter fields. */ + public fields: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]; + + /** DataSourceParameter validationDescription. */ + public validationDescription: string; + + /** DataSourceParameter validationHelpUrl. */ + public validationHelpUrl: string; + + /** DataSourceParameter immutable. */ + public immutable: boolean; + + /** DataSourceParameter recurse. */ + public recurse: boolean; + + /** DataSourceParameter deprecated. */ + public deprecated: boolean; + + /** + * Creates a new DataSourceParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceParameter instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Encodes the specified DataSourceParameter message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @param message DataSourceParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @param message DataSourceParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Verifies a DataSourceParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DataSourceParameter; + + /** + * Creates a plain object from a DataSourceParameter message. Also converts values to other types if specified. + * @param message DataSourceParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DataSourceParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSourceParameter { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INTEGER = 2, + DOUBLE = 3, + BOOLEAN = 4, + RECORD = 5, + PLUS_PAGE = 6 + } + } + + /** Properties of a DataSource. */ + interface IDataSource { + + /** DataSource name */ + name?: (string|null); + + /** DataSource dataSourceId */ + dataSourceId?: (string|null); + + /** DataSource displayName */ + displayName?: (string|null); + + /** DataSource description */ + description?: (string|null); + + /** DataSource clientId */ + clientId?: (string|null); + + /** DataSource scopes */ + scopes?: (string[]|null); + + /** DataSource transferType */ + transferType?: (google.cloud.bigquery.datatransfer.v1.TransferType|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferType|null); + + /** DataSource supportsMultipleTransfers */ + supportsMultipleTransfers?: (boolean|null); + + /** DataSource updateDeadlineSeconds */ + updateDeadlineSeconds?: (number|null); + + /** DataSource defaultSchedule */ + defaultSchedule?: (string|null); + + /** DataSource supportsCustomSchedule */ + supportsCustomSchedule?: (boolean|null); + + /** DataSource parameters */ + parameters?: (google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]|null); + + /** DataSource helpUrl */ + helpUrl?: (string|null); + + /** DataSource authorizationType */ + authorizationType?: (google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|null); + + /** DataSource dataRefreshType */ + dataRefreshType?: (google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|null); + + /** DataSource defaultDataRefreshWindowDays */ + defaultDataRefreshWindowDays?: (number|null); + + /** DataSource manualRunsDisabled */ + manualRunsDisabled?: (boolean|null); + + /** DataSource minimumScheduleInterval */ + minimumScheduleInterval?: (google.protobuf.IDuration|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDataSource); + + /** DataSource name. */ + public name: string; + + /** DataSource dataSourceId. */ + public dataSourceId: string; + + /** DataSource displayName. */ + public displayName: string; + + /** DataSource description. */ + public description: string; + + /** DataSource clientId. */ + public clientId: string; + + /** DataSource scopes. */ + public scopes: string[]; + + /** DataSource transferType. */ + public transferType: (google.cloud.bigquery.datatransfer.v1.TransferType|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferType); + + /** DataSource supportsMultipleTransfers. */ + public supportsMultipleTransfers: boolean; + + /** DataSource updateDeadlineSeconds. */ + public updateDeadlineSeconds: number; + + /** DataSource defaultSchedule. */ + public defaultSchedule: string; + + /** DataSource supportsCustomSchedule. */ + public supportsCustomSchedule: boolean; + + /** DataSource parameters. */ + public parameters: google.cloud.bigquery.datatransfer.v1.IDataSourceParameter[]; + + /** DataSource helpUrl. */ + public helpUrl: string; + + /** DataSource authorizationType. */ + public authorizationType: (google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType); + + /** DataSource dataRefreshType. */ + public dataRefreshType: (google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|keyof typeof google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType); + + /** DataSource defaultDataRefreshWindowDays. */ + public defaultDataRefreshWindowDays: number; + + /** DataSource manualRunsDisabled. */ + public manualRunsDisabled: boolean; + + /** DataSource minimumScheduleInterval. */ + public minimumScheduleInterval?: (google.protobuf.IDuration|null); + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDataSource): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSource { + + /** AuthorizationType enum. */ + enum AuthorizationType { + AUTHORIZATION_TYPE_UNSPECIFIED = 0, + AUTHORIZATION_CODE = 1, + GOOGLE_PLUS_AUTHORIZATION_CODE = 2, + FIRST_PARTY_OAUTH = 3 + } + + /** DataRefreshType enum. */ + enum DataRefreshType { + DATA_REFRESH_TYPE_UNSPECIFIED = 0, + SLIDING_WINDOW = 1, + CUSTOM_SLIDING_WINDOW = 2 + } + } + + /** Properties of a GetDataSourceRequest. */ + interface IGetDataSourceRequest { + + /** GetDataSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceRequest. */ + class GetDataSourceRequest implements IGetDataSourceRequest { + + /** + * Constructs a new GetDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest); + + /** GetDataSourceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Verifies a GetDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesRequest. */ + interface IListDataSourcesRequest { + + /** ListDataSourcesRequest parent */ + parent?: (string|null); + + /** ListDataSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourcesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListDataSourcesRequest. */ + class ListDataSourcesRequest implements IListDataSourcesRequest { + + /** + * Constructs a new ListDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest); + + /** ListDataSourcesRequest parent. */ + public parent: string; + + /** ListDataSourcesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourcesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Verifies a ListDataSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @param message ListDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesResponse. */ + interface IListDataSourcesResponse { + + /** ListDataSourcesResponse dataSources */ + dataSources?: (google.cloud.bigquery.datatransfer.v1.IDataSource[]|null); + + /** ListDataSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDataSourcesResponse. */ + class ListDataSourcesResponse implements IListDataSourcesResponse { + + /** + * Constructs a new ListDataSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse); + + /** ListDataSourcesResponse dataSources. */ + public dataSources: google.cloud.bigquery.datatransfer.v1.IDataSource[]; + + /** ListDataSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Verifies a ListDataSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @param message ListDataSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTransferConfigRequest. */ + interface ICreateTransferConfigRequest { + + /** CreateTransferConfigRequest parent */ + parent?: (string|null); + + /** CreateTransferConfigRequest transferConfig */ + transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** CreateTransferConfigRequest authorizationCode */ + authorizationCode?: (string|null); + + /** CreateTransferConfigRequest versionInfo */ + versionInfo?: (string|null); + + /** CreateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); + } + + /** Represents a CreateTransferConfigRequest. */ + class CreateTransferConfigRequest implements ICreateTransferConfigRequest { + + /** + * Constructs a new CreateTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest); + + /** CreateTransferConfigRequest parent. */ + public parent: string; + + /** CreateTransferConfigRequest transferConfig. */ + public transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** CreateTransferConfigRequest authorizationCode. */ + public authorizationCode: string; + + /** CreateTransferConfigRequest versionInfo. */ + public versionInfo: string; + + /** CreateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + + /** + * Creates a new CreateTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Encodes the specified CreateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @param message CreateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @param message CreateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Verifies a CreateTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; + + /** + * Creates a plain object from a CreateTransferConfigRequest message. Also converts values to other types if specified. + * @param message CreateTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTransferConfigRequest. */ + interface IUpdateTransferConfigRequest { + + /** UpdateTransferConfigRequest transferConfig */ + transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** UpdateTransferConfigRequest authorizationCode */ + authorizationCode?: (string|null); + + /** UpdateTransferConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransferConfigRequest versionInfo */ + versionInfo?: (string|null); + + /** UpdateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); + } + + /** Represents an UpdateTransferConfigRequest. */ + class UpdateTransferConfigRequest implements IUpdateTransferConfigRequest { + + /** + * Constructs a new UpdateTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest); + + /** UpdateTransferConfigRequest transferConfig. */ + public transferConfig?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig|null); + + /** UpdateTransferConfigRequest authorizationCode. */ + public authorizationCode: string; + + /** UpdateTransferConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTransferConfigRequest versionInfo. */ + public versionInfo: string; + + /** UpdateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + + /** + * Creates a new UpdateTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Encodes the specified UpdateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @param message UpdateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @param message UpdateTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Verifies an UpdateTransferConfigRequest message. + * @param message Plain 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 UpdateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; + + /** + * Creates a plain object from an UpdateTransferConfigRequest message. Also converts values to other types if specified. + * @param message UpdateTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransferConfigRequest. */ + interface IGetTransferConfigRequest { + + /** GetTransferConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetTransferConfigRequest. */ + class GetTransferConfigRequest implements IGetTransferConfigRequest { + + /** + * Constructs a new GetTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest); + + /** GetTransferConfigRequest name. */ + public name: string; + + /** + * Creates a new GetTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Encodes the specified GetTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @param message GetTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @param message GetTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Verifies a GetTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest; + + /** + * Creates a plain object from a GetTransferConfigRequest message. Also converts values to other types if specified. + * @param message GetTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransferConfigRequest. */ + interface IDeleteTransferConfigRequest { + + /** DeleteTransferConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTransferConfigRequest. */ + class DeleteTransferConfigRequest implements IDeleteTransferConfigRequest { + + /** + * Constructs a new DeleteTransferConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest); + + /** DeleteTransferConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteTransferConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransferConfigRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Encodes the specified DeleteTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @param message DeleteTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @param message DeleteTransferConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Verifies a DeleteTransferConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransferConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; + + /** + * Creates a plain object from a DeleteTransferConfigRequest message. Also converts values to other types if specified. + * @param message DeleteTransferConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransferConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransferConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTransferRunRequest. */ + interface IGetTransferRunRequest { + + /** GetTransferRunRequest name */ + name?: (string|null); + } + + /** Represents a GetTransferRunRequest. */ + class GetTransferRunRequest implements IGetTransferRunRequest { + + /** + * Constructs a new GetTransferRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest); + + /** GetTransferRunRequest name. */ + public name: string; + + /** + * Creates a new GetTransferRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTransferRunRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Encodes the specified GetTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @param message GetTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @param message GetTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Verifies a GetTransferRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTransferRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; + + /** + * Creates a plain object from a GetTransferRunRequest message. Also converts values to other types if specified. + * @param message GetTransferRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTransferRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTransferRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTransferRunRequest. */ + interface IDeleteTransferRunRequest { + + /** DeleteTransferRunRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTransferRunRequest. */ + class DeleteTransferRunRequest implements IDeleteTransferRunRequest { + + /** + * Constructs a new DeleteTransferRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest); + + /** DeleteTransferRunRequest name. */ + public name: string; + + /** + * Creates a new DeleteTransferRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTransferRunRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Encodes the specified DeleteTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @param message DeleteTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @param message DeleteTransferRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Verifies a DeleteTransferRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTransferRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest; + + /** + * Creates a plain object from a DeleteTransferRunRequest message. Also converts values to other types if specified. + * @param message DeleteTransferRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTransferRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTransferRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferConfigsRequest. */ + interface IListTransferConfigsRequest { + + /** ListTransferConfigsRequest parent */ + parent?: (string|null); + + /** ListTransferConfigsRequest dataSourceIds */ + dataSourceIds?: (string[]|null); + + /** ListTransferConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListTransferConfigsRequest. */ + class ListTransferConfigsRequest implements IListTransferConfigsRequest { + + /** + * Constructs a new ListTransferConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest); + + /** ListTransferConfigsRequest parent. */ + public parent: string; + + /** ListTransferConfigsRequest dataSourceIds. */ + public dataSourceIds: string[]; + + /** ListTransferConfigsRequest pageToken. */ + public pageToken: string; + + /** ListTransferConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListTransferConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferConfigsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Encodes the specified ListTransferConfigsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @param message ListTransferConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @param message ListTransferConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Verifies a ListTransferConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest; + + /** + * Creates a plain object from a ListTransferConfigsRequest message. Also converts values to other types if specified. + * @param message ListTransferConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferConfigsResponse. */ + interface IListTransferConfigsResponse { + + /** ListTransferConfigsResponse transferConfigs */ + transferConfigs?: (google.cloud.bigquery.datatransfer.v1.ITransferConfig[]|null); + + /** ListTransferConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferConfigsResponse. */ + class ListTransferConfigsResponse implements IListTransferConfigsResponse { + + /** + * Constructs a new ListTransferConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse); + + /** ListTransferConfigsResponse transferConfigs. */ + public transferConfigs: google.cloud.bigquery.datatransfer.v1.ITransferConfig[]; + + /** ListTransferConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferConfigsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Encodes the specified ListTransferConfigsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @param message ListTransferConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @param message ListTransferConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Verifies a ListTransferConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse; + + /** + * Creates a plain object from a ListTransferConfigsResponse message. Also converts values to other types if specified. + * @param message ListTransferConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferRunsRequest. */ + interface IListTransferRunsRequest { + + /** ListTransferRunsRequest parent */ + parent?: (string|null); + + /** ListTransferRunsRequest states */ + states?: (google.cloud.bigquery.datatransfer.v1.TransferState[]|null); + + /** ListTransferRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferRunsRequest runAttempt */ + runAttempt?: (google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|keyof typeof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|null); + } + + /** Represents a ListTransferRunsRequest. */ + class ListTransferRunsRequest implements IListTransferRunsRequest { + + /** + * Constructs a new ListTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest); + + /** ListTransferRunsRequest parent. */ + public parent: string; + + /** ListTransferRunsRequest states. */ + public states: google.cloud.bigquery.datatransfer.v1.TransferState[]; + + /** ListTransferRunsRequest pageToken. */ + public pageToken: string; + + /** ListTransferRunsRequest pageSize. */ + public pageSize: number; + + /** ListTransferRunsRequest runAttempt. */ + public runAttempt: (google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|keyof typeof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt); + + /** + * Creates a new ListTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Encodes the specified ListTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @param message ListTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @param message ListTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Verifies a ListTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; + + /** + * Creates a plain object from a ListTransferRunsRequest message. Also converts values to other types if specified. + * @param message ListTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListTransferRunsRequest { + + /** RunAttempt enum. */ + enum RunAttempt { + RUN_ATTEMPT_UNSPECIFIED = 0, + LATEST = 1 + } + } + + /** Properties of a ListTransferRunsResponse. */ + interface IListTransferRunsResponse { + + /** ListTransferRunsResponse transferRuns */ + transferRuns?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + + /** ListTransferRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferRunsResponse. */ + class ListTransferRunsResponse implements IListTransferRunsResponse { + + /** + * Constructs a new ListTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse); + + /** ListTransferRunsResponse transferRuns. */ + public transferRuns: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** ListTransferRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Encodes the specified ListTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @param message ListTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @param message ListTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Verifies a ListTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse; + + /** + * Creates a plain object from a ListTransferRunsResponse message. Also converts values to other types if specified. + * @param message ListTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferLogsRequest. */ + interface IListTransferLogsRequest { + + /** ListTransferLogsRequest parent */ + parent?: (string|null); + + /** ListTransferLogsRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferLogsRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferLogsRequest messageTypes */ + messageTypes?: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[]|null); + } + + /** Represents a ListTransferLogsRequest. */ + class ListTransferLogsRequest implements IListTransferLogsRequest { + + /** + * Constructs a new ListTransferLogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest); + + /** ListTransferLogsRequest parent. */ + public parent: string; + + /** ListTransferLogsRequest pageToken. */ + public pageToken: string; + + /** ListTransferLogsRequest pageSize. */ + public pageSize: number; + + /** ListTransferLogsRequest messageTypes. */ + public messageTypes: google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[]; + + /** + * Creates a new ListTransferLogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferLogsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Encodes the specified ListTransferLogsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @param message ListTransferLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferLogsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @param message ListTransferLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Verifies a ListTransferLogsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferLogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferLogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest; + + /** + * Creates a plain object from a ListTransferLogsRequest message. Also converts values to other types if specified. + * @param message ListTransferLogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferLogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferLogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferLogsResponse. */ + interface IListTransferLogsResponse { + + /** ListTransferLogsResponse transferMessages */ + transferMessages?: (google.cloud.bigquery.datatransfer.v1.ITransferMessage[]|null); + + /** ListTransferLogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferLogsResponse. */ + class ListTransferLogsResponse implements IListTransferLogsResponse { + + /** + * Constructs a new ListTransferLogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse); + + /** ListTransferLogsResponse transferMessages. */ + public transferMessages: google.cloud.bigquery.datatransfer.v1.ITransferMessage[]; + + /** ListTransferLogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferLogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferLogsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Encodes the specified ListTransferLogsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @param message ListTransferLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferLogsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @param message ListTransferLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Verifies a ListTransferLogsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferLogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferLogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse; + + /** + * Creates a plain object from a ListTransferLogsResponse message. Also converts values to other types if specified. + * @param message ListTransferLogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferLogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferLogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckValidCredsRequest. */ + interface ICheckValidCredsRequest { + + /** CheckValidCredsRequest name */ + name?: (string|null); + } + + /** Represents a CheckValidCredsRequest. */ + class CheckValidCredsRequest implements ICheckValidCredsRequest { + + /** + * Constructs a new CheckValidCredsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest); + + /** CheckValidCredsRequest name. */ + public name: string; + + /** + * Creates a new CheckValidCredsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckValidCredsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Encodes the specified CheckValidCredsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @param message CheckValidCredsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckValidCredsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @param message CheckValidCredsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Verifies a CheckValidCredsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckValidCredsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckValidCredsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest; + + /** + * Creates a plain object from a CheckValidCredsRequest message. Also converts values to other types if specified. + * @param message CheckValidCredsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckValidCredsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckValidCredsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckValidCredsResponse. */ + interface ICheckValidCredsResponse { + + /** CheckValidCredsResponse hasValidCreds */ + hasValidCreds?: (boolean|null); + } + + /** Represents a CheckValidCredsResponse. */ + class CheckValidCredsResponse implements ICheckValidCredsResponse { + + /** + * Constructs a new CheckValidCredsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse); + + /** CheckValidCredsResponse hasValidCreds. */ + public hasValidCreds: boolean; + + /** + * Creates a new CheckValidCredsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckValidCredsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Encodes the specified CheckValidCredsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @param message CheckValidCredsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckValidCredsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @param message CheckValidCredsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Verifies a CheckValidCredsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckValidCredsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckValidCredsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse; + + /** + * Creates a plain object from a CheckValidCredsResponse message. Also converts values to other types if specified. + * @param message CheckValidCredsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckValidCredsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckValidCredsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleTransferRunsRequest. */ + interface IScheduleTransferRunsRequest { + + /** ScheduleTransferRunsRequest parent */ + parent?: (string|null); + + /** ScheduleTransferRunsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleTransferRunsRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ScheduleTransferRunsRequest. */ + class ScheduleTransferRunsRequest implements IScheduleTransferRunsRequest { + + /** + * Constructs a new ScheduleTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest); + + /** ScheduleTransferRunsRequest parent. */ + public parent: string; + + /** ScheduleTransferRunsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleTransferRunsRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ScheduleTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Encodes the specified ScheduleTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @param message ScheduleTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @param message ScheduleTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Verifies a ScheduleTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest; + + /** + * Creates a plain object from a ScheduleTransferRunsRequest message. Also converts values to other types if specified. + * @param message ScheduleTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleTransferRunsResponse. */ + interface IScheduleTransferRunsResponse { + + /** ScheduleTransferRunsResponse runs */ + runs?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + } + + /** Represents a ScheduleTransferRunsResponse. */ + class ScheduleTransferRunsResponse implements IScheduleTransferRunsResponse { + + /** + * Constructs a new ScheduleTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse); + + /** ScheduleTransferRunsResponse runs. */ + public runs: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** + * Creates a new ScheduleTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Encodes the specified ScheduleTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @param message ScheduleTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @param message ScheduleTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Verifies a ScheduleTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse; + + /** + * Creates a plain object from a ScheduleTransferRunsResponse message. Also converts values to other types if specified. + * @param message ScheduleTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartManualTransferRunsRequest. */ + interface IStartManualTransferRunsRequest { + + /** StartManualTransferRunsRequest parent */ + parent?: (string|null); + + /** StartManualTransferRunsRequest requestedTimeRange */ + requestedTimeRange?: (google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null); + + /** StartManualTransferRunsRequest requestedRunTime */ + requestedRunTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StartManualTransferRunsRequest. */ + class StartManualTransferRunsRequest implements IStartManualTransferRunsRequest { + + /** + * Constructs a new StartManualTransferRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest); + + /** StartManualTransferRunsRequest parent. */ + public parent: string; + + /** StartManualTransferRunsRequest requestedTimeRange. */ + public requestedTimeRange?: (google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null); + + /** StartManualTransferRunsRequest requestedRunTime. */ + public requestedRunTime?: (google.protobuf.ITimestamp|null); + + /** StartManualTransferRunsRequest time. */ + public time?: ("requestedTimeRange"|"requestedRunTime"); + + /** + * Creates a new StartManualTransferRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartManualTransferRunsRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Encodes the specified StartManualTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @param message StartManualTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartManualTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @param message StartManualTransferRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Verifies a StartManualTransferRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartManualTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartManualTransferRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest; + + /** + * Creates a plain object from a StartManualTransferRunsRequest message. Also converts values to other types if specified. + * @param message StartManualTransferRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartManualTransferRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartManualTransferRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StartManualTransferRunsRequest { + + /** Properties of a TimeRange. */ + interface ITimeRange { + + /** TimeRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeRange. */ + class TimeRange implements ITimeRange { + + /** + * Constructs a new TimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange); + + /** TimeRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeRange instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Verifies a TimeRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @param message TimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StartManualTransferRunsResponse. */ + interface IStartManualTransferRunsResponse { + + /** StartManualTransferRunsResponse runs */ + runs?: (google.cloud.bigquery.datatransfer.v1.ITransferRun[]|null); + } + + /** Represents a StartManualTransferRunsResponse. */ + class StartManualTransferRunsResponse implements IStartManualTransferRunsResponse { + + /** + * Constructs a new StartManualTransferRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse); + + /** StartManualTransferRunsResponse runs. */ + public runs: google.cloud.bigquery.datatransfer.v1.ITransferRun[]; + + /** + * Creates a new StartManualTransferRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StartManualTransferRunsResponse instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Encodes the specified StartManualTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @param message StartManualTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartManualTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @param message StartManualTransferRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Verifies a StartManualTransferRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartManualTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartManualTransferRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse; + + /** + * Creates a plain object from a StartManualTransferRunsResponse message. Also converts values to other types if specified. + * @param message StartManualTransferRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartManualTransferRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartManualTransferRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnrollDataSourcesRequest. */ + interface IEnrollDataSourcesRequest { + + /** EnrollDataSourcesRequest name */ + name?: (string|null); + + /** EnrollDataSourcesRequest dataSourceIds */ + dataSourceIds?: (string[]|null); + } + + /** Represents an EnrollDataSourcesRequest. */ + class EnrollDataSourcesRequest implements IEnrollDataSourcesRequest { + + /** + * Constructs a new EnrollDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest); + + /** EnrollDataSourcesRequest name. */ + public name: string; + + /** EnrollDataSourcesRequest dataSourceIds. */ + public dataSourceIds: string[]; + + /** + * Creates a new EnrollDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnrollDataSourcesRequest instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Encodes the specified EnrollDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @param message EnrollDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnrollDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @param message EnrollDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Verifies an EnrollDataSourcesRequest message. + * @param message Plain 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 EnrollDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnrollDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest; + + /** + * Creates a plain object from an EnrollDataSourcesRequest message. Also converts values to other types if specified. + * @param message EnrollDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnrollDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnrollDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TransferType enum. */ + enum TransferType { + TRANSFER_TYPE_UNSPECIFIED = 0, + BATCH = 1, + STREAMING = 2 + } + + /** TransferState enum. */ + enum TransferState { + TRANSFER_STATE_UNSPECIFIED = 0, + PENDING = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + CANCELLED = 6 + } + + /** Properties of an EmailPreferences. */ + interface IEmailPreferences { + + /** EmailPreferences enableFailureEmail */ + enableFailureEmail?: (boolean|null); + } + + /** Represents an EmailPreferences. */ + class EmailPreferences implements IEmailPreferences { + + /** + * Constructs a new EmailPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences); + + /** EmailPreferences enableFailureEmail. */ + public enableFailureEmail: boolean; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns EmailPreferences instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Verifies an EmailPreferences message. + * @param message Plain 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 EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmailPreferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @param message EmailPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.EmailPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmailPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmailPreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleOptions. */ + interface IScheduleOptions { + + /** ScheduleOptions disableAutoScheduling */ + disableAutoScheduling?: (boolean|null); + + /** ScheduleOptions startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleOptions endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ScheduleOptions. */ + class ScheduleOptions implements IScheduleOptions { + + /** + * Constructs a new ScheduleOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleOptions); + + /** ScheduleOptions disableAutoScheduling. */ + public disableAutoScheduling: boolean; + + /** ScheduleOptions startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScheduleOptions endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ScheduleOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleOptions instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IScheduleOptions): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Encodes the specified ScheduleOptions message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @param message ScheduleOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IScheduleOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScheduleOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @param message ScheduleOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IScheduleOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Verifies a ScheduleOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScheduleOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduleOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.ScheduleOptions; + + /** + * Creates a plain object from a ScheduleOptions message. Also converts values to other types if specified. + * @param message ScheduleOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.ScheduleOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScheduleOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScheduleOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo email */ + email?: (string|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IUserInfo); + + /** UserInfo email. */ + public email?: (string|null); + + /** UserInfo _email. */ + public _email?: "email"; + + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IUserInfo): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Verifies a UserInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.UserInfo; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferConfig. */ + interface ITransferConfig { + + /** TransferConfig name */ + name?: (string|null); + + /** TransferConfig destinationDatasetId */ + destinationDatasetId?: (string|null); + + /** TransferConfig displayName */ + displayName?: (string|null); + + /** TransferConfig dataSourceId */ + dataSourceId?: (string|null); + + /** TransferConfig params */ + params?: (google.protobuf.IStruct|null); + + /** TransferConfig schedule */ + schedule?: (string|null); + + /** TransferConfig scheduleOptions */ + scheduleOptions?: (google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null); + + /** TransferConfig dataRefreshWindowDays */ + dataRefreshWindowDays?: (number|null); + + /** TransferConfig disabled */ + disabled?: (boolean|null); + + /** TransferConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig nextRunTime */ + nextRunTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig state */ + state?: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState|null); + + /** TransferConfig userId */ + userId?: (number|Long|string|null); + + /** TransferConfig datasetRegion */ + datasetRegion?: (string|null); + + /** TransferConfig notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferConfig emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferConfig ownerInfo */ + ownerInfo?: (google.cloud.bigquery.datatransfer.v1.IUserInfo|null); + } + + /** Represents a TransferConfig. */ + class TransferConfig implements ITransferConfig { + + /** + * Constructs a new TransferConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferConfig); + + /** TransferConfig name. */ + public name: string; + + /** TransferConfig destinationDatasetId. */ + public destinationDatasetId?: (string|null); + + /** TransferConfig displayName. */ + public displayName: string; + + /** TransferConfig dataSourceId. */ + public dataSourceId: string; + + /** TransferConfig params. */ + public params?: (google.protobuf.IStruct|null); + + /** TransferConfig schedule. */ + public schedule: string; + + /** TransferConfig scheduleOptions. */ + public scheduleOptions?: (google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null); + + /** TransferConfig dataRefreshWindowDays. */ + public dataRefreshWindowDays: number; + + /** TransferConfig disabled. */ + public disabled: boolean; + + /** TransferConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig nextRunTime. */ + public nextRunTime?: (google.protobuf.ITimestamp|null); + + /** TransferConfig state. */ + public state: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState); + + /** TransferConfig userId. */ + public userId: (number|Long|string); + + /** TransferConfig datasetRegion. */ + public datasetRegion: string; + + /** TransferConfig notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferConfig emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferConfig ownerInfo. */ + public ownerInfo?: (google.cloud.bigquery.datatransfer.v1.IUserInfo|null); + + /** TransferConfig destination. */ + public destination?: "destinationDatasetId"; + + /** TransferConfig _ownerInfo. */ + public _ownerInfo?: "ownerInfo"; + + /** + * Creates a new TransferConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferConfig instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferConfig): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Encodes the specified TransferConfig message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @param message TransferConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @param message TransferConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Decodes a TransferConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Verifies a TransferConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferConfig; + + /** + * Creates a plain object from a TransferConfig message. Also converts values to other types if specified. + * @param message TransferConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferRun. */ + interface ITransferRun { + + /** TransferRun name */ + name?: (string|null); + + /** TransferRun scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun runTime */ + runTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun errorStatus */ + errorStatus?: (google.rpc.IStatus|null); + + /** TransferRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun params */ + params?: (google.protobuf.IStruct|null); + + /** TransferRun destinationDatasetId */ + destinationDatasetId?: (string|null); + + /** TransferRun dataSourceId */ + dataSourceId?: (string|null); + + /** TransferRun state */ + state?: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState|null); + + /** TransferRun userId */ + userId?: (number|Long|string|null); + + /** TransferRun schedule */ + schedule?: (string|null); + + /** TransferRun notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferRun emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + } + + /** Represents a TransferRun. */ + class TransferRun implements ITransferRun { + + /** + * Constructs a new TransferRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferRun); + + /** TransferRun name. */ + public name: string; + + /** TransferRun scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun runTime. */ + public runTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun errorStatus. */ + public errorStatus?: (google.rpc.IStatus|null); + + /** TransferRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TransferRun params. */ + public params?: (google.protobuf.IStruct|null); + + /** TransferRun destinationDatasetId. */ + public destinationDatasetId?: (string|null); + + /** TransferRun dataSourceId. */ + public dataSourceId: string; + + /** TransferRun state. */ + public state: (google.cloud.bigquery.datatransfer.v1.TransferState|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferState); + + /** TransferRun userId. */ + public userId: (number|Long|string); + + /** TransferRun schedule. */ + public schedule: string; + + /** TransferRun notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferRun emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + + /** TransferRun destination. */ + public destination?: "destinationDatasetId"; + + /** + * Creates a new TransferRun instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferRun instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferRun): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Encodes the specified TransferRun message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @param message TransferRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @param message TransferRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Decodes a TransferRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Verifies a TransferRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferRun; + + /** + * Creates a plain object from a TransferRun message. Also converts values to other types if specified. + * @param message TransferRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferMessage. */ + interface ITransferMessage { + + /** TransferMessage messageTime */ + messageTime?: (google.protobuf.ITimestamp|null); + + /** TransferMessage severity */ + severity?: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|null); + + /** TransferMessage messageText */ + messageText?: (string|null); + } + + /** Represents a TransferMessage. */ + class TransferMessage implements ITransferMessage { + + /** + * Constructs a new TransferMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.ITransferMessage); + + /** TransferMessage messageTime. */ + public messageTime?: (google.protobuf.ITimestamp|null); + + /** TransferMessage severity. */ + public severity: (google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|keyof typeof google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity); + + /** TransferMessage messageText. */ + public messageText: string; + + /** + * Creates a new TransferMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferMessage instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.ITransferMessage): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Encodes the specified TransferMessage message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @param message TransferMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.ITransferMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferMessage message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @param message TransferMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.ITransferMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Decodes a TransferMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Verifies a TransferMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.TransferMessage; + + /** + * Creates a plain object from a TransferMessage message. Also converts values to other types if specified. + * @param message TransferMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.TransferMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferMessage { + + /** MessageSeverity enum. */ + enum MessageSeverity { + MESSAGE_SEVERITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ERROR = 3 + } + } + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @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; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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 DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.js b/packages/google-cloud-bigquery-datatransfer/protos/protos.js new file mode 100644 index 000000000000..6267625dcfc6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.js @@ -0,0 +1,25230 @@ +// Copyright 2022 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_bigquery_data_transfer_protos || ($protobuf.roots._google_cloud_bigquery_data_transfer_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.datatransfer = (function() { + + /** + * Namespace datatransfer. + * @memberof google.cloud.bigquery + * @namespace + */ + var datatransfer = {}; + + datatransfer.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.bigquery.datatransfer + * @namespace + */ + var v1 = {}; + + v1.DataTransferService = (function() { + + /** + * Constructs a new DataTransferService service. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataTransferService + * @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 DataTransferService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataTransferService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataTransferService; + + /** + * Creates new DataTransferService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @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 {DataTransferService} RPC service. Useful where requests and/or responses are streamed. + */ + DataTransferService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getDataSource}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.DataSource} [response] DataSource + */ + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getDataSource = function getDataSource(request, callback) { + return this.rpcCall(getDataSource, $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest, $root.google.cloud.bigquery.datatransfer.v1.DataSource, request, callback); + }, "name", { value: "GetDataSource" }); + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listDataSources}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse + */ + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listDataSources = function listDataSources(request, callback) { + return this.rpcCall(listDataSources, $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest, $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse, request, callback); + }, "name", { value: "ListDataSources" }); + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|createTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef CreateTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls CreateTransferConfig. + * @function createTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} request CreateTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.createTransferConfig = function createTransferConfig(request, callback) { + return this.rpcCall(createTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "CreateTransferConfig" }); + + /** + * Calls CreateTransferConfig. + * @function createTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} request CreateTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|updateTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef UpdateTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls UpdateTransferConfig. + * @function updateTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} request UpdateTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.updateTransferConfig = function updateTransferConfig(request, callback) { + return this.rpcCall(updateTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "UpdateTransferConfig" }); + + /** + * Calls UpdateTransferConfig. + * @function updateTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} request UpdateTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef DeleteTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransferConfig. + * @function deleteTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} request DeleteTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.deleteTransferConfig = function deleteTransferConfig(request, callback) { + return this.rpcCall(deleteTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransferConfig" }); + + /** + * Calls DeleteTransferConfig. + * @function deleteTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} request DeleteTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferConfig}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetTransferConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} [response] TransferConfig + */ + + /** + * Calls GetTransferConfig. + * @function getTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} request GetTransferConfigRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfigCallback} callback Node-style callback called with the error, if any, and TransferConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getTransferConfig = function getTransferConfig(request, callback) { + return this.rpcCall(getTransferConfig, $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferConfig, request, callback); + }, "name", { value: "GetTransferConfig" }); + + /** + * Calls GetTransferConfig. + * @function getTransferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} request GetTransferConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferConfigs}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} [response] ListTransferConfigsResponse + */ + + /** + * Calls ListTransferConfigs. + * @function listTransferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} request ListTransferConfigsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigsCallback} callback Node-style callback called with the error, if any, and ListTransferConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferConfigs = function listTransferConfigs(request, callback) { + return this.rpcCall(listTransferConfigs, $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse, request, callback); + }, "name", { value: "ListTransferConfigs" }); + + /** + * Calls ListTransferConfigs. + * @function listTransferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} request ListTransferConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|scheduleTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ScheduleTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} [response] ScheduleTransferRunsResponse + */ + + /** + * Calls ScheduleTransferRuns. + * @function scheduleTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} request ScheduleTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRunsCallback} callback Node-style callback called with the error, if any, and ScheduleTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.scheduleTransferRuns = function scheduleTransferRuns(request, callback) { + return this.rpcCall(scheduleTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse, request, callback); + }, "name", { value: "ScheduleTransferRuns" }); + + /** + * Calls ScheduleTransferRuns. + * @function scheduleTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} request ScheduleTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|startManualTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef StartManualTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} [response] StartManualTransferRunsResponse + */ + + /** + * Calls StartManualTransferRuns. + * @function startManualTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} request StartManualTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRunsCallback} callback Node-style callback called with the error, if any, and StartManualTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.startManualTransferRuns = function startManualTransferRuns(request, callback) { + return this.rpcCall(startManualTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse, request, callback); + }, "name", { value: "StartManualTransferRuns" }); + + /** + * Calls StartManualTransferRuns. + * @function startManualTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} request StartManualTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|getTransferRun}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef GetTransferRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.TransferRun} [response] TransferRun + */ + + /** + * Calls GetTransferRun. + * @function getTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} request GetTransferRunRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRunCallback} callback Node-style callback called with the error, if any, and TransferRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.getTransferRun = function getTransferRun(request, callback) { + return this.rpcCall(getTransferRun, $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest, $root.google.cloud.bigquery.datatransfer.v1.TransferRun, request, callback); + }, "name", { value: "GetTransferRun" }); + + /** + * Calls GetTransferRun. + * @function getTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} request GetTransferRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|deleteTransferRun}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef DeleteTransferRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTransferRun. + * @function deleteTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} request DeleteTransferRunRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRunCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.deleteTransferRun = function deleteTransferRun(request, callback) { + return this.rpcCall(deleteTransferRun, $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTransferRun" }); + + /** + * Calls DeleteTransferRun. + * @function deleteTransferRun + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} request DeleteTransferRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferRuns}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} [response] ListTransferRunsResponse + */ + + /** + * Calls ListTransferRuns. + * @function listTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} request ListTransferRunsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRunsCallback} callback Node-style callback called with the error, if any, and ListTransferRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferRuns = function listTransferRuns(request, callback) { + return this.rpcCall(listTransferRuns, $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse, request, callback); + }, "name", { value: "ListTransferRuns" }); + + /** + * Calls ListTransferRuns. + * @function listTransferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} request ListTransferRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|listTransferLogs}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef ListTransferLogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} [response] ListTransferLogsResponse + */ + + /** + * Calls ListTransferLogs. + * @function listTransferLogs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} request ListTransferLogsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogsCallback} callback Node-style callback called with the error, if any, and ListTransferLogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.listTransferLogs = function listTransferLogs(request, callback) { + return this.rpcCall(listTransferLogs, $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest, $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse, request, callback); + }, "name", { value: "ListTransferLogs" }); + + /** + * Calls ListTransferLogs. + * @function listTransferLogs + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} request ListTransferLogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|checkValidCreds}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef CheckValidCredsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} [response] CheckValidCredsResponse + */ + + /** + * Calls CheckValidCreds. + * @function checkValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} request CheckValidCredsRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCredsCallback} callback Node-style callback called with the error, if any, and CheckValidCredsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.checkValidCreds = function checkValidCreds(request, callback) { + return this.rpcCall(checkValidCreds, $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest, $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse, request, callback); + }, "name", { value: "CheckValidCreds" }); + + /** + * Calls CheckValidCreds. + * @function checkValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} request CheckValidCredsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.datatransfer.v1.DataTransferService|enrollDataSources}. + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @typedef EnrollDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls EnrollDataSources. + * @function enrollDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} request EnrollDataSourcesRequest message or plain object + * @param {google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSourcesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataTransferService.prototype.enrollDataSources = function enrollDataSources(request, callback) { + return this.rpcCall(enrollDataSources, $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "EnrollDataSources" }); + + /** + * Calls EnrollDataSources. + * @function enrollDataSources + * @memberof google.cloud.bigquery.datatransfer.v1.DataTransferService + * @instance + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} request EnrollDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataTransferService; + })(); + + v1.DataSourceParameter = (function() { + + /** + * Properties of a DataSourceParameter. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDataSourceParameter + * @property {string|null} [paramId] DataSourceParameter paramId + * @property {string|null} [displayName] DataSourceParameter displayName + * @property {string|null} [description] DataSourceParameter description + * @property {google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type|null} [type] DataSourceParameter type + * @property {boolean|null} [required] DataSourceParameter required + * @property {boolean|null} [repeated] DataSourceParameter repeated + * @property {string|null} [validationRegex] DataSourceParameter validationRegex + * @property {Array.|null} [allowedValues] DataSourceParameter allowedValues + * @property {google.protobuf.IDoubleValue|null} [minValue] DataSourceParameter minValue + * @property {google.protobuf.IDoubleValue|null} [maxValue] DataSourceParameter maxValue + * @property {Array.|null} [fields] DataSourceParameter fields + * @property {string|null} [validationDescription] DataSourceParameter validationDescription + * @property {string|null} [validationHelpUrl] DataSourceParameter validationHelpUrl + * @property {boolean|null} [immutable] DataSourceParameter immutable + * @property {boolean|null} [recurse] DataSourceParameter recurse + * @property {boolean|null} [deprecated] DataSourceParameter deprecated + */ + + /** + * Constructs a new DataSourceParameter. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataSourceParameter. + * @implements IDataSourceParameter + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter=} [properties] Properties to set + */ + function DataSourceParameter(properties) { + this.allowedValues = []; + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceParameter paramId. + * @member {string} paramId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.paramId = ""; + + /** + * DataSourceParameter displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.displayName = ""; + + /** + * DataSourceParameter description. + * @member {string} description + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.description = ""; + + /** + * DataSourceParameter type. + * @member {google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type} type + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.type = 0; + + /** + * DataSourceParameter required. + * @member {boolean} required + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.required = false; + + /** + * DataSourceParameter repeated. + * @member {boolean} repeated + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.repeated = false; + + /** + * DataSourceParameter validationRegex. + * @member {string} validationRegex + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationRegex = ""; + + /** + * DataSourceParameter allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.allowedValues = $util.emptyArray; + + /** + * DataSourceParameter minValue. + * @member {google.protobuf.IDoubleValue|null|undefined} minValue + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.minValue = null; + + /** + * DataSourceParameter maxValue. + * @member {google.protobuf.IDoubleValue|null|undefined} maxValue + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.maxValue = null; + + /** + * DataSourceParameter fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.fields = $util.emptyArray; + + /** + * DataSourceParameter validationDescription. + * @member {string} validationDescription + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationDescription = ""; + + /** + * DataSourceParameter validationHelpUrl. + * @member {string} validationHelpUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.validationHelpUrl = ""; + + /** + * DataSourceParameter immutable. + * @member {boolean} immutable + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.immutable = false; + + /** + * DataSourceParameter recurse. + * @member {boolean} recurse + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.recurse = false; + + /** + * DataSourceParameter deprecated. + * @member {boolean} deprecated + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + */ + DataSourceParameter.prototype.deprecated = false; + + /** + * Creates a new DataSourceParameter instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter instance + */ + DataSourceParameter.create = function create(properties) { + return new DataSourceParameter(properties); + }; + + /** + * Encodes the specified DataSourceParameter message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter} message DataSourceParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paramId != null && Object.hasOwnProperty.call(message, "paramId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paramId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.required); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + if (message.validationRegex != null && Object.hasOwnProperty.call(message, "validationRegex")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.validationRegex); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.allowedValues[i]); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.protobuf.DoubleValue.encode(message.minValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.protobuf.DoubleValue.encode(message.maxValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.encode(message.fields[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.validationDescription != null && Object.hasOwnProperty.call(message, "validationDescription")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.validationDescription); + if (message.validationHelpUrl != null && Object.hasOwnProperty.call(message, "validationHelpUrl")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.validationHelpUrl); + if (message.immutable != null && Object.hasOwnProperty.call(message, "immutable")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.immutable); + if (message.recurse != null && Object.hasOwnProperty.call(message, "recurse")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.recurse); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.deprecated); + return writer; + }; + + /** + * Encodes the specified DataSourceParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSourceParameter} message DataSourceParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.paramId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + message.required = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + case 7: { + message.validationRegex = reader.string(); + break; + } + case 8: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 9: { + message.minValue = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + case 10: { + message.maxValue = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.decode(reader, reader.uint32())); + break; + } + case 12: { + message.validationDescription = reader.string(); + break; + } + case 13: { + message.validationHelpUrl = reader.string(); + break; + } + case 14: { + message.immutable = reader.bool(); + break; + } + case 15: { + message.recurse = reader.bool(); + break; + } + case 20: { + message.deprecated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceParameter message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paramId != null && message.hasOwnProperty("paramId")) + if (!$util.isString(message.paramId)) + return "paramId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + if (!$util.isString(message.validationRegex)) + return "validationRegex: string expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.protobuf.DoubleValue.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.protobuf.DoubleValue.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.validationDescription != null && message.hasOwnProperty("validationDescription")) + if (!$util.isString(message.validationDescription)) + return "validationDescription: string expected"; + if (message.validationHelpUrl != null && message.hasOwnProperty("validationHelpUrl")) + if (!$util.isString(message.validationHelpUrl)) + return "validationHelpUrl: string expected"; + if (message.immutable != null && message.hasOwnProperty("immutable")) + if (typeof message.immutable !== "boolean") + return "immutable: boolean expected"; + if (message.recurse != null && message.hasOwnProperty("recurse")) + if (typeof message.recurse !== "boolean") + return "recurse: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + return null; + }; + + /** + * Creates a DataSourceParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} DataSourceParameter + */ + DataSourceParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter(); + if (object.paramId != null) + message.paramId = String(object.paramId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "INTEGER": + case 2: + message.type = 2; + break; + case "DOUBLE": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "RECORD": + case 5: + message.type = 5; + break; + case "PLUS_PAGE": + case 6: + message.type = 6; + break; + } + if (object.required != null) + message.required = Boolean(object.required); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + if (object.validationRegex != null) + message.validationRegex = String(object.validationRegex); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.minValue: object expected"); + message.minValue = $root.google.protobuf.DoubleValue.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.maxValue: object expected"); + message.maxValue = $root.google.protobuf.DoubleValue.fromObject(object.maxValue); + } + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fromObject(object.fields[i]); + } + } + if (object.validationDescription != null) + message.validationDescription = String(object.validationDescription); + if (object.validationHelpUrl != null) + message.validationHelpUrl = String(object.validationHelpUrl); + if (object.immutable != null) + message.immutable = Boolean(object.immutable); + if (object.recurse != null) + message.recurse = Boolean(object.recurse); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + return message; + }; + + /** + * Creates a plain object from a DataSourceParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DataSourceParameter} message DataSourceParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.fields = []; + } + if (options.defaults) { + object.paramId = ""; + object.displayName = ""; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.required = false; + object.repeated = false; + object.validationRegex = ""; + object.minValue = null; + object.maxValue = null; + object.validationDescription = ""; + object.validationHelpUrl = ""; + object.immutable = false; + object.recurse = false; + object.deprecated = false; + } + if (message.paramId != null && message.hasOwnProperty("paramId")) + object.paramId = message.paramId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type[message.type] : message.type; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + object.validationRegex = message.validationRegex; + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.protobuf.DoubleValue.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.protobuf.DoubleValue.toObject(message.maxValue, options); + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.toObject(message.fields[j], options); + } + if (message.validationDescription != null && message.hasOwnProperty("validationDescription")) + object.validationDescription = message.validationDescription; + if (message.validationHelpUrl != null && message.hasOwnProperty("validationHelpUrl")) + object.validationHelpUrl = message.validationHelpUrl; + if (message.immutable != null && message.hasOwnProperty("immutable")) + object.immutable = message.immutable; + if (message.recurse != null && message.hasOwnProperty("recurse")) + object.recurse = message.recurse; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + return object; + }; + + /** + * Converts this DataSourceParameter to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @instance + * @returns {Object.} JSON object + */ + DataSourceParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceParameter + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSourceParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"; + }; + + /** + * Type enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INTEGER=2 INTEGER value + * @property {number} DOUBLE=3 DOUBLE value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} RECORD=5 RECORD value + * @property {number} PLUS_PAGE=6 PLUS_PAGE value + */ + DataSourceParameter.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INTEGER"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "RECORD"] = 5; + values[valuesById[6] = "PLUS_PAGE"] = 6; + return values; + })(); + + return DataSourceParameter; + })(); + + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDataSource + * @property {string|null} [name] DataSource name + * @property {string|null} [dataSourceId] DataSource dataSourceId + * @property {string|null} [displayName] DataSource displayName + * @property {string|null} [description] DataSource description + * @property {string|null} [clientId] DataSource clientId + * @property {Array.|null} [scopes] DataSource scopes + * @property {google.cloud.bigquery.datatransfer.v1.TransferType|null} [transferType] DataSource transferType + * @property {boolean|null} [supportsMultipleTransfers] DataSource supportsMultipleTransfers + * @property {number|null} [updateDeadlineSeconds] DataSource updateDeadlineSeconds + * @property {string|null} [defaultSchedule] DataSource defaultSchedule + * @property {boolean|null} [supportsCustomSchedule] DataSource supportsCustomSchedule + * @property {Array.|null} [parameters] DataSource parameters + * @property {string|null} [helpUrl] DataSource helpUrl + * @property {google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType|null} [authorizationType] DataSource authorizationType + * @property {google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType|null} [dataRefreshType] DataSource dataRefreshType + * @property {number|null} [defaultDataRefreshWindowDays] DataSource defaultDataRefreshWindowDays + * @property {boolean|null} [manualRunsDisabled] DataSource manualRunsDisabled + * @property {google.protobuf.IDuration|null} [minimumScheduleInterval] DataSource minimumScheduleInterval + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + this.scopes = []; + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSource name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.name = ""; + + /** + * DataSource dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceId = ""; + + /** + * DataSource displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.displayName = ""; + + /** + * DataSource description. + * @member {string} description + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.description = ""; + + /** + * DataSource clientId. + * @member {string} clientId + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.clientId = ""; + + /** + * DataSource scopes. + * @member {Array.} scopes + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.scopes = $util.emptyArray; + + /** + * DataSource transferType. + * @member {google.cloud.bigquery.datatransfer.v1.TransferType} transferType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.transferType = 0; + + /** + * DataSource supportsMultipleTransfers. + * @member {boolean} supportsMultipleTransfers + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.supportsMultipleTransfers = false; + + /** + * DataSource updateDeadlineSeconds. + * @member {number} updateDeadlineSeconds + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.updateDeadlineSeconds = 0; + + /** + * DataSource defaultSchedule. + * @member {string} defaultSchedule + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.defaultSchedule = ""; + + /** + * DataSource supportsCustomSchedule. + * @member {boolean} supportsCustomSchedule + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.supportsCustomSchedule = false; + + /** + * DataSource parameters. + * @member {Array.} parameters + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.parameters = $util.emptyArray; + + /** + * DataSource helpUrl. + * @member {string} helpUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.helpUrl = ""; + + /** + * DataSource authorizationType. + * @member {google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType} authorizationType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.authorizationType = 0; + + /** + * DataSource dataRefreshType. + * @member {google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType} dataRefreshType + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.dataRefreshType = 0; + + /** + * DataSource defaultDataRefreshWindowDays. + * @member {number} defaultDataRefreshWindowDays + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.defaultDataRefreshWindowDays = 0; + + /** + * DataSource manualRunsDisabled. + * @member {boolean} manualRunsDisabled + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.manualRunsDisabled = false; + + /** + * DataSource minimumScheduleInterval. + * @member {google.protobuf.IDuration|null|undefined} minimumScheduleInterval + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + */ + DataSource.prototype.minimumScheduleInterval = null; + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.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.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientId); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.scopes[i]); + if (message.transferType != null && Object.hasOwnProperty.call(message, "transferType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.transferType); + if (message.supportsMultipleTransfers != null && Object.hasOwnProperty.call(message, "supportsMultipleTransfers")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.supportsMultipleTransfers); + if (message.updateDeadlineSeconds != null && Object.hasOwnProperty.call(message, "updateDeadlineSeconds")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.updateDeadlineSeconds); + if (message.defaultSchedule != null && Object.hasOwnProperty.call(message, "defaultSchedule")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.defaultSchedule); + if (message.supportsCustomSchedule != null && Object.hasOwnProperty.call(message, "supportsCustomSchedule")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.supportsCustomSchedule); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.encode(message.parameters[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.helpUrl != null && Object.hasOwnProperty.call(message, "helpUrl")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.helpUrl); + if (message.authorizationType != null && Object.hasOwnProperty.call(message, "authorizationType")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.authorizationType); + if (message.dataRefreshType != null && Object.hasOwnProperty.call(message, "dataRefreshType")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dataRefreshType); + if (message.defaultDataRefreshWindowDays != null && Object.hasOwnProperty.call(message, "defaultDataRefreshWindowDays")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.defaultDataRefreshWindowDays); + if (message.manualRunsDisabled != null && Object.hasOwnProperty.call(message, "manualRunsDisabled")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.manualRunsDisabled); + if (message.minimumScheduleInterval != null && Object.hasOwnProperty.call(message, "minimumScheduleInterval")) + $root.google.protobuf.Duration.encode(message.minimumScheduleInterval, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DataSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataSourceId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.clientId = reader.string(); + break; + } + case 6: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 7: { + message.transferType = reader.int32(); + break; + } + case 8: { + message.supportsMultipleTransfers = reader.bool(); + break; + } + case 9: { + message.updateDeadlineSeconds = reader.int32(); + break; + } + case 10: { + message.defaultSchedule = reader.string(); + break; + } + case 11: { + message.supportsCustomSchedule = reader.bool(); + break; + } + case 12: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.decode(reader, reader.uint32())); + break; + } + case 13: { + message.helpUrl = reader.string(); + break; + } + case 14: { + message.authorizationType = reader.int32(); + break; + } + case 15: { + message.dataRefreshType = reader.int32(); + break; + } + case 16: { + message.defaultDataRefreshWindowDays = reader.int32(); + break; + } + case 17: { + message.manualRunsDisabled = reader.bool(); + break; + } + case 18: { + message.minimumScheduleInterval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.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.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.transferType != null && message.hasOwnProperty("transferType")) + switch (message.transferType) { + default: + return "transferType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.supportsMultipleTransfers != null && message.hasOwnProperty("supportsMultipleTransfers")) + if (typeof message.supportsMultipleTransfers !== "boolean") + return "supportsMultipleTransfers: boolean expected"; + if (message.updateDeadlineSeconds != null && message.hasOwnProperty("updateDeadlineSeconds")) + if (!$util.isInteger(message.updateDeadlineSeconds)) + return "updateDeadlineSeconds: integer expected"; + if (message.defaultSchedule != null && message.hasOwnProperty("defaultSchedule")) + if (!$util.isString(message.defaultSchedule)) + return "defaultSchedule: string expected"; + if (message.supportsCustomSchedule != null && message.hasOwnProperty("supportsCustomSchedule")) + if (typeof message.supportsCustomSchedule !== "boolean") + return "supportsCustomSchedule: boolean expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.helpUrl != null && message.hasOwnProperty("helpUrl")) + if (!$util.isString(message.helpUrl)) + return "helpUrl: string expected"; + if (message.authorizationType != null && message.hasOwnProperty("authorizationType")) + switch (message.authorizationType) { + default: + return "authorizationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dataRefreshType != null && message.hasOwnProperty("dataRefreshType")) + switch (message.dataRefreshType) { + default: + return "dataRefreshType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultDataRefreshWindowDays != null && message.hasOwnProperty("defaultDataRefreshWindowDays")) + if (!$util.isInteger(message.defaultDataRefreshWindowDays)) + return "defaultDataRefreshWindowDays: integer expected"; + if (message.manualRunsDisabled != null && message.hasOwnProperty("manualRunsDisabled")) + if (typeof message.manualRunsDisabled !== "boolean") + return "manualRunsDisabled: boolean expected"; + if (message.minimumScheduleInterval != null && message.hasOwnProperty("minimumScheduleInterval")) { + var error = $root.google.protobuf.Duration.verify(message.minimumScheduleInterval); + if (error) + return "minimumScheduleInterval." + error; + } + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DataSource) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DataSource(); + if (object.name != null) + message.name = String(object.name); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + switch (object.transferType) { + case "TRANSFER_TYPE_UNSPECIFIED": + case 0: + message.transferType = 0; + break; + case "BATCH": + case 1: + message.transferType = 1; + break; + case "STREAMING": + case 2: + message.transferType = 2; + break; + } + if (object.supportsMultipleTransfers != null) + message.supportsMultipleTransfers = Boolean(object.supportsMultipleTransfers); + if (object.updateDeadlineSeconds != null) + message.updateDeadlineSeconds = object.updateDeadlineSeconds | 0; + if (object.defaultSchedule != null) + message.defaultSchedule = String(object.defaultSchedule); + if (object.supportsCustomSchedule != null) + message.supportsCustomSchedule = Boolean(object.supportsCustomSchedule); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.parameters: object expected"); + message.parameters[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.fromObject(object.parameters[i]); + } + } + if (object.helpUrl != null) + message.helpUrl = String(object.helpUrl); + switch (object.authorizationType) { + case "AUTHORIZATION_TYPE_UNSPECIFIED": + case 0: + message.authorizationType = 0; + break; + case "AUTHORIZATION_CODE": + case 1: + message.authorizationType = 1; + break; + case "GOOGLE_PLUS_AUTHORIZATION_CODE": + case 2: + message.authorizationType = 2; + break; + case "FIRST_PARTY_OAUTH": + case 3: + message.authorizationType = 3; + break; + } + switch (object.dataRefreshType) { + case "DATA_REFRESH_TYPE_UNSPECIFIED": + case 0: + message.dataRefreshType = 0; + break; + case "SLIDING_WINDOW": + case 1: + message.dataRefreshType = 1; + break; + case "CUSTOM_SLIDING_WINDOW": + case 2: + message.dataRefreshType = 2; + break; + } + if (object.defaultDataRefreshWindowDays != null) + message.defaultDataRefreshWindowDays = object.defaultDataRefreshWindowDays | 0; + if (object.manualRunsDisabled != null) + message.manualRunsDisabled = Boolean(object.manualRunsDisabled); + if (object.minimumScheduleInterval != null) { + if (typeof object.minimumScheduleInterval !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.DataSource.minimumScheduleInterval: object expected"); + message.minimumScheduleInterval = $root.google.protobuf.Duration.fromObject(object.minimumScheduleInterval); + } + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.scopes = []; + object.parameters = []; + } + if (options.defaults) { + object.name = ""; + object.dataSourceId = ""; + object.displayName = ""; + object.description = ""; + object.clientId = ""; + object.transferType = options.enums === String ? "TRANSFER_TYPE_UNSPECIFIED" : 0; + object.supportsMultipleTransfers = false; + object.updateDeadlineSeconds = 0; + object.defaultSchedule = ""; + object.supportsCustomSchedule = false; + object.helpUrl = ""; + object.authorizationType = options.enums === String ? "AUTHORIZATION_TYPE_UNSPECIFIED" : 0; + object.dataRefreshType = options.enums === String ? "DATA_REFRESH_TYPE_UNSPECIFIED" : 0; + object.defaultDataRefreshWindowDays = 0; + object.manualRunsDisabled = false; + object.minimumScheduleInterval = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.transferType != null && message.hasOwnProperty("transferType")) + object.transferType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferType[message.transferType] : message.transferType; + if (message.supportsMultipleTransfers != null && message.hasOwnProperty("supportsMultipleTransfers")) + object.supportsMultipleTransfers = message.supportsMultipleTransfers; + if (message.updateDeadlineSeconds != null && message.hasOwnProperty("updateDeadlineSeconds")) + object.updateDeadlineSeconds = message.updateDeadlineSeconds; + if (message.defaultSchedule != null && message.hasOwnProperty("defaultSchedule")) + object.defaultSchedule = message.defaultSchedule; + if (message.supportsCustomSchedule != null && message.hasOwnProperty("supportsCustomSchedule")) + object.supportsCustomSchedule = message.supportsCustomSchedule; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSourceParameter.toObject(message.parameters[j], options); + } + if (message.helpUrl != null && message.hasOwnProperty("helpUrl")) + object.helpUrl = message.helpUrl; + if (message.authorizationType != null && message.hasOwnProperty("authorizationType")) + object.authorizationType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType[message.authorizationType] : message.authorizationType; + if (message.dataRefreshType != null && message.hasOwnProperty("dataRefreshType")) + object.dataRefreshType = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType[message.dataRefreshType] : message.dataRefreshType; + if (message.defaultDataRefreshWindowDays != null && message.hasOwnProperty("defaultDataRefreshWindowDays")) + object.defaultDataRefreshWindowDays = message.defaultDataRefreshWindowDays; + if (message.manualRunsDisabled != null && message.hasOwnProperty("manualRunsDisabled")) + object.manualRunsDisabled = message.manualRunsDisabled; + if (message.minimumScheduleInterval != null && message.hasOwnProperty("minimumScheduleInterval")) + object.minimumScheduleInterval = $root.google.protobuf.Duration.toObject(message.minimumScheduleInterval, options); + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DataSource"; + }; + + /** + * AuthorizationType enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType + * @enum {number} + * @property {number} AUTHORIZATION_TYPE_UNSPECIFIED=0 AUTHORIZATION_TYPE_UNSPECIFIED value + * @property {number} AUTHORIZATION_CODE=1 AUTHORIZATION_CODE value + * @property {number} GOOGLE_PLUS_AUTHORIZATION_CODE=2 GOOGLE_PLUS_AUTHORIZATION_CODE value + * @property {number} FIRST_PARTY_OAUTH=3 FIRST_PARTY_OAUTH value + */ + DataSource.AuthorizationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHORIZATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTHORIZATION_CODE"] = 1; + values[valuesById[2] = "GOOGLE_PLUS_AUTHORIZATION_CODE"] = 2; + values[valuesById[3] = "FIRST_PARTY_OAUTH"] = 3; + return values; + })(); + + /** + * DataRefreshType enum. + * @name google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType + * @enum {number} + * @property {number} DATA_REFRESH_TYPE_UNSPECIFIED=0 DATA_REFRESH_TYPE_UNSPECIFIED value + * @property {number} SLIDING_WINDOW=1 SLIDING_WINDOW value + * @property {number} CUSTOM_SLIDING_WINDOW=2 CUSTOM_SLIDING_WINDOW value + */ + DataSource.DataRefreshType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_REFRESH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SLIDING_WINDOW"] = 1; + values[valuesById[2] = "CUSTOM_SLIDING_WINDOW"] = 2; + return values; + })(); + + return DataSource; + })(); + + v1.GetDataSourceRequest = (function() { + + /** + * Properties of a GetDataSourceRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetDataSourceRequest + * @property {string|null} [name] GetDataSourceRequest name + */ + + /** + * Constructs a new GetDataSourceRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetDataSourceRequest. + * @implements IGetDataSourceRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest=} [properties] Properties to set + */ + function GetDataSourceRequest(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]]; + } + + /** + * GetDataSourceRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @instance + */ + GetDataSourceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest instance + */ + GetDataSourceRequest.create = function create(properties) { + return new GetDataSourceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.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 GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest(); + 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 GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceRequest.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 GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} GetDataSourceRequest + */ + GetDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest} message GetDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceRequest.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 GetDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"; + }; + + return GetDataSourceRequest; + })(); + + v1.ListDataSourcesRequest = (function() { + + /** + * Properties of a ListDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListDataSourcesRequest + * @property {string|null} [parent] ListDataSourcesRequest parent + * @property {string|null} [pageToken] ListDataSourcesRequest pageToken + * @property {number|null} [pageSize] ListDataSourcesRequest pageSize + */ + + /** + * Constructs a new ListDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListDataSourcesRequest. + * @implements IListDataSourcesRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest=} [properties] Properties to set + */ + function ListDataSourcesRequest(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]]; + } + + /** + * ListDataSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.parent = ""; + + /** + * ListDataSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageToken = ""; + + /** + * ListDataSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest instance + */ + ListDataSourcesRequest.create = function create(properties) { + return new ListDataSourcesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} ListDataSourcesRequest + */ + ListDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest} message ListDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"; + }; + + return ListDataSourcesRequest; + })(); + + v1.ListDataSourcesResponse = (function() { + + /** + * Properties of a ListDataSourcesResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListDataSourcesResponse + * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources + * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken + */ + + /** + * Constructs a new ListDataSourcesResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListDataSourcesResponse. + * @implements IListDataSourcesResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse=} [properties] Properties to set + */ + function ListDataSourcesResponse(properties) { + this.dataSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesResponse dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; + + /** + * ListDataSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse instance + */ + ListDataSourcesResponse.create = function create(properties) { + return new ListDataSourcesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.DataSource.encode(message.dataSources[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 ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push($root.google.cloud.bigquery.datatransfer.v1.DataSource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.DataSource.verify(message.dataSources[i]); + if (error) + return "dataSources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} ListDataSourcesResponse + */ + ListDataSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) { + if (typeof object.dataSources[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse.dataSources: object expected"); + message.dataSources[i] = $root.google.cloud.bigquery.datatransfer.v1.DataSource.fromObject(object.dataSources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse} message ListDataSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSources = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = $root.google.cloud.bigquery.datatransfer.v1.DataSource.toObject(message.dataSources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"; + }; + + return ListDataSourcesResponse; + })(); + + v1.CreateTransferConfigRequest = (function() { + + /** + * Properties of a CreateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICreateTransferConfigRequest + * @property {string|null} [parent] CreateTransferConfigRequest parent + * @property {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null} [transferConfig] CreateTransferConfigRequest transferConfig + * @property {string|null} [authorizationCode] CreateTransferConfigRequest authorizationCode + * @property {string|null} [versionInfo] CreateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] CreateTransferConfigRequest serviceAccountName + */ + + /** + * Constructs a new CreateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CreateTransferConfigRequest. + * @implements ICreateTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest=} [properties] Properties to set + */ + function CreateTransferConfigRequest(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]]; + } + + /** + * CreateTransferConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.parent = ""; + + /** + * CreateTransferConfigRequest transferConfig. + * @member {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null|undefined} transferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.transferConfig = null; + + /** + * CreateTransferConfigRequest authorizationCode. + * @member {string} authorizationCode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.authorizationCode = ""; + + /** + * CreateTransferConfigRequest versionInfo. + * @member {string} versionInfo + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.versionInfo = ""; + + /** + * CreateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.serviceAccountName = ""; + + /** + * Creates a new CreateTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest instance + */ + CreateTransferConfigRequest.create = function create(properties) { + return new CreateTransferConfigRequest(properties); + }; + + /** + * Encodes the specified CreateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} message CreateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferConfigRequest.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.transferConfig != null && Object.hasOwnProperty.call(message, "transferConfig")) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authorizationCode != null && Object.hasOwnProperty.call(message, "authorizationCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.authorizationCode); + if (message.versionInfo != null && Object.hasOwnProperty.call(message, "versionInfo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && Object.hasOwnProperty.call(message, "serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); + return writer; + }; + + /** + * Encodes the specified CreateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest} message CreateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authorizationCode = reader.string(); + break; + } + case 5: { + message.versionInfo = reader.string(); + break; + } + case 6: { + message.serviceAccountName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransferConfigRequest.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.transferConfig != null && message.hasOwnProperty("transferConfig")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfig); + if (error) + return "transferConfig." + error; + } + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + if (!$util.isString(message.authorizationCode)) + return "authorizationCode: string expected"; + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + if (!$util.isString(message.versionInfo)) + return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; + return null; + }; + + /** + * Creates a CreateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} CreateTransferConfigRequest + */ + CreateTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.transferConfig != null) { + if (typeof object.transferConfig !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest.transferConfig: object expected"); + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfig); + } + if (object.authorizationCode != null) + message.authorizationCode = String(object.authorizationCode); + if (object.versionInfo != null) + message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); + return message; + }; + + /** + * Creates a plain object from a CreateTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest} message CreateTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransferConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.transferConfig = null; + object.authorizationCode = ""; + object.versionInfo = ""; + object.serviceAccountName = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) + object.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfig, options); + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + object.authorizationCode = message.authorizationCode; + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; + return object; + }; + + /** + * Converts this CreateTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"; + }; + + return CreateTransferConfigRequest; + })(); + + v1.UpdateTransferConfigRequest = (function() { + + /** + * Properties of an UpdateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IUpdateTransferConfigRequest + * @property {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null} [transferConfig] UpdateTransferConfigRequest transferConfig + * @property {string|null} [authorizationCode] UpdateTransferConfigRequest authorizationCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTransferConfigRequest updateMask + * @property {string|null} [versionInfo] UpdateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] UpdateTransferConfigRequest serviceAccountName + */ + + /** + * Constructs a new UpdateTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an UpdateTransferConfigRequest. + * @implements IUpdateTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest=} [properties] Properties to set + */ + function UpdateTransferConfigRequest(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]]; + } + + /** + * UpdateTransferConfigRequest transferConfig. + * @member {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null|undefined} transferConfig + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.transferConfig = null; + + /** + * UpdateTransferConfigRequest authorizationCode. + * @member {string} authorizationCode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.authorizationCode = ""; + + /** + * UpdateTransferConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.updateMask = null; + + /** + * UpdateTransferConfigRequest versionInfo. + * @member {string} versionInfo + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.versionInfo = ""; + + /** + * UpdateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.serviceAccountName = ""; + + /** + * Creates a new UpdateTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest instance + */ + UpdateTransferConfigRequest.create = function create(properties) { + return new UpdateTransferConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} message UpdateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferConfig != null && Object.hasOwnProperty.call(message, "transferConfig")) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authorizationCode != null && Object.hasOwnProperty.call(message, "authorizationCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.authorizationCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.versionInfo != null && Object.hasOwnProperty.call(message, "versionInfo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && Object.hasOwnProperty.call(message, "serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); + return writer; + }; + + /** + * Encodes the specified UpdateTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest} message UpdateTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.authorizationCode = reader.string(); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 5: { + message.versionInfo = reader.string(); + break; + } + case 6: { + message.serviceAccountName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTransferConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfig); + if (error) + return "transferConfig." + error; + } + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + if (!$util.isString(message.authorizationCode)) + return "authorizationCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + if (!$util.isString(message.versionInfo)) + return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; + return null; + }; + + /** + * Creates an UpdateTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} UpdateTransferConfigRequest + */ + UpdateTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest(); + if (object.transferConfig != null) { + if (typeof object.transferConfig !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.transferConfig: object expected"); + message.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfig); + } + if (object.authorizationCode != null) + message.authorizationCode = String(object.authorizationCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.versionInfo != null) + message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); + return message; + }; + + /** + * Creates a plain object from an UpdateTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest} message UpdateTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTransferConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transferConfig = null; + object.authorizationCode = ""; + object.updateMask = null; + object.versionInfo = ""; + object.serviceAccountName = ""; + } + if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) + object.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfig, options); + if (message.authorizationCode != null && message.hasOwnProperty("authorizationCode")) + object.authorizationCode = message.authorizationCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) + object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; + return object; + }; + + /** + * Converts this UpdateTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"; + }; + + return UpdateTransferConfigRequest; + })(); + + v1.GetTransferConfigRequest = (function() { + + /** + * Properties of a GetTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetTransferConfigRequest + * @property {string|null} [name] GetTransferConfigRequest name + */ + + /** + * Constructs a new GetTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetTransferConfigRequest. + * @implements IGetTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest=} [properties] Properties to set + */ + function GetTransferConfigRequest(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]]; + } + + /** + * GetTransferConfigRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @instance + */ + GetTransferConfigRequest.prototype.name = ""; + + /** + * Creates a new GetTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest instance + */ + GetTransferConfigRequest.create = function create(properties) { + return new GetTransferConfigRequest(properties); + }; + + /** + * Encodes the specified GetTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} message GetTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferConfigRequest.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 GetTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest} message GetTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest(); + 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 GetTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransferConfigRequest.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 GetTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} GetTransferConfigRequest + */ + GetTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest} message GetTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransferConfigRequest.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 GetTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"; + }; + + return GetTransferConfigRequest; + })(); + + v1.DeleteTransferConfigRequest = (function() { + + /** + * Properties of a DeleteTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDeleteTransferConfigRequest + * @property {string|null} [name] DeleteTransferConfigRequest name + */ + + /** + * Constructs a new DeleteTransferConfigRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DeleteTransferConfigRequest. + * @implements IDeleteTransferConfigRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest=} [properties] Properties to set + */ + function DeleteTransferConfigRequest(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]]; + } + + /** + * DeleteTransferConfigRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @instance + */ + DeleteTransferConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteTransferConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest instance + */ + DeleteTransferConfigRequest.create = function create(properties) { + return new DeleteTransferConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteTransferConfigRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} message DeleteTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest} message DeleteTransferConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransferConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest(); + 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 DeleteTransferConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransferConfigRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} DeleteTransferConfigRequest + */ + DeleteTransferConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTransferConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest} message DeleteTransferConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransferConfigRequest.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 DeleteTransferConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransferConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransferConfigRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransferConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"; + }; + + return DeleteTransferConfigRequest; + })(); + + v1.GetTransferRunRequest = (function() { + + /** + * Properties of a GetTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IGetTransferRunRequest + * @property {string|null} [name] GetTransferRunRequest name + */ + + /** + * Constructs a new GetTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a GetTransferRunRequest. + * @implements IGetTransferRunRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest=} [properties] Properties to set + */ + function GetTransferRunRequest(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]]; + } + + /** + * GetTransferRunRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @instance + */ + GetTransferRunRequest.prototype.name = ""; + + /** + * Creates a new GetTransferRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest instance + */ + GetTransferRunRequest.create = function create(properties) { + return new GetTransferRunRequest(properties); + }; + + /** + * Encodes the specified GetTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} message GetTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferRunRequest.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 GetTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest} message GetTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTransferRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTransferRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest(); + 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 GetTransferRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTransferRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTransferRunRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTransferRunRequest.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 GetTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} GetTransferRunRequest + */ + GetTransferRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTransferRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest} message GetTransferRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTransferRunRequest.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 GetTransferRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetTransferRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTransferRunRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTransferRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"; + }; + + return GetTransferRunRequest; + })(); + + v1.DeleteTransferRunRequest = (function() { + + /** + * Properties of a DeleteTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IDeleteTransferRunRequest + * @property {string|null} [name] DeleteTransferRunRequest name + */ + + /** + * Constructs a new DeleteTransferRunRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a DeleteTransferRunRequest. + * @implements IDeleteTransferRunRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest=} [properties] Properties to set + */ + function DeleteTransferRunRequest(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]]; + } + + /** + * DeleteTransferRunRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @instance + */ + DeleteTransferRunRequest.prototype.name = ""; + + /** + * Creates a new DeleteTransferRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest instance + */ + DeleteTransferRunRequest.create = function create(properties) { + return new DeleteTransferRunRequest(properties); + }; + + /** + * Encodes the specified DeleteTransferRunRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} message DeleteTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest} message DeleteTransferRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTransferRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTransferRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest(); + 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 DeleteTransferRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTransferRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTransferRunRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} DeleteTransferRunRequest + */ + DeleteTransferRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTransferRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest} message DeleteTransferRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTransferRunRequest.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 DeleteTransferRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTransferRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTransferRunRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTransferRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"; + }; + + return DeleteTransferRunRequest; + })(); + + v1.ListTransferConfigsRequest = (function() { + + /** + * Properties of a ListTransferConfigsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferConfigsRequest + * @property {string|null} [parent] ListTransferConfigsRequest parent + * @property {Array.|null} [dataSourceIds] ListTransferConfigsRequest dataSourceIds + * @property {string|null} [pageToken] ListTransferConfigsRequest pageToken + * @property {number|null} [pageSize] ListTransferConfigsRequest pageSize + */ + + /** + * Constructs a new ListTransferConfigsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferConfigsRequest. + * @implements IListTransferConfigsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest=} [properties] Properties to set + */ + function ListTransferConfigsRequest(properties) { + this.dataSourceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.parent = ""; + + /** + * ListTransferConfigsRequest dataSourceIds. + * @member {Array.} dataSourceIds + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.dataSourceIds = $util.emptyArray; + + /** + * ListTransferConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.pageToken = ""; + + /** + * ListTransferConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + */ + ListTransferConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListTransferConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest instance + */ + ListTransferConfigsRequest.create = function create(properties) { + return new ListTransferConfigsRequest(properties); + }; + + /** + * Encodes the specified ListTransferConfigsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} message ListTransferConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsRequest.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.dataSourceIds != null && message.dataSourceIds.length) + for (var i = 0; i < message.dataSourceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceIds[i]); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListTransferConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest} message ListTransferConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.dataSourceIds && message.dataSourceIds.length)) + message.dataSourceIds = []; + message.dataSourceIds.push(reader.string()); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferConfigsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferConfigsRequest.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.dataSourceIds != null && message.hasOwnProperty("dataSourceIds")) { + if (!Array.isArray(message.dataSourceIds)) + return "dataSourceIds: array expected"; + for (var i = 0; i < message.dataSourceIds.length; ++i) + if (!$util.isString(message.dataSourceIds[i])) + return "dataSourceIds: string[] expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListTransferConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} ListTransferConfigsRequest + */ + ListTransferConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataSourceIds) { + if (!Array.isArray(object.dataSourceIds)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest.dataSourceIds: array expected"); + message.dataSourceIds = []; + for (var i = 0; i < object.dataSourceIds.length; ++i) + message.dataSourceIds[i] = String(object.dataSourceIds[i]); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListTransferConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest} message ListTransferConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSourceIds = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataSourceIds && message.dataSourceIds.length) { + object.dataSourceIds = []; + for (var j = 0; j < message.dataSourceIds.length; ++j) + object.dataSourceIds[j] = message.dataSourceIds[j]; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListTransferConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"; + }; + + return ListTransferConfigsRequest; + })(); + + v1.ListTransferConfigsResponse = (function() { + + /** + * Properties of a ListTransferConfigsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferConfigsResponse + * @property {Array.|null} [transferConfigs] ListTransferConfigsResponse transferConfigs + * @property {string|null} [nextPageToken] ListTransferConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferConfigsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferConfigsResponse. + * @implements IListTransferConfigsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse=} [properties] Properties to set + */ + function ListTransferConfigsResponse(properties) { + this.transferConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferConfigsResponse transferConfigs. + * @member {Array.} transferConfigs + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + */ + ListTransferConfigsResponse.prototype.transferConfigs = $util.emptyArray; + + /** + * ListTransferConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + */ + ListTransferConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse instance + */ + ListTransferConfigsResponse.create = function create(properties) { + return new ListTransferConfigsResponse(properties); + }; + + /** + * Encodes the specified ListTransferConfigsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse} message ListTransferConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferConfigs != null && message.transferConfigs.length) + for (var i = 0; i < message.transferConfigs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.encode(message.transferConfigs[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 ListTransferConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse} message ListTransferConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferConfigs && message.transferConfigs.length)) + message.transferConfigs = []; + message.transferConfigs.push($root.google.cloud.bigquery.datatransfer.v1.TransferConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferConfigsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferConfigs != null && message.hasOwnProperty("transferConfigs")) { + if (!Array.isArray(message.transferConfigs)) + return "transferConfigs: array expected"; + for (var i = 0; i < message.transferConfigs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.verify(message.transferConfigs[i]); + if (error) + return "transferConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} ListTransferConfigsResponse + */ + ListTransferConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse(); + if (object.transferConfigs) { + if (!Array.isArray(object.transferConfigs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.transferConfigs: array expected"); + message.transferConfigs = []; + for (var i = 0; i < object.transferConfigs.length; ++i) { + if (typeof object.transferConfigs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse.transferConfigs: object expected"); + message.transferConfigs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.fromObject(object.transferConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse} message ListTransferConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferConfigs && message.transferConfigs.length) { + object.transferConfigs = []; + for (var j = 0; j < message.transferConfigs.length; ++j) + object.transferConfigs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"; + }; + + return ListTransferConfigsResponse; + })(); + + v1.ListTransferRunsRequest = (function() { + + /** + * Properties of a ListTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferRunsRequest + * @property {string|null} [parent] ListTransferRunsRequest parent + * @property {Array.|null} [states] ListTransferRunsRequest states + * @property {string|null} [pageToken] ListTransferRunsRequest pageToken + * @property {number|null} [pageSize] ListTransferRunsRequest pageSize + * @property {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt|null} [runAttempt] ListTransferRunsRequest runAttempt + */ + + /** + * Constructs a new ListTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferRunsRequest. + * @implements IListTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest=} [properties] Properties to set + */ + function ListTransferRunsRequest(properties) { + this.states = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.parent = ""; + + /** + * ListTransferRunsRequest states. + * @member {Array.} states + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.states = $util.emptyArray; + + /** + * ListTransferRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.pageToken = ""; + + /** + * ListTransferRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.pageSize = 0; + + /** + * ListTransferRunsRequest runAttempt. + * @member {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} runAttempt + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + */ + ListTransferRunsRequest.prototype.runAttempt = 0; + + /** + * Creates a new ListTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest instance + */ + ListTransferRunsRequest.create = function create(properties) { + return new ListTransferRunsRequest(properties); + }; + + /** + * Encodes the specified ListTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} message ListTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsRequest.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.states != null && message.states.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.states.length; ++i) + writer.int32(message.states[i]); + writer.ldelim(); + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.runAttempt != null && Object.hasOwnProperty.call(message, "runAttempt")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.runAttempt); + return writer; + }; + + /** + * Encodes the specified ListTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest} message ListTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.states && message.states.length)) + message.states = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.states.push(reader.int32()); + } else + message.states.push(reader.int32()); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.runAttempt = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferRunsRequest.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.states != null && message.hasOwnProperty("states")) { + if (!Array.isArray(message.states)) + return "states: array expected"; + for (var i = 0; i < message.states.length; ++i) + switch (message.states[i]) { + default: + return "states: enum value[] expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.runAttempt != null && message.hasOwnProperty("runAttempt")) + switch (message.runAttempt) { + default: + return "runAttempt: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ListTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} ListTransferRunsRequest + */ + ListTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.states) { + if (!Array.isArray(object.states)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.states: array expected"); + message.states = []; + for (var i = 0; i < object.states.length; ++i) + switch (object.states[i]) { + default: + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.states[i] = 0; + break; + case "PENDING": + case 2: + message.states[i] = 2; + break; + case "RUNNING": + case 3: + message.states[i] = 3; + break; + case "SUCCEEDED": + case 4: + message.states[i] = 4; + break; + case "FAILED": + case 5: + message.states[i] = 5; + break; + case "CANCELLED": + case 6: + message.states[i] = 6; + break; + } + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + switch (object.runAttempt) { + case "RUN_ATTEMPT_UNSPECIFIED": + case 0: + message.runAttempt = 0; + break; + case "LATEST": + case 1: + message.runAttempt = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest} message ListTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.states = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.runAttempt = options.enums === String ? "RUN_ATTEMPT_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.states && message.states.length) { + object.states = []; + for (var j = 0; j < message.states.length; ++j) + object.states[j] = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.states[j]] : message.states[j]; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.runAttempt != null && message.hasOwnProperty("runAttempt")) + object.runAttempt = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt[message.runAttempt] : message.runAttempt; + return object; + }; + + /** + * Converts this ListTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"; + }; + + /** + * RunAttempt enum. + * @name google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt + * @enum {number} + * @property {number} RUN_ATTEMPT_UNSPECIFIED=0 RUN_ATTEMPT_UNSPECIFIED value + * @property {number} LATEST=1 LATEST value + */ + ListTransferRunsRequest.RunAttempt = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RUN_ATTEMPT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LATEST"] = 1; + return values; + })(); + + return ListTransferRunsRequest; + })(); + + v1.ListTransferRunsResponse = (function() { + + /** + * Properties of a ListTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferRunsResponse + * @property {Array.|null} [transferRuns] ListTransferRunsResponse transferRuns + * @property {string|null} [nextPageToken] ListTransferRunsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferRunsResponse. + * @implements IListTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse=} [properties] Properties to set + */ + function ListTransferRunsResponse(properties) { + this.transferRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferRunsResponse transferRuns. + * @member {Array.} transferRuns + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + */ + ListTransferRunsResponse.prototype.transferRuns = $util.emptyArray; + + /** + * ListTransferRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + */ + ListTransferRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse instance + */ + ListTransferRunsResponse.create = function create(properties) { + return new ListTransferRunsResponse(properties); + }; + + /** + * Encodes the specified ListTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse} message ListTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferRuns != null && message.transferRuns.length) + for (var i = 0; i < message.transferRuns.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.transferRuns[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 ListTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse} message ListTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferRuns && message.transferRuns.length)) + message.transferRuns = []; + message.transferRuns.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferRuns != null && message.hasOwnProperty("transferRuns")) { + if (!Array.isArray(message.transferRuns)) + return "transferRuns: array expected"; + for (var i = 0; i < message.transferRuns.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.transferRuns[i]); + if (error) + return "transferRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} ListTransferRunsResponse + */ + ListTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse(); + if (object.transferRuns) { + if (!Array.isArray(object.transferRuns)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.transferRuns: array expected"); + message.transferRuns = []; + for (var i = 0; i < object.transferRuns.length; ++i) { + if (typeof object.transferRuns[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse.transferRuns: object expected"); + message.transferRuns[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.transferRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse} message ListTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferRuns && message.transferRuns.length) { + object.transferRuns = []; + for (var j = 0; j < message.transferRuns.length; ++j) + object.transferRuns[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.transferRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"; + }; + + return ListTransferRunsResponse; + })(); + + v1.ListTransferLogsRequest = (function() { + + /** + * Properties of a ListTransferLogsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferLogsRequest + * @property {string|null} [parent] ListTransferLogsRequest parent + * @property {string|null} [pageToken] ListTransferLogsRequest pageToken + * @property {number|null} [pageSize] ListTransferLogsRequest pageSize + * @property {Array.|null} [messageTypes] ListTransferLogsRequest messageTypes + */ + + /** + * Constructs a new ListTransferLogsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferLogsRequest. + * @implements IListTransferLogsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest=} [properties] Properties to set + */ + function ListTransferLogsRequest(properties) { + this.messageTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferLogsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.parent = ""; + + /** + * ListTransferLogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.pageToken = ""; + + /** + * ListTransferLogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.pageSize = 0; + + /** + * ListTransferLogsRequest messageTypes. + * @member {Array.} messageTypes + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + */ + ListTransferLogsRequest.prototype.messageTypes = $util.emptyArray; + + /** + * Creates a new ListTransferLogsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest instance + */ + ListTransferLogsRequest.create = function create(properties) { + return new ListTransferLogsRequest(properties); + }; + + /** + * Encodes the specified ListTransferLogsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} message ListTransferLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.messageTypes != null && message.messageTypes.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.messageTypes.length; ++i) + writer.int32(message.messageTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ListTransferLogsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest} message ListTransferLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + if (!(message.messageTypes && message.messageTypes.length)) + message.messageTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.messageTypes.push(reader.int32()); + } else + message.messageTypes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferLogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferLogsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferLogsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.messageTypes != null && message.hasOwnProperty("messageTypes")) { + if (!Array.isArray(message.messageTypes)) + return "messageTypes: array expected"; + for (var i = 0; i < message.messageTypes.length; ++i) + switch (message.messageTypes[i]) { + default: + return "messageTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a ListTransferLogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} ListTransferLogsRequest + */ + ListTransferLogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.messageTypes) { + if (!Array.isArray(object.messageTypes)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest.messageTypes: array expected"); + message.messageTypes = []; + for (var i = 0; i < object.messageTypes.length; ++i) + switch (object.messageTypes[i]) { + default: + case "MESSAGE_SEVERITY_UNSPECIFIED": + case 0: + message.messageTypes[i] = 0; + break; + case "INFO": + case 1: + message.messageTypes[i] = 1; + break; + case "WARNING": + case 2: + message.messageTypes[i] = 2; + break; + case "ERROR": + case 3: + message.messageTypes[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ListTransferLogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest} message ListTransferLogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferLogsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messageTypes = []; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.messageTypes && message.messageTypes.length) { + object.messageTypes = []; + for (var j = 0; j < message.messageTypes.length; ++j) + object.messageTypes[j] = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[message.messageTypes[j]] : message.messageTypes[j]; + } + return object; + }; + + /** + * Converts this ListTransferLogsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferLogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferLogsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferLogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"; + }; + + return ListTransferLogsRequest; + })(); + + v1.ListTransferLogsResponse = (function() { + + /** + * Properties of a ListTransferLogsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IListTransferLogsResponse + * @property {Array.|null} [transferMessages] ListTransferLogsResponse transferMessages + * @property {string|null} [nextPageToken] ListTransferLogsResponse nextPageToken + */ + + /** + * Constructs a new ListTransferLogsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ListTransferLogsResponse. + * @implements IListTransferLogsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse=} [properties] Properties to set + */ + function ListTransferLogsResponse(properties) { + this.transferMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferLogsResponse transferMessages. + * @member {Array.} transferMessages + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + */ + ListTransferLogsResponse.prototype.transferMessages = $util.emptyArray; + + /** + * ListTransferLogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + */ + ListTransferLogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferLogsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse instance + */ + ListTransferLogsResponse.create = function create(properties) { + return new ListTransferLogsResponse(properties); + }; + + /** + * Encodes the specified ListTransferLogsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse} message ListTransferLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferMessages != null && message.transferMessages.length) + for (var i = 0; i < message.transferMessages.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.encode(message.transferMessages[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 ListTransferLogsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse} message ListTransferLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferLogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferMessages && message.transferMessages.length)) + message.transferMessages = []; + message.transferMessages.push($root.google.cloud.bigquery.datatransfer.v1.TransferMessage.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferLogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferLogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferLogsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferLogsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferMessages != null && message.hasOwnProperty("transferMessages")) { + if (!Array.isArray(message.transferMessages)) + return "transferMessages: array expected"; + for (var i = 0; i < message.transferMessages.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.verify(message.transferMessages[i]); + if (error) + return "transferMessages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferLogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} ListTransferLogsResponse + */ + ListTransferLogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse(); + if (object.transferMessages) { + if (!Array.isArray(object.transferMessages)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.transferMessages: array expected"); + message.transferMessages = []; + for (var i = 0; i < object.transferMessages.length; ++i) { + if (typeof object.transferMessages[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse.transferMessages: object expected"); + message.transferMessages[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.fromObject(object.transferMessages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferLogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse} message ListTransferLogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferLogsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferMessages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferMessages && message.transferMessages.length) { + object.transferMessages = []; + for (var j = 0; j < message.transferMessages.length; ++j) + object.transferMessages[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.toObject(message.transferMessages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferLogsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferLogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferLogsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferLogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"; + }; + + return ListTransferLogsResponse; + })(); + + v1.CheckValidCredsRequest = (function() { + + /** + * Properties of a CheckValidCredsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICheckValidCredsRequest + * @property {string|null} [name] CheckValidCredsRequest name + */ + + /** + * Constructs a new CheckValidCredsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CheckValidCredsRequest. + * @implements ICheckValidCredsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest=} [properties] Properties to set + */ + function CheckValidCredsRequest(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]]; + } + + /** + * CheckValidCredsRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @instance + */ + CheckValidCredsRequest.prototype.name = ""; + + /** + * Creates a new CheckValidCredsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest instance + */ + CheckValidCredsRequest.create = function create(properties) { + return new CheckValidCredsRequest(properties); + }; + + /** + * Encodes the specified CheckValidCredsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} message CheckValidCredsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsRequest.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 CheckValidCredsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest} message CheckValidCredsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckValidCredsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest(); + 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 CheckValidCredsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckValidCredsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckValidCredsRequest.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 CheckValidCredsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} CheckValidCredsRequest + */ + CheckValidCredsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CheckValidCredsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest} message CheckValidCredsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckValidCredsRequest.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 CheckValidCredsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @instance + * @returns {Object.} JSON object + */ + CheckValidCredsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckValidCredsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckValidCredsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"; + }; + + return CheckValidCredsRequest; + })(); + + v1.CheckValidCredsResponse = (function() { + + /** + * Properties of a CheckValidCredsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ICheckValidCredsResponse + * @property {boolean|null} [hasValidCreds] CheckValidCredsResponse hasValidCreds + */ + + /** + * Constructs a new CheckValidCredsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a CheckValidCredsResponse. + * @implements ICheckValidCredsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse=} [properties] Properties to set + */ + function CheckValidCredsResponse(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]]; + } + + /** + * CheckValidCredsResponse hasValidCreds. + * @member {boolean} hasValidCreds + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @instance + */ + CheckValidCredsResponse.prototype.hasValidCreds = false; + + /** + * Creates a new CheckValidCredsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse instance + */ + CheckValidCredsResponse.create = function create(properties) { + return new CheckValidCredsResponse(properties); + }; + + /** + * Encodes the specified CheckValidCredsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse} message CheckValidCredsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hasValidCreds != null && Object.hasOwnProperty.call(message, "hasValidCreds")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.hasValidCreds); + return writer; + }; + + /** + * Encodes the specified CheckValidCredsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse} message CheckValidCredsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckValidCredsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hasValidCreds = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckValidCredsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckValidCredsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckValidCredsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckValidCredsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hasValidCreds != null && message.hasOwnProperty("hasValidCreds")) + if (typeof message.hasValidCreds !== "boolean") + return "hasValidCreds: boolean expected"; + return null; + }; + + /** + * Creates a CheckValidCredsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} CheckValidCredsResponse + */ + CheckValidCredsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse(); + if (object.hasValidCreds != null) + message.hasValidCreds = Boolean(object.hasValidCreds); + return message; + }; + + /** + * Creates a plain object from a CheckValidCredsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse} message CheckValidCredsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckValidCredsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.hasValidCreds = false; + if (message.hasValidCreds != null && message.hasOwnProperty("hasValidCreds")) + object.hasValidCreds = message.hasValidCreds; + return object; + }; + + /** + * Converts this CheckValidCredsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @instance + * @returns {Object.} JSON object + */ + CheckValidCredsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckValidCredsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckValidCredsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"; + }; + + return CheckValidCredsResponse; + })(); + + v1.ScheduleTransferRunsRequest = (function() { + + /** + * Properties of a ScheduleTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleTransferRunsRequest + * @property {string|null} [parent] ScheduleTransferRunsRequest parent + * @property {google.protobuf.ITimestamp|null} [startTime] ScheduleTransferRunsRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScheduleTransferRunsRequest endTime + */ + + /** + * Constructs a new ScheduleTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleTransferRunsRequest. + * @implements IScheduleTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest=} [properties] Properties to set + */ + function ScheduleTransferRunsRequest(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]]; + } + + /** + * ScheduleTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.parent = ""; + + /** + * ScheduleTransferRunsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.startTime = null; + + /** + * ScheduleTransferRunsRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + */ + ScheduleTransferRunsRequest.prototype.endTime = null; + + /** + * Creates a new ScheduleTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest instance + */ + ScheduleTransferRunsRequest.create = function create(properties) { + return new ScheduleTransferRunsRequest(properties); + }; + + /** + * Encodes the specified ScheduleTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} message ScheduleTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsRequest.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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScheduleTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest} message ScheduleTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleTransferRunsRequest.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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a ScheduleTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} ScheduleTransferRunsRequest + */ + ScheduleTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a ScheduleTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest} message ScheduleTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.startTime = null; + object.endTime = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this ScheduleTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ScheduleTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"; + }; + + return ScheduleTransferRunsRequest; + })(); + + v1.ScheduleTransferRunsResponse = (function() { + + /** + * Properties of a ScheduleTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleTransferRunsResponse + * @property {Array.|null} [runs] ScheduleTransferRunsResponse runs + */ + + /** + * Constructs a new ScheduleTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleTransferRunsResponse. + * @implements IScheduleTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse=} [properties] Properties to set + */ + function ScheduleTransferRunsResponse(properties) { + this.runs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduleTransferRunsResponse runs. + * @member {Array.} runs + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @instance + */ + ScheduleTransferRunsResponse.prototype.runs = $util.emptyArray; + + /** + * Creates a new ScheduleTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse instance + */ + ScheduleTransferRunsResponse.create = function create(properties) { + return new ScheduleTransferRunsResponse(properties); + }; + + /** + * Encodes the specified ScheduleTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse} message ScheduleTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runs != null && message.runs.length) + for (var i = 0; i < message.runs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.runs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScheduleTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse} message ScheduleTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runs && message.runs.length)) + message.runs = []; + message.runs.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runs != null && message.hasOwnProperty("runs")) { + if (!Array.isArray(message.runs)) + return "runs: array expected"; + for (var i = 0; i < message.runs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.runs[i]); + if (error) + return "runs." + error; + } + } + return null; + }; + + /** + * Creates a ScheduleTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} ScheduleTransferRunsResponse + */ + ScheduleTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse(); + if (object.runs) { + if (!Array.isArray(object.runs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.runs: array expected"); + message.runs = []; + for (var i = 0; i < object.runs.length; ++i) { + if (typeof object.runs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse.runs: object expected"); + message.runs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.runs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScheduleTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse} message ScheduleTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runs = []; + if (message.runs && message.runs.length) { + object.runs = []; + for (var j = 0; j < message.runs.length; ++j) + object.runs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.runs[j], options); + } + return object; + }; + + /** + * Converts this ScheduleTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ScheduleTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"; + }; + + return ScheduleTransferRunsResponse; + })(); + + v1.StartManualTransferRunsRequest = (function() { + + /** + * Properties of a StartManualTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IStartManualTransferRunsRequest + * @property {string|null} [parent] StartManualTransferRunsRequest parent + * @property {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null} [requestedTimeRange] StartManualTransferRunsRequest requestedTimeRange + * @property {google.protobuf.ITimestamp|null} [requestedRunTime] StartManualTransferRunsRequest requestedRunTime + */ + + /** + * Constructs a new StartManualTransferRunsRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a StartManualTransferRunsRequest. + * @implements IStartManualTransferRunsRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest=} [properties] Properties to set + */ + function StartManualTransferRunsRequest(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]]; + } + + /** + * StartManualTransferRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.parent = ""; + + /** + * StartManualTransferRunsRequest requestedTimeRange. + * @member {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange|null|undefined} requestedTimeRange + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.requestedTimeRange = null; + + /** + * StartManualTransferRunsRequest requestedRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} requestedRunTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + StartManualTransferRunsRequest.prototype.requestedRunTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StartManualTransferRunsRequest time. + * @member {"requestedTimeRange"|"requestedRunTime"|undefined} time + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + */ + Object.defineProperty(StartManualTransferRunsRequest.prototype, "time", { + get: $util.oneOfGetter($oneOfFields = ["requestedTimeRange", "requestedRunTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartManualTransferRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest instance + */ + StartManualTransferRunsRequest.create = function create(properties) { + return new StartManualTransferRunsRequest(properties); + }; + + /** + * Encodes the specified StartManualTransferRunsRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} message StartManualTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsRequest.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.requestedTimeRange != null && Object.hasOwnProperty.call(message, "requestedTimeRange")) + $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.encode(message.requestedTimeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestedRunTime != null && Object.hasOwnProperty.call(message, "requestedRunTime")) + $root.google.protobuf.Timestamp.encode(message.requestedRunTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartManualTransferRunsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest} message StartManualTransferRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestedRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartManualTransferRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartManualTransferRunsRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartManualTransferRunsRequest.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.requestedTimeRange != null && message.hasOwnProperty("requestedTimeRange")) { + properties.time = 1; + { + var error = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify(message.requestedTimeRange); + if (error) + return "requestedTimeRange." + error; + } + } + if (message.requestedRunTime != null && message.hasOwnProperty("requestedRunTime")) { + if (properties.time === 1) + return "time: multiple values"; + properties.time = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.requestedRunTime); + if (error) + return "requestedRunTime." + error; + } + } + return null; + }; + + /** + * Creates a StartManualTransferRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} StartManualTransferRunsRequest + */ + StartManualTransferRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestedTimeRange != null) { + if (typeof object.requestedTimeRange !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requestedTimeRange: object expected"); + message.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.fromObject(object.requestedTimeRange); + } + if (object.requestedRunTime != null) { + if (typeof object.requestedRunTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requestedRunTime: object expected"); + message.requestedRunTime = $root.google.protobuf.Timestamp.fromObject(object.requestedRunTime); + } + return message; + }; + + /** + * Creates a plain object from a StartManualTransferRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest} message StartManualTransferRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartManualTransferRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requestedTimeRange != null && message.hasOwnProperty("requestedTimeRange")) { + object.requestedTimeRange = $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.toObject(message.requestedTimeRange, options); + if (options.oneofs) + object.time = "requestedTimeRange"; + } + if (message.requestedRunTime != null && message.hasOwnProperty("requestedRunTime")) { + object.requestedRunTime = $root.google.protobuf.Timestamp.toObject(message.requestedRunTime, options); + if (options.oneofs) + object.time = "requestedRunTime"; + } + return object; + }; + + /** + * Converts this StartManualTransferRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @instance + * @returns {Object.} JSON object + */ + StartManualTransferRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartManualTransferRunsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartManualTransferRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"; + }; + + StartManualTransferRunsRequest.TimeRange = (function() { + + /** + * Properties of a TimeRange. + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @interface ITimeRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + */ + + /** + * Constructs a new TimeRange. + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest + * @classdesc Represents a TimeRange. + * @implements ITimeRange + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange=} [properties] Properties to set + */ + function TimeRange(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]]; + } + + /** + * TimeRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + */ + TimeRange.prototype.startTime = null; + + /** + * TimeRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + */ + TimeRange.prototype.endTime = null; + + /** + * Creates a new TimeRange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange instance + */ + TimeRange.create = function create(properties) { + return new TimeRange(properties); + }; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeRange message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} TimeRange + */ + TimeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} message TimeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeRange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @instance + * @returns {Object.} JSON object + */ + TimeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeRange + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"; + }; + + return TimeRange; + })(); + + return StartManualTransferRunsRequest; + })(); + + v1.StartManualTransferRunsResponse = (function() { + + /** + * Properties of a StartManualTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IStartManualTransferRunsResponse + * @property {Array.|null} [runs] StartManualTransferRunsResponse runs + */ + + /** + * Constructs a new StartManualTransferRunsResponse. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a StartManualTransferRunsResponse. + * @implements IStartManualTransferRunsResponse + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse=} [properties] Properties to set + */ + function StartManualTransferRunsResponse(properties) { + this.runs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartManualTransferRunsResponse runs. + * @member {Array.} runs + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @instance + */ + StartManualTransferRunsResponse.prototype.runs = $util.emptyArray; + + /** + * Creates a new StartManualTransferRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse instance + */ + StartManualTransferRunsResponse.create = function create(properties) { + return new StartManualTransferRunsResponse(properties); + }; + + /** + * Encodes the specified StartManualTransferRunsResponse message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse} message StartManualTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runs != null && message.runs.length) + for (var i = 0; i < message.runs.length; ++i) + $root.google.cloud.bigquery.datatransfer.v1.TransferRun.encode(message.runs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartManualTransferRunsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse} message StartManualTransferRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartManualTransferRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runs && message.runs.length)) + message.runs = []; + message.runs.push($root.google.cloud.bigquery.datatransfer.v1.TransferRun.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartManualTransferRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartManualTransferRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartManualTransferRunsResponse message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartManualTransferRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runs != null && message.hasOwnProperty("runs")) { + if (!Array.isArray(message.runs)) + return "runs: array expected"; + for (var i = 0; i < message.runs.length; ++i) { + var error = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.verify(message.runs[i]); + if (error) + return "runs." + error; + } + } + return null; + }; + + /** + * Creates a StartManualTransferRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} StartManualTransferRunsResponse + */ + StartManualTransferRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse(); + if (object.runs) { + if (!Array.isArray(object.runs)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.runs: array expected"); + message.runs = []; + for (var i = 0; i < object.runs.length; ++i) { + if (typeof object.runs[i] !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse.runs: object expected"); + message.runs[i] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.fromObject(object.runs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StartManualTransferRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse} message StartManualTransferRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartManualTransferRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runs = []; + if (message.runs && message.runs.length) { + object.runs = []; + for (var j = 0; j < message.runs.length; ++j) + object.runs[j] = $root.google.cloud.bigquery.datatransfer.v1.TransferRun.toObject(message.runs[j], options); + } + return object; + }; + + /** + * Converts this StartManualTransferRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @instance + * @returns {Object.} JSON object + */ + StartManualTransferRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartManualTransferRunsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartManualTransferRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"; + }; + + return StartManualTransferRunsResponse; + })(); + + v1.EnrollDataSourcesRequest = (function() { + + /** + * Properties of an EnrollDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IEnrollDataSourcesRequest + * @property {string|null} [name] EnrollDataSourcesRequest name + * @property {Array.|null} [dataSourceIds] EnrollDataSourcesRequest dataSourceIds + */ + + /** + * Constructs a new EnrollDataSourcesRequest. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an EnrollDataSourcesRequest. + * @implements IEnrollDataSourcesRequest + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest=} [properties] Properties to set + */ + function EnrollDataSourcesRequest(properties) { + this.dataSourceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnrollDataSourcesRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + */ + EnrollDataSourcesRequest.prototype.name = ""; + + /** + * EnrollDataSourcesRequest dataSourceIds. + * @member {Array.} dataSourceIds + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + */ + EnrollDataSourcesRequest.prototype.dataSourceIds = $util.emptyArray; + + /** + * Creates a new EnrollDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest instance + */ + EnrollDataSourcesRequest.create = function create(properties) { + return new EnrollDataSourcesRequest(properties); + }; + + /** + * Encodes the specified EnrollDataSourcesRequest message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} message EnrollDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnrollDataSourcesRequest.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.dataSourceIds != null && message.dataSourceIds.length) + for (var i = 0; i < message.dataSourceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSourceIds[i]); + return writer; + }; + + /** + * Encodes the specified EnrollDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest} message EnrollDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnrollDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnrollDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.dataSourceIds && message.dataSourceIds.length)) + message.dataSourceIds = []; + message.dataSourceIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnrollDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnrollDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnrollDataSourcesRequest message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnrollDataSourcesRequest.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.dataSourceIds != null && message.hasOwnProperty("dataSourceIds")) { + if (!Array.isArray(message.dataSourceIds)) + return "dataSourceIds: array expected"; + for (var i = 0; i < message.dataSourceIds.length; ++i) + if (!$util.isString(message.dataSourceIds[i])) + return "dataSourceIds: string[] expected"; + } + return null; + }; + + /** + * Creates an EnrollDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} EnrollDataSourcesRequest + */ + EnrollDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.dataSourceIds) { + if (!Array.isArray(object.dataSourceIds)) + throw TypeError(".google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest.dataSourceIds: array expected"); + message.dataSourceIds = []; + for (var i = 0; i < object.dataSourceIds.length; ++i) + message.dataSourceIds[i] = String(object.dataSourceIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnrollDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest} message EnrollDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnrollDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSourceIds = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSourceIds && message.dataSourceIds.length) { + object.dataSourceIds = []; + for (var j = 0; j < message.dataSourceIds.length; ++j) + object.dataSourceIds[j] = message.dataSourceIds[j]; + } + return object; + }; + + /** + * Converts this EnrollDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + EnrollDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnrollDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnrollDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"; + }; + + return EnrollDataSourcesRequest; + })(); + + /** + * TransferType enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferType + * @enum {number} + * @property {number} TRANSFER_TYPE_UNSPECIFIED=0 TRANSFER_TYPE_UNSPECIFIED value + * @property {number} BATCH=1 BATCH value + * @property {number} STREAMING=2 STREAMING value + */ + v1.TransferType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BATCH"] = 1; + values[valuesById[2] = "STREAMING"] = 2; + return values; + })(); + + /** + * TransferState enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferState + * @enum {number} + * @property {number} TRANSFER_STATE_UNSPECIFIED=0 TRANSFER_STATE_UNSPECIFIED value + * @property {number} PENDING=2 PENDING value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} CANCELLED=6 CANCELLED value + */ + v1.TransferState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFER_STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "PENDING"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "CANCELLED"] = 6; + return values; + })(); + + v1.EmailPreferences = (function() { + + /** + * Properties of an EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IEmailPreferences + * @property {boolean|null} [enableFailureEmail] EmailPreferences enableFailureEmail + */ + + /** + * Constructs a new EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an EmailPreferences. + * @implements IEmailPreferences + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + */ + function EmailPreferences(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]]; + } + + /** + * EmailPreferences enableFailureEmail. + * @member {boolean} enableFailureEmail + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + */ + EmailPreferences.prototype.enableFailureEmail = false; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences instance + */ + EmailPreferences.create = function create(properties) { + return new EmailPreferences(properties); + }; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableFailureEmail != null && Object.hasOwnProperty.call(message, "enableFailureEmail")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableFailureEmail); + return writer; + }; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableFailureEmail = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmailPreferences message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmailPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + if (typeof message.enableFailureEmail !== "boolean") + return "enableFailureEmail: boolean expected"; + return null; + }; + + /** + * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + */ + EmailPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + if (object.enableFailureEmail != null) + message.enableFailureEmail = Boolean(object.enableFailureEmail); + return message; + }; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.EmailPreferences} message EmailPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmailPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFailureEmail = false; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + object.enableFailureEmail = message.enableFailureEmail; + return object; + }; + + /** + * Converts this EmailPreferences to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + * @returns {Object.} JSON object + */ + EmailPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmailPreferences + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmailPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.EmailPreferences"; + }; + + return EmailPreferences; + })(); + + v1.ScheduleOptions = (function() { + + /** + * Properties of a ScheduleOptions. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IScheduleOptions + * @property {boolean|null} [disableAutoScheduling] ScheduleOptions disableAutoScheduling + * @property {google.protobuf.ITimestamp|null} [startTime] ScheduleOptions startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScheduleOptions endTime + */ + + /** + * Constructs a new ScheduleOptions. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a ScheduleOptions. + * @implements IScheduleOptions + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions=} [properties] Properties to set + */ + function ScheduleOptions(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]]; + } + + /** + * ScheduleOptions disableAutoScheduling. + * @member {boolean} disableAutoScheduling + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.disableAutoScheduling = false; + + /** + * ScheduleOptions startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.startTime = null; + + /** + * ScheduleOptions endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + */ + ScheduleOptions.prototype.endTime = null; + + /** + * Creates a new ScheduleOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions instance + */ + ScheduleOptions.create = function create(properties) { + return new ScheduleOptions(properties); + }; + + /** + * Encodes the specified ScheduleOptions message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions} message ScheduleOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.disableAutoScheduling != null && Object.hasOwnProperty.call(message, "disableAutoScheduling")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disableAutoScheduling); + return writer; + }; + + /** + * Encodes the specified ScheduleOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IScheduleOptions} message ScheduleOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.disableAutoScheduling = reader.bool(); + break; + } + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleOptions message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disableAutoScheduling != null && message.hasOwnProperty("disableAutoScheduling")) + if (typeof message.disableAutoScheduling !== "boolean") + return "disableAutoScheduling: boolean expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a ScheduleOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} ScheduleOptions + */ + ScheduleOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions(); + if (object.disableAutoScheduling != null) + message.disableAutoScheduling = Boolean(object.disableAutoScheduling); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleOptions.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.ScheduleOptions.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a ScheduleOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ScheduleOptions} message ScheduleOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.disableAutoScheduling = false; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.disableAutoScheduling != null && message.hasOwnProperty("disableAutoScheduling")) + object.disableAutoScheduling = message.disableAutoScheduling; + return object; + }; + + /** + * Converts this ScheduleOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @instance + * @returns {Object.} JSON object + */ + ScheduleOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.ScheduleOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"; + }; + + return ScheduleOptions; + })(); + + v1.UserInfo = (function() { + + /** + * Properties of a UserInfo. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IUserInfo + * @property {string|null} [email] UserInfo email + */ + + /** + * Constructs a new UserInfo. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a UserInfo. + * @implements IUserInfo + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo=} [properties] Properties to set + */ + function UserInfo(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]]; + } + + /** + * UserInfo email. + * @member {string|null|undefined} email + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + */ + UserInfo.prototype.email = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UserInfo _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + */ + Object.defineProperty(UserInfo.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo instance + */ + UserInfo.create = function create(properties) { + return new UserInfo(properties); + }; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + return writer; + }; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.UserInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IUserInfo} message UserInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.UserInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserInfo message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + return null; + }; + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.UserInfo} UserInfo + */ + UserInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.UserInfo) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.UserInfo(); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {google.cloud.bigquery.datatransfer.v1.UserInfo} message UserInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + return object; + }; + + /** + * Converts this UserInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @instance + * @returns {Object.} JSON object + */ + UserInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.UserInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.UserInfo"; + }; + + return UserInfo; + })(); + + v1.TransferConfig = (function() { + + /** + * Properties of a TransferConfig. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferConfig + * @property {string|null} [name] TransferConfig name + * @property {string|null} [destinationDatasetId] TransferConfig destinationDatasetId + * @property {string|null} [displayName] TransferConfig displayName + * @property {string|null} [dataSourceId] TransferConfig dataSourceId + * @property {google.protobuf.IStruct|null} [params] TransferConfig params + * @property {string|null} [schedule] TransferConfig schedule + * @property {google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null} [scheduleOptions] TransferConfig scheduleOptions + * @property {number|null} [dataRefreshWindowDays] TransferConfig dataRefreshWindowDays + * @property {boolean|null} [disabled] TransferConfig disabled + * @property {google.protobuf.ITimestamp|null} [updateTime] TransferConfig updateTime + * @property {google.protobuf.ITimestamp|null} [nextRunTime] TransferConfig nextRunTime + * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferConfig state + * @property {number|Long|null} [userId] TransferConfig userId + * @property {string|null} [datasetRegion] TransferConfig datasetRegion + * @property {string|null} [notificationPubsubTopic] TransferConfig notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferConfig emailPreferences + * @property {google.cloud.bigquery.datatransfer.v1.IUserInfo|null} [ownerInfo] TransferConfig ownerInfo + */ + + /** + * Constructs a new TransferConfig. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferConfig. + * @implements ITransferConfig + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig=} [properties] Properties to set + */ + function TransferConfig(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]]; + } + + /** + * TransferConfig name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.name = ""; + + /** + * TransferConfig destinationDatasetId. + * @member {string|null|undefined} destinationDatasetId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.destinationDatasetId = null; + + /** + * TransferConfig displayName. + * @member {string} displayName + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.displayName = ""; + + /** + * TransferConfig dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.dataSourceId = ""; + + /** + * TransferConfig params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.params = null; + + /** + * TransferConfig schedule. + * @member {string} schedule + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.schedule = ""; + + /** + * TransferConfig scheduleOptions. + * @member {google.cloud.bigquery.datatransfer.v1.IScheduleOptions|null|undefined} scheduleOptions + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.scheduleOptions = null; + + /** + * TransferConfig dataRefreshWindowDays. + * @member {number} dataRefreshWindowDays + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.dataRefreshWindowDays = 0; + + /** + * TransferConfig disabled. + * @member {boolean} disabled + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.disabled = false; + + /** + * TransferConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.updateTime = null; + + /** + * TransferConfig nextRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRunTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.nextRunTime = null; + + /** + * TransferConfig state. + * @member {google.cloud.bigquery.datatransfer.v1.TransferState} state + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.state = 0; + + /** + * TransferConfig userId. + * @member {number|Long} userId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferConfig datasetRegion. + * @member {string} datasetRegion + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.datasetRegion = ""; + + /** + * TransferConfig notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.notificationPubsubTopic = ""; + + /** + * TransferConfig emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.emailPreferences = null; + + /** + * TransferConfig ownerInfo. + * @member {google.cloud.bigquery.datatransfer.v1.IUserInfo|null|undefined} ownerInfo + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.ownerInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferConfig destination. + * @member {"destinationDatasetId"|undefined} destination + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + Object.defineProperty(TransferConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationDatasetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferConfig _ownerInfo. + * @member {"ownerInfo"|undefined} _ownerInfo + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + Object.defineProperty(TransferConfig.prototype, "_ownerInfo", { + get: $util.oneOfGetter($oneOfFields = ["ownerInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferConfig instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig instance + */ + TransferConfig.create = function create(properties) { + return new TransferConfig(properties); + }; + + /** + * Encodes the specified TransferConfig message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig} message TransferConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferConfig.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.destinationDatasetId != null && Object.hasOwnProperty.call(message, "destinationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationDatasetId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataSourceId); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.schedule); + if (message.nextRunTime != null && Object.hasOwnProperty.call(message, "nextRunTime")) + $root.google.protobuf.Timestamp.encode(message.nextRunTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); + if (message.dataRefreshWindowDays != null && Object.hasOwnProperty.call(message, "dataRefreshWindowDays")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.dataRefreshWindowDays); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.disabled); + if (message.datasetRegion != null && Object.hasOwnProperty.call(message, "datasetRegion")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.datasetRegion); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.scheduleOptions != null && Object.hasOwnProperty.call(message, "scheduleOptions")) + $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.encode(message.scheduleOptions, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.ownerInfo != null && Object.hasOwnProperty.call(message, "ownerInfo")) + $root.google.cloud.bigquery.datatransfer.v1.UserInfo.encode(message.ownerInfo, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferConfig} message TransferConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.destinationDatasetId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 5: { + message.dataSourceId = reader.string(); + break; + } + case 9: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.schedule = reader.string(); + break; + } + case 24: { + message.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.decode(reader, reader.uint32()); + break; + } + case 12: { + message.dataRefreshWindowDays = reader.int32(); + break; + } + case 13: { + message.disabled = reader.bool(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.nextRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.userId = reader.int64(); + break; + } + case 14: { + message.datasetRegion = reader.string(); + break; + } + case 15: { + message.notificationPubsubTopic = reader.string(); + break; + } + case 18: { + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; + } + case 27: { + message.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferConfig message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + properties.destination = 1; + if (!$util.isString(message.destinationDatasetId)) + return "destinationDatasetId: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.verify(message.scheduleOptions); + if (error) + return "scheduleOptions." + error; + } + if (message.dataRefreshWindowDays != null && message.hasOwnProperty("dataRefreshWindowDays")) + if (!$util.isInteger(message.dataRefreshWindowDays)) + return "dataRefreshWindowDays: integer expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRunTime); + if (error) + return "nextRunTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) + return "userId: integer|Long expected"; + if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) + if (!$util.isString(message.datasetRegion)) + return "datasetRegion: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } + if (message.ownerInfo != null && message.hasOwnProperty("ownerInfo")) { + properties._ownerInfo = 1; + { + var error = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.verify(message.ownerInfo); + if (error) + return "ownerInfo." + error; + } + } + return null; + }; + + /** + * Creates a TransferConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferConfig} TransferConfig + */ + TransferConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferConfig) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationDatasetId != null) + message.destinationDatasetId = String(object.destinationDatasetId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.scheduleOptions != null) { + if (typeof object.scheduleOptions !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.scheduleOptions: object expected"); + message.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.fromObject(object.scheduleOptions); + } + if (object.dataRefreshWindowDays != null) + message.dataRefreshWindowDays = object.dataRefreshWindowDays | 0; + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.nextRunTime != null) { + if (typeof object.nextRunTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.nextRunTime: object expected"); + message.nextRunTime = $root.google.protobuf.Timestamp.fromObject(object.nextRunTime); + } + switch (object.state) { + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.userId != null) + if ($util.Long) + (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; + else if (typeof object.userId === "string") + message.userId = parseInt(object.userId, 10); + else if (typeof object.userId === "number") + message.userId = object.userId; + else if (typeof object.userId === "object") + message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); + if (object.datasetRegion != null) + message.datasetRegion = String(object.datasetRegion); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } + if (object.ownerInfo != null) { + if (typeof object.ownerInfo !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.ownerInfo: object expected"); + message.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.fromObject(object.ownerInfo); + } + return message; + }; + + /** + * Creates a plain object from a TransferConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} message TransferConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.updateTime = null; + object.dataSourceId = ""; + object.schedule = ""; + object.nextRunTime = null; + object.params = null; + object.state = options.enums === String ? "TRANSFER_STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userId = options.longs === String ? "0" : 0; + object.dataRefreshWindowDays = 0; + object.disabled = false; + object.datasetRegion = ""; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; + object.scheduleOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + object.destinationDatasetId = message.destinationDatasetId; + if (options.oneofs) + object.destination = "destinationDatasetId"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = message.schedule; + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) + object.nextRunTime = $root.google.protobuf.Timestamp.toObject(message.nextRunTime, options); + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.state] : message.state; + if (message.userId != null && message.hasOwnProperty("userId")) + if (typeof message.userId === "number") + object.userId = options.longs === String ? String(message.userId) : message.userId; + else + object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; + if (message.dataRefreshWindowDays != null && message.hasOwnProperty("dataRefreshWindowDays")) + object.dataRefreshWindowDays = message.dataRefreshWindowDays; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) + object.datasetRegion = message.datasetRegion; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); + if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) + object.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.toObject(message.scheduleOptions, options); + if (message.ownerInfo != null && message.hasOwnProperty("ownerInfo")) { + object.ownerInfo = $root.google.cloud.bigquery.datatransfer.v1.UserInfo.toObject(message.ownerInfo, options); + if (options.oneofs) + object._ownerInfo = "ownerInfo"; + } + return object; + }; + + /** + * Converts this TransferConfig to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + * @returns {Object.} JSON object + */ + TransferConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferConfig + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferConfig"; + }; + + return TransferConfig; + })(); + + v1.TransferRun = (function() { + + /** + * Properties of a TransferRun. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferRun + * @property {string|null} [name] TransferRun name + * @property {google.protobuf.ITimestamp|null} [scheduleTime] TransferRun scheduleTime + * @property {google.protobuf.ITimestamp|null} [runTime] TransferRun runTime + * @property {google.rpc.IStatus|null} [errorStatus] TransferRun errorStatus + * @property {google.protobuf.ITimestamp|null} [startTime] TransferRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TransferRun endTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TransferRun updateTime + * @property {google.protobuf.IStruct|null} [params] TransferRun params + * @property {string|null} [destinationDatasetId] TransferRun destinationDatasetId + * @property {string|null} [dataSourceId] TransferRun dataSourceId + * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferRun state + * @property {number|Long|null} [userId] TransferRun userId + * @property {string|null} [schedule] TransferRun schedule + * @property {string|null} [notificationPubsubTopic] TransferRun notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferRun emailPreferences + */ + + /** + * Constructs a new TransferRun. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferRun. + * @implements ITransferRun + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun=} [properties] Properties to set + */ + function TransferRun(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]]; + } + + /** + * TransferRun name. + * @member {string} name + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.name = ""; + + /** + * TransferRun scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.scheduleTime = null; + + /** + * TransferRun runTime. + * @member {google.protobuf.ITimestamp|null|undefined} runTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.runTime = null; + + /** + * TransferRun errorStatus. + * @member {google.rpc.IStatus|null|undefined} errorStatus + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.errorStatus = null; + + /** + * TransferRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.startTime = null; + + /** + * TransferRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.endTime = null; + + /** + * TransferRun updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.updateTime = null; + + /** + * TransferRun params. + * @member {google.protobuf.IStruct|null|undefined} params + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.params = null; + + /** + * TransferRun destinationDatasetId. + * @member {string|null|undefined} destinationDatasetId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.destinationDatasetId = null; + + /** + * TransferRun dataSourceId. + * @member {string} dataSourceId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.dataSourceId = ""; + + /** + * TransferRun state. + * @member {google.cloud.bigquery.datatransfer.v1.TransferState} state + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.state = 0; + + /** + * TransferRun userId. + * @member {number|Long} userId + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferRun schedule. + * @member {string} schedule + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.schedule = ""; + + /** + * TransferRun notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.notificationPubsubTopic = ""; + + /** + * TransferRun emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.emailPreferences = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferRun destination. + * @member {"destinationDatasetId"|undefined} destination + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + Object.defineProperty(TransferRun.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationDatasetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferRun instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun instance + */ + TransferRun.create = function create(properties) { + return new TransferRun(properties); + }; + + /** + * Encodes the specified TransferRun message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun} message TransferRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRun.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.destinationDatasetId != null && Object.hasOwnProperty.call(message, "destinationDatasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationDatasetId); + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dataSourceId != null && Object.hasOwnProperty.call(message, "dataSourceId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataSourceId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.runTime != null && Object.hasOwnProperty.call(message, "runTime")) + $root.google.protobuf.Timestamp.encode(message.runTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.userId); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.schedule); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferRun} message TransferRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.runTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 21: { + message.errorStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.params = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 2: { + message.destinationDatasetId = reader.string(); + break; + } + case 7: { + message.dataSourceId = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 11: { + message.userId = reader.int64(); + break; + } + case 12: { + message.schedule = reader.string(); + break; + } + case 23: { + message.notificationPubsubTopic = reader.string(); + break; + } + case 25: { + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferRun message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.runTime); + if (error) + return "runTime." + error; + } + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) { + var error = $root.google.rpc.Status.verify(message.errorStatus); + if (error) + return "errorStatus." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + var error = $root.google.protobuf.Struct.verify(message.params); + if (error) + return "params." + error; + } + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + properties.destination = 1; + if (!$util.isString(message.destinationDatasetId)) + return "destinationDatasetId: string expected"; + } + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + if (!$util.isString(message.dataSourceId)) + return "dataSourceId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high))) + return "userId: integer|Long expected"; + if (message.schedule != null && message.hasOwnProperty("schedule")) + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } + return null; + }; + + /** + * Creates a TransferRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferRun} TransferRun + */ + TransferRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferRun) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferRun(); + if (object.name != null) + message.name = String(object.name); + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + if (object.runTime != null) { + if (typeof object.runTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.runTime: object expected"); + message.runTime = $root.google.protobuf.Timestamp.fromObject(object.runTime); + } + if (object.errorStatus != null) { + if (typeof object.errorStatus !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.errorStatus: object expected"); + message.errorStatus = $root.google.rpc.Status.fromObject(object.errorStatus); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.params: object expected"); + message.params = $root.google.protobuf.Struct.fromObject(object.params); + } + if (object.destinationDatasetId != null) + message.destinationDatasetId = String(object.destinationDatasetId); + if (object.dataSourceId != null) + message.dataSourceId = String(object.dataSourceId); + switch (object.state) { + case "TRANSFER_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "CANCELLED": + case 6: + message.state = 6; + break; + } + if (object.userId != null) + if ($util.Long) + (message.userId = $util.Long.fromValue(object.userId)).unsigned = false; + else if (typeof object.userId === "string") + message.userId = parseInt(object.userId, 10); + else if (typeof object.userId === "number") + message.userId = object.userId; + else if (typeof object.userId === "object") + message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } + return message; + }; + + /** + * Creates a plain object from a TransferRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferRun} message TransferRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.scheduleTime = null; + object.startTime = null; + object.endTime = null; + object.updateTime = null; + object.dataSourceId = ""; + object.state = options.enums === String ? "TRANSFER_STATE_UNSPECIFIED" : 0; + object.params = null; + object.runTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.userId = options.longs === String ? "0" : 0; + object.schedule = ""; + object.errorStatus = null; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationDatasetId != null && message.hasOwnProperty("destinationDatasetId")) { + object.destinationDatasetId = message.destinationDatasetId; + if (options.oneofs) + object.destination = "destinationDatasetId"; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.dataSourceId != null && message.hasOwnProperty("dataSourceId")) + object.dataSourceId = message.dataSourceId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferState[message.state] : message.state; + if (message.params != null && message.hasOwnProperty("params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.runTime != null && message.hasOwnProperty("runTime")) + object.runTime = $root.google.protobuf.Timestamp.toObject(message.runTime, options); + if (message.userId != null && message.hasOwnProperty("userId")) + if (typeof message.userId === "number") + object.userId = options.longs === String ? String(message.userId) : message.userId; + else + object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = message.schedule; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = $root.google.rpc.Status.toObject(message.errorStatus, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); + return object; + }; + + /** + * Converts this TransferRun to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + * @returns {Object.} JSON object + */ + TransferRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferRun + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferRun"; + }; + + return TransferRun; + })(); + + v1.TransferMessage = (function() { + + /** + * Properties of a TransferMessage. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface ITransferMessage + * @property {google.protobuf.ITimestamp|null} [messageTime] TransferMessage messageTime + * @property {google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity|null} [severity] TransferMessage severity + * @property {string|null} [messageText] TransferMessage messageText + */ + + /** + * Constructs a new TransferMessage. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents a TransferMessage. + * @implements ITransferMessage + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage=} [properties] Properties to set + */ + function TransferMessage(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]]; + } + + /** + * TransferMessage messageTime. + * @member {google.protobuf.ITimestamp|null|undefined} messageTime + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.messageTime = null; + + /** + * TransferMessage severity. + * @member {google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity} severity + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.severity = 0; + + /** + * TransferMessage messageText. + * @member {string} messageText + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + */ + TransferMessage.prototype.messageText = ""; + + /** + * Creates a new TransferMessage instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage instance + */ + TransferMessage.create = function create(properties) { + return new TransferMessage(properties); + }; + + /** + * Encodes the specified TransferMessage message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage} message TransferMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageTime != null && Object.hasOwnProperty.call(message, "messageTime")) + $root.google.protobuf.Timestamp.encode(message.messageTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); + if (message.messageText != null && Object.hasOwnProperty.call(message, "messageText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageText); + return writer; + }; + + /** + * Encodes the specified TransferMessage message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.TransferMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.ITransferMessage} message TransferMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.TransferMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.severity = reader.int32(); + break; + } + case 3: { + message.messageText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferMessage message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageTime != null && message.hasOwnProperty("messageTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.messageTime); + if (error) + return "messageTime." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.messageText != null && message.hasOwnProperty("messageText")) + if (!$util.isString(message.messageText)) + return "messageText: string expected"; + return null; + }; + + /** + * Creates a TransferMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.TransferMessage} TransferMessage + */ + TransferMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.TransferMessage) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.TransferMessage(); + if (object.messageTime != null) { + if (typeof object.messageTime !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferMessage.messageTime: object expected"); + message.messageTime = $root.google.protobuf.Timestamp.fromObject(object.messageTime); + } + switch (object.severity) { + case "MESSAGE_SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFO": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "ERROR": + case 3: + message.severity = 3; + break; + } + if (object.messageText != null) + message.messageText = String(object.messageText); + return message; + }; + + /** + * Creates a plain object from a TransferMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {google.cloud.bigquery.datatransfer.v1.TransferMessage} message TransferMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.messageTime = null; + object.severity = options.enums === String ? "MESSAGE_SEVERITY_UNSPECIFIED" : 0; + object.messageText = ""; + } + if (message.messageTime != null && message.hasOwnProperty("messageTime")) + object.messageTime = $root.google.protobuf.Timestamp.toObject(message.messageTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity[message.severity] : message.severity; + if (message.messageText != null && message.hasOwnProperty("messageText")) + object.messageText = message.messageText; + return object; + }; + + /** + * Converts this TransferMessage to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @instance + * @returns {Object.} JSON object + */ + TransferMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferMessage + * @function getTypeUrl + * @memberof google.cloud.bigquery.datatransfer.v1.TransferMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.datatransfer.v1.TransferMessage"; + }; + + /** + * MessageSeverity enum. + * @name google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity + * @enum {number} + * @property {number} MESSAGE_SEVERITY_UNSPECIFIED=0 MESSAGE_SEVERITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ERROR=3 ERROR value + */ + TransferMessage.MessageSeverity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return TransferMessage; + })(); + + return v1; + })(); + + return datatransfer; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.json b/packages/google-cloud-bigquery-datatransfer/protos/protos.json new file mode 100644 index 000000000000..0c10300be096 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.json @@ -0,0 +1,2651 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "datatransfer": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.DataTransfer.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1;datatransfer", + "java_multiple_files": true, + "java_outer_classname": "TransferProto", + "java_package": "com.google.cloud.bigquery.datatransfer.v1", + "php_namespace": "Google\\Cloud\\BigQuery\\DataTransfer\\V1", + "ruby_package": "Google::Cloud::Bigquery::DataTransfer::V1", + "objc_class_prefix": "GCBDT" + }, + "nested": { + "DataTransferService": { + "options": { + "(google.api.default_host)": "bigquerydatatransfer.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetDataSource": { + "requestType": "GetDataSourceRequest", + "responseType": "DataSource", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataSources/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/dataSources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dataSources/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/dataSources/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataSources": { + "requestType": "ListDataSourcesRequest", + "responseType": "ListDataSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSources", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/dataSources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dataSources", + "additional_bindings": { + "get": "/v1/{parent=projects/*}/dataSources" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateTransferConfig": { + "requestType": "CreateTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "(google.api.http).body": "transfer_config", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*}/transferConfigs", + "(google.api.http).additional_bindings.body": "transfer_config", + "(google.api.method_signature)": "parent,transfer_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "body": "transfer_config", + "additional_bindings": { + "post": "/v1/{parent=projects/*}/transferConfigs", + "body": "transfer_config" + } + } + }, + { + "(google.api.method_signature)": "parent,transfer_config" + } + ] + }, + "UpdateTransferConfig": { + "requestType": "UpdateTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).patch": "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).body": "transfer_config", + "(google.api.http).additional_bindings.patch": "/v1/{transfer_config.name=projects/*/transferConfigs/*}", + "(google.api.http).additional_bindings.body": "transfer_config", + "(google.api.method_signature)": "transfer_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}", + "body": "transfer_config", + "additional_bindings": { + "patch": "/v1/{transfer_config.name=projects/*/transferConfigs/*}", + "body": "transfer_config" + } + } + }, + { + "(google.api.method_signature)": "transfer_config,update_mask" + } + ] + }, + "DeleteTransferConfig": { + "requestType": "DeleteTransferConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/transferConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/transferConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetTransferConfig": { + "requestType": "GetTransferConfigRequest", + "responseType": "TransferConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/transferConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/transferConfigs/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/transferConfigs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTransferConfigs": { + "requestType": "ListTransferConfigsRequest", + "responseType": "ListTransferConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*}/transferConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/transferConfigs", + "additional_bindings": { + "get": "/v1/{parent=projects/*}/transferConfigs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ScheduleTransferRuns": { + "requestType": "ScheduleTransferRunsRequest", + "responseType": "ScheduleTransferRunsResponse", + "options": { + "deprecated": true, + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,start_time,end_time" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,start_time,end_time" + } + ] + }, + "StartManualTransferRuns": { + "requestType": "StartManualTransferRunsRequest", + "responseType": "StartManualTransferRunsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns", + "body": "*" + } + } + } + ] + }, + "GetTransferRun": { + "requestType": "GetTransferRunRequest", + "responseType": "TransferRun", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/transferConfigs/*/runs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteTransferRun": { + "requestType": "DeleteTransferRunRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/transferConfigs/*/runs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/transferConfigs/*/runs/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTransferRuns": { + "requestType": "ListTransferRunsRequest", + "responseType": "ListTransferRunsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/transferConfigs/*}/runs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs", + "additional_bindings": { + "get": "/v1/{parent=projects/*/transferConfigs/*}/runs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListTransferLogs": { + "requestType": "ListTransferLogsRequest", + "responseType": "ListTransferLogsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs", + "additional_bindings": { + "get": "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CheckValidCreds": { + "requestType": "CheckValidCredsRequest", + "responseType": "CheckValidCredsResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/dataSources/*}:checkValidCreds", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/dataSources/*}:checkValidCreds", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "EnrollDataSources": { + "requestType": "EnrollDataSourcesRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*}:enrollDataSources", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*}:enrollDataSources", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*}:enrollDataSources", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*}:enrollDataSources", + "body": "*" + } + } + } + ] + } + } + }, + "DataSourceParameter": { + "fields": { + "paramId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + }, + "required": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + }, + "validationRegex": { + "type": "string", + "id": 7 + }, + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "minValue": { + "type": "google.protobuf.DoubleValue", + "id": 9 + }, + "maxValue": { + "type": "google.protobuf.DoubleValue", + "id": 10 + }, + "fields": { + "rule": "repeated", + "type": "DataSourceParameter", + "id": 11 + }, + "validationDescription": { + "type": "string", + "id": 12 + }, + "validationHelpUrl": { + "type": "string", + "id": 13 + }, + "immutable": { + "type": "bool", + "id": 14 + }, + "recurse": { + "type": "bool", + "id": 15 + }, + "deprecated": { + "type": "bool", + "id": 20 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INTEGER": 2, + "DOUBLE": 3, + "BOOLEAN": 4, + "RECORD": 5, + "PLUS_PAGE": 6 + } + } + } + }, + "DataSource": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/DataSource", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataSources/{data_source}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "clientId": { + "type": "string", + "id": 5 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "transferType": { + "type": "TransferType", + "id": 7, + "options": { + "deprecated": true + } + }, + "supportsMultipleTransfers": { + "type": "bool", + "id": 8, + "options": { + "deprecated": true + } + }, + "updateDeadlineSeconds": { + "type": "int32", + "id": 9 + }, + "defaultSchedule": { + "type": "string", + "id": 10 + }, + "supportsCustomSchedule": { + "type": "bool", + "id": 11 + }, + "parameters": { + "rule": "repeated", + "type": "DataSourceParameter", + "id": 12 + }, + "helpUrl": { + "type": "string", + "id": 13 + }, + "authorizationType": { + "type": "AuthorizationType", + "id": 14 + }, + "dataRefreshType": { + "type": "DataRefreshType", + "id": 15 + }, + "defaultDataRefreshWindowDays": { + "type": "int32", + "id": 16 + }, + "manualRunsDisabled": { + "type": "bool", + "id": 17 + }, + "minimumScheduleInterval": { + "type": "google.protobuf.Duration", + "id": 18 + } + }, + "nested": { + "AuthorizationType": { + "values": { + "AUTHORIZATION_TYPE_UNSPECIFIED": 0, + "AUTHORIZATION_CODE": 1, + "GOOGLE_PLUS_AUTHORIZATION_CODE": 2, + "FIRST_PARTY_OAUTH": 3 + } + }, + "DataRefreshType": { + "values": { + "DATA_REFRESH_TYPE_UNSPECIFIED": 0, + "SLIDING_WINDOW": 1, + "CUSTOM_SLIDING_WINDOW": 2 + } + } + } + }, + "GetDataSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/DataSource" + } + } + } + }, + "ListDataSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/DataSource" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListDataSourcesResponse": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "DataSource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateTransferConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "transferConfig": { + "type": "TransferConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationCode": { + "type": "string", + "id": 3 + }, + "versionInfo": { + "type": "string", + "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 + } + } + }, + "UpdateTransferConfigRequest": { + "fields": { + "transferConfig": { + "type": "TransferConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationCode": { + "type": "string", + "id": 3 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "versionInfo": { + "type": "string", + "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 + } + } + }, + "GetTransferConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + } + } + }, + "DeleteTransferConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + } + } + }, + "GetTransferRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + } + } + }, + "DeleteTransferRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + } + } + }, + "ListTransferConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "dataSourceIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListTransferConfigsResponse": { + "fields": { + "transferConfigs": { + "rule": "repeated", + "type": "TransferConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListTransferRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/Run" + } + }, + "states": { + "rule": "repeated", + "type": "TransferState", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "runAttempt": { + "type": "RunAttempt", + "id": 5 + } + }, + "nested": { + "RunAttempt": { + "values": { + "RUN_ATTEMPT_UNSPECIFIED": 0, + "LATEST": 1 + } + } + } + }, + "ListTransferRunsResponse": { + "fields": { + "transferRuns": { + "rule": "repeated", + "type": "TransferRun", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListTransferLogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" + } + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "messageTypes": { + "rule": "repeated", + "type": "TransferMessage.MessageSeverity", + "id": 6 + } + } + }, + "ListTransferLogsResponse": { + "fields": { + "transferMessages": { + "rule": "repeated", + "type": "TransferMessage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CheckValidCredsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/DataSource" + } + } + } + }, + "CheckValidCredsResponse": { + "fields": { + "hasValidCreds": { + "type": "bool", + "id": 1 + } + } + }, + "ScheduleTransferRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ScheduleTransferRunsResponse": { + "fields": { + "runs": { + "rule": "repeated", + "type": "TransferRun", + "id": 1 + } + } + }, + "StartManualTransferRunsRequest": { + "oneofs": { + "time": { + "oneof": [ + "requestedTimeRange", + "requestedRunTime" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + } + }, + "requestedTimeRange": { + "type": "TimeRange", + "id": 3 + }, + "requestedRunTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "TimeRange": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "StartManualTransferRunsResponse": { + "fields": { + "runs": { + "rule": "repeated", + "type": "TransferRun", + "id": 1 + } + } + }, + "EnrollDataSourcesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataSourceIds": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "TransferType": { + "options": { + "deprecated": true + }, + "values": { + "TRANSFER_TYPE_UNSPECIFIED": 0, + "BATCH": 1, + "STREAMING": 2 + } + }, + "TransferState": { + "values": { + "TRANSFER_STATE_UNSPECIFIED": 0, + "PENDING": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "CANCELLED": 6 + } + }, + "EmailPreferences": { + "fields": { + "enableFailureEmail": { + "type": "bool", + "id": 1 + } + } + }, + "ScheduleOptions": { + "fields": { + "disableAutoScheduling": { + "type": "bool", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "UserInfo": { + "oneofs": { + "_email": { + "oneof": [ + "email" + ] + } + }, + "fields": { + "email": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "TransferConfig": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/TransferConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" + }, + "oneofs": { + "destination": { + "oneof": [ + "destinationDatasetId" + ] + }, + "_ownerInfo": { + "oneof": [ + "ownerInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "destinationDatasetId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "dataSourceId": { + "type": "string", + "id": 5 + }, + "params": { + "type": "google.protobuf.Struct", + "id": 9 + }, + "schedule": { + "type": "string", + "id": 7 + }, + "scheduleOptions": { + "type": "ScheduleOptions", + "id": 24 + }, + "dataRefreshWindowDays": { + "type": "int32", + "id": 12 + }, + "disabled": { + "type": "bool", + "id": 13 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextRunTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "TransferState", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userId": { + "type": "int64", + "id": 11 + }, + "datasetRegion": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 15 + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 18 + }, + "ownerInfo": { + "type": "UserInfo", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "TransferRun": { + "options": { + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/Run", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" + }, + "oneofs": { + "destination": { + "oneof": [ + "destinationDatasetId" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "runTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "errorStatus": { + "type": "google.rpc.Status", + "id": 21 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "params": { + "type": "google.protobuf.Struct", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destinationDatasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "TransferState", + "id": 8 + }, + "userId": { + "type": "int64", + "id": 11 + }, + "schedule": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TransferMessage": { + "fields": { + "messageTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "severity": { + "type": "MessageSeverity", + "id": 2 + }, + "messageText": { + "type": "string", + "id": 3 + } + }, + "nested": { + "MessageSeverity": { + "values": { + "MESSAGE_SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 3 + } + } + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/samples/README.md b/packages/google-cloud-bigquery-datatransfer/samples/README.md new file mode 100644 index 000000000000..9199f3ac6fc5 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/README.md @@ -0,0 +1,338 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Data Transfer Service: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Data_transfer_service.check_valid_creds](#data_transfer_service.check_valid_creds) + * [Data_transfer_service.create_transfer_config](#data_transfer_service.create_transfer_config) + * [Data_transfer_service.delete_transfer_config](#data_transfer_service.delete_transfer_config) + * [Data_transfer_service.delete_transfer_run](#data_transfer_service.delete_transfer_run) + * [Data_transfer_service.enroll_data_sources](#data_transfer_service.enroll_data_sources) + * [Data_transfer_service.get_data_source](#data_transfer_service.get_data_source) + * [Data_transfer_service.get_transfer_config](#data_transfer_service.get_transfer_config) + * [Data_transfer_service.get_transfer_run](#data_transfer_service.get_transfer_run) + * [Data_transfer_service.list_data_sources](#data_transfer_service.list_data_sources) + * [Data_transfer_service.list_transfer_configs](#data_transfer_service.list_transfer_configs) + * [Data_transfer_service.list_transfer_logs](#data_transfer_service.list_transfer_logs) + * [Data_transfer_service.list_transfer_runs](#data_transfer_service.list_transfer_runs) + * [Data_transfer_service.schedule_transfer_runs](#data_transfer_service.schedule_transfer_runs) + * [Data_transfer_service.start_manual_transfer_runs](#data_transfer_service.start_manual_transfer_runs) + * [Data_transfer_service.update_transfer_config](#data_transfer_service.update_transfer_config) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Data_transfer_service.check_valid_creds + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js` + + +----- + + + + +### Data_transfer_service.create_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js` + + +----- + + + + +### Data_transfer_service.delete_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js` + + +----- + + + + +### Data_transfer_service.delete_transfer_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js` + + +----- + + + + +### Data_transfer_service.enroll_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js` + + +----- + + + + +### Data_transfer_service.get_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js` + + +----- + + + + +### Data_transfer_service.get_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js` + + +----- + + + + +### Data_transfer_service.get_transfer_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js` + + +----- + + + + +### Data_transfer_service.list_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js` + + +----- + + + + +### Data_transfer_service.list_transfer_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js` + + +----- + + + + +### Data_transfer_service.list_transfer_logs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js` + + +----- + + + + +### Data_transfer_service.list_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.schedule_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.start_manual_transfer_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js` + + +----- + + + + +### Data_transfer_service.update_transfer_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/transfer/ diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js new file mode 100644 index 000000000000..91dd765c211f --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callCheckValidCreds() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.checkValidCreds(request); + console.log(response); + } + + callCheckValidCreds(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js new file mode 100644 index 000000000000..a2ddfb165b16 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js @@ -0,0 +1,103 @@ +// Copyright 2022 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'; + +function main(parent, transferConfig) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The BigQuery project id where the transfer configuration should be created. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. + */ + // const parent = 'abc123' + /** + * Required. Data transfer configuration to create. + */ + // const transferConfig = {} + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + // const authorizationCode = 'abc123' + /** + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + */ + // const versionInfo = 'abc123' + /** + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + */ + // const serviceAccountName = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callCreateTransferConfig() { + // Construct request + const request = { + parent, + transferConfig, + }; + + // Run request + const response = await datatransferClient.createTransferConfig(request); + console.log(response); + } + + callCreateTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js new file mode 100644 index 000000000000..40dd46f89122 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callDeleteTransferConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.deleteTransferConfig(request); + console.log(response); + } + + callDeleteTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js new file mode 100644 index 000000000000..3b280391e6cb --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callDeleteTransferRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.deleteTransferRun(request); + console.log(response); + } + + callDeleteTransferRun(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js new file mode 100644 index 000000000000..e0553ce148a3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main() { + // [START bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The name of the project resource in the form: + * `projects/{project_id}` + */ + // const name = 'abc123' + /** + * Data sources that are enrolled. It is required to provide at least one + * data source id. + */ + // const dataSourceIds = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callEnrollDataSources() { + // Construct request + const request = { + }; + + // Run request + const response = await datatransferClient.enrollDataSources(request); + console.log(response); + } + + callEnrollDataSources(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js new file mode 100644 index 000000000000..da7418e8ae46 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getDataSource(request); + console.log(response); + } + + callGetDataSource(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js new file mode 100644 index 000000000000..bf6503724093 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetTransferConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getTransferConfig(request); + console.log(response); + } + + callGetTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js new file mode 100644 index 000000000000..698698e38a59 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const name = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callGetTransferRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await datatransferClient.getTransferRun(request); + console.log(response); + } + + callGetTransferRun(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js new file mode 100644 index 000000000000..516866b4bc92 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + */ + // const parent = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListDataSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listDataSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSources(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js new file mode 100644 index 000000000000..9e4f144680a3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js @@ -0,0 +1,81 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + */ + // const parent = 'abc123' + /** + * When specified, only configurations of requested data sources are returned. + */ + // const dataSourceIds = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferConfigs(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js new file mode 100644 index 000000000000..e6828957ffbc --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js @@ -0,0 +1,82 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + // const parent = 'abc123' + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + // const messageTypes = 1234 + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferLogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferLogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferLogs(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js new file mode 100644 index 000000000000..a16ee7806ce3 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * When specified, only transfer runs with requested states are returned. + */ + // const states = 1234 + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + // const pageToken = 'abc123' + /** + * Page size. The default page size is the maximum value of 1000 results. + */ + // const pageSize = 1234 + /** + * Indicates how run attempts are to be pulled. + */ + // const runAttempt = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callListTransferRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datatransferClient.listTransferRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js new file mode 100644 index 000000000000..a7ab3cccdae0 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js @@ -0,0 +1,75 @@ +// Copyright 2022 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'; + +function main(parent, startTime, endTime) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + */ + // const startTime = {} + /** + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + */ + // const endTime = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callScheduleTransferRuns() { + // Construct request + const request = { + parent, + startTime, + endTime, + }; + + // Run request + const response = await datatransferClient.scheduleTransferRuns(request); + console.log(response); + } + + callScheduleTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js new file mode 100644 index 000000000000..acff4f9bfb2a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js @@ -0,0 +1,71 @@ +// Copyright 2022 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'; + +function main() { + // [START bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + */ + // const parent = 'abc123' + /** + * Time range for the transfer runs that should be started. + */ + // const requestedTimeRange = {} + /** + * Specific run_time for a transfer run to be started. The + * requested_run_time must not be in the future. + */ + // const requestedRunTime = {} + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callStartManualTransferRuns() { + // Construct request + const request = { + }; + + // Run request + const response = await datatransferClient.startManualTransferRuns(request); + console.log(response); + } + + callStartManualTransferRuns(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js new file mode 100644 index 000000000000..f6e55317a091 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js @@ -0,0 +1,101 @@ +// Copyright 2022 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'; + +function main(transferConfig, updateMask) { + // [START bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Data transfer configuration to create. + */ + // const transferConfig = {} + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + // const authorizationCode = 'abc123' + /** + * Required. Required list of fields to be updated in this request. + */ + // const updateMask = {} + /** + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + */ + // const versionInfo = 'abc123' + /** + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + */ + // const serviceAccountName = 'abc123' + + // Imports the Datatransfer library + const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1; + + // Instantiates a client + const datatransferClient = new DataTransferServiceClient(); + + async function callUpdateTransferConfig() { + // Construct request + const request = { + transferConfig, + updateMask, + }; + + // Run request + const response = await datatransferClient.updateTransferConfig(request); + console.log(response); + } + + callUpdateTransferConfig(); + // [END bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json new file mode 100644 index 000000000000..376c09e28a07 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json @@ -0,0 +1,715 @@ +{ + "clientLibrary": { + "name": "nodejs-datatransfer", + "version": "3.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.datatransfer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async", + "title": "DataTransferService getDataSource Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a supported data source and returns its settings.", + "canonical": true, + "file": "data_transfer_service.get_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSource", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.DataSource", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetDataSource", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetDataSource", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async", + "title": "DataTransferService listDataSources Sample", + "origin": "API_DEFINITION", + "description": " Lists supported data sources and returns their settings.", + "canonical": true, + "file": "data_transfer_service.list_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListDataSources", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async", + "title": "DataTransferService createTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new data transfer configuration.", + "canonical": true, + "file": "data_transfer_service.create_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "transfer_config", + "type": ".google.cloud.bigquery.datatransfer.v1.TransferConfig" + }, + { + "name": "authorization_code", + "type": "TYPE_STRING" + }, + { + "name": "version_info", + "type": "TYPE_STRING" + }, + { + "name": "service_account_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "CreateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CreateTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async", + "title": "DataTransferService updateTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a data transfer configuration. All fields must be set, even if they are not updated.", + "canonical": true, + "file": "data_transfer_service.update_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfig", + "async": true, + "parameters": [ + { + "name": "transfer_config", + "type": ".google.cloud.bigquery.datatransfer.v1.TransferConfig" + }, + { + "name": "authorization_code", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "version_info", + "type": "TYPE_STRING" + }, + { + "name": "service_account_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "UpdateTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.UpdateTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async", + "title": "DataTransferService deleteTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a data transfer configuration, including any associated transfer runs and logs.", + "canonical": true, + "file": "data_transfer_service.delete_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "DeleteTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async", + "title": "DataTransferService getTransferConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns information about a data transfer config.", + "canonical": true, + "file": "data_transfer_service.get_transfer_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferConfig", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetTransferConfig", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferConfig", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async", + "title": "DataTransferService listTransferConfigs Sample", + "origin": "API_DEFINITION", + "description": " Returns information about all transfer configs owned by a project in the specified location.", + "canonical": true, + "file": "data_transfer_service.list_transfer_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferConfigs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "data_source_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferConfigs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferConfigs", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async", + "title": "DataTransferService scheduleTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.", + "canonical": true, + "file": "data_transfer_service.schedule_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ScheduleTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "end_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ScheduleTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ScheduleTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async", + "title": "DataTransferService startManualTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time.", + "canonical": true, + "file": "data_transfer_service.start_manual_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartManualTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requested_time_range", + "type": ".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange" + }, + { + "name": "requested_run_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "StartManualTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.StartManualTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async", + "title": "DataTransferService getTransferRun Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the particular transfer run.", + "canonical": true, + "file": "data_transfer_service.get_transfer_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.TransferRun", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "GetTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.GetTransferRun", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async", + "title": "DataTransferService deleteTransferRun Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified transfer run.", + "canonical": true, + "file": "data_transfer_service.delete_transfer_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "DeleteTransferRun", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.DeleteTransferRun", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async", + "title": "DataTransferService listTransferRuns Sample", + "origin": "API_DEFINITION", + "description": " Returns information about running and completed transfer runs.", + "canonical": true, + "file": "data_transfer_service.list_transfer_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "states", + "type": "TYPE_ENUM[]" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "run_attempt", + "type": ".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferRuns", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferRuns", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async", + "title": "DataTransferService listTransferLogs Sample", + "origin": "API_DEFINITION", + "description": " Returns log messages for the transfer run.", + "canonical": true, + "file": "data_transfer_service.list_transfer_logs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferLogs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "message_types", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "ListTransferLogs", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.ListTransferLogs", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async", + "title": "DataTransferService checkValidCreds Sample", + "origin": "API_DEFINITION", + "description": " Returns true if valid credentials exist for the given data source and requesting user.", + "canonical": true, + "file": "data_transfer_service.check_valid_creds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckValidCreds", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCreds", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "CheckValidCreds", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.CheckValidCreds", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + }, + { + "regionTag": "bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async", + "title": "DataTransferService enrollDataSources Sample", + "origin": "API_DEFINITION", + "description": " Enroll data sources in a user project. This allows users to create transfer configurations for these data sources. They will also appear in the ListDataSources RPC and as such, will appear in the BigQuery UI 'https://bigquery.cloud.google.com' (and the documents can be found at https://cloud.google.com/bigquery/bigquery-web-ui and https://cloud.google.com/bigquery/docs/working-with-transfers).", + "canonical": true, + "file": "data_transfer_service.enroll_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnrollDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSources", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "data_source_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataTransferServiceClient", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient" + }, + "method": { + "shortName": "EnrollDataSources", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService.EnrollDataSources", + "service": { + "shortName": "DataTransferService", + "fullName": "google.cloud.bigquery.datatransfer.v1.DataTransferService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-datatransfer/samples/package.json b/packages/google-cloud-bigquery-datatransfer/samples/package.json new file mode 100644 index 000000000000..e4456c379eba --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-docs-samples-bigquery-data-transfer", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "repository": "googleapis/nodejs-bigquery-data-transfer", + "private": true, + "scripts": { + "test": "mocha --timeout 60000" + }, + "dependencies": { + "@google-cloud/bigquery-data-transfer": "^3.1.3" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js b/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js new file mode 100644 index 000000000000..f755a7663fad --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/quickstart.js @@ -0,0 +1,53 @@ +// Copyright 2017 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. + +'use strict'; + +// [START bigquerydatatransfer_quickstart] +const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer'); +const client = new bigqueryDataTransfer.v1.DataTransferServiceClient(); + +async function quickstart() { + const projectId = await client.getProjectId(); + + // Iterate over all elements. + const formattedParent = client.projectPath(projectId, 'us-central1'); + let nextRequest = {parent: formattedParent}; + const options = {autoPaginate: false}; + console.log('Data sources:'); + do { + // Fetch the next page. + const responses = await client.listDataSources(nextRequest, options); + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + resources.forEach(resource => { + console.log(` ${resource.name}`); + }); + } while (nextRequest); + + console.log('\n\n'); + console.log('Sources via stream:'); + + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(` ${element.name}`); + }); +} +quickstart(); +// [END bigquerydatatransfer_quickstart] diff --git a/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js b/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js new file mode 100644 index 000000000000..ad0a7a8b39b6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/samples/test/quickstart.test.js @@ -0,0 +1,28 @@ +// Copyright 2017 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('quickstart', () => { + it('should return a list of resources', () => { + const stdout = execSync('node quickstart'); + assert.match(stdout, /^Data sources/); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/smoke-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js b/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js new file mode 100644 index 000000000000..15f915571d76 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/smoke-test/data_transfer_service_smoke_test.js @@ -0,0 +1,99 @@ +// Copyright 2020 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. + +'use strict'; + +const {describe, it} = require('mocha'); + +describe('DataTransferServiceSmokeTest', () => { + if (!process.env.GCLOUD_PROJECT) { + throw new Error('Usage: GCLOUD_PROJECT= node #{$0}'); + } + const projectId = process.env.GCLOUD_PROJECT; + + it('successfully makes a call to the service using promises', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + // Iterate over all elements. + const formattedParent = client.locationPath(projectId, 'us-central1'); + + client + .listDataSources({parent: formattedParent}) + .then(responses => { + const resources = responses[0]; + for (const resource of resources) { + console.log(resource); + } + }) + .then(done) + .catch(done); + }); + + it('successfully makes a call to the service using callbacks', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + // Or obtain the paged response. + const formattedParent = client.locationPath(projectId, 'us-central1'); + + const options = {autoPaginate: false}; + const callback = responses => { + // The actual resources in a response. + const resources = responses[0]; + // The next request if the response shows that there are more responses. + const nextRequest = responses[1]; + // The actual response object, if necessary. + // const rawResponse = responses[2]; + for (const resource of resources) { + console.log(resource); + } + if (nextRequest) { + // Fetch the next page. + return client.listDataSources(nextRequest, options).then(callback); + } + }; + client + .listDataSources({parent: formattedParent}, options) + .then(callback) + .then(done) + .catch(done); + }); + + it('successfully makes a call to the service using streaming', done => { + // eslint-disable-next-line node/no-missing-require + const bigqueryDataTransfer = require('../src'); + + const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({ + // optional auth parameters. + }); + + const formattedParent = client.locationPath(projectId, 'us-central1'); + client + .listDataSourcesStream({parent: formattedParent}) + .on('data', element => { + console.log(element); + }) + .on('error', done) + .on('end', done); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/src/index.ts b/packages/google-cloud-bigquery-datatransfer/src/index.ts new file mode 100644 index 000000000000..dbd64da95fc2 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const DataTransferServiceClient = v1.DataTransferServiceClient; +type DataTransferServiceClient = v1.DataTransferServiceClient; + +export {v1, DataTransferServiceClient}; +export default {v1, DataTransferServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts new file mode 100644 index 000000000000..8095cc77edfd --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts @@ -0,0 +1,2831 @@ +// Copyright 2022 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, +} 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/data_transfer_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_transfer_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This API allows users to manage their data transfers into BigQuery. + * @class + * @memberof v1 + */ +export class DataTransferServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + dataTransferServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataTransferServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 DataTransferServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataTransferServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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}' + ), + projectDataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/dataSources/{data_source}' + ), + projectLocationDataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataSources/{data_source}' + ), + projectLocationTransferConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}' + ), + projectLocationTransferConfigRunPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}' + ), + projectTransferConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/transferConfigs/{transfer_config}' + ), + projectTransferConfigRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/transferConfigs/{transfer_config}/runs/{run}' + ), + }; + + // 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 = { + listDataSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataSources' + ), + listTransferConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferConfigs' + ), + listTransferRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferRuns' + ), + listTransferLogs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferMessages' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.datatransfer.v1.DataTransferService', + 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.dataTransferServiceStub) { + return this.dataTransferServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.datatransfer.v1.DataTransferService. + this.dataTransferServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.datatransfer.v1.DataTransferService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.datatransfer.v1 + .DataTransferService, + 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 dataTransferServiceStubMethods = [ + 'getDataSource', + 'listDataSources', + 'createTransferConfig', + 'updateTransferConfig', + 'deleteTransferConfig', + 'getTransferConfig', + 'listTransferConfigs', + 'scheduleTransferRuns', + 'startManualTransferRuns', + 'getTransferRun', + 'deleteTransferRun', + 'listTransferRuns', + 'listTransferLogs', + 'checkValidCreds', + 'enrollDataSources', + ]; + for (const methodName of dataTransferServiceStubMethods) { + const callPromise = this.dataTransferServiceStub.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.dataTransferServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'bigquerydatatransfer.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'bigquerydatatransfer.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Retrieves a supported data source and returns its settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` + * @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 [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.get_data_source.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_async + */ + getDataSource( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | undefined + ), + {} | undefined + ] + >; + getDataSource( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | 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.getDataSource(request, options, callback); + } + /** + * Creates a new data transfer configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id where the transfer configuration should be created. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig + * Required. Data transfer configuration to create. + * @param {string} request.authorizationCode + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + * @param {string} request.versionInfo + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + * @param {string} request.serviceAccountName + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.create_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_async + */ + createTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + createTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | 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.createTransferConfig(request, options, callback); + } + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.datatransfer.v1.TransferConfig} request.transferConfig + * Required. Data transfer configuration to create. + * @param {string} request.authorizationCode + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Required list of fields to be updated in this request. + * @param {string} request.versionInfo + * Optional version info. If users want to find a very recent access token, + * that is, immediately after approving access, users have to set the + * version_info claim in the token request. To obtain the version_info, users + * must use the "none+gsession" response type. which be return a + * version_info back in the authorization response which be be put in a JWT + * claim in the token request. + * @param {string} request.serviceAccountName + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.update_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_async + */ + updateTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | 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({ + 'transfer_config.name': request.transferConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTransferConfig(request, options, callback); + } + /** + * Deletes a data transfer configuration, including any associated transfer + * runs and logs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.delete_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_async + */ + deleteTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | 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.deleteTransferConfig(request, options, callback); + } + /** + * Returns information about a data transfer config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.get_transfer_config.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_async + */ + getTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | undefined + ), + {} | undefined + ] + >; + getTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferConfig( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferConfig( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | 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.getTransferConfig(request, options, callback); + } + /** + * Creates transfer runs for a time range [start_time, end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + * DEPRECATED: use StartManualTransferRuns instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {google.protobuf.Timestamp} request.startTime + * Required. Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + * @param {google.protobuf.Timestamp} request.endTime + * Required. End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + * @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 [ScheduleTransferRunsResponse]{@link google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.schedule_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_async + * @deprecated ScheduleTransferRuns is deprecated and may be removed in a future version. + */ + scheduleTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | undefined + ), + {} | undefined + ] + >; + scheduleTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + scheduleTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + scheduleTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | 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(); + this.warn( + 'DEP$DataTransferService-$ScheduleTransferRuns', + 'ScheduleTransferRuns is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.innerApiCalls.scheduleTransferRuns(request, options, callback); + } + /** + * Start manual transfer runs to be executed now with schedule_time equal to + * current time. The transfer runs can be created for a time range where the + * run_time is between start_time (inclusive) and end_time (exclusive), or for + * a specific run_time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange} request.requestedTimeRange + * Time range for the transfer runs that should be started. + * @param {google.protobuf.Timestamp} request.requestedRunTime + * Specific run_time for a transfer run to be started. The + * requested_run_time must not be in the future. + * @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 [StartManualTransferRunsResponse]{@link google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_async + */ + startManualTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | undefined + ), + {} | undefined + ] + >; + startManualTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startManualTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startManualTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | 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.startManualTransferRuns( + request, + options, + callback + ); + } + /** + * Returns information about the particular transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @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 [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.get_transfer_run.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_async + */ + getTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | undefined + ), + {} | undefined + ] + >; + getTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | 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.getTransferRun(request, options, callback); + } + /** + * Deletes the specified transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.delete_transfer_run.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_async + */ + deleteTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | undefined + ), + {} | undefined + ] + >; + deleteTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferRun( + request: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTransferRun( + request?: protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | 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.deleteTransferRun(request, options, callback); + } + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. + * @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 [CheckValidCredsResponse]{@link google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.check_valid_creds.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_async + */ + checkValidCreds( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | undefined + ), + {} | undefined + ] + >; + checkValidCreds( + request: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkValidCreds( + request: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + callback: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkValidCreds( + request?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | 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.checkValidCreds(request, options, callback); + } + /** + * Enroll data sources in a user project. This allows users to create transfer + * configurations for these data sources. They will also appear in the + * ListDataSources RPC and as such, will appear in the BigQuery UI + * 'https://bigquery.cloud.google.com' (and the documents can be found at + * https://cloud.google.com/bigquery/bigquery-web-ui and + * https://cloud.google.com/bigquery/docs/working-with-transfers). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the project resource in the form: + * `projects/{project_id}` + * @param {string[]} request.dataSourceIds + * Data sources that are enrolled. It is required to provide at least one + * data source id. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.enroll_data_sources.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_async + */ + enrollDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | undefined + ), + {} | undefined + ] + >; + enrollDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enrollDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enrollDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | 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.enrollDataSources(request, options, callback); + } + + /** + * Lists supported data sources and returns their settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. + * 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 `listDataSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource[], + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + ] + >; + listDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): void; + listDataSources( + request: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): void; + listDataSources( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource[], + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + ] + > | 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.listDataSources(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 BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource} 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 `listDataSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDataSourcesStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.createStream( + this.innerApiCalls.listDataSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataSources`, 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 BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DataSource]{@link google.cloud.bigquery.datatransfer.v1.DataSource}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.list_data_sources.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_async + */ + listDataSourcesAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.asyncIterate( + this.innerApiCalls['listDataSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns information about all transfer configs owned by a project in the + * specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. + * 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 `listTransferConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferConfigs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + ] + >; + listTransferConfigs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): void; + listTransferConfigs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): void; + listTransferConfigs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + ] + > | 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.listTransferConfigs(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 BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig} 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 `listTransferConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferConfigsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + 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['listTransferConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferConfigs.createStream( + this.innerApiCalls.listTransferConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferConfigs`, 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 BigQuery project id for which data sources + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` + * @param {string[]} request.dataSourceIds + * When specified, only configurations of requested data sources are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferConfig]{@link google.cloud.bigquery.datatransfer.v1.TransferConfig}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.list_transfer_configs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_async + */ + listTransferConfigsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + 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['listTransferConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferConfigs.asyncIterate( + this.innerApiCalls['listTransferConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns information about running and completed transfer runs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. + * 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 `listTransferRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + ] + >; + listTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): void; + listTransferRuns( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): void; + listTransferRuns( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + ] + > | 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.listTransferRuns(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. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun} 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 `listTransferRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferRunsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + 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['listTransferRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferRuns.createStream( + this.innerApiCalls.listTransferRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferRuns`, 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. Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. + * @param {number[]} request.states + * When specified, only transfer runs with requested states are returned. + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt} request.runAttempt + * Indicates how run attempts are to be pulled. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferRun]{@link google.cloud.bigquery.datatransfer.v1.TransferRun}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.list_transfer_runs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_async + */ + listTransferRunsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + 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['listTransferRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferRuns.asyncIterate( + this.innerApiCalls['listTransferRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns log messages for the transfer run. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @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 [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage}. + * 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 `listTransferLogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferLogs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + ] + >; + listTransferLogs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): void; + listTransferLogs( + request: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): void; + listTransferLogs( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + ): Promise< + [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + ] + > | 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.listTransferLogs(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. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @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 [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage} 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 `listTransferLogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTransferLogsStream( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + 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['listTransferLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferLogs.createStream( + this.innerApiCalls.listTransferLogs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferLogs`, 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. Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {string} request.pageToken + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + * @param {number} request.pageSize + * Page size. The default page size is the maximum value of 1000 results. + * @param {number[]} request.messageTypes + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferMessage]{@link google.cloud.bigquery.datatransfer.v1.TransferMessage}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_transfer_service.list_transfer_logs.js + * region_tag:bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_async + */ + listTransferLogsAsync( + request?: protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + 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['listTransferLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferLogs.asyncIterate( + this.innerApiCalls['listTransferLogs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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 projectDataSource resource name string. + * + * @param {string} project + * @param {string} data_source + * @returns {string} Resource name string. + */ + projectDataSourcePath(project: string, dataSource: string) { + return this.pathTemplates.projectDataSourcePathTemplate.render({ + project: project, + data_source: dataSource, + }); + } + + /** + * Parse the project from ProjectDataSource resource. + * + * @param {string} projectDataSourceName + * A fully-qualified path representing project_data_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectDataSourceName(projectDataSourceName: string) { + return this.pathTemplates.projectDataSourcePathTemplate.match( + projectDataSourceName + ).project; + } + + /** + * Parse the data_source from ProjectDataSource resource. + * + * @param {string} projectDataSourceName + * A fully-qualified path representing project_data_source resource. + * @returns {string} A string representing the data_source. + */ + matchDataSourceFromProjectDataSourceName(projectDataSourceName: string) { + return this.pathTemplates.projectDataSourcePathTemplate.match( + projectDataSourceName + ).data_source; + } + + /** + * Return a fully-qualified projectLocationDataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_source + * @returns {string} Resource name string. + */ + projectLocationDataSourcePath( + project: string, + location: string, + dataSource: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.render({ + project: project, + location: location, + data_source: dataSource, + }); + } + + /** + * Parse the project from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).project; + } + + /** + * Parse the location from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).location; + } + + /** + * Parse the data_source from ProjectLocationDataSource resource. + * + * @param {string} projectLocationDataSourceName + * A fully-qualified path representing project_location_data_source resource. + * @returns {string} A string representing the data_source. + */ + matchDataSourceFromProjectLocationDataSourceName( + projectLocationDataSourceName: string + ) { + return this.pathTemplates.projectLocationDataSourcePathTemplate.match( + projectLocationDataSourceName + ).data_source; + } + + /** + * Return a fully-qualified projectLocationTransferConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} transfer_config + * @returns {string} Resource name string. + */ + projectLocationTransferConfigPath( + project: string, + location: string, + transferConfig: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.render({ + project: project, + location: location, + transfer_config: transferConfig, + }); + } + + /** + * Parse the project from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).project; + } + + /** + * Parse the location from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).location; + } + + /** + * Parse the transfer_config from ProjectLocationTransferConfig resource. + * + * @param {string} projectLocationTransferConfigName + * A fully-qualified path representing project_location_transfer_config resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectLocationTransferConfigName( + projectLocationTransferConfigName: string + ) { + return this.pathTemplates.projectLocationTransferConfigPathTemplate.match( + projectLocationTransferConfigName + ).transfer_config; + } + + /** + * Return a fully-qualified projectLocationTransferConfigRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} transfer_config + * @param {string} run + * @returns {string} Resource name string. + */ + projectLocationTransferConfigRunPath( + project: string, + location: string, + transferConfig: string, + run: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.render( + { + project: project, + location: location, + transfer_config: transferConfig, + run: run, + } + ); + } + + /** + * Parse the project from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).project; + } + + /** + * Parse the location from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).location; + } + + /** + * Parse the transfer_config from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).transfer_config; + } + + /** + * Parse the run from ProjectLocationTransferConfigRun resource. + * + * @param {string} projectLocationTransferConfigRunName + * A fully-qualified path representing project_location_transfer_config_run resource. + * @returns {string} A string representing the run. + */ + matchRunFromProjectLocationTransferConfigRunName( + projectLocationTransferConfigRunName: string + ) { + return this.pathTemplates.projectLocationTransferConfigRunPathTemplate.match( + projectLocationTransferConfigRunName + ).run; + } + + /** + * Return a fully-qualified projectTransferConfig resource name string. + * + * @param {string} project + * @param {string} transfer_config + * @returns {string} Resource name string. + */ + projectTransferConfigPath(project: string, transferConfig: string) { + return this.pathTemplates.projectTransferConfigPathTemplate.render({ + project: project, + transfer_config: transferConfig, + }); + } + + /** + * Parse the project from ProjectTransferConfig resource. + * + * @param {string} projectTransferConfigName + * A fully-qualified path representing project_transfer_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTransferConfigName(projectTransferConfigName: string) { + return this.pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).project; + } + + /** + * Parse the transfer_config from ProjectTransferConfig resource. + * + * @param {string} projectTransferConfigName + * A fully-qualified path representing project_transfer_config resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectTransferConfigName( + projectTransferConfigName: string + ) { + return this.pathTemplates.projectTransferConfigPathTemplate.match( + projectTransferConfigName + ).transfer_config; + } + + /** + * Return a fully-qualified projectTransferConfigRun resource name string. + * + * @param {string} project + * @param {string} transfer_config + * @param {string} run + * @returns {string} Resource name string. + */ + projectTransferConfigRunPath( + project: string, + transferConfig: string, + run: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.render({ + project: project, + transfer_config: transferConfig, + run: run, + }); + } + + /** + * Parse the project from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).project; + } + + /** + * Parse the transfer_config from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the transfer_config. + */ + matchTransferConfigFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).transfer_config; + } + + /** + * Parse the run from ProjectTransferConfigRun resource. + * + * @param {string} projectTransferConfigRunName + * A fully-qualified path representing project_transfer_config_run resource. + * @returns {string} A string representing the run. + */ + matchRunFromProjectTransferConfigRunName( + projectTransferConfigRunName: string + ) { + return this.pathTemplates.projectTransferConfigRunPathTemplate.match( + projectTransferConfigRunName + ).run; + } + + /** + * 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.dataTransferServiceStub && !this._terminated) { + return this.dataTransferServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json new file mode 100644 index 000000000000..32271a384008 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client_config.json @@ -0,0 +1,99 @@ +{ + "interfaces": { + "google.cloud.bigquery.datatransfer.v1.DataTransferService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "GetDataSource": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDataSources": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTransferConfig": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTransferConfig": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferConfigs": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ScheduleTransferRuns": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartManualTransferRuns": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteTransferRun": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferRuns": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTransferLogs": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CheckValidCreds": { + "timeout_millis": 20000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "EnrollDataSources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json new file mode 100644 index 000000000000..2fc32ccab2a8 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto", + "../../protos/google/cloud/bigquery/datatransfer/v1/transfer.proto" +] diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..85059e6c876d --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/gapic_metadata.json @@ -0,0 +1,189 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.datatransfer.v1", + "libraryPackage": "@google-cloud/bigquery-data-transfer", + "services": { + "DataTransferService": { + "clients": { + "grpc": { + "libraryClient": "DataTransferServiceClient", + "rpcs": { + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "CreateTransferConfig": { + "methods": [ + "createTransferConfig" + ] + }, + "UpdateTransferConfig": { + "methods": [ + "updateTransferConfig" + ] + }, + "DeleteTransferConfig": { + "methods": [ + "deleteTransferConfig" + ] + }, + "GetTransferConfig": { + "methods": [ + "getTransferConfig" + ] + }, + "ScheduleTransferRuns": { + "methods": [ + "scheduleTransferRuns" + ] + }, + "StartManualTransferRuns": { + "methods": [ + "startManualTransferRuns" + ] + }, + "GetTransferRun": { + "methods": [ + "getTransferRun" + ] + }, + "DeleteTransferRun": { + "methods": [ + "deleteTransferRun" + ] + }, + "CheckValidCreds": { + "methods": [ + "checkValidCreds" + ] + }, + "EnrollDataSources": { + "methods": [ + "enrollDataSources" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListTransferConfigs": { + "methods": [ + "listTransferConfigs", + "listTransferConfigsStream", + "listTransferConfigsAsync" + ] + }, + "ListTransferRuns": { + "methods": [ + "listTransferRuns", + "listTransferRunsStream", + "listTransferRunsAsync" + ] + }, + "ListTransferLogs": { + "methods": [ + "listTransferLogs", + "listTransferLogsStream", + "listTransferLogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataTransferServiceClient", + "rpcs": { + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "CreateTransferConfig": { + "methods": [ + "createTransferConfig" + ] + }, + "UpdateTransferConfig": { + "methods": [ + "updateTransferConfig" + ] + }, + "DeleteTransferConfig": { + "methods": [ + "deleteTransferConfig" + ] + }, + "GetTransferConfig": { + "methods": [ + "getTransferConfig" + ] + }, + "ScheduleTransferRuns": { + "methods": [ + "scheduleTransferRuns" + ] + }, + "StartManualTransferRuns": { + "methods": [ + "startManualTransferRuns" + ] + }, + "GetTransferRun": { + "methods": [ + "getTransferRun" + ] + }, + "DeleteTransferRun": { + "methods": [ + "deleteTransferRun" + ] + }, + "CheckValidCreds": { + "methods": [ + "checkValidCreds" + ] + }, + "EnrollDataSources": { + "methods": [ + "enrollDataSources" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListTransferConfigs": { + "methods": [ + "listTransferConfigs", + "listTransferConfigsStream", + "listTransferConfigsAsync" + ] + }, + "ListTransferRuns": { + "methods": [ + "listTransferRuns", + "listTransferRunsStream", + "listTransferRunsAsync" + ] + }, + "ListTransferLogs": { + "methods": [ + "listTransferLogs", + "listTransferLogsStream", + "listTransferLogsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts new file mode 100644 index 000000000000..025734f63e25 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {DataTransferServiceClient} from './data_transfer_service_client'; diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml b/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..9afaca04e5cb --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datatransfer = require('@google-cloud/bigquery-data-transfer'); + +function main() { + const dataTransferServiceClient = + new datatransfer.DataTransferServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..bcd32e2fe0ba --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 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 {DataTransferServiceClient} from '@google-cloud/bigquery-data-transfer'; + +// check that the client class type name can be used +function doStuffWithDataTransferServiceClient( + client: DataTransferServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataTransferServiceClient = new DataTransferServiceClient(); + doStuffWithDataTransferServiceClient(dataTransferServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/install.ts b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts new file mode 100644 index 000000000000..14bf3b8ce216 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts @@ -0,0 +1,3693 @@ +// Copyright 2022 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 datatransferserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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.DataTransferServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + datatransferserviceModule.v1.DataTransferServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + datatransferserviceModule.v1.DataTransferServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datatransferserviceModule.v1.DataTransferServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datatransferserviceModule.v1.DataTransferServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.dataTransferServiceStub, undefined); + await client.initialize(); + assert(client.dataTransferServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.dataTransferServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.dataTransferServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + 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 datatransferserviceModule.v1.DataTransferServiceClient( + { + 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('getDataSource', () => { + it('invokes getDataSource without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ); + client.innerApiCalls.getDataSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IDataSource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataSource(request), expectedError); + }); + }); + + describe('createTransferConfig', () => { + it('invokes createTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.createTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.createTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createTransferConfig(request), expectedError); + }); + }); + + describe('updateTransferConfig', () => { + it('invokes updateTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.updateTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.updateTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest() + ); + request.transferConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest', + ['transferConfig', 'name'] + ); + request.transferConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTransferConfig(request), expectedError); + }); + }); + + describe('deleteTransferConfig', () => { + it('invokes deleteTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransferConfig( + 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.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTransferConfig(request), expectedError); + }); + }); + + describe('getTransferConfig', () => { + it('invokes getTransferConfig without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.getTransferConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ); + client.innerApiCalls.getTransferConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTransferConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferConfig with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferConfig(request), expectedError); + }); + }); + + describe('scheduleTransferRuns', () => { + it('invokes scheduleTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() + ); + client.innerApiCalls.scheduleTransferRuns = + stubSimpleCall(expectedResponse); + const [response] = await client.scheduleTransferRuns(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() + ); + client.innerApiCalls.scheduleTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.scheduleTransferRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.scheduleTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.scheduleTransferRuns(request), expectedError); + assert(stub.calledOnce); + const actualRequest = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.scheduleTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes scheduleTransferRuns with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.scheduleTransferRuns(request), expectedError); + assert(stub.calledOnce); + }); + }); + + describe('startManualTransferRuns', () => { + it('invokes startManualTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() + ); + client.innerApiCalls.startManualTransferRuns = + stubSimpleCall(expectedResponse); + const [response] = await client.startManualTransferRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() + ); + client.innerApiCalls.startManualTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startManualTransferRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startManualTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.startManualTransferRuns(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startManualTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startManualTransferRuns with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.startManualTransferRuns(request), + expectedError + ); + }); + }); + + describe('getTransferRun', () => { + it('invokes getTransferRun without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ); + client.innerApiCalls.getTransferRun = stubSimpleCall(expectedResponse); + const [response] = await client.getTransferRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ); + client.innerApiCalls.getTransferRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTransferRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTransferRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTransferRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTransferRun with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTransferRun(request), expectedError); + }); + }); + + describe('deleteTransferRun', () => { + it('invokes deleteTransferRun without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferRun = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTransferRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTransferRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTransferRun( + 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.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTransferRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTransferRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTransferRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTransferRun with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTransferRun(request), expectedError); + }); + }); + + describe('checkValidCreds', () => { + it('invokes checkValidCreds without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() + ); + client.innerApiCalls.checkValidCreds = stubSimpleCall(expectedResponse); + const [response] = await client.checkValidCreds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() + ); + client.innerApiCalls.checkValidCreds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkValidCreds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkValidCreds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkValidCreds(request), expectedError); + const actualRequest = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkValidCreds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkValidCreds with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkValidCreds(request), expectedError); + }); + }); + + describe('enrollDataSources', () => { + it('invokes enrollDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.enrollDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.enrollDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.enrollDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enrollDataSources( + 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.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enrollDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enrollDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollDataSources with closed client', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enrollDataSources(request), expectedError); + }); + }); + + describe('listDataSources', () => { + it('invokes listDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.innerApiCalls.listDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSources( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourcesStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.DataSource[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.DataSource + ) => { + 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.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataSourcesStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.DataSource[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.DataSource + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.DataSource() + ), + ]; + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] = + []; + const iterable = client.listDataSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.IDataSource[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferConfigs', () => { + it('invokes listTransferConfigs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.innerApiCalls.listTransferConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransferConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigs without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.innerApiCalls.listTransferConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferConfigsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.descriptors.page.listTransferConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig + ) => { + 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.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferConfigs, request) + ); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferConfigsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferConfigs, request) + ); + assert( + (client.descriptors.page.listTransferConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferConfigs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() + ), + ]; + client.descriptors.page.listTransferConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] = + []; + const iterable = client.listTransferConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferConfigs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferRuns', () => { + it('invokes listTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.innerApiCalls.listTransferRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRuns without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.innerApiCalls.listTransferRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferRuns( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferRunsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.descriptors.page.listTransferRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferRun + ) => { + 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.listTransferRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferRuns, request) + ); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferRunsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferRuns.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferRun + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferRuns, request) + ); + assert( + (client.descriptors.page.listTransferRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferRuns without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() + ), + ]; + client.descriptors.page.listTransferRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] = + []; + const iterable = client.listTransferRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferRuns with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferRuns.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferLogs', () => { + it('invokes listTransferLogs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.innerApiCalls.listTransferLogs = stubSimpleCall(expectedResponse); + const [response] = await client.listTransferLogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogs without error using callback', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.innerApiCalls.listTransferLogs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferLogs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferLogs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferLogs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferLogsStream without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.descriptors.page.listTransferLogs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage + ) => { + 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.listTransferLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferLogs, request) + ); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferLogsStream with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferLogs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.datatransfer.v1.TransferMessage + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferLogs, request) + ); + assert( + (client.descriptors.page.listTransferLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferLogs without error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() + ), + ]; + client.descriptors.page.listTransferLogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] = + []; + const iterable = client.listTransferLogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferLogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferLogs with error', async () => { + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferLogs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferLogsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferLogs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + 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('projectDataSource', () => { + const fakePath = '/rendered/path/projectDataSource'; + const expectedParameters = { + project: 'projectValue', + data_source: 'dataSourceValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectDataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectDataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectDataSourcePath', () => { + const result = client.projectDataSourcePath( + 'projectValue', + 'dataSourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectDataSourceName', () => { + const result = client.matchProjectFromProjectDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataSourceFromProjectDataSourceName', () => { + const result = + client.matchDataSourceFromProjectDataSourceName(fakePath); + assert.strictEqual(result, 'dataSourceValue'); + assert( + ( + client.pathTemplates.projectDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationDataSource', () => { + const fakePath = '/rendered/path/projectLocationDataSource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_source: 'dataSourceValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationDataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationDataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationDataSourcePath', () => { + const result = client.projectLocationDataSourcePath( + 'projectValue', + 'locationValue', + 'dataSourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationDataSourceName', () => { + const result = + client.matchProjectFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationDataSourceName', () => { + const result = + client.matchLocationFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataSourceFromProjectLocationDataSourceName', () => { + const result = + client.matchDataSourceFromProjectLocationDataSourceName(fakePath); + assert.strictEqual(result, 'dataSourceValue'); + assert( + ( + client.pathTemplates.projectLocationDataSourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationTransferConfig', () => { + const fakePath = '/rendered/path/projectLocationTransferConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + transfer_config: 'transferConfigValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationTransferConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationTransferConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationTransferConfigPath', () => { + const result = client.projectLocationTransferConfigPath( + 'projectValue', + 'locationValue', + 'transferConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationTransferConfigName', () => { + const result = + client.matchProjectFromProjectLocationTransferConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationTransferConfigName', () => { + const result = + client.matchLocationFromProjectLocationTransferConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectLocationTransferConfigName', () => { + const result = + client.matchTransferConfigFromProjectLocationTransferConfigName( + fakePath + ); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationTransferConfigRun', () => { + const fakePath = '/rendered/path/projectLocationTransferConfigRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + transfer_config: 'transferConfigValue', + run: 'runValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationTransferConfigRunPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationTransferConfigRunPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationTransferConfigRunPath', () => { + const result = client.projectLocationTransferConfigRunPath( + 'projectValue', + 'locationValue', + 'transferConfigValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchProjectFromProjectLocationTransferConfigRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchLocationFromProjectLocationTransferConfigRunName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchTransferConfigFromProjectLocationTransferConfigRunName( + fakePath + ); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromProjectLocationTransferConfigRunName', () => { + const result = + client.matchRunFromProjectLocationTransferConfigRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.projectLocationTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTransferConfig', () => { + const fakePath = '/rendered/path/projectTransferConfig'; + const expectedParameters = { + project: 'projectValue', + transfer_config: 'transferConfigValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectTransferConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTransferConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTransferConfigPath', () => { + const result = client.projectTransferConfigPath( + 'projectValue', + 'transferConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTransferConfigName', () => { + const result = + client.matchProjectFromProjectTransferConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectTransferConfigName', () => { + const result = + client.matchTransferConfigFromProjectTransferConfigName(fakePath); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectTransferConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTransferConfigRun', () => { + const fakePath = '/rendered/path/projectTransferConfigRun'; + const expectedParameters = { + project: 'projectValue', + transfer_config: 'transferConfigValue', + run: 'runValue', + }; + const client = new datatransferserviceModule.v1.DataTransferServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectTransferConfigRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTransferConfigRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTransferConfigRunPath', () => { + const result = client.projectTransferConfigRunPath( + 'projectValue', + 'transferConfigValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTransferConfigRunName', () => { + const result = + client.matchProjectFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransferConfigFromProjectTransferConfigRunName', () => { + const result = + client.matchTransferConfigFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'transferConfigValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromProjectTransferConfigRunName', () => { + const result = + client.matchRunFromProjectTransferConfigRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.projectTransferConfigRunPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-datatransfer/tsconfig.json b/packages/google-cloud-bigquery-datatransfer/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/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/packages/google-cloud-bigquery-datatransfer/webpack.config.js b/packages/google-cloud-bigquery-datatransfer/webpack.config.js new file mode 100644 index 000000000000..a4ee6847ab33 --- /dev/null +++ b/packages/google-cloud-bigquery-datatransfer/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: 'DataTransferService', + filename: './data-transfer-service.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/packages/google-cloud-bigquery-reservation/.OwlBot.yaml b/packages/google-cloud-bigquery-reservation/.OwlBot.yaml new file mode 100644 index 000000000000..3e852a624ab6 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.OwlBot.yaml @@ -0,0 +1,26 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-preserve-regex: + - /owl-bot-staging/v1beta1 + +deep-copy-regex: + - source: /google/cloud/bigquery/reservation/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-reservation/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-bigquery-reservation/.eslintignore b/packages/google-cloud-bigquery-reservation/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-bigquery-reservation/.eslintrc.json b/packages/google-cloud-bigquery-reservation/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-reservation/.gitattributes b/packages/google-cloud-bigquery-reservation/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-bigquery-reservation/.gitignore b/packages/google-cloud-bigquery-reservation/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.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/packages/google-cloud-bigquery-reservation/.jsdoc.js b/packages/google-cloud-bigquery-reservation/.jsdoc.js new file mode 100644 index 000000000000..2e387bea4d0a --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-reservation', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-reservation/.mocharc.js b/packages/google-cloud-bigquery-reservation/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-bigquery-reservation/.nycrc b/packages/google-cloud-bigquery-reservation/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-reservation/.prettierignore b/packages/google-cloud-bigquery-reservation/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-reservation/.prettierrc.js b/packages/google-cloud-bigquery-reservation/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json new file mode 100644 index 000000000000..aa23e9b238be --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "name": "bigqueryreservation", + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "default_version": "v1", + "api_id": "bigqueryreservation.googleapis.com", + "distribution_name": "@google-cloud/bigquery-reservation", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", + "codeowner_team": "@googleapis/api-bigquery", + "name_pretty": "Google BigQuery Reservation", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest", + "release_level": "stable", + "api_shortname": "bigqueryreservation", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md new file mode 100644 index 000000000000..186cf78d566e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -0,0 +1,144 @@ +# Changelog + +## [2.0.2](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.1...v2.0.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#170](https://github.com/googleapis/nodejs-bigquery-reservation/issues/170)) ([a2bdb93](https://github.com/googleapis/nodejs-bigquery-reservation/commit/a2bdb9342de046fec22897343b3a1c1e696928fc)) + +## [2.0.1](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.0...v2.0.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#169](https://github.com/googleapis/nodejs-bigquery-reservation/issues/169)) ([3532064](https://github.com/googleapis/nodejs-bigquery-reservation/commit/3532064ee2c7d07efe437875aaf18065ca7c036e)) +* Better support for fallback mode ([#165](https://github.com/googleapis/nodejs-bigquery-reservation/issues/165)) ([90fbf83](https://github.com/googleapis/nodejs-bigquery-reservation/commit/90fbf831bb4dbb4b5b03d782deeb5c8dc854e8dc)) +* Change import long to require ([#166](https://github.com/googleapis/nodejs-bigquery-reservation/issues/166)) ([c41ce5a](https://github.com/googleapis/nodejs-bigquery-reservation/commit/c41ce5a29572372d8e6ec8b0d2ca2901e10dfb71)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-reservation/issues/1553)) ([#168](https://github.com/googleapis/nodejs-bigquery-reservation/issues/168)) ([56f9393](https://github.com/googleapis/nodejs-bigquery-reservation/commit/56f939367a5e3e8367c3d907638acefbcb945e8d)) +* **docs:** Document fallback rest option ([#161](https://github.com/googleapis/nodejs-bigquery-reservation/issues/161)) ([9db1472](https://github.com/googleapis/nodejs-bigquery-reservation/commit/9db14722d4bd6c74e47a4145691b3920bb82ebe0)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-reservation/issues/1546)) ([#167](https://github.com/googleapis/nodejs-bigquery-reservation/issues/167)) ([fd418d7](https://github.com/googleapis/nodejs-bigquery-reservation/commit/fd418d758721e21e86ecfab0f5e4c82fc8f40726)) + +## [2.0.0](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v1.4.0...v2.0.0) (2022-06-07) + + +### ⚠ BREAKING CHANGES + +* Update library to use Node 12 +* update library to use Node 12 (#155) + +### Build System + +* update library to use Node 12 ([#155](https://github.com/googleapis/nodejs-bigquery-reservation/issues/155)) ([408fedd](https://github.com/googleapis/nodejs-bigquery-reservation/commit/408feddc7218687fcb8c4f0ee332b5231fb705eb)) + + +### *build + +* Update library to use Node 12 ([408fedd](https://github.com/googleapis/nodejs-bigquery-reservation/commit/408feddc7218687fcb8c4f0ee332b5231fb705eb)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.3.0...v1.4.0) (2021-12-30) + + +### Features + +* increase the logical timeout (retry deadline) to 5 minutes ([#120](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/120)) ([5510500](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5510500551df96a89c9481d7fe30b0cc95de5918)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.2.0...v1.3.0) (2021-09-01) + + +### Features + +* Added commitment_start_time to capacity commitments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Force deleting capacity commitments is allowed ... ([#103](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/103)) ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Reservation objects now contain a creation time and an update time ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.6...v1.2.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#100](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/100)) ([0047223](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/004722310ece662732fe60c8941be1b30214ed6d)) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#97](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/97)) ([2e5a332](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/2e5a332b21067dd73ec6d2b218b87b61b8ebf59e)) +* **deps:** google-gax v2.24.1 ([#99](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/99)) ([3a4cdec](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/3a4cdec8d028f0d6fd6d8ebc3977c00231b290bb)) + +### [1.1.6](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.5...v1.1.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#89](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/89)) ([b7b0b92](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b7b0b9263f2f8fd0fcb8fd977fc7f24727138b29)) + +### [1.1.5](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.4...v1.1.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#87](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/87)) ([9081a32](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/9081a3237099c98bb5d3694785afbe9ff4dcaaea)) + +### [1.1.4](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.3...v1.1.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#84](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/84)) ([42c4bcb](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/42c4bcb09e5f1c7b604e923a89b05fa895f663c8)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.2...v1.1.3) (2021-06-25) + + +### Bug Fixes + +* make request optional in all cases ([#80](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/80)) ([5cf25a7](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5cf25a7b312ce3a009635a18125ab8f10a096089)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.1...v1.1.2) (2021-06-07) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#72](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/72)) ([17a06f7](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/17a06f7921e7c0200f1ff73ed29cd03c4c85b560)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.0...v1.1.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#64](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/64)) ([57b7f5b](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/57b7f5b3356bf9f00d28d3a0d8b4c329ae8d61b9)) +* use require() to load JSON protos ([#67](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/67)) ([ea052ed](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/ea052ed26f0474c849def47d73d41c0ebdc9f432)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.2...v1.1.0) (2021-01-09) + + +### Features + +* introduce style enumeration ([#43](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/43)) ([06bfdc6](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/06bfdc6a0c6c3b0416bbb34ff5b46e96256215ef)) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/bigquery-reservation to ^1.0.1 ([#38](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/38)) ([b4ee172](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b4ee172520adbbdff077d2a1db7d72c88401f98a)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.1...v1.0.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([5a32067](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5a32067bdc000025c3166c72069db861800be5d8)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.0...v1.0.1) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#28](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/28)) ([fa58436](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/fa584362f0c9ef485bbb8e76db143565cb144317)) + +## 1.0.0 (2020-07-14) + + +### Features + +* generate v1 of the API ([#2](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/2)) ([e368d52](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/e368d5289c8c18b974a6e470320e0c23f2772dcd)) diff --git a/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md b/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md new file mode 100644 index 000000000000..c5e938c011bb --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Reservation API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/LICENSE b/packages/google-cloud-bigquery-reservation/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md new file mode 100644 index 000000000000..070419bfd541 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -0,0 +1,194 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Reservation: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) + + + + +BigQuery Reservation client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google BigQuery Reservation Node.js Client API Reference][client-docs] +* [Google BigQuery Reservation Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Reservation API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigquery-reservation +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const { + ReservationServiceClient, +} = require('@google-cloud/bigquery-reservation'); + +// Creates a client +const client = new ReservationServiceClient(); + +// project = 'my-project' // Project to list reservations for. +// location = 'US' // BigQuery location. + +async function listReservations() { + const [reservations] = await client.listReservations({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${reservations.length} reservations`); + console.info(reservations); +} + +async function listCapacityCommitments() { + const [commitments] = await client.listCapacityCommitments({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${commitments.length} commitments`); + console.info(commitments); +} + +listReservations(); +listCapacityCommitments(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Reservation_service.create_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js,samples/README.md) | +| Reservation_service.create_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js,samples/README.md) | +| Reservation_service.create_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js,samples/README.md) | +| Reservation_service.delete_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js,samples/README.md) | +| Reservation_service.delete_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js,samples/README.md) | +| Reservation_service.delete_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js,samples/README.md) | +| Reservation_service.get_bi_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js,samples/README.md) | +| Reservation_service.get_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js,samples/README.md) | +| Reservation_service.get_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js,samples/README.md) | +| Reservation_service.list_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js,samples/README.md) | +| Reservation_service.list_capacity_commitments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js,samples/README.md) | +| Reservation_service.list_reservations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js,samples/README.md) | +| Reservation_service.merge_capacity_commitments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js,samples/README.md) | +| Reservation_service.move_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js,samples/README.md) | +| Reservation_service.search_all_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js,samples/README.md) | +| Reservation_service.search_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js,samples/README.md) | +| Reservation_service.split_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js,samples/README.md) | +| Reservation_service.update_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js,samples/README.md) | +| Reservation_service.update_bi_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js,samples/README.md) | +| Reservation_service.update_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js,samples/README.md) | +| Reservation_service.update_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/test/quickstart.js,samples/README.md) | + + + +The [Google BigQuery Reservation Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigquery-reservation@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest +[product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-reservation/linkinator.config.json b/packages/google-cloud-bigquery-reservation/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json new file mode 100644 index 000000000000..91a96d2015ad --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/bigquery-reservation", + "version": "2.0.2", + "description": "BigQuery Reservation client for Node.js", + "repository": "googleapis/nodejs-bigquery-reservation", + "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 reservation", + "reservation", + "reservation service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm i", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.2.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.4", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto new file mode 100644 index 000000000000..7276c30b5723 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto @@ -0,0 +1,1055 @@ +// Copyright 2022 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.cloud.bigquery.reservation.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/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Reservation.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation"; +option java_multiple_files = true; +option java_outer_classname = "ReservationProto"; +option java_package = "com.google.cloud.bigquery.reservation.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Reservation\\V1"; + +// This API allows users to manage their flat-rate BigQuery reservations. +// +// A reservation provides computational resource guarantees, in the form of +// [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a +// unit of computational power in BigQuery, and serves as the basic unit of +// parallelism. In a scan of a multi-partitioned table, a single slot operates +// on a single partition of the table. A reservation resource exists as a child +// resource of the admin project and location, e.g.: +// `projects/myproject/locations/US/reservations/reservationName`. +// +// A capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. A capacity +// commitment resource exists as a child resource of the admin project and +// location, e.g.: +// `projects/myproject/locations/US/capacityCommitments/id`. +service ReservationService { + option (google.api.default_host) = "bigqueryreservation.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new reservation resource. + rpc CreateReservation(CreateReservationRequest) returns (Reservation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/reservations" + body: "reservation" + }; + option (google.api.method_signature) = "parent,reservation,reservation_id"; + } + + // Lists all the reservations for the project in the specified location. + rpc ListReservations(ListReservationsRequest) returns (ListReservationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/reservations" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the reservation. + rpc GetReservation(GetReservationRequest) returns (Reservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a reservation. + // Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + // assignments. + rpc DeleteReservation(DeleteReservationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing reservation resource. + rpc UpdateReservation(UpdateReservationRequest) returns (Reservation) { + option (google.api.http) = { + patch: "/v1/{reservation.name=projects/*/locations/*/reservations/*}" + body: "reservation" + }; + option (google.api.method_signature) = "reservation,update_mask"; + } + + // Creates a new capacity commitment resource. + rpc CreateCapacityCommitment(CreateCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/capacityCommitments" + body: "capacity_commitment" + }; + option (google.api.method_signature) = "parent,capacity_commitment"; + } + + // Lists all the capacity commitments for the admin project. + rpc ListCapacityCommitments(ListCapacityCommitmentsRequest) returns (ListCapacityCommitmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/capacityCommitments" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the capacity commitment. + rpc GetCapacityCommitment(GetCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a capacity commitment. Attempting to delete capacity commitment + // before its commitment_end_time will fail with the error code + // `google.rpc.Code.FAILED_PRECONDITION`. + rpc DeleteCapacityCommitment(DeleteCapacityCommitmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing capacity commitment. + // + // Only `plan` and `renewal_plan` fields can be updated. + // + // Plan can only be changed to a plan of a longer commitment period. + // Attempting to change to a plan with shorter commitment period will fail + // with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc UpdateCapacityCommitment(UpdateCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + patch: "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}" + body: "capacity_commitment" + }; + option (google.api.method_signature) = "capacity_commitment,update_mask"; + } + + // Splits capacity commitment to two commitments of the same plan and + // `commitment_end_time`. + // + // A common use case is to enable downgrading commitments. + // + // For example, in order to downgrade from 10000 slots to 8000, you might + // split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + // you delete the first one after the commitment end time passes. + rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest) returns (SplitCapacityCommitmentResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split" + body: "*" + }; + option (google.api.method_signature) = "name,slot_count"; + } + + // Merges capacity commitments of the same plan into a single commitment. + // + // The resulting capacity commitment has the greater commitment_end_time + // out of the to-be-merged capacity commitments. + // + // Attempting to merge capacity commitments of different plan will fail + // with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc MergeCapacityCommitments(MergeCapacityCommitmentsRequest) returns (CapacityCommitment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge" + body: "*" + }; + option (google.api.method_signature) = "parent,capacity_commitment_ids"; + } + + // Creates an assignment object which allows the given project to submit jobs + // of a certain type using slots from the specified reservation. + // + // Currently a + // resource (project, folder, organization) can only have one assignment per + // each (job_type, location) combination, and that reservation will be used + // for all jobs of the matching type. + // + // Different assignments can be created on different levels of the + // projects, folders or organization hierarchy. During query execution, + // the assignment is looked up at the project, folder and organization levels + // in that order. The first assignment found is applied to the query. + // + // When creating assignments, it does not matter if other assignments exist at + // higher levels. + // + // Example: + // + // * The organization `organizationA` contains two projects, `project1` + // and `project2`. + // * Assignments for all three entities (`organizationA`, `project1`, and + // `project2`) could all be created and mapped to the same or different + // reservations. + // + // "None" assignments represent an absence of the assignment. Projects + // assigned to None use on-demand pricing. To create a "None" assignment, use + // "none" as a reservation_id in the parent. Example parent: + // `projects/myproject/locations/US/reservations/none`. + // + // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + // 'bigquery.admin' permissions on the project using the reservation + // and the project that owns this reservation. + // + // Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + // does not match location of the reservation. + rpc CreateAssignment(CreateAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + body: "assignment" + }; + option (google.api.method_signature) = "parent,assignment"; + } + + // Lists assignments. + // + // Only explicitly created assignments will be returned. + // + // Example: + // + // * Organization `organizationA` contains two projects, `project1` and + // `project2`. + // * Reservation `res1` exists and was created previously. + // * CreateAssignment was used previously to define the following + // associations between entities and reservations: `` + // and `` + // + // In this example, ListAssignments will just return the above two assignments + // for reservation `res1`, and no expansion/merge will happen. + // + // The wildcard "-" can be used for + // reservations in the request. In that case all assignments belongs to the + // specified project and location will be listed. + // + // **Note** "-" cannot be used for projects nor locations. + rpc ListAssignments(ListAssignmentsRequest) returns (ListAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a assignment. No expansion will happen. + // + // Example: + // + // * Organization `organizationA` contains two projects, `project1` and + // `project2`. + // * Reservation `res1` exists and was created previously. + // * CreateAssignment was used previously to define the following + // associations between entities and reservations: `` + // and `` + // + // In this example, deletion of the `` assignment won't + // affect the other assignment ``. After said deletion, + // queries from `project1` will still use `res1` while queries from + // `project2` will switch to use on-demand mode. + rpc DeleteAssignment(DeleteAssignmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deprecated: Looks up assignments for a specified resource for a particular + // region. If the request is about a project: + // + // 1. Assignments created on the project will be returned if they exist. + // 2. Otherwise assignments created on the closest ancestor will be + // returned. + // 3. Assignments for different JobTypes will all be returned. + // + // The same logic applies if the request is about a folder. + // + // If the request is about an organization, then assignments created on the + // organization will be returned (organization doesn't have ancestors). + // + // Comparing to ListAssignments, there are some behavior + // differences: + // + // 1. permission on the assignee will be verified in this API. + // 2. Hierarchy lookup (project->folder->organization) happens in this API. + // 3. Parent here is `projects/*/locations/*`, instead of + // `projects/*/locations/*reservations/*`. + // + // **Note** "-" cannot be used for projects + // nor locations. + rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) { + option deprecated = true; + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + + // Looks up assignments for a specified resource for a particular region. + // If the request is about a project: + // + // 1. Assignments created on the project will be returned if they exist. + // 2. Otherwise assignments created on the closest ancestor will be + // returned. + // 3. Assignments for different JobTypes will all be returned. + // + // The same logic applies if the request is about a folder. + // + // If the request is about an organization, then assignments created on the + // organization will be returned (organization doesn't have ancestors). + // + // Comparing to ListAssignments, there are some behavior + // differences: + // + // 1. permission on the assignee will be verified in this API. + // 2. Hierarchy lookup (project->folder->organization) happens in this API. + // 3. Parent here is `projects/*/locations/*`, instead of + // `projects/*/locations/*reservations/*`. + rpc SearchAllAssignments(SearchAllAssignmentsRequest) returns (SearchAllAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAllAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + + // Moves an assignment under a new reservation. + // + // This differs from removing an existing assignment and recreating a new one + // by providing a transactional change that ensures an assignee always has an + // associated reservation. + rpc MoveAssignment(MoveAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name,destination_id"; + } + + // Updates an existing assignment. + // + // Only the `priority` field can be updated. + rpc UpdateAssignment(UpdateAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + patch: "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}" + body: "assignment" + }; + option (google.api.method_signature) = "assignment,update_mask"; + } + + // Retrieves a BI reservation. + rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/biReservation}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a BI reservation. + // + // Only fields specified in the `field_mask` are updated. + // + // A singleton BI reservation always exists with default size 0. + // In order to reserve BI capacity it needs to be updated to an amount + // greater than 0. In order to release BI capacity reservation size + // must be set to 0. + rpc UpdateBiReservation(UpdateBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + patch: "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}" + body: "bi_reservation" + }; + option (google.api.method_signature) = "bi_reservation,update_mask"; + } +} + +// A reservation is a mechanism used to guarantee slots to users. +message Reservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Reservation" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}" + }; + + // The resource name of the reservation, e.g., + // `projects/*/locations/*/reservations/team1-prod`. + // The reservation_id must only contain lower case alphanumeric characters or + // dashes. It must start with a letter and must not end with a dash. Its + // maximum length is 64 characters. + string name = 1; + + // Minimum slots available to this reservation. A slot is a unit of + // computational power in BigQuery, and serves as the unit of parallelism. + // + // Queries using this reservation might use more slots during runtime if + // ignore_idle_slots is set to false. + // + // If the new reservation's slot capacity exceeds the project's slot capacity + // or if total slot capacity of the new reservation and its siblings exceeds + // the project's slot capacity, the request will fail with + // `google.rpc.Code.RESOURCE_EXHAUSTED`. + // + // NOTE: for reservations in US or EU multi-regions, slot capacity constraints + // are checked separately for default and auxiliary regions. See + // multi_region_auxiliary flag for more details. + int64 slot_capacity = 2; + + // If false, any query or pipeline job using this reservation will use idle + // slots from other reservations within the same admin project. If true, a + // query or pipeline job using this reservation will execute with the slot + // capacity specified in the slot_capacity field at most. + bool ignore_idle_slots = 4; + + // Maximum number of queries that are allowed to run concurrently in this + // reservation. This is a soft limit due to asynchronous nature of the system + // and various optimizations for small queries. + // Default value is 0 which means that concurrency will be automatically set + // based on the reservation size. + int64 concurrency = 16; + + // Output only. Creation time of the reservation. + google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of the reservation. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Applicable only for reservations located within one of the BigQuery + // multi-regions (US or EU). + // + // If set to true, this reservation is placed in the organization's + // secondary region which is designated for disaster recovery purposes. + // If false, this reservation is placed in the organization's default region. + bool multi_region_auxiliary = 14; +} + +// Capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. Annual +// commitments renew by default. Commitments can be removed after their +// commitment end time passes. +// +// In order to remove annual commitment, its plan needs to be changed +// to monthly or flex first. +// +// A capacity commitment resource exists as a child resource of the admin +// project. +message CapacityCommitment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + pattern: "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}" + }; + + // Commitment plan defines the current committed period. Capacity commitment + // cannot be deleted during it's committed period. + enum CommitmentPlan { + // Invalid plan value. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + COMMITMENT_PLAN_UNSPECIFIED = 0; + + // Flex commitments have committed period of 1 minute after becoming ACTIVE. + // After that, they are not in a committed period anymore and can be removed + // any time. + FLEX = 3; + + // Trial commitments have a committed period of 182 days after becoming + // ACTIVE. After that, they are converted to a new commitment based on the + // `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so + // that it can be deleted right after committed period ends. + TRIAL = 5; + + // Monthly commitments have a committed period of 30 days after becoming + // ACTIVE. After that, they are not in a committed period anymore and can be + // removed any time. + MONTHLY = 2; + + // Annual commitments have a committed period of 365 days after becoming + // ACTIVE. After that they are converted to a new commitment based on the + // renewal_plan. + ANNUAL = 4; + } + + // Capacity commitment can either become ACTIVE right away or transition + // from PENDING to ACTIVE or FAILED. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Capacity commitment is pending provisioning. Pending capacity commitment + // does not contribute to the project's slot_capacity. + PENDING = 1; + + // Once slots are provisioned, capacity commitment becomes active. + // slot_count is added to the project's slot_capacity. + ACTIVE = 2; + + // Capacity commitment is failed to be activated by the backend. + FAILED = 3; + } + + // Output only. The resource name of the capacity commitment, e.g., + // `projects/myproject/locations/US/capacityCommitments/123` + // The commitment_id must only contain lower case alphanumeric characters or + // dashes. It must start with a letter and must not end + // with a dash. Its maximum length is 64 characters. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of slots in this commitment. + int64 slot_count = 2; + + // Capacity commitment commitment plan. + CommitmentPlan plan = 3; + + // Output only. State of the commitment. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start of the current commitment period. It is applicable only for + // ACTIVE capacity commitments. + google.protobuf.Timestamp commitment_start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end of the current commitment period. It is applicable only for ACTIVE + // capacity commitments. + google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For FAILED commitment plan, provides the reason of failure. + google.rpc.Status failure_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The plan this capacity commitment is converted to after commitment_end_time + // passes. Once the plan is changed, committed period is extended according to + // commitment plan. Only applicable for ANNUAL and TRIAL commitments. + CommitmentPlan renewal_plan = 8; + + // Applicable only for commitments located within one of the BigQuery + // multi-regions (US or EU). + // + // If set to true, this commitment is placed in the organization's + // secondary region which is designated for disaster recovery purposes. + // If false, this commitment is placed in the organization's default region. + bool multi_region_auxiliary = 10; +} + +// The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation]. +message CreateReservationRequest { + // Required. Project, location. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The reservation ID. It must only contain lower case alphanumeric + // characters or dashes. It must start with a letter and must not end + // with a dash. Its maximum length is 64 characters. + string reservation_id = 2; + + // Definition of the new reservation to create. + Reservation reservation = 3; +} + +// The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsRequest { + // Required. The parent resource name containing project and location, e.g.: + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The maximum number of items to return per page. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsResponse { + // List of reservations visible to the user. + repeated Reservation reservations = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation]. +message GetReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // `projects/myproject/locations/US/reservations/team1-prod` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation]. +message DeleteReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // `projects/myproject/locations/US/reservations/team1-prod` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation]. +message UpdateReservationRequest { + // Content of the reservation to update. + Reservation reservation = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment]. +message CreateCapacityCommitmentRequest { + // Required. Resource name of the parent reservation. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Content of the capacity commitment to create. + CapacityCommitment capacity_commitment = 2; + + // If true, fail the request if another project in the organization has a + // capacity commitment. + bool enforce_single_admin_project_per_org = 4; + + // The optional capacity commitment ID. Capacity commitment name will be + // generated automatically if this field is empty. + // This field must only contain lower case alphanumeric characters or dashes. + // The first and last character cannot be a dash. Max length is 64 characters. + // NOTE: this ID won't be kept if the capacity commitment is split or merged. + string capacity_commitment_id = 5; +} + +// The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsRequest { + // Required. Resource name of the parent reservation. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsResponse { + // List of capacity commitments visible to the user. + repeated CapacityCommitment capacity_commitments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment]. +message GetCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to retrieve. E.g., + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; +} + +// The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment]. +message DeleteCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to delete. E.g., + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Can be used to force delete commitments even if assignments exist. Deleting + // commitments with assignments may cause queries to fail if they no longer + // have access to slots. + bool force = 3; +} + +// The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment]. +message UpdateCapacityCommitmentRequest { + // Content of the capacity commitment to update. + CapacityCommitment capacity_commitment = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentRequest { + // Required. The resource name e.g.,: + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Number of slots in the capacity commitment after the split. + int64 slot_count = 2; +} + +// The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentResponse { + // First capacity commitment, result of a split. + CapacityCommitment first = 1; + + // Second capacity commitment, result of a split. + CapacityCommitment second = 2; +} + +// The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments]. +message MergeCapacityCommitmentsRequest { + // Parent resource that identifies admin project and location e.g., + // `projects/myproject/locations/us` + string parent = 1 [(google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + }]; + + // Ids of capacity commitments to merge. + // These capacity commitments must exist under admin project and location + // specified in the parent. + // ID is the last portion of capacity commitment name e.g., 'abc' for + // projects/myproject/locations/US/capacityCommitments/abc + repeated string capacity_commitment_ids = 2; +} + +// An assignment allows a project to submit jobs +// of a certain type using slots from the specified reservation. +message Assignment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Assignment" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}" + }; + + // Types of job, which could be specified when using the reservation. + enum JobType { + // Invalid type. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + JOB_TYPE_UNSPECIFIED = 0; + + // Pipeline (load/export) jobs from the project will use the reservation. + PIPELINE = 1; + + // Query jobs from the project will use the reservation. + QUERY = 2; + + // BigQuery ML jobs that use services external to BigQuery for model + // training. These jobs will not utilize idle slots from other reservations. + ML_EXTERNAL = 3; + } + + // Assignment will remain in PENDING state if no active capacity commitment is + // present. It will become ACTIVE when some capacity commitment becomes + // active. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Queries from assignee will be executed as on-demand, if related + // assignment is pending. + PENDING = 1; + + // Assignment is ready. + ACTIVE = 2; + } + + // Output only. Name of the resource. E.g.: + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + // The assignment_id must only contain lower case alphanumeric characters or + // dashes and the max length is 64 characters. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource which will use the reservation. E.g. + // `projects/myproject`, `folders/123`, or `organizations/456`. + string assignee = 4; + + // Which type of jobs will use the reservation. + JobType job_type = 3; + + // Output only. State of the assignment. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. +// Note: "bigquery.reservationAssignments.create" permission is required on the +// related assignee. +message CreateAssignmentRequest { + // Required. The parent resource name of the assignment + // E.g. `projects/myproject/locations/US/reservations/team1-prod` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // Assignment resource to create. + Assignment assignment = 2; + + // The optional assignment ID. Assignment name will be generated automatically + // if this field is empty. + // This field must only contain lower case alphanumeric characters or dashes. + // Max length is 64 characters. + string assignment_id = 4; +} + +// The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsRequest { + // Required. The parent resource name e.g.: + // + // `projects/myproject/locations/US/reservations/team1-prod` + // + // Or: + // + // `projects/myproject/locations/US/reservations/-` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // The maximum number of items to return per page. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. +// Note: "bigquery.reservationAssignments.delete" permission is required on the +// related assignee. +message DeleteAssignmentRequest { + // Required. Name of the resource, e.g. + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; +} + +// The request for +// [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAssignmentsRequest { + // Required. The resource name of the admin project(containing project and location), + // e.g.: + // `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Please specify resource name as assignee in the query. + // + // Examples: + // + // * `assignee=projects/myproject` + // * `assignee=folders/123` + // * `assignee=organizations/456` + string query = 2; + + // The maximum number of items to return per page. + int32 page_size = 3; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 4; +} + +// The request for +// [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAllAssignmentsRequest { + // Required. The resource name with location (project name could be the wildcard '-'), + // e.g.: + // `projects/-/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Please specify resource name as assignee in the query. + // + // Examples: + // + // * `assignee=projects/myproject` + // * `assignee=folders/123` + // * `assignee=organizations/456` + string query = 2; + + // The maximum number of items to return per page. + int32 page_size = 3; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 4; +} + +// The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. +message SearchAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +message SearchAllAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for +// [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment]. +// +// **Note**: "bigquery.reservationAssignments.create" permission is required on +// the destination_id. +// +// **Note**: "bigquery.reservationAssignments.create" and +// "bigquery.reservationAssignments.delete" permission are required on the +// related assignee. +message MoveAssignmentRequest { + // Required. The resource name of the assignment, + // e.g. + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // The new reservation ID, e.g.: + // `projects/myotherproject/locations/US/reservations/team2-prod` + string destination_id = 3 [(google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + }]; +} + +// The request for [ReservationService.UpdateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment]. +message UpdateAssignmentRequest { + // Content of the assignment to update. + Assignment assignment = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Fully qualified reference to BigQuery table. +// Internally stored as google.cloud.bi.v1.BqTableReference. +message TableReference { + // The assigned project ID of the project. + string project_id = 1; + + // The ID of the dataset in the above project. + string dataset_id = 2; + + // The ID of the table in the above dataset. + string table_id = 3; +} + +// Represents a BI Reservation. +message BiReservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/BiReservation" + pattern: "projects/{project}/locations/{location}/biReservation" + }; + + // The resource name of the singleton BI reservation. + // Reservation names have the form + // `projects/{project_id}/locations/{location_id}/biReservation`. + string name = 1; + + // Output only. The last update timestamp of a reservation. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Size of a reservation, in bytes. + int64 size = 4; + + // Preferred tables to use BI capacity for. + repeated TableReference preferred_tables = 5; +} + +// A request to get a singleton BI reservation. +message GetBiReservationRequest { + // Required. Name of the requested reservation, for example: + // `projects/{project_id}/locations/{location_id}/biReservation` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/BiReservation" + } + ]; +} + +// A request to update a BI reservation. +message UpdateBiReservationRequest { + // A reservation to update. + BiReservation bi_reservation = 1; + + // A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts new file mode 100644 index 000000000000..ddc95a1df0cc --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -0,0 +1,8454 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace reservation. */ + namespace reservation { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a ReservationService */ + class ReservationService extends $protobuf.rpc.Service { + + /** + * Constructs a new ReservationService 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 ReservationService 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): ReservationService; + + /** + * Calls CreateReservation. + * @param request CreateReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public createReservation(request: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationCallback): void; + + /** + * Calls CreateReservation. + * @param request CreateReservationRequest message or plain object + * @returns Promise + */ + public createReservation(request: google.cloud.bigquery.reservation.v1.ICreateReservationRequest): Promise; + + /** + * Calls ListReservations. + * @param request ListReservationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReservationsResponse + */ + public listReservations(request: google.cloud.bigquery.reservation.v1.IListReservationsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListReservationsCallback): void; + + /** + * Calls ListReservations. + * @param request ListReservationsRequest message or plain object + * @returns Promise + */ + public listReservations(request: google.cloud.bigquery.reservation.v1.IListReservationsRequest): Promise; + + /** + * Calls GetReservation. + * @param request GetReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public getReservation(request: google.cloud.bigquery.reservation.v1.IGetReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetReservationCallback): void; + + /** + * Calls GetReservation. + * @param request GetReservationRequest message or plain object + * @returns Promise + */ + public getReservation(request: google.cloud.bigquery.reservation.v1.IGetReservationRequest): Promise; + + /** + * Calls DeleteReservation. + * @param request DeleteReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReservation(request: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationCallback): void; + + /** + * Calls DeleteReservation. + * @param request DeleteReservationRequest message or plain object + * @returns Promise + */ + public deleteReservation(request: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest): Promise; + + /** + * Calls UpdateReservation. + * @param request UpdateReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public updateReservation(request: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservationCallback): void; + + /** + * Calls UpdateReservation. + * @param request UpdateReservationRequest message or plain object + * @returns Promise + */ + public updateReservation(request: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest): Promise; + + /** + * Calls CreateCapacityCommitment. + * @param request CreateCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public createCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitmentCallback): void; + + /** + * Calls CreateCapacityCommitment. + * @param request CreateCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public createCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest): Promise; + + /** + * Calls ListCapacityCommitments. + * @param request ListCapacityCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCapacityCommitmentsResponse + */ + public listCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitmentsCallback): void; + + /** + * Calls ListCapacityCommitments. + * @param request ListCapacityCommitmentsRequest message or plain object + * @returns Promise + */ + public listCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest): Promise; + + /** + * Calls GetCapacityCommitment. + * @param request GetCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public getCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitmentCallback): void; + + /** + * Calls GetCapacityCommitment. + * @param request GetCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public getCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest): Promise; + + /** + * Calls DeleteCapacityCommitment. + * @param request DeleteCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitmentCallback): void; + + /** + * Calls DeleteCapacityCommitment. + * @param request DeleteCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public deleteCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest): Promise; + + /** + * Calls UpdateCapacityCommitment. + * @param request UpdateCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public updateCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitmentCallback): void; + + /** + * Calls UpdateCapacityCommitment. + * @param request UpdateCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public updateCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest): Promise; + + /** + * Calls SplitCapacityCommitment. + * @param request SplitCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SplitCapacityCommitmentResponse + */ + public splitCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitmentCallback): void; + + /** + * Calls SplitCapacityCommitment. + * @param request SplitCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public splitCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest): Promise; + + /** + * Calls MergeCapacityCommitments. + * @param request MergeCapacityCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public mergeCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitmentsCallback): void; + + /** + * Calls MergeCapacityCommitments. + * @param request MergeCapacityCommitmentsRequest message or plain object + * @returns Promise + */ + public mergeCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest): Promise; + + /** + * Calls CreateAssignment. + * @param request CreateAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public createAssignment(request: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignmentCallback): void; + + /** + * Calls CreateAssignment. + * @param request CreateAssignmentRequest message or plain object + * @returns Promise + */ + public createAssignment(request: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest): Promise; + + /** + * Calls ListAssignments. + * @param request ListAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssignmentsResponse + */ + public listAssignments(request: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListAssignmentsCallback): void; + + /** + * Calls ListAssignments. + * @param request ListAssignmentsRequest message or plain object + * @returns Promise + */ + public listAssignments(request: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest): Promise; + + /** + * Calls DeleteAssignment. + * @param request DeleteAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAssignment(request: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignmentCallback): void; + + /** + * Calls DeleteAssignment. + * @param request DeleteAssignmentRequest message or plain object + * @returns Promise + */ + public deleteAssignment(request: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest): Promise; + + /** + * Calls SearchAssignments. + * @param request SearchAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAssignmentsResponse + */ + public searchAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignmentsCallback): void; + + /** + * Calls SearchAssignments. + * @param request SearchAssignmentsRequest message or plain object + * @returns Promise + */ + public searchAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest): Promise; + + /** + * Calls SearchAllAssignments. + * @param request SearchAllAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllAssignmentsResponse + */ + public searchAllAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignmentsCallback): void; + + /** + * Calls SearchAllAssignments. + * @param request SearchAllAssignmentsRequest message or plain object + * @returns Promise + */ + public searchAllAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest): Promise; + + /** + * Calls MoveAssignment. + * @param request MoveAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public moveAssignment(request: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignmentCallback): void; + + /** + * Calls MoveAssignment. + * @param request MoveAssignmentRequest message or plain object + * @returns Promise + */ + public moveAssignment(request: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest): Promise; + + /** + * Calls UpdateAssignment. + * @param request UpdateAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public updateAssignment(request: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignmentCallback): void; + + /** + * Calls UpdateAssignment. + * @param request UpdateAssignmentRequest message or plain object + * @returns Promise + */ + public updateAssignment(request: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest): Promise; + + /** + * Calls GetBiReservation. + * @param request GetBiReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BiReservation + */ + public getBiReservation(request: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservationCallback): void; + + /** + * Calls GetBiReservation. + * @param request GetBiReservationRequest message or plain object + * @returns Promise + */ + public getBiReservation(request: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest): Promise; + + /** + * Calls UpdateBiReservation. + * @param request UpdateBiReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BiReservation + */ + public updateBiReservation(request: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservationCallback): void; + + /** + * Calls UpdateBiReservation. + * @param request UpdateBiReservationRequest message or plain object + * @returns Promise + */ + public updateBiReservation(request: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest): Promise; + } + + namespace ReservationService { + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type CreateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listReservations}. + * @param error Error, if any + * @param [response] ListReservationsResponse + */ + type ListReservationsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListReservationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type GetReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteReservation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReservationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type UpdateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type CreateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listCapacityCommitments}. + * @param error Error, if any + * @param [response] ListCapacityCommitmentsResponse + */ + type ListCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type GetCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteCapacityCommitment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCapacityCommitmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type UpdateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|splitCapacityCommitment}. + * @param error Error, if any + * @param [response] SplitCapacityCommitmentResponse + */ + type SplitCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|mergeCapacityCommitments}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type MergeCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type CreateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listAssignments}. + * @param error Error, if any + * @param [response] ListAssignmentsResponse + */ + type ListAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteAssignment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAssignmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAssignments}. + * @param error Error, if any + * @param [response] SearchAssignmentsResponse + */ + type SearchAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAllAssignments}. + * @param error Error, if any + * @param [response] SearchAllAssignmentsResponse + */ + type SearchAllAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|moveAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type MoveAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type UpdateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getBiReservation}. + * @param error Error, if any + * @param [response] BiReservation + */ + type GetBiReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.BiReservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateBiReservation}. + * @param error Error, if any + * @param [response] BiReservation + */ + type UpdateBiReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.BiReservation) => void; + } + + /** Properties of a Reservation. */ + interface IReservation { + + /** Reservation name */ + name?: (string|null); + + /** Reservation slotCapacity */ + slotCapacity?: (number|Long|string|null); + + /** Reservation ignoreIdleSlots */ + ignoreIdleSlots?: (boolean|null); + + /** Reservation concurrency */ + concurrency?: (number|Long|string|null); + + /** Reservation creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** Reservation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Reservation multiRegionAuxiliary */ + multiRegionAuxiliary?: (boolean|null); + } + + /** Represents a Reservation. */ + class Reservation implements IReservation { + + /** + * Constructs a new Reservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IReservation); + + /** Reservation name. */ + public name: string; + + /** Reservation slotCapacity. */ + public slotCapacity: (number|Long|string); + + /** Reservation ignoreIdleSlots. */ + public ignoreIdleSlots: boolean; + + /** Reservation concurrency. */ + public concurrency: (number|Long|string); + + /** Reservation creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** Reservation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Reservation multiRegionAuxiliary. */ + public multiRegionAuxiliary: boolean; + + /** + * Creates a new Reservation instance using the specified properties. + * @param [properties] Properties to set + * @returns Reservation instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IReservation): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @param message Reservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @param message Reservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reservation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Decodes a Reservation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Verifies a Reservation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reservation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reservation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Creates a plain object from a Reservation message. Also converts values to other types if specified. + * @param message Reservation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.Reservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reservation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CapacityCommitment. */ + interface ICapacityCommitment { + + /** CapacityCommitment name */ + name?: (string|null); + + /** CapacityCommitment slotCount */ + slotCount?: (number|Long|string|null); + + /** CapacityCommitment plan */ + plan?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null); + + /** CapacityCommitment state */ + state?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null); + + /** CapacityCommitment commitmentStartTime */ + commitmentStartTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment commitmentEndTime */ + commitmentEndTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment failureStatus */ + failureStatus?: (google.rpc.IStatus|null); + + /** CapacityCommitment renewalPlan */ + renewalPlan?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null); + + /** CapacityCommitment multiRegionAuxiliary */ + multiRegionAuxiliary?: (boolean|null); + } + + /** Represents a CapacityCommitment. */ + class CapacityCommitment implements ICapacityCommitment { + + /** + * Constructs a new CapacityCommitment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICapacityCommitment); + + /** CapacityCommitment name. */ + public name: string; + + /** CapacityCommitment slotCount. */ + public slotCount: (number|Long|string); + + /** CapacityCommitment plan. */ + public plan: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan); + + /** CapacityCommitment state. */ + public state: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State); + + /** CapacityCommitment commitmentStartTime. */ + public commitmentStartTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment commitmentEndTime. */ + public commitmentEndTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment failureStatus. */ + public failureStatus?: (google.rpc.IStatus|null); + + /** CapacityCommitment renewalPlan. */ + public renewalPlan: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan); + + /** CapacityCommitment multiRegionAuxiliary. */ + public multiRegionAuxiliary: boolean; + + /** + * Creates a new CapacityCommitment instance using the specified properties. + * @param [properties] Properties to set + * @returns CapacityCommitment instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICapacityCommitment): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Encodes the specified CapacityCommitment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @param message CapacityCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICapacityCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CapacityCommitment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @param message CapacityCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICapacityCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Verifies a CapacityCommitment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CapacityCommitment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CapacityCommitment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Creates a plain object from a CapacityCommitment message. Also converts values to other types if specified. + * @param message CapacityCommitment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CapacityCommitment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CapacityCommitment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CapacityCommitment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CapacityCommitment { + + /** CommitmentPlan enum. */ + enum CommitmentPlan { + COMMITMENT_PLAN_UNSPECIFIED = 0, + FLEX = 3, + TRIAL = 5, + MONTHLY = 2, + ANNUAL = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3 + } + } + + /** Properties of a CreateReservationRequest. */ + interface ICreateReservationRequest { + + /** CreateReservationRequest parent */ + parent?: (string|null); + + /** CreateReservationRequest reservationId */ + reservationId?: (string|null); + + /** CreateReservationRequest reservation */ + reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + } + + /** Represents a CreateReservationRequest. */ + class CreateReservationRequest implements ICreateReservationRequest { + + /** + * Constructs a new CreateReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateReservationRequest); + + /** CreateReservationRequest parent. */ + public parent: string; + + /** CreateReservationRequest reservationId. */ + public reservationId: string; + + /** CreateReservationRequest reservation. */ + public reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** + * Creates a new CreateReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateReservationRequest): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Encodes the specified CreateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @param message CreateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @param message CreateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Verifies a CreateReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Creates a plain object from a CreateReservationRequest message. Also converts values to other types if specified. + * @param message CreateReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReservationsRequest. */ + interface IListReservationsRequest { + + /** ListReservationsRequest parent */ + parent?: (string|null); + + /** ListReservationsRequest pageSize */ + pageSize?: (number|null); + + /** ListReservationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReservationsRequest. */ + class ListReservationsRequest implements IListReservationsRequest { + + /** + * Constructs a new ListReservationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListReservationsRequest); + + /** ListReservationsRequest parent. */ + public parent: string; + + /** ListReservationsRequest pageSize. */ + public pageSize: number; + + /** ListReservationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReservationsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListReservationsRequest): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @param message ListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @param message ListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Verifies a ListReservationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReservationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Creates a plain object from a ListReservationsRequest message. Also converts values to other types if specified. + * @param message ListReservationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListReservationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReservationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReservationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReservationsResponse. */ + interface IListReservationsResponse { + + /** ListReservationsResponse reservations */ + reservations?: (google.cloud.bigquery.reservation.v1.IReservation[]|null); + + /** ListReservationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReservationsResponse. */ + class ListReservationsResponse implements IListReservationsResponse { + + /** + * Constructs a new ListReservationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListReservationsResponse); + + /** ListReservationsResponse reservations. */ + public reservations: google.cloud.bigquery.reservation.v1.IReservation[]; + + /** ListReservationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReservationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReservationsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListReservationsResponse): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Encodes the specified ListReservationsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @param message ListReservationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListReservationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReservationsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @param message ListReservationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListReservationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Verifies a ListReservationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReservationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReservationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Creates a plain object from a ListReservationsResponse message. Also converts values to other types if specified. + * @param message ListReservationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListReservationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReservationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReservationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetReservationRequest. */ + interface IGetReservationRequest { + + /** GetReservationRequest name */ + name?: (string|null); + } + + /** Represents a GetReservationRequest. */ + class GetReservationRequest implements IGetReservationRequest { + + /** + * Constructs a new GetReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetReservationRequest); + + /** GetReservationRequest name. */ + public name: string; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetReservationRequest): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @param message GetReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @param message GetReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Verifies a GetReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Creates a plain object from a GetReservationRequest message. Also converts values to other types if specified. + * @param message GetReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteReservationRequest. */ + interface IDeleteReservationRequest { + + /** DeleteReservationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReservationRequest. */ + class DeleteReservationRequest implements IDeleteReservationRequest { + + /** + * Constructs a new DeleteReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest); + + /** DeleteReservationRequest name. */ + public name: string; + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @param message DeleteReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @param message DeleteReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Verifies a DeleteReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Creates a plain object from a DeleteReservationRequest message. Also converts values to other types if specified. + * @param message DeleteReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateReservationRequest. */ + interface IUpdateReservationRequest { + + /** UpdateReservationRequest reservation */ + reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** UpdateReservationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateReservationRequest. */ + class UpdateReservationRequest implements IUpdateReservationRequest { + + /** + * Constructs a new UpdateReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest); + + /** UpdateReservationRequest reservation. */ + public reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** UpdateReservationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Encodes the specified UpdateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @param message UpdateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @param message UpdateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Verifies an UpdateReservationRequest message. + * @param message Plain 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 UpdateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Creates a plain object from an UpdateReservationRequest message. Also converts values to other types if specified. + * @param message UpdateReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCapacityCommitmentRequest. */ + interface ICreateCapacityCommitmentRequest { + + /** CreateCapacityCommitmentRequest parent */ + parent?: (string|null); + + /** CreateCapacityCommitmentRequest capacityCommitment */ + capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg */ + enforceSingleAdminProjectPerOrg?: (boolean|null); + + /** CreateCapacityCommitmentRequest capacityCommitmentId */ + capacityCommitmentId?: (string|null); + } + + /** Represents a CreateCapacityCommitmentRequest. */ + class CreateCapacityCommitmentRequest implements ICreateCapacityCommitmentRequest { + + /** + * Constructs a new CreateCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest); + + /** CreateCapacityCommitmentRequest parent. */ + public parent: string; + + /** CreateCapacityCommitmentRequest capacityCommitment. */ + public capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg. */ + public enforceSingleAdminProjectPerOrg: boolean; + + /** CreateCapacityCommitmentRequest capacityCommitmentId. */ + public capacityCommitmentId: string; + + /** + * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @param message CreateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @param message CreateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Verifies a CreateCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Creates a plain object from a CreateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message CreateCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCapacityCommitmentsRequest. */ + interface IListCapacityCommitmentsRequest { + + /** ListCapacityCommitmentsRequest parent */ + parent?: (string|null); + + /** ListCapacityCommitmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCapacityCommitmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCapacityCommitmentsRequest. */ + class ListCapacityCommitmentsRequest implements IListCapacityCommitmentsRequest { + + /** + * Constructs a new ListCapacityCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest); + + /** ListCapacityCommitmentsRequest parent. */ + public parent: string; + + /** ListCapacityCommitmentsRequest pageSize. */ + public pageSize: number; + + /** ListCapacityCommitmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCapacityCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCapacityCommitmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @param message ListCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @param message ListCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Verifies a ListCapacityCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCapacityCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Creates a plain object from a ListCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @param message ListCapacityCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCapacityCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCapacityCommitmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCapacityCommitmentsResponse. */ + interface IListCapacityCommitmentsResponse { + + /** ListCapacityCommitmentsResponse capacityCommitments */ + capacityCommitments?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment[]|null); + + /** ListCapacityCommitmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCapacityCommitmentsResponse. */ + class ListCapacityCommitmentsResponse implements IListCapacityCommitmentsResponse { + + /** + * Constructs a new ListCapacityCommitmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse); + + /** ListCapacityCommitmentsResponse capacityCommitments. */ + public capacityCommitments: google.cloud.bigquery.reservation.v1.ICapacityCommitment[]; + + /** ListCapacityCommitmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCapacityCommitmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCapacityCommitmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @param message ListCapacityCommitmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @param message ListCapacityCommitmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Verifies a ListCapacityCommitmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCapacityCommitmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCapacityCommitmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Creates a plain object from a ListCapacityCommitmentsResponse message. Also converts values to other types if specified. + * @param message ListCapacityCommitmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCapacityCommitmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCapacityCommitmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCapacityCommitmentRequest. */ + interface IGetCapacityCommitmentRequest { + + /** GetCapacityCommitmentRequest name */ + name?: (string|null); + } + + /** Represents a GetCapacityCommitmentRequest. */ + class GetCapacityCommitmentRequest implements IGetCapacityCommitmentRequest { + + /** + * Constructs a new GetCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest); + + /** GetCapacityCommitmentRequest name. */ + public name: string; + + /** + * Creates a new GetCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Encodes the specified GetCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @param message GetCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @param message GetCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Verifies a GetCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Creates a plain object from a GetCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message GetCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCapacityCommitmentRequest. */ + interface IDeleteCapacityCommitmentRequest { + + /** DeleteCapacityCommitmentRequest name */ + name?: (string|null); + + /** DeleteCapacityCommitmentRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteCapacityCommitmentRequest. */ + class DeleteCapacityCommitmentRequest implements IDeleteCapacityCommitmentRequest { + + /** + * Constructs a new DeleteCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest); + + /** DeleteCapacityCommitmentRequest name. */ + public name: string; + + /** DeleteCapacityCommitmentRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @param message DeleteCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @param message DeleteCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Verifies a DeleteCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Creates a plain object from a DeleteCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message DeleteCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCapacityCommitmentRequest. */ + interface IUpdateCapacityCommitmentRequest { + + /** UpdateCapacityCommitmentRequest capacityCommitment */ + capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** UpdateCapacityCommitmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCapacityCommitmentRequest. */ + class UpdateCapacityCommitmentRequest implements IUpdateCapacityCommitmentRequest { + + /** + * Constructs a new UpdateCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest); + + /** UpdateCapacityCommitmentRequest capacityCommitment. */ + public capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** UpdateCapacityCommitmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @param message UpdateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @param message UpdateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Verifies an UpdateCapacityCommitmentRequest message. + * @param message Plain 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 UpdateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Creates a plain object from an UpdateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message UpdateCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SplitCapacityCommitmentRequest. */ + interface ISplitCapacityCommitmentRequest { + + /** SplitCapacityCommitmentRequest name */ + name?: (string|null); + + /** SplitCapacityCommitmentRequest slotCount */ + slotCount?: (number|Long|string|null); + } + + /** Represents a SplitCapacityCommitmentRequest. */ + class SplitCapacityCommitmentRequest implements ISplitCapacityCommitmentRequest { + + /** + * Constructs a new SplitCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest); + + /** SplitCapacityCommitmentRequest name. */ + public name: string; + + /** SplitCapacityCommitmentRequest slotCount. */ + public slotCount: (number|Long|string); + + /** + * Creates a new SplitCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @param message SplitCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @param message SplitCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Verifies a SplitCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Creates a plain object from a SplitCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message SplitCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SplitCapacityCommitmentResponse. */ + interface ISplitCapacityCommitmentResponse { + + /** SplitCapacityCommitmentResponse first */ + first?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** SplitCapacityCommitmentResponse second */ + second?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + } + + /** Represents a SplitCapacityCommitmentResponse. */ + class SplitCapacityCommitmentResponse implements ISplitCapacityCommitmentResponse { + + /** + * Constructs a new SplitCapacityCommitmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse); + + /** SplitCapacityCommitmentResponse first. */ + public first?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** SplitCapacityCommitmentResponse second. */ + public second?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** + * Creates a new SplitCapacityCommitmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitCapacityCommitmentResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @param message SplitCapacityCommitmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @param message SplitCapacityCommitmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Verifies a SplitCapacityCommitmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitCapacityCommitmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitCapacityCommitmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Creates a plain object from a SplitCapacityCommitmentResponse message. Also converts values to other types if specified. + * @param message SplitCapacityCommitmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitCapacityCommitmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitCapacityCommitmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergeCapacityCommitmentsRequest. */ + interface IMergeCapacityCommitmentsRequest { + + /** MergeCapacityCommitmentsRequest parent */ + parent?: (string|null); + + /** MergeCapacityCommitmentsRequest capacityCommitmentIds */ + capacityCommitmentIds?: (string[]|null); + } + + /** Represents a MergeCapacityCommitmentsRequest. */ + class MergeCapacityCommitmentsRequest implements IMergeCapacityCommitmentsRequest { + + /** + * Constructs a new MergeCapacityCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest); + + /** MergeCapacityCommitmentsRequest parent. */ + public parent: string; + + /** MergeCapacityCommitmentsRequest capacityCommitmentIds. */ + public capacityCommitmentIds: string[]; + + /** + * Creates a new MergeCapacityCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MergeCapacityCommitmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @param message MergeCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @param message MergeCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Verifies a MergeCapacityCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergeCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergeCapacityCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Creates a plain object from a MergeCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @param message MergeCapacityCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergeCapacityCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergeCapacityCommitmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Assignment. */ + interface IAssignment { + + /** Assignment name */ + name?: (string|null); + + /** Assignment assignee */ + assignee?: (string|null); + + /** Assignment jobType */ + jobType?: (google.cloud.bigquery.reservation.v1.Assignment.JobType|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.JobType|null); + + /** Assignment state */ + state?: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State|null); + } + + /** Represents an Assignment. */ + class Assignment implements IAssignment { + + /** + * Constructs a new Assignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IAssignment); + + /** Assignment name. */ + public name: string; + + /** Assignment assignee. */ + public assignee: string; + + /** Assignment jobType. */ + public jobType: (google.cloud.bigquery.reservation.v1.Assignment.JobType|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.JobType); + + /** Assignment state. */ + public state: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State); + + /** + * Creates a new Assignment instance using the specified properties. + * @param [properties] Properties to set + * @returns Assignment instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IAssignment): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Encodes the specified Assignment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @param message Assignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Assignment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @param message Assignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Assignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Decodes an Assignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Verifies an Assignment message. + * @param message Plain 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 Assignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Assignment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Creates a plain object from an Assignment message. Also converts values to other types if specified. + * @param message Assignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.Assignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Assignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Assignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Assignment { + + /** JobType enum. */ + enum JobType { + JOB_TYPE_UNSPECIFIED = 0, + PIPELINE = 1, + QUERY = 2, + ML_EXTERNAL = 3 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2 + } + } + + /** Properties of a CreateAssignmentRequest. */ + interface ICreateAssignmentRequest { + + /** CreateAssignmentRequest parent */ + parent?: (string|null); + + /** CreateAssignmentRequest assignment */ + assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** CreateAssignmentRequest assignmentId */ + assignmentId?: (string|null); + } + + /** Represents a CreateAssignmentRequest. */ + class CreateAssignmentRequest implements ICreateAssignmentRequest { + + /** + * Constructs a new CreateAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest); + + /** CreateAssignmentRequest parent. */ + public parent: string; + + /** CreateAssignmentRequest assignment. */ + public assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** CreateAssignmentRequest assignmentId. */ + public assignmentId: string; + + /** + * Creates a new CreateAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Encodes the specified CreateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @param message CreateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @param message CreateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Verifies a CreateAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Creates a plain object from a CreateAssignmentRequest message. Also converts values to other types if specified. + * @param message CreateAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssignmentsRequest. */ + interface IListAssignmentsRequest { + + /** ListAssignmentsRequest parent */ + parent?: (string|null); + + /** ListAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssignmentsRequest. */ + class ListAssignmentsRequest implements IListAssignmentsRequest { + + /** + * Constructs a new ListAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest); + + /** ListAssignmentsRequest parent. */ + public parent: string; + + /** ListAssignmentsRequest pageSize. */ + public pageSize: number; + + /** ListAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Encodes the specified ListAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @param message ListAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @param message ListAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Verifies a ListAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Creates a plain object from a ListAssignmentsRequest message. Also converts values to other types if specified. + * @param message ListAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssignmentsResponse. */ + interface IListAssignmentsResponse { + + /** ListAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** ListAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssignmentsResponse. */ + class ListAssignmentsResponse implements IListAssignmentsResponse { + + /** + * Constructs a new ListAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse); + + /** ListAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** ListAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Encodes the specified ListAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @param message ListAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @param message ListAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Verifies a ListAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Creates a plain object from a ListAssignmentsResponse message. Also converts values to other types if specified. + * @param message ListAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAssignmentRequest. */ + interface IDeleteAssignmentRequest { + + /** DeleteAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAssignmentRequest. */ + class DeleteAssignmentRequest implements IDeleteAssignmentRequest { + + /** + * Constructs a new DeleteAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest); + + /** DeleteAssignmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Encodes the specified DeleteAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @param message DeleteAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @param message DeleteAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Verifies a DeleteAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Creates a plain object from a DeleteAssignmentRequest message. Also converts values to other types if specified. + * @param message DeleteAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAssignmentsRequest. */ + interface ISearchAssignmentsRequest { + + /** SearchAssignmentsRequest parent */ + parent?: (string|null); + + /** SearchAssignmentsRequest query */ + query?: (string|null); + + /** SearchAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAssignmentsRequest. */ + class SearchAssignmentsRequest implements ISearchAssignmentsRequest { + + /** + * Constructs a new SearchAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest); + + /** SearchAssignmentsRequest parent. */ + public parent: string; + + /** SearchAssignmentsRequest query. */ + public query: string; + + /** SearchAssignmentsRequest pageSize. */ + public pageSize: number; + + /** SearchAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Encodes the specified SearchAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @param message SearchAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @param message SearchAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Verifies a SearchAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Creates a plain object from a SearchAssignmentsRequest message. Also converts values to other types if specified. + * @param message SearchAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllAssignmentsRequest. */ + interface ISearchAllAssignmentsRequest { + + /** SearchAllAssignmentsRequest parent */ + parent?: (string|null); + + /** SearchAllAssignmentsRequest query */ + query?: (string|null); + + /** SearchAllAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAllAssignmentsRequest. */ + class SearchAllAssignmentsRequest implements ISearchAllAssignmentsRequest { + + /** + * Constructs a new SearchAllAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest); + + /** SearchAllAssignmentsRequest parent. */ + public parent: string; + + /** SearchAllAssignmentsRequest query. */ + public query: string; + + /** SearchAllAssignmentsRequest pageSize. */ + public pageSize: number; + + /** SearchAllAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAllAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Encodes the specified SearchAllAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @param message SearchAllAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @param message SearchAllAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Verifies a SearchAllAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Creates a plain object from a SearchAllAssignmentsRequest message. Also converts values to other types if specified. + * @param message SearchAllAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAssignmentsResponse. */ + interface ISearchAssignmentsResponse { + + /** SearchAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** SearchAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAssignmentsResponse. */ + class SearchAssignmentsResponse implements ISearchAssignmentsResponse { + + /** + * Constructs a new SearchAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse); + + /** SearchAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** SearchAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Encodes the specified SearchAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @param message SearchAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @param message SearchAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Verifies a SearchAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Creates a plain object from a SearchAssignmentsResponse message. Also converts values to other types if specified. + * @param message SearchAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllAssignmentsResponse. */ + interface ISearchAllAssignmentsResponse { + + /** SearchAllAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** SearchAllAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllAssignmentsResponse. */ + class SearchAllAssignmentsResponse implements ISearchAllAssignmentsResponse { + + /** + * Constructs a new SearchAllAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse); + + /** SearchAllAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** SearchAllAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Encodes the specified SearchAllAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @param message SearchAllAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @param message SearchAllAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Verifies a SearchAllAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Creates a plain object from a SearchAllAssignmentsResponse message. Also converts values to other types if specified. + * @param message SearchAllAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveAssignmentRequest. */ + interface IMoveAssignmentRequest { + + /** MoveAssignmentRequest name */ + name?: (string|null); + + /** MoveAssignmentRequest destinationId */ + destinationId?: (string|null); + } + + /** Represents a MoveAssignmentRequest. */ + class MoveAssignmentRequest implements IMoveAssignmentRequest { + + /** + * Constructs a new MoveAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest); + + /** MoveAssignmentRequest name. */ + public name: string; + + /** MoveAssignmentRequest destinationId. */ + public destinationId: string; + + /** + * Creates a new MoveAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Encodes the specified MoveAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @param message MoveAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @param message MoveAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Verifies a MoveAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Creates a plain object from a MoveAssignmentRequest message. Also converts values to other types if specified. + * @param message MoveAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAssignmentRequest. */ + interface IUpdateAssignmentRequest { + + /** UpdateAssignmentRequest assignment */ + assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** UpdateAssignmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAssignmentRequest. */ + class UpdateAssignmentRequest implements IUpdateAssignmentRequest { + + /** + * Constructs a new UpdateAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest); + + /** UpdateAssignmentRequest assignment. */ + public assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** UpdateAssignmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Encodes the specified UpdateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @param message UpdateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @param message UpdateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Verifies an UpdateAssignmentRequest message. + * @param message Plain 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 UpdateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Creates a plain object from an UpdateAssignmentRequest message. Also converts values to other types if specified. + * @param message UpdateAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableReference. */ + interface ITableReference { + + /** TableReference projectId */ + projectId?: (string|null); + + /** TableReference datasetId */ + datasetId?: (string|null); + + /** TableReference tableId */ + tableId?: (string|null); + } + + /** Represents a TableReference. */ + class TableReference implements ITableReference { + + /** + * Constructs a new TableReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ITableReference); + + /** TableReference projectId. */ + public projectId: string; + + /** TableReference datasetId. */ + public datasetId: string; + + /** TableReference tableId. */ + public tableId: string; + + /** + * Creates a new TableReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReference instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ITableReference): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Verifies a TableReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @param message TableReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BiReservation. */ + interface IBiReservation { + + /** BiReservation name */ + name?: (string|null); + + /** BiReservation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BiReservation size */ + size?: (number|Long|string|null); + + /** BiReservation preferredTables */ + preferredTables?: (google.cloud.bigquery.reservation.v1.ITableReference[]|null); + } + + /** Represents a BiReservation. */ + class BiReservation implements IBiReservation { + + /** + * Constructs a new BiReservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IBiReservation); + + /** BiReservation name. */ + public name: string; + + /** BiReservation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BiReservation size. */ + public size: (number|Long|string); + + /** BiReservation preferredTables. */ + public preferredTables: google.cloud.bigquery.reservation.v1.ITableReference[]; + + /** + * Creates a new BiReservation instance using the specified properties. + * @param [properties] Properties to set + * @returns BiReservation instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IBiReservation): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Encodes the specified BiReservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @param message BiReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IBiReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BiReservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @param message BiReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IBiReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BiReservation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Decodes a BiReservation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Verifies a BiReservation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BiReservation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BiReservation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Creates a plain object from a BiReservation message. Also converts values to other types if specified. + * @param message BiReservation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.BiReservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BiReservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BiReservation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBiReservationRequest. */ + interface IGetBiReservationRequest { + + /** GetBiReservationRequest name */ + name?: (string|null); + } + + /** Represents a GetBiReservationRequest. */ + class GetBiReservationRequest implements IGetBiReservationRequest { + + /** + * Constructs a new GetBiReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest); + + /** GetBiReservationRequest name. */ + public name: string; + + /** + * Creates a new GetBiReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBiReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Encodes the specified GetBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @param message GetBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @param message GetBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Verifies a GetBiReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBiReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Creates a plain object from a GetBiReservationRequest message. Also converts values to other types if specified. + * @param message GetBiReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetBiReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBiReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBiReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBiReservationRequest. */ + interface IUpdateBiReservationRequest { + + /** UpdateBiReservationRequest biReservation */ + biReservation?: (google.cloud.bigquery.reservation.v1.IBiReservation|null); + + /** UpdateBiReservationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBiReservationRequest. */ + class UpdateBiReservationRequest implements IUpdateBiReservationRequest { + + /** + * Constructs a new UpdateBiReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest); + + /** UpdateBiReservationRequest biReservation. */ + public biReservation?: (google.cloud.bigquery.reservation.v1.IBiReservation|null); + + /** UpdateBiReservationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBiReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBiReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Encodes the specified UpdateBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @param message UpdateBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @param message UpdateBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Verifies an UpdateBiReservationRequest message. + * @param message Plain 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 UpdateBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBiReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Creates a plain object from an UpdateBiReservationRequest message. Also converts values to other types if specified. + * @param message UpdateBiReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBiReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBiReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 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; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js new file mode 100644 index 000000000000..8f49b952d83e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -0,0 +1,21278 @@ +// Copyright 2022 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_bigquery_reservation_protos || ($protobuf.roots._google_cloud_bigquery_reservation_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.reservation = (function() { + + /** + * Namespace reservation. + * @memberof google.cloud.bigquery + * @namespace + */ + var reservation = {}; + + reservation.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.bigquery.reservation + * @namespace + */ + var v1 = {}; + + v1.ReservationService = (function() { + + /** + * Constructs a new ReservationService service. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ReservationService + * @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 ReservationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ReservationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ReservationService; + + /** + * Creates new ReservationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @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 {ReservationService} RPC service. Useful where requests and/or responses are streamed. + */ + ReservationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls CreateReservation. + * @function createReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} request CreateReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createReservation = function createReservation(request, callback) { + return this.rpcCall(createReservation, $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "CreateReservation" }); + + /** + * Calls CreateReservation. + * @function createReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} request CreateReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listReservations}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListReservationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListReservationsResponse} [response] ListReservationsResponse + */ + + /** + * Calls ListReservations. + * @function listReservations + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListReservationsCallback} callback Node-style callback called with the error, if any, and ListReservationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listReservations = function listReservations(request, callback) { + return this.rpcCall(listReservations, $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest, $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse, request, callback); + }, "name", { value: "ListReservations" }); + + /** + * Calls ListReservations. + * @function listReservations + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls GetReservation. + * @function getReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getReservation = function getReservation(request, callback) { + return this.rpcCall(getReservation, $root.google.cloud.bigquery.reservation.v1.GetReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "GetReservation" }); + + /** + * Calls GetReservation. + * @function getReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReservation. + * @function deleteReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteReservation = function deleteReservation(request, callback) { + return this.rpcCall(deleteReservation, $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReservation" }); + + /** + * Calls DeleteReservation. + * @function deleteReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls UpdateReservation. + * @function updateReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} request UpdateReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateReservation = function updateReservation(request, callback) { + return this.rpcCall(updateReservation, $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "UpdateReservation" }); + + /** + * Calls UpdateReservation. + * @function updateReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} request UpdateReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls CreateCapacityCommitment. + * @function createCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} request CreateCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createCapacityCommitment = function createCapacityCommitment(request, callback) { + return this.rpcCall(createCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "CreateCapacityCommitment" }); + + /** + * Calls CreateCapacityCommitment. + * @function createCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} request CreateCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listCapacityCommitments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListCapacityCommitmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} [response] ListCapacityCommitmentsResponse + */ + + /** + * Calls ListCapacityCommitments. + * @function listCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} request ListCapacityCommitmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitmentsCallback} callback Node-style callback called with the error, if any, and ListCapacityCommitmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listCapacityCommitments = function listCapacityCommitments(request, callback) { + return this.rpcCall(listCapacityCommitments, $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse, request, callback); + }, "name", { value: "ListCapacityCommitments" }); + + /** + * Calls ListCapacityCommitments. + * @function listCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} request ListCapacityCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls GetCapacityCommitment. + * @function getCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} request GetCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getCapacityCommitment = function getCapacityCommitment(request, callback) { + return this.rpcCall(getCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "GetCapacityCommitment" }); + + /** + * Calls GetCapacityCommitment. + * @function getCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} request GetCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCapacityCommitment. + * @function deleteCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} request DeleteCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteCapacityCommitment = function deleteCapacityCommitment(request, callback) { + return this.rpcCall(deleteCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCapacityCommitment" }); + + /** + * Calls DeleteCapacityCommitment. + * @function deleteCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} request DeleteCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls UpdateCapacityCommitment. + * @function updateCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} request UpdateCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateCapacityCommitment = function updateCapacityCommitment(request, callback) { + return this.rpcCall(updateCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "UpdateCapacityCommitment" }); + + /** + * Calls UpdateCapacityCommitment. + * @function updateCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} request UpdateCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|splitCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SplitCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} [response] SplitCapacityCommitmentResponse + */ + + /** + * Calls SplitCapacityCommitment. + * @function splitCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} request SplitCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and SplitCapacityCommitmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.splitCapacityCommitment = function splitCapacityCommitment(request, callback) { + return this.rpcCall(splitCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse, request, callback); + }, "name", { value: "SplitCapacityCommitment" }); + + /** + * Calls SplitCapacityCommitment. + * @function splitCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} request SplitCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|mergeCapacityCommitments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef MergeCapacityCommitmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls MergeCapacityCommitments. + * @function mergeCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} request MergeCapacityCommitmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitmentsCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.mergeCapacityCommitments = function mergeCapacityCommitments(request, callback) { + return this.rpcCall(mergeCapacityCommitments, $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "MergeCapacityCommitments" }); + + /** + * Calls MergeCapacityCommitments. + * @function mergeCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} request MergeCapacityCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls CreateAssignment. + * @function createAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} request CreateAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createAssignment = function createAssignment(request, callback) { + return this.rpcCall(createAssignment, $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "CreateAssignment" }); + + /** + * Calls CreateAssignment. + * @function createAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} request CreateAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} [response] ListAssignmentsResponse + */ + + /** + * Calls ListAssignments. + * @function listAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} request ListAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListAssignmentsCallback} callback Node-style callback called with the error, if any, and ListAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listAssignments = function listAssignments(request, callback) { + return this.rpcCall(listAssignments, $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse, request, callback); + }, "name", { value: "ListAssignments" }); + + /** + * Calls ListAssignments. + * @function listAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} request ListAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAssignment. + * @function deleteAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} request DeleteAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteAssignment = function deleteAssignment(request, callback) { + return this.rpcCall(deleteAssignment, $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAssignment" }); + + /** + * Calls DeleteAssignment. + * @function deleteAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} request DeleteAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SearchAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} [response] SearchAssignmentsResponse + */ + + /** + * Calls SearchAssignments. + * @function searchAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} request SearchAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignmentsCallback} callback Node-style callback called with the error, if any, and SearchAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.searchAssignments = function searchAssignments(request, callback) { + return this.rpcCall(searchAssignments, $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse, request, callback); + }, "name", { value: "SearchAssignments" }); + + /** + * Calls SearchAssignments. + * @function searchAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} request SearchAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAllAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SearchAllAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} [response] SearchAllAssignmentsResponse + */ + + /** + * Calls SearchAllAssignments. + * @function searchAllAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} request SearchAllAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignmentsCallback} callback Node-style callback called with the error, if any, and SearchAllAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.searchAllAssignments = function searchAllAssignments(request, callback) { + return this.rpcCall(searchAllAssignments, $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse, request, callback); + }, "name", { value: "SearchAllAssignments" }); + + /** + * Calls SearchAllAssignments. + * @function searchAllAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} request SearchAllAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|moveAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef MoveAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls MoveAssignment. + * @function moveAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} request MoveAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.moveAssignment = function moveAssignment(request, callback) { + return this.rpcCall(moveAssignment, $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "MoveAssignment" }); + + /** + * Calls MoveAssignment. + * @function moveAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} request MoveAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls UpdateAssignment. + * @function updateAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} request UpdateAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateAssignment = function updateAssignment(request, callback) { + return this.rpcCall(updateAssignment, $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "UpdateAssignment" }); + + /** + * Calls UpdateAssignment. + * @function updateAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} request UpdateAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getBiReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetBiReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.BiReservation} [response] BiReservation + */ + + /** + * Calls GetBiReservation. + * @function getBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} request GetBiReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservationCallback} callback Node-style callback called with the error, if any, and BiReservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getBiReservation = function getBiReservation(request, callback) { + return this.rpcCall(getBiReservation, $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, $root.google.cloud.bigquery.reservation.v1.BiReservation, request, callback); + }, "name", { value: "GetBiReservation" }); + + /** + * Calls GetBiReservation. + * @function getBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} request GetBiReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateBiReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateBiReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.BiReservation} [response] BiReservation + */ + + /** + * Calls UpdateBiReservation. + * @function updateBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} request UpdateBiReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservationCallback} callback Node-style callback called with the error, if any, and BiReservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateBiReservation = function updateBiReservation(request, callback) { + return this.rpcCall(updateBiReservation, $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, $root.google.cloud.bigquery.reservation.v1.BiReservation, request, callback); + }, "name", { value: "UpdateBiReservation" }); + + /** + * Calls UpdateBiReservation. + * @function updateBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} request UpdateBiReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ReservationService; + })(); + + v1.Reservation = (function() { + + /** + * Properties of a Reservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IReservation + * @property {string|null} [name] Reservation name + * @property {number|Long|null} [slotCapacity] Reservation slotCapacity + * @property {boolean|null} [ignoreIdleSlots] Reservation ignoreIdleSlots + * @property {number|Long|null} [concurrency] Reservation concurrency + * @property {google.protobuf.ITimestamp|null} [creationTime] Reservation creationTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Reservation updateTime + * @property {boolean|null} [multiRegionAuxiliary] Reservation multiRegionAuxiliary + */ + + /** + * Constructs a new Reservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a Reservation. + * @implements IReservation + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IReservation=} [properties] Properties to set + */ + function Reservation(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]]; + } + + /** + * Reservation name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.name = ""; + + /** + * Reservation slotCapacity. + * @member {number|Long} slotCapacity + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.slotCapacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Reservation ignoreIdleSlots. + * @member {boolean} ignoreIdleSlots + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.ignoreIdleSlots = false; + + /** + * Reservation concurrency. + * @member {number|Long} concurrency + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.concurrency = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Reservation creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.creationTime = null; + + /** + * Reservation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.updateTime = null; + + /** + * Reservation multiRegionAuxiliary. + * @member {boolean} multiRegionAuxiliary + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.multiRegionAuxiliary = false; + + /** + * Creates a new Reservation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation instance + */ + Reservation.create = function create(properties) { + return new Reservation(properties); + }; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation} message Reservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reservation.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.slotCapacity != null && Object.hasOwnProperty.call(message, "slotCapacity")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCapacity); + if (message.ignoreIdleSlots != null && Object.hasOwnProperty.call(message, "ignoreIdleSlots")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreIdleSlots); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.multiRegionAuxiliary != null && Object.hasOwnProperty.call(message, "multiRegionAuxiliary")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.multiRegionAuxiliary); + if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.concurrency); + return writer; + }; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation} message Reservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reservation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reservation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reservation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.Reservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCapacity = reader.int64(); + break; + } + case 4: { + message.ignoreIdleSlots = reader.bool(); + break; + } + case 16: { + message.concurrency = reader.int64(); + break; + } + case 8: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.multiRegionAuxiliary = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reservation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reservation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reservation message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reservation.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.slotCapacity != null && message.hasOwnProperty("slotCapacity")) + if (!$util.isInteger(message.slotCapacity) && !(message.slotCapacity && $util.isInteger(message.slotCapacity.low) && $util.isInteger(message.slotCapacity.high))) + return "slotCapacity: integer|Long expected"; + if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) + if (typeof message.ignoreIdleSlots !== "boolean") + return "ignoreIdleSlots: boolean expected"; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) + if (!$util.isInteger(message.concurrency) && !(message.concurrency && $util.isInteger(message.concurrency.low) && $util.isInteger(message.concurrency.high))) + return "concurrency: integer|Long expected"; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime); + if (error) + return "creationTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + if (typeof message.multiRegionAuxiliary !== "boolean") + return "multiRegionAuxiliary: boolean expected"; + return null; + }; + + /** + * Creates a Reservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + */ + Reservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.Reservation) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.Reservation(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCapacity != null) + if ($util.Long) + (message.slotCapacity = $util.Long.fromValue(object.slotCapacity)).unsigned = false; + else if (typeof object.slotCapacity === "string") + message.slotCapacity = parseInt(object.slotCapacity, 10); + else if (typeof object.slotCapacity === "number") + message.slotCapacity = object.slotCapacity; + else if (typeof object.slotCapacity === "object") + message.slotCapacity = new $util.LongBits(object.slotCapacity.low >>> 0, object.slotCapacity.high >>> 0).toNumber(); + if (object.ignoreIdleSlots != null) + message.ignoreIdleSlots = Boolean(object.ignoreIdleSlots); + if (object.concurrency != null) + if ($util.Long) + (message.concurrency = $util.Long.fromValue(object.concurrency)).unsigned = false; + else if (typeof object.concurrency === "string") + message.concurrency = parseInt(object.concurrency, 10); + else if (typeof object.concurrency === "number") + message.concurrency = object.concurrency; + else if (typeof object.concurrency === "object") + message.concurrency = new $util.LongBits(object.concurrency.low >>> 0, object.concurrency.high >>> 0).toNumber(); + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.multiRegionAuxiliary != null) + message.multiRegionAuxiliary = Boolean(object.multiRegionAuxiliary); + return message; + }; + + /** + * Creates a plain object from a Reservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation} message Reservation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reservation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCapacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCapacity = options.longs === String ? "0" : 0; + object.ignoreIdleSlots = false; + object.creationTime = null; + object.updateTime = null; + object.multiRegionAuxiliary = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.concurrency = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.concurrency = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCapacity != null && message.hasOwnProperty("slotCapacity")) + if (typeof message.slotCapacity === "number") + object.slotCapacity = options.longs === String ? String(message.slotCapacity) : message.slotCapacity; + else + object.slotCapacity = options.longs === String ? $util.Long.prototype.toString.call(message.slotCapacity) : options.longs === Number ? new $util.LongBits(message.slotCapacity.low >>> 0, message.slotCapacity.high >>> 0).toNumber() : message.slotCapacity; + if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) + object.ignoreIdleSlots = message.ignoreIdleSlots; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + object.multiRegionAuxiliary = message.multiRegionAuxiliary; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) + if (typeof message.concurrency === "number") + object.concurrency = options.longs === String ? String(message.concurrency) : message.concurrency; + else + object.concurrency = options.longs === String ? $util.Long.prototype.toString.call(message.concurrency) : options.longs === Number ? new $util.LongBits(message.concurrency.low >>> 0, message.concurrency.high >>> 0).toNumber() : message.concurrency; + return object; + }; + + /** + * Converts this Reservation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + * @returns {Object.} JSON object + */ + Reservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Reservation + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reservation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.Reservation"; + }; + + return Reservation; + })(); + + v1.CapacityCommitment = (function() { + + /** + * Properties of a CapacityCommitment. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICapacityCommitment + * @property {string|null} [name] CapacityCommitment name + * @property {number|Long|null} [slotCount] CapacityCommitment slotCount + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [plan] CapacityCommitment plan + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null} [state] CapacityCommitment state + * @property {google.protobuf.ITimestamp|null} [commitmentStartTime] CapacityCommitment commitmentStartTime + * @property {google.protobuf.ITimestamp|null} [commitmentEndTime] CapacityCommitment commitmentEndTime + * @property {google.rpc.IStatus|null} [failureStatus] CapacityCommitment failureStatus + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [renewalPlan] CapacityCommitment renewalPlan + * @property {boolean|null} [multiRegionAuxiliary] CapacityCommitment multiRegionAuxiliary + */ + + /** + * Constructs a new CapacityCommitment. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CapacityCommitment. + * @implements ICapacityCommitment + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment=} [properties] Properties to set + */ + function CapacityCommitment(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]]; + } + + /** + * CapacityCommitment name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.name = ""; + + /** + * CapacityCommitment slotCount. + * @member {number|Long} slotCount + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.slotCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CapacityCommitment plan. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan} plan + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.plan = 0; + + /** + * CapacityCommitment state. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.State} state + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.state = 0; + + /** + * CapacityCommitment commitmentStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitmentStartTime + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.commitmentStartTime = null; + + /** + * CapacityCommitment commitmentEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitmentEndTime + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.commitmentEndTime = null; + + /** + * CapacityCommitment failureStatus. + * @member {google.rpc.IStatus|null|undefined} failureStatus + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.failureStatus = null; + + /** + * CapacityCommitment renewalPlan. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan} renewalPlan + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.renewalPlan = 0; + + /** + * CapacityCommitment multiRegionAuxiliary. + * @member {boolean} multiRegionAuxiliary + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.multiRegionAuxiliary = false; + + /** + * Creates a new CapacityCommitment instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment instance + */ + CapacityCommitment.create = function create(properties) { + return new CapacityCommitment(properties); + }; + + /** + * Encodes the specified CapacityCommitment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment} message CapacityCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapacityCommitment.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.slotCount != null && Object.hasOwnProperty.call(message, "slotCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCount); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.plan); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.commitmentEndTime != null && Object.hasOwnProperty.call(message, "commitmentEndTime")) + $root.google.protobuf.Timestamp.encode(message.commitmentEndTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.failureStatus != null && Object.hasOwnProperty.call(message, "failureStatus")) + $root.google.rpc.Status.encode(message.failureStatus, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.renewalPlan != null && Object.hasOwnProperty.call(message, "renewalPlan")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.renewalPlan); + if (message.commitmentStartTime != null && Object.hasOwnProperty.call(message, "commitmentStartTime")) + $root.google.protobuf.Timestamp.encode(message.commitmentStartTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.multiRegionAuxiliary != null && Object.hasOwnProperty.call(message, "multiRegionAuxiliary")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.multiRegionAuxiliary); + return writer; + }; + + /** + * Encodes the specified CapacityCommitment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment} message CapacityCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapacityCommitment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapacityCommitment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CapacityCommitment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCount = reader.int64(); + break; + } + case 3: { + message.plan = reader.int32(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 9: { + message.commitmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.commitmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.failureStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.renewalPlan = reader.int32(); + break; + } + case 10: { + message.multiRegionAuxiliary = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapacityCommitment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CapacityCommitment message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CapacityCommitment.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.slotCount != null && message.hasOwnProperty("slotCount")) + if (!$util.isInteger(message.slotCount) && !(message.slotCount && $util.isInteger(message.slotCount.low) && $util.isInteger(message.slotCount.high))) + return "slotCount: integer|Long expected"; + if (message.plan != null && message.hasOwnProperty("plan")) + switch (message.plan) { + default: + return "plan: enum value expected"; + case 0: + case 3: + case 5: + case 2: + case 4: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.commitmentStartTime != null && message.hasOwnProperty("commitmentStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitmentStartTime); + if (error) + return "commitmentStartTime." + error; + } + if (message.commitmentEndTime != null && message.hasOwnProperty("commitmentEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitmentEndTime); + if (error) + return "commitmentEndTime." + error; + } + if (message.failureStatus != null && message.hasOwnProperty("failureStatus")) { + var error = $root.google.rpc.Status.verify(message.failureStatus); + if (error) + return "failureStatus." + error; + } + if (message.renewalPlan != null && message.hasOwnProperty("renewalPlan")) + switch (message.renewalPlan) { + default: + return "renewalPlan: enum value expected"; + case 0: + case 3: + case 5: + case 2: + case 4: + break; + } + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + if (typeof message.multiRegionAuxiliary !== "boolean") + return "multiRegionAuxiliary: boolean expected"; + return null; + }; + + /** + * Creates a CapacityCommitment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + */ + CapacityCommitment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CapacityCommitment) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CapacityCommitment(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCount != null) + if ($util.Long) + (message.slotCount = $util.Long.fromValue(object.slotCount)).unsigned = false; + else if (typeof object.slotCount === "string") + message.slotCount = parseInt(object.slotCount, 10); + else if (typeof object.slotCount === "number") + message.slotCount = object.slotCount; + else if (typeof object.slotCount === "object") + message.slotCount = new $util.LongBits(object.slotCount.low >>> 0, object.slotCount.high >>> 0).toNumber(); + switch (object.plan) { + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.plan = 0; + break; + case "FLEX": + case 3: + message.plan = 3; + break; + case "TRIAL": + case 5: + message.plan = 5; + break; + case "MONTHLY": + case 2: + message.plan = 2; + break; + case "ANNUAL": + case 4: + message.plan = 4; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.commitmentStartTime != null) { + if (typeof object.commitmentStartTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.commitmentStartTime: object expected"); + message.commitmentStartTime = $root.google.protobuf.Timestamp.fromObject(object.commitmentStartTime); + } + if (object.commitmentEndTime != null) { + if (typeof object.commitmentEndTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.commitmentEndTime: object expected"); + message.commitmentEndTime = $root.google.protobuf.Timestamp.fromObject(object.commitmentEndTime); + } + if (object.failureStatus != null) { + if (typeof object.failureStatus !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.failureStatus: object expected"); + message.failureStatus = $root.google.rpc.Status.fromObject(object.failureStatus); + } + switch (object.renewalPlan) { + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.renewalPlan = 0; + break; + case "FLEX": + case 3: + message.renewalPlan = 3; + break; + case "TRIAL": + case 5: + message.renewalPlan = 5; + break; + case "MONTHLY": + case 2: + message.renewalPlan = 2; + break; + case "ANNUAL": + case 4: + message.renewalPlan = 4; + break; + } + if (object.multiRegionAuxiliary != null) + message.multiRegionAuxiliary = Boolean(object.multiRegionAuxiliary); + return message; + }; + + /** + * Creates a plain object from a CapacityCommitment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} message CapacityCommitment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CapacityCommitment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCount = options.longs === String ? "0" : 0; + object.plan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.commitmentEndTime = null; + object.failureStatus = null; + object.renewalPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + object.commitmentStartTime = null; + object.multiRegionAuxiliary = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCount != null && message.hasOwnProperty("slotCount")) + if (typeof message.slotCount === "number") + object.slotCount = options.longs === String ? String(message.slotCount) : message.slotCount; + else + object.slotCount = options.longs === String ? $util.Long.prototype.toString.call(message.slotCount) : options.longs === Number ? new $util.LongBits(message.slotCount.low >>> 0, message.slotCount.high >>> 0).toNumber() : message.slotCount; + if (message.plan != null && message.hasOwnProperty("plan")) + object.plan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.plan] : message.plan; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.State[message.state] : message.state; + if (message.commitmentEndTime != null && message.hasOwnProperty("commitmentEndTime")) + object.commitmentEndTime = $root.google.protobuf.Timestamp.toObject(message.commitmentEndTime, options); + if (message.failureStatus != null && message.hasOwnProperty("failureStatus")) + object.failureStatus = $root.google.rpc.Status.toObject(message.failureStatus, options); + if (message.renewalPlan != null && message.hasOwnProperty("renewalPlan")) + object.renewalPlan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.renewalPlan] : message.renewalPlan; + if (message.commitmentStartTime != null && message.hasOwnProperty("commitmentStartTime")) + object.commitmentStartTime = $root.google.protobuf.Timestamp.toObject(message.commitmentStartTime, options); + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + object.multiRegionAuxiliary = message.multiRegionAuxiliary; + return object; + }; + + /** + * Converts this CapacityCommitment to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + * @returns {Object.} JSON object + */ + CapacityCommitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CapacityCommitment + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CapacityCommitment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CapacityCommitment"; + }; + + /** + * CommitmentPlan enum. + * @name google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + * @enum {number} + * @property {number} COMMITMENT_PLAN_UNSPECIFIED=0 COMMITMENT_PLAN_UNSPECIFIED value + * @property {number} FLEX=3 FLEX value + * @property {number} TRIAL=5 TRIAL value + * @property {number} MONTHLY=2 MONTHLY value + * @property {number} ANNUAL=4 ANNUAL value + */ + CapacityCommitment.CommitmentPlan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMITMENT_PLAN_UNSPECIFIED"] = 0; + values[valuesById[3] = "FLEX"] = 3; + values[valuesById[5] = "TRIAL"] = 5; + values[valuesById[2] = "MONTHLY"] = 2; + values[valuesById[4] = "ANNUAL"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.bigquery.reservation.v1.CapacityCommitment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + */ + CapacityCommitment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return CapacityCommitment; + })(); + + v1.CreateReservationRequest = (function() { + + /** + * Properties of a CreateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateReservationRequest + * @property {string|null} [parent] CreateReservationRequest parent + * @property {string|null} [reservationId] CreateReservationRequest reservationId + * @property {google.cloud.bigquery.reservation.v1.IReservation|null} [reservation] CreateReservationRequest reservation + */ + + /** + * Constructs a new CreateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateReservationRequest. + * @implements ICreateReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest=} [properties] Properties to set + */ + function CreateReservationRequest(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]]; + } + + /** + * CreateReservationRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.parent = ""; + + /** + * CreateReservationRequest reservationId. + * @member {string} reservationId + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.reservationId = ""; + + /** + * CreateReservationRequest reservation. + * @member {google.cloud.bigquery.reservation.v1.IReservation|null|undefined} reservation + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.reservation = null; + + /** + * Creates a new CreateReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest instance + */ + CreateReservationRequest.create = function create(properties) { + return new CreateReservationRequest(properties); + }; + + /** + * Encodes the specified CreateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} message CreateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReservationRequest.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.reservationId != null && Object.hasOwnProperty.call(message, "reservationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reservationId); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} message CreateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.reservationId = reader.string(); + break; + } + case 3: { + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReservationRequest.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.reservationId != null && message.hasOwnProperty("reservationId")) + if (!$util.isString(message.reservationId)) + return "reservationId: string expected"; + if (message.reservation != null && message.hasOwnProperty("reservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservation); + if (error) + return "reservation." + error; + } + return null; + }; + + /** + * Creates a CreateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + */ + CreateReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reservationId != null) + message.reservationId = String(object.reservationId); + if (object.reservation != null) { + if (typeof object.reservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateReservationRequest.reservation: object expected"); + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservation); + } + return message; + }; + + /** + * Creates a plain object from a CreateReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateReservationRequest} message CreateReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.reservationId = ""; + object.reservation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reservationId != null && message.hasOwnProperty("reservationId")) + object.reservationId = message.reservationId; + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservation, options); + return object; + }; + + /** + * Converts this CreateReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateReservationRequest"; + }; + + return CreateReservationRequest; + })(); + + v1.ListReservationsRequest = (function() { + + /** + * Properties of a ListReservationsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListReservationsRequest + * @property {string|null} [parent] ListReservationsRequest parent + * @property {number|null} [pageSize] ListReservationsRequest pageSize + * @property {string|null} [pageToken] ListReservationsRequest pageToken + */ + + /** + * Constructs a new ListReservationsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListReservationsRequest. + * @implements IListReservationsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest=} [properties] Properties to set + */ + function ListReservationsRequest(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]]; + } + + /** + * ListReservationsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.parent = ""; + + /** + * ListReservationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.pageSize = 0; + + /** + * ListReservationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest instance + */ + ListReservationsRequest.create = function create(properties) { + return new ListReservationsRequest(properties); + }; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} message ListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} message ListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReservationsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReservationsRequest.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.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 ListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + */ + ListReservationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListReservationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListReservationsRequest} message ListReservationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReservationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListReservationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReservationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReservationsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReservationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListReservationsRequest"; + }; + + return ListReservationsRequest; + })(); + + v1.ListReservationsResponse = (function() { + + /** + * Properties of a ListReservationsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListReservationsResponse + * @property {Array.|null} [reservations] ListReservationsResponse reservations + * @property {string|null} [nextPageToken] ListReservationsResponse nextPageToken + */ + + /** + * Constructs a new ListReservationsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListReservationsResponse. + * @implements IListReservationsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse=} [properties] Properties to set + */ + function ListReservationsResponse(properties) { + this.reservations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReservationsResponse reservations. + * @member {Array.} reservations + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + */ + ListReservationsResponse.prototype.reservations = $util.emptyArray; + + /** + * ListReservationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + */ + ListReservationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReservationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse instance + */ + ListReservationsResponse.create = function create(properties) { + return new ListReservationsResponse(properties); + }; + + /** + * Encodes the specified ListReservationsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse} message ListReservationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reservations != null && message.reservations.length) + for (var i = 0; i < message.reservations.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservations[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 ListReservationsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse} message ListReservationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reservations && message.reservations.length)) + message.reservations = []; + message.reservations.push($root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReservationsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReservationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reservations != null && message.hasOwnProperty("reservations")) { + if (!Array.isArray(message.reservations)) + return "reservations: array expected"; + for (var i = 0; i < message.reservations.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservations[i]); + if (error) + return "reservations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReservationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + */ + ListReservationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse(); + if (object.reservations) { + if (!Array.isArray(object.reservations)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListReservationsResponse.reservations: array expected"); + message.reservations = []; + for (var i = 0; i < object.reservations.length; ++i) { + if (typeof object.reservations[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListReservationsResponse.reservations: object expected"); + message.reservations[i] = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReservationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListReservationsResponse} message ListReservationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReservationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reservations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reservations && message.reservations.length) { + object.reservations = []; + for (var j = 0; j < message.reservations.length; ++j) + object.reservations[j] = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReservationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReservationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReservationsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReservationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListReservationsResponse"; + }; + + return ListReservationsResponse; + })(); + + v1.GetReservationRequest = (function() { + + /** + * Properties of a GetReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetReservationRequest + * @property {string|null} [name] GetReservationRequest name + */ + + /** + * Constructs a new GetReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetReservationRequest. + * @implements IGetReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest=} [properties] Properties to set + */ + function GetReservationRequest(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]]; + } + + /** + * GetReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @instance + */ + GetReservationRequest.prototype.name = ""; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest instance + */ + GetReservationRequest.create = function create(properties) { + return new GetReservationRequest(properties); + }; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} message GetReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReservationRequest.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 GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} message GetReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetReservationRequest(); + 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 GetReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReservationRequest.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 GetReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + */ + GetReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetReservationRequest} message GetReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReservationRequest.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 GetReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetReservationRequest"; + }; + + return GetReservationRequest; + })(); + + v1.DeleteReservationRequest = (function() { + + /** + * Properties of a DeleteReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteReservationRequest + * @property {string|null} [name] DeleteReservationRequest name + */ + + /** + * Constructs a new DeleteReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteReservationRequest. + * @implements IDeleteReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest=} [properties] Properties to set + */ + function DeleteReservationRequest(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]]; + } + + /** + * DeleteReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.name = ""; + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest instance + */ + DeleteReservationRequest.create = function create(properties) { + return new DeleteReservationRequest(properties); + }; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} message DeleteReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReservationRequest.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 DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} message DeleteReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(); + 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 DeleteReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReservationRequest.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 DeleteReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + */ + DeleteReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} message DeleteReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReservationRequest.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 DeleteReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteReservationRequest"; + }; + + return DeleteReservationRequest; + })(); + + v1.UpdateReservationRequest = (function() { + + /** + * Properties of an UpdateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateReservationRequest + * @property {google.cloud.bigquery.reservation.v1.IReservation|null} [reservation] UpdateReservationRequest reservation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateReservationRequest updateMask + */ + + /** + * Constructs a new UpdateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateReservationRequest. + * @implements IUpdateReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest=} [properties] Properties to set + */ + function UpdateReservationRequest(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]]; + } + + /** + * UpdateReservationRequest reservation. + * @member {google.cloud.bigquery.reservation.v1.IReservation|null|undefined} reservation + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + */ + UpdateReservationRequest.prototype.reservation = null; + + /** + * UpdateReservationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + */ + UpdateReservationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest instance + */ + UpdateReservationRequest.create = function create(properties) { + return new UpdateReservationRequest(properties); + }; + + /** + * Encodes the specified UpdateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} message UpdateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservation, 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 UpdateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} message UpdateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.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 UpdateReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reservation != null && message.hasOwnProperty("reservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservation); + if (error) + return "reservation." + 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 UpdateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + */ + UpdateReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(); + if (object.reservation != null) { + if (typeof object.reservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateReservationRequest.reservation: object expected"); + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateReservationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} message UpdateReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reservation = null; + object.updateMask = null; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateReservationRequest"; + }; + + return UpdateReservationRequest; + })(); + + v1.CreateCapacityCommitmentRequest = (function() { + + /** + * Properties of a CreateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateCapacityCommitmentRequest + * @property {string|null} [parent] CreateCapacityCommitmentRequest parent + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [capacityCommitment] CreateCapacityCommitmentRequest capacityCommitment + * @property {boolean|null} [enforceSingleAdminProjectPerOrg] CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg + * @property {string|null} [capacityCommitmentId] CreateCapacityCommitmentRequest capacityCommitmentId + */ + + /** + * Constructs a new CreateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateCapacityCommitmentRequest. + * @implements ICreateCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest=} [properties] Properties to set + */ + function CreateCapacityCommitmentRequest(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]]; + } + + /** + * CreateCapacityCommitmentRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.parent = ""; + + /** + * CreateCapacityCommitmentRequest capacityCommitment. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} capacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.capacityCommitment = null; + + /** + * CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg. + * @member {boolean} enforceSingleAdminProjectPerOrg + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.enforceSingleAdminProjectPerOrg = false; + + /** + * CreateCapacityCommitmentRequest capacityCommitmentId. + * @member {string} capacityCommitmentId + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.capacityCommitmentId = ""; + + /** + * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest instance + */ + CreateCapacityCommitmentRequest.create = function create(properties) { + return new CreateCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCapacityCommitmentRequest.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.capacityCommitment != null && Object.hasOwnProperty.call(message, "capacityCommitment")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enforceSingleAdminProjectPerOrg != null && Object.hasOwnProperty.call(message, "enforceSingleAdminProjectPerOrg")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enforceSingleAdminProjectPerOrg); + if (message.capacityCommitmentId != null && Object.hasOwnProperty.call(message, "capacityCommitmentId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.capacityCommitmentId); + return writer; + }; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.enforceSingleAdminProjectPerOrg = reader.bool(); + break; + } + case 5: { + message.capacityCommitmentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCapacityCommitmentRequest.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.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitment); + if (error) + return "capacityCommitment." + error; + } + if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) + if (typeof message.enforceSingleAdminProjectPerOrg !== "boolean") + return "enforceSingleAdminProjectPerOrg: boolean expected"; + if (message.capacityCommitmentId != null && message.hasOwnProperty("capacityCommitmentId")) + if (!$util.isString(message.capacityCommitmentId)) + return "capacityCommitmentId: string expected"; + return null; + }; + + /** + * Creates a CreateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + */ + CreateCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.capacityCommitment != null) { + if (typeof object.capacityCommitment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.capacityCommitment: object expected"); + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitment); + } + if (object.enforceSingleAdminProjectPerOrg != null) + message.enforceSingleAdminProjectPerOrg = Boolean(object.enforceSingleAdminProjectPerOrg); + if (object.capacityCommitmentId != null) + message.capacityCommitmentId = String(object.capacityCommitmentId); + return message; + }; + + /** + * Creates a plain object from a CreateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.capacityCommitment = null; + object.enforceSingleAdminProjectPerOrg = false; + object.capacityCommitmentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) + object.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitment, options); + if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) + object.enforceSingleAdminProjectPerOrg = message.enforceSingleAdminProjectPerOrg; + if (message.capacityCommitmentId != null && message.hasOwnProperty("capacityCommitmentId")) + object.capacityCommitmentId = message.capacityCommitmentId; + return object; + }; + + /** + * Converts this CreateCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest"; + }; + + return CreateCapacityCommitmentRequest; + })(); + + v1.ListCapacityCommitmentsRequest = (function() { + + /** + * Properties of a ListCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListCapacityCommitmentsRequest + * @property {string|null} [parent] ListCapacityCommitmentsRequest parent + * @property {number|null} [pageSize] ListCapacityCommitmentsRequest pageSize + * @property {string|null} [pageToken] ListCapacityCommitmentsRequest pageToken + */ + + /** + * Constructs a new ListCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListCapacityCommitmentsRequest. + * @implements IListCapacityCommitmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest=} [properties] Properties to set + */ + function ListCapacityCommitmentsRequest(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]]; + } + + /** + * ListCapacityCommitmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.parent = ""; + + /** + * ListCapacityCommitmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.pageSize = 0; + + /** + * ListCapacityCommitmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCapacityCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest instance + */ + ListCapacityCommitmentsRequest.create = function create(properties) { + return new ListCapacityCommitmentsRequest(properties); + }; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCapacityCommitmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCapacityCommitmentsRequest.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.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 ListCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + */ + ListCapacityCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCapacityCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListCapacityCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCapacityCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCapacityCommitmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCapacityCommitmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest"; + }; + + return ListCapacityCommitmentsRequest; + })(); + + v1.ListCapacityCommitmentsResponse = (function() { + + /** + * Properties of a ListCapacityCommitmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListCapacityCommitmentsResponse + * @property {Array.|null} [capacityCommitments] ListCapacityCommitmentsResponse capacityCommitments + * @property {string|null} [nextPageToken] ListCapacityCommitmentsResponse nextPageToken + */ + + /** + * Constructs a new ListCapacityCommitmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListCapacityCommitmentsResponse. + * @implements IListCapacityCommitmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse=} [properties] Properties to set + */ + function ListCapacityCommitmentsResponse(properties) { + this.capacityCommitments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCapacityCommitmentsResponse capacityCommitments. + * @member {Array.} capacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + */ + ListCapacityCommitmentsResponse.prototype.capacityCommitments = $util.emptyArray; + + /** + * ListCapacityCommitmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + */ + ListCapacityCommitmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCapacityCommitmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse instance + */ + ListCapacityCommitmentsResponse.create = function create(properties) { + return new ListCapacityCommitmentsResponse(properties); + }; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.capacityCommitments != null && message.capacityCommitments.length) + for (var i = 0; i < message.capacityCommitments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitments[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 ListCapacityCommitmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.capacityCommitments && message.capacityCommitments.length)) + message.capacityCommitments = []; + message.capacityCommitments.push($root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCapacityCommitmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCapacityCommitmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.capacityCommitments != null && message.hasOwnProperty("capacityCommitments")) { + if (!Array.isArray(message.capacityCommitments)) + return "capacityCommitments: array expected"; + for (var i = 0; i < message.capacityCommitments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitments[i]); + if (error) + return "capacityCommitments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCapacityCommitmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + */ + ListCapacityCommitmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(); + if (object.capacityCommitments) { + if (!Array.isArray(object.capacityCommitments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.capacityCommitments: array expected"); + message.capacityCommitments = []; + for (var i = 0; i < object.capacityCommitments.length; ++i) { + if (typeof object.capacityCommitments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.capacityCommitments: object expected"); + message.capacityCommitments[i] = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCapacityCommitmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCapacityCommitmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.capacityCommitments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.capacityCommitments && message.capacityCommitments.length) { + object.capacityCommitments = []; + for (var j = 0; j < message.capacityCommitments.length; ++j) + object.capacityCommitments[j] = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCapacityCommitmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCapacityCommitmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCapacityCommitmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCapacityCommitmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse"; + }; + + return ListCapacityCommitmentsResponse; + })(); + + v1.GetCapacityCommitmentRequest = (function() { + + /** + * Properties of a GetCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetCapacityCommitmentRequest + * @property {string|null} [name] GetCapacityCommitmentRequest name + */ + + /** + * Constructs a new GetCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetCapacityCommitmentRequest. + * @implements IGetCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest=} [properties] Properties to set + */ + function GetCapacityCommitmentRequest(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]]; + } + + /** + * GetCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @instance + */ + GetCapacityCommitmentRequest.prototype.name = ""; + + /** + * Creates a new GetCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest instance + */ + GetCapacityCommitmentRequest.create = function create(properties) { + return new GetCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified GetCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} message GetCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} message GetCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(); + 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 GetCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + */ + GetCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} message GetCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest"; + }; + + return GetCapacityCommitmentRequest; + })(); + + v1.DeleteCapacityCommitmentRequest = (function() { + + /** + * Properties of a DeleteCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteCapacityCommitmentRequest + * @property {string|null} [name] DeleteCapacityCommitmentRequest name + * @property {boolean|null} [force] DeleteCapacityCommitmentRequest force + */ + + /** + * Constructs a new DeleteCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteCapacityCommitmentRequest. + * @implements IDeleteCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest=} [properties] Properties to set + */ + function DeleteCapacityCommitmentRequest(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]]; + } + + /** + * DeleteCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + */ + DeleteCapacityCommitmentRequest.prototype.name = ""; + + /** + * DeleteCapacityCommitmentRequest force. + * @member {boolean} force + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + */ + DeleteCapacityCommitmentRequest.prototype.force = false; + + /** + * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest instance + */ + DeleteCapacityCommitmentRequest.create = function create(properties) { + return new DeleteCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCapacityCommitmentRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCapacityCommitmentRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + */ + DeleteCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest"; + }; + + return DeleteCapacityCommitmentRequest; + })(); + + v1.UpdateCapacityCommitmentRequest = (function() { + + /** + * Properties of an UpdateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateCapacityCommitmentRequest + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [capacityCommitment] UpdateCapacityCommitmentRequest capacityCommitment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCapacityCommitmentRequest updateMask + */ + + /** + * Constructs a new UpdateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateCapacityCommitmentRequest. + * @implements IUpdateCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest=} [properties] Properties to set + */ + function UpdateCapacityCommitmentRequest(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]]; + } + + /** + * UpdateCapacityCommitmentRequest capacityCommitment. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} capacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + */ + UpdateCapacityCommitmentRequest.prototype.capacityCommitment = null; + + /** + * UpdateCapacityCommitmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + */ + UpdateCapacityCommitmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest instance + */ + UpdateCapacityCommitmentRequest.create = function create(properties) { + return new UpdateCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCapacityCommitmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.capacityCommitment != null && Object.hasOwnProperty.call(message, "capacityCommitment")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitment, 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 UpdateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.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 UpdateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCapacityCommitmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitment); + if (error) + return "capacityCommitment." + 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 UpdateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + */ + UpdateCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(); + if (object.capacityCommitment != null) { + if (typeof object.capacityCommitment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.capacityCommitment: object expected"); + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.capacityCommitment = null; + object.updateMask = null; + } + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) + object.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest"; + }; + + return UpdateCapacityCommitmentRequest; + })(); + + v1.SplitCapacityCommitmentRequest = (function() { + + /** + * Properties of a SplitCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISplitCapacityCommitmentRequest + * @property {string|null} [name] SplitCapacityCommitmentRequest name + * @property {number|Long|null} [slotCount] SplitCapacityCommitmentRequest slotCount + */ + + /** + * Constructs a new SplitCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SplitCapacityCommitmentRequest. + * @implements ISplitCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest=} [properties] Properties to set + */ + function SplitCapacityCommitmentRequest(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]]; + } + + /** + * SplitCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + */ + SplitCapacityCommitmentRequest.prototype.name = ""; + + /** + * SplitCapacityCommitmentRequest slotCount. + * @member {number|Long} slotCount + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + */ + SplitCapacityCommitmentRequest.prototype.slotCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SplitCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest instance + */ + SplitCapacityCommitmentRequest.create = function create(properties) { + return new SplitCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentRequest.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.slotCount != null && Object.hasOwnProperty.call(message, "slotCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCount); + return writer; + }; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitCapacityCommitmentRequest.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.slotCount != null && message.hasOwnProperty("slotCount")) + if (!$util.isInteger(message.slotCount) && !(message.slotCount && $util.isInteger(message.slotCount.low) && $util.isInteger(message.slotCount.high))) + return "slotCount: integer|Long expected"; + return null; + }; + + /** + * Creates a SplitCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + */ + SplitCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCount != null) + if ($util.Long) + (message.slotCount = $util.Long.fromValue(object.slotCount)).unsigned = false; + else if (typeof object.slotCount === "string") + message.slotCount = parseInt(object.slotCount, 10); + else if (typeof object.slotCount === "number") + message.slotCount = object.slotCount; + else if (typeof object.slotCount === "object") + message.slotCount = new $util.LongBits(object.slotCount.low >>> 0, object.slotCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SplitCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCount != null && message.hasOwnProperty("slotCount")) + if (typeof message.slotCount === "number") + object.slotCount = options.longs === String ? String(message.slotCount) : message.slotCount; + else + object.slotCount = options.longs === String ? $util.Long.prototype.toString.call(message.slotCount) : options.longs === Number ? new $util.LongBits(message.slotCount.low >>> 0, message.slotCount.high >>> 0).toNumber() : message.slotCount; + return object; + }; + + /** + * Converts this SplitCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + SplitCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SplitCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest"; + }; + + return SplitCapacityCommitmentRequest; + })(); + + v1.SplitCapacityCommitmentResponse = (function() { + + /** + * Properties of a SplitCapacityCommitmentResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISplitCapacityCommitmentResponse + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [first] SplitCapacityCommitmentResponse first + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [second] SplitCapacityCommitmentResponse second + */ + + /** + * Constructs a new SplitCapacityCommitmentResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SplitCapacityCommitmentResponse. + * @implements ISplitCapacityCommitmentResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse=} [properties] Properties to set + */ + function SplitCapacityCommitmentResponse(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]]; + } + + /** + * SplitCapacityCommitmentResponse first. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} first + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + */ + SplitCapacityCommitmentResponse.prototype.first = null; + + /** + * SplitCapacityCommitmentResponse second. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} second + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + */ + SplitCapacityCommitmentResponse.prototype.second = null; + + /** + * Creates a new SplitCapacityCommitmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse instance + */ + SplitCapacityCommitmentResponse.create = function create(properties) { + return new SplitCapacityCommitmentResponse(properties); + }; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.first != null && Object.hasOwnProperty.call(message, "first")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.first, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.second != null && Object.hasOwnProperty.call(message, "second")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.second, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitCapacityCommitmentResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitCapacityCommitmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.first != null && message.hasOwnProperty("first")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.first); + if (error) + return "first." + error; + } + if (message.second != null && message.hasOwnProperty("second")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.second); + if (error) + return "second." + error; + } + return null; + }; + + /** + * Creates a SplitCapacityCommitmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + */ + SplitCapacityCommitmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(); + if (object.first != null) { + if (typeof object.first !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.first: object expected"); + message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.first); + } + if (object.second != null) { + if (typeof object.second !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.second: object expected"); + message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.second); + } + return message; + }; + + /** + * Creates a plain object from a SplitCapacityCommitmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitCapacityCommitmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.first = null; + object.second = null; + } + if (message.first != null && message.hasOwnProperty("first")) + object.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.first, options); + if (message.second != null && message.hasOwnProperty("second")) + object.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.second, options); + return object; + }; + + /** + * Converts this SplitCapacityCommitmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + * @returns {Object.} JSON object + */ + SplitCapacityCommitmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SplitCapacityCommitmentResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitCapacityCommitmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse"; + }; + + return SplitCapacityCommitmentResponse; + })(); + + v1.MergeCapacityCommitmentsRequest = (function() { + + /** + * Properties of a MergeCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IMergeCapacityCommitmentsRequest + * @property {string|null} [parent] MergeCapacityCommitmentsRequest parent + * @property {Array.|null} [capacityCommitmentIds] MergeCapacityCommitmentsRequest capacityCommitmentIds + */ + + /** + * Constructs a new MergeCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a MergeCapacityCommitmentsRequest. + * @implements IMergeCapacityCommitmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest=} [properties] Properties to set + */ + function MergeCapacityCommitmentsRequest(properties) { + this.capacityCommitmentIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergeCapacityCommitmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + */ + MergeCapacityCommitmentsRequest.prototype.parent = ""; + + /** + * MergeCapacityCommitmentsRequest capacityCommitmentIds. + * @member {Array.} capacityCommitmentIds + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + */ + MergeCapacityCommitmentsRequest.prototype.capacityCommitmentIds = $util.emptyArray; + + /** + * Creates a new MergeCapacityCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest instance + */ + MergeCapacityCommitmentsRequest.create = function create(properties) { + return new MergeCapacityCommitmentsRequest(properties); + }; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeCapacityCommitmentsRequest.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.capacityCommitmentIds != null && message.capacityCommitmentIds.length) + for (var i = 0; i < message.capacityCommitmentIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.capacityCommitmentIds[i]); + return writer; + }; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeCapacityCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeCapacityCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.capacityCommitmentIds && message.capacityCommitmentIds.length)) + message.capacityCommitmentIds = []; + message.capacityCommitmentIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeCapacityCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergeCapacityCommitmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergeCapacityCommitmentsRequest.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.capacityCommitmentIds != null && message.hasOwnProperty("capacityCommitmentIds")) { + if (!Array.isArray(message.capacityCommitmentIds)) + return "capacityCommitmentIds: array expected"; + for (var i = 0; i < message.capacityCommitmentIds.length; ++i) + if (!$util.isString(message.capacityCommitmentIds[i])) + return "capacityCommitmentIds: string[] expected"; + } + return null; + }; + + /** + * Creates a MergeCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + */ + MergeCapacityCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.capacityCommitmentIds) { + if (!Array.isArray(object.capacityCommitmentIds)) + throw TypeError(".google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.capacityCommitmentIds: array expected"); + message.capacityCommitmentIds = []; + for (var i = 0; i < object.capacityCommitmentIds.length; ++i) + message.capacityCommitmentIds[i] = String(object.capacityCommitmentIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a MergeCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergeCapacityCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.capacityCommitmentIds = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.capacityCommitmentIds && message.capacityCommitmentIds.length) { + object.capacityCommitmentIds = []; + for (var j = 0; j < message.capacityCommitmentIds.length; ++j) + object.capacityCommitmentIds[j] = message.capacityCommitmentIds[j]; + } + return object; + }; + + /** + * Converts this MergeCapacityCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + MergeCapacityCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergeCapacityCommitmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergeCapacityCommitmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest"; + }; + + return MergeCapacityCommitmentsRequest; + })(); + + v1.Assignment = (function() { + + /** + * Properties of an Assignment. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IAssignment + * @property {string|null} [name] Assignment name + * @property {string|null} [assignee] Assignment assignee + * @property {google.cloud.bigquery.reservation.v1.Assignment.JobType|null} [jobType] Assignment jobType + * @property {google.cloud.bigquery.reservation.v1.Assignment.State|null} [state] Assignment state + */ + + /** + * Constructs a new Assignment. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an Assignment. + * @implements IAssignment + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IAssignment=} [properties] Properties to set + */ + function Assignment(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]]; + } + + /** + * Assignment name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.name = ""; + + /** + * Assignment assignee. + * @member {string} assignee + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.assignee = ""; + + /** + * Assignment jobType. + * @member {google.cloud.bigquery.reservation.v1.Assignment.JobType} jobType + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.jobType = 0; + + /** + * Assignment state. + * @member {google.cloud.bigquery.reservation.v1.Assignment.State} state + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.state = 0; + + /** + * Creates a new Assignment instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment instance + */ + Assignment.create = function create(properties) { + return new Assignment(properties); + }; + + /** + * Encodes the specified Assignment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment} message Assignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assignment.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.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.jobType); + if (message.assignee != null && Object.hasOwnProperty.call(message, "assignee")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.assignee); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Assignment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment} message Assignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Assignment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.Assignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.assignee = reader.string(); + break; + } + case 3: { + message.jobType = reader.int32(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Assignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Assignment message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Assignment.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.assignee != null && message.hasOwnProperty("assignee")) + if (!$util.isString(message.assignee)) + return "assignee: string expected"; + if (message.jobType != null && message.hasOwnProperty("jobType")) + switch (message.jobType) { + default: + return "jobType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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 an Assignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + */ + Assignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.Assignment) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.Assignment(); + if (object.name != null) + message.name = String(object.name); + if (object.assignee != null) + message.assignee = String(object.assignee); + switch (object.jobType) { + case "JOB_TYPE_UNSPECIFIED": + case 0: + message.jobType = 0; + break; + case "PIPELINE": + case 1: + message.jobType = 1; + break; + case "QUERY": + case 2: + message.jobType = 2; + break; + case "ML_EXTERNAL": + case 3: + message.jobType = 3; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Assignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.Assignment} message Assignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Assignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.jobType = options.enums === String ? "JOB_TYPE_UNSPECIFIED" : 0; + object.assignee = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.jobType != null && message.hasOwnProperty("jobType")) + object.jobType = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.Assignment.JobType[message.jobType] : message.jobType; + if (message.assignee != null && message.hasOwnProperty("assignee")) + object.assignee = message.assignee; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.Assignment.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Assignment to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + * @returns {Object.} JSON object + */ + Assignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Assignment + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Assignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.Assignment"; + }; + + /** + * JobType enum. + * @name google.cloud.bigquery.reservation.v1.Assignment.JobType + * @enum {number} + * @property {number} JOB_TYPE_UNSPECIFIED=0 JOB_TYPE_UNSPECIFIED value + * @property {number} PIPELINE=1 PIPELINE value + * @property {number} QUERY=2 QUERY value + * @property {number} ML_EXTERNAL=3 ML_EXTERNAL value + */ + Assignment.JobType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PIPELINE"] = 1; + values[valuesById[2] = "QUERY"] = 2; + values[valuesById[3] = "ML_EXTERNAL"] = 3; + return values; + })(); + + /** + * State enum. + * @name google.cloud.bigquery.reservation.v1.Assignment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + */ + Assignment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + return values; + })(); + + return Assignment; + })(); + + v1.CreateAssignmentRequest = (function() { + + /** + * Properties of a CreateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateAssignmentRequest + * @property {string|null} [parent] CreateAssignmentRequest parent + * @property {google.cloud.bigquery.reservation.v1.IAssignment|null} [assignment] CreateAssignmentRequest assignment + * @property {string|null} [assignmentId] CreateAssignmentRequest assignmentId + */ + + /** + * Constructs a new CreateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateAssignmentRequest. + * @implements ICreateAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest=} [properties] Properties to set + */ + function CreateAssignmentRequest(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]]; + } + + /** + * CreateAssignmentRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.parent = ""; + + /** + * CreateAssignmentRequest assignment. + * @member {google.cloud.bigquery.reservation.v1.IAssignment|null|undefined} assignment + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.assignment = null; + + /** + * CreateAssignmentRequest assignmentId. + * @member {string} assignmentId + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.assignmentId = ""; + + /** + * Creates a new CreateAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest instance + */ + CreateAssignmentRequest.create = function create(properties) { + return new CreateAssignmentRequest(properties); + }; + + /** + * Encodes the specified CreateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} message CreateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssignmentRequest.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.assignment != null && Object.hasOwnProperty.call(message, "assignment")) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assignmentId != null && Object.hasOwnProperty.call(message, "assignmentId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.assignmentId); + return writer; + }; + + /** + * Encodes the specified CreateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} message CreateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.assignmentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssignmentRequest.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.assignment != null && message.hasOwnProperty("assignment")) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignment); + if (error) + return "assignment." + error; + } + if (message.assignmentId != null && message.hasOwnProperty("assignmentId")) + if (!$util.isString(message.assignmentId)) + return "assignmentId: string expected"; + return null; + }; + + /** + * Creates a CreateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + */ + CreateAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assignment != null) { + if (typeof object.assignment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.assignment: object expected"); + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignment); + } + if (object.assignmentId != null) + message.assignmentId = String(object.assignmentId); + return message; + }; + + /** + * Creates a plain object from a CreateAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} message CreateAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.assignment = null; + object.assignmentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assignment != null && message.hasOwnProperty("assignment")) + object.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignment, options); + if (message.assignmentId != null && message.hasOwnProperty("assignmentId")) + object.assignmentId = message.assignmentId; + return object; + }; + + /** + * Converts this CreateAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateAssignmentRequest"; + }; + + return CreateAssignmentRequest; + })(); + + v1.ListAssignmentsRequest = (function() { + + /** + * Properties of a ListAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListAssignmentsRequest + * @property {string|null} [parent] ListAssignmentsRequest parent + * @property {number|null} [pageSize] ListAssignmentsRequest pageSize + * @property {string|null} [pageToken] ListAssignmentsRequest pageToken + */ + + /** + * Constructs a new ListAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListAssignmentsRequest. + * @implements IListAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest=} [properties] Properties to set + */ + function ListAssignmentsRequest(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]]; + } + + /** + * ListAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.parent = ""; + + /** + * ListAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.pageSize = 0; + + /** + * ListAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest instance + */ + ListAssignmentsRequest.create = function create(properties) { + return new ListAssignmentsRequest(properties); + }; + + /** + * Encodes the specified ListAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} message ListAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} message ListAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssignmentsRequest.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.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 ListAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + */ + ListAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} message ListAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListAssignmentsRequest"; + }; + + return ListAssignmentsRequest; + })(); + + v1.ListAssignmentsResponse = (function() { + + /** + * Properties of a ListAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListAssignmentsResponse + * @property {Array.|null} [assignments] ListAssignmentsResponse assignments + * @property {string|null} [nextPageToken] ListAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new ListAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListAssignmentsResponse. + * @implements IListAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse=} [properties] Properties to set + */ + function ListAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + */ + ListAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * ListAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + */ + ListAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse instance + */ + ListAssignmentsResponse.create = function create(properties) { + return new ListAssignmentsResponse(properties); + }; + + /** + * Encodes the specified ListAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse} message ListAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 ListAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse} message ListAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + */ + ListAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} message ListAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListAssignmentsResponse"; + }; + + return ListAssignmentsResponse; + })(); + + v1.DeleteAssignmentRequest = (function() { + + /** + * Properties of a DeleteAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteAssignmentRequest + * @property {string|null} [name] DeleteAssignmentRequest name + */ + + /** + * Constructs a new DeleteAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteAssignmentRequest. + * @implements IDeleteAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest=} [properties] Properties to set + */ + function DeleteAssignmentRequest(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]]; + } + + /** + * DeleteAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @instance + */ + DeleteAssignmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest instance + */ + DeleteAssignmentRequest.create = function create(properties) { + return new DeleteAssignmentRequest(properties); + }; + + /** + * Encodes the specified DeleteAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} message DeleteAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} message DeleteAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(); + 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 DeleteAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + */ + DeleteAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} message DeleteAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest"; + }; + + return DeleteAssignmentRequest; + })(); + + v1.SearchAssignmentsRequest = (function() { + + /** + * Properties of a SearchAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAssignmentsRequest + * @property {string|null} [parent] SearchAssignmentsRequest parent + * @property {string|null} [query] SearchAssignmentsRequest query + * @property {number|null} [pageSize] SearchAssignmentsRequest pageSize + * @property {string|null} [pageToken] SearchAssignmentsRequest pageToken + */ + + /** + * Constructs a new SearchAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAssignmentsRequest. + * @implements ISearchAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest=} [properties] Properties to set + */ + function SearchAssignmentsRequest(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]]; + } + + /** + * SearchAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.parent = ""; + + /** + * SearchAssignmentsRequest query. + * @member {string} query + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.query = ""; + + /** + * SearchAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.pageSize = 0; + + /** + * SearchAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest instance + */ + SearchAssignmentsRequest.create = function create(properties) { + return new SearchAssignmentsRequest(properties); + }; + + /** + * Encodes the specified SearchAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} message SearchAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsRequest.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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + 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 SearchAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} message SearchAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + 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 SearchAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssignmentsRequest.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + */ + SearchAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + 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 SearchAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} message SearchAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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 SearchAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest"; + }; + + return SearchAssignmentsRequest; + })(); + + v1.SearchAllAssignmentsRequest = (function() { + + /** + * Properties of a SearchAllAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAllAssignmentsRequest + * @property {string|null} [parent] SearchAllAssignmentsRequest parent + * @property {string|null} [query] SearchAllAssignmentsRequest query + * @property {number|null} [pageSize] SearchAllAssignmentsRequest pageSize + * @property {string|null} [pageToken] SearchAllAssignmentsRequest pageToken + */ + + /** + * Constructs a new SearchAllAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAllAssignmentsRequest. + * @implements ISearchAllAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest=} [properties] Properties to set + */ + function SearchAllAssignmentsRequest(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]]; + } + + /** + * SearchAllAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.parent = ""; + + /** + * SearchAllAssignmentsRequest query. + * @member {string} query + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.query = ""; + + /** + * SearchAllAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.pageSize = 0; + + /** + * SearchAllAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAllAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest instance + */ + SearchAllAssignmentsRequest.create = function create(properties) { + return new SearchAllAssignmentsRequest(properties); + }; + + /** + * Encodes the specified SearchAllAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} message SearchAllAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsRequest.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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + 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 SearchAllAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} message SearchAllAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + 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 SearchAllAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllAssignmentsRequest.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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: 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 SearchAllAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + */ + SearchAllAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) + message.query = String(object.query); + 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 SearchAllAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} message SearchAllAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + 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 SearchAllAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest"; + }; + + return SearchAllAssignmentsRequest; + })(); + + v1.SearchAssignmentsResponse = (function() { + + /** + * Properties of a SearchAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAssignmentsResponse + * @property {Array.|null} [assignments] SearchAssignmentsResponse assignments + * @property {string|null} [nextPageToken] SearchAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new SearchAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAssignmentsResponse. + * @implements ISearchAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse=} [properties] Properties to set + */ + function SearchAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + */ + SearchAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * SearchAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + */ + SearchAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse instance + */ + SearchAssignmentsResponse.create = function create(properties) { + return new SearchAssignmentsResponse(properties); + }; + + /** + * Encodes the specified SearchAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse} message SearchAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 SearchAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse} message SearchAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + */ + SearchAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} message SearchAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse"; + }; + + return SearchAssignmentsResponse; + })(); + + v1.SearchAllAssignmentsResponse = (function() { + + /** + * Properties of a SearchAllAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAllAssignmentsResponse + * @property {Array.|null} [assignments] SearchAllAssignmentsResponse assignments + * @property {string|null} [nextPageToken] SearchAllAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new SearchAllAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAllAssignmentsResponse. + * @implements ISearchAllAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse=} [properties] Properties to set + */ + function SearchAllAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + */ + SearchAllAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * SearchAllAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + */ + SearchAllAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse instance + */ + SearchAllAssignmentsResponse.create = function create(properties) { + return new SearchAllAssignmentsResponse(properties); + }; + + /** + * Encodes the specified SearchAllAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse} message SearchAllAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 SearchAllAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse} message SearchAllAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + */ + SearchAllAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} message SearchAllAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse"; + }; + + return SearchAllAssignmentsResponse; + })(); + + v1.MoveAssignmentRequest = (function() { + + /** + * Properties of a MoveAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IMoveAssignmentRequest + * @property {string|null} [name] MoveAssignmentRequest name + * @property {string|null} [destinationId] MoveAssignmentRequest destinationId + */ + + /** + * Constructs a new MoveAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a MoveAssignmentRequest. + * @implements IMoveAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest=} [properties] Properties to set + */ + function MoveAssignmentRequest(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]]; + } + + /** + * MoveAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + */ + MoveAssignmentRequest.prototype.name = ""; + + /** + * MoveAssignmentRequest destinationId. + * @member {string} destinationId + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + */ + MoveAssignmentRequest.prototype.destinationId = ""; + + /** + * Creates a new MoveAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest instance + */ + MoveAssignmentRequest.create = function create(properties) { + return new MoveAssignmentRequest(properties); + }; + + /** + * Encodes the specified MoveAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} message MoveAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAssignmentRequest.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.destinationId != null && Object.hasOwnProperty.call(message, "destinationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationId); + return writer; + }; + + /** + * Encodes the specified MoveAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} message MoveAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.destinationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAssignmentRequest.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.destinationId != null && message.hasOwnProperty("destinationId")) + if (!$util.isString(message.destinationId)) + return "destinationId: string expected"; + return null; + }; + + /** + * Creates a MoveAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + */ + MoveAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationId != null) + message.destinationId = String(object.destinationId); + return message; + }; + + /** + * Creates a plain object from a MoveAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} message MoveAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.destinationId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationId != null && message.hasOwnProperty("destinationId")) + object.destinationId = message.destinationId; + return object; + }; + + /** + * Converts this MoveAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + MoveAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.MoveAssignmentRequest"; + }; + + return MoveAssignmentRequest; + })(); + + v1.UpdateAssignmentRequest = (function() { + + /** + * Properties of an UpdateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateAssignmentRequest + * @property {google.cloud.bigquery.reservation.v1.IAssignment|null} [assignment] UpdateAssignmentRequest assignment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAssignmentRequest updateMask + */ + + /** + * Constructs a new UpdateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateAssignmentRequest. + * @implements IUpdateAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest=} [properties] Properties to set + */ + function UpdateAssignmentRequest(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]]; + } + + /** + * UpdateAssignmentRequest assignment. + * @member {google.cloud.bigquery.reservation.v1.IAssignment|null|undefined} assignment + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + */ + UpdateAssignmentRequest.prototype.assignment = null; + + /** + * UpdateAssignmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + */ + UpdateAssignmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest instance + */ + UpdateAssignmentRequest.create = function create(properties) { + return new UpdateAssignmentRequest(properties); + }; + + /** + * Encodes the specified UpdateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} message UpdateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssignmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignment != null && Object.hasOwnProperty.call(message, "assignment")) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignment, 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 UpdateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} message UpdateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.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 UpdateAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAssignmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignment != null && message.hasOwnProperty("assignment")) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignment); + if (error) + return "assignment." + 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 UpdateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + */ + UpdateAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest(); + if (object.assignment != null) { + if (typeof object.assignment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.assignment: object expected"); + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} message UpdateAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.assignment = null; + object.updateMask = null; + } + if (message.assignment != null && message.hasOwnProperty("assignment")) + object.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest"; + }; + + return UpdateAssignmentRequest; + })(); + + v1.TableReference = (function() { + + /** + * Properties of a TableReference. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ITableReference + * @property {string|null} [projectId] TableReference projectId + * @property {string|null} [datasetId] TableReference datasetId + * @property {string|null} [tableId] TableReference tableId + */ + + /** + * Constructs a new TableReference. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a TableReference. + * @implements ITableReference + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ITableReference=} [properties] Properties to set + */ + function TableReference(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]]; + } + + /** + * TableReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.projectId = ""; + + /** + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.datasetId = ""; + + /** + * TableReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.tableId = ""; + + /** + * Creates a new TableReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference instance + */ + TableReference.create = function create(properties) { + return new TableReference(properties); + }; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.TableReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReference message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + */ + TableReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.TableReference) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.TableReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.TableReference} message TableReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this TableReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + * @returns {Object.} JSON object + */ + TableReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.TableReference"; + }; + + return TableReference; + })(); + + v1.BiReservation = (function() { + + /** + * Properties of a BiReservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IBiReservation + * @property {string|null} [name] BiReservation name + * @property {google.protobuf.ITimestamp|null} [updateTime] BiReservation updateTime + * @property {number|Long|null} [size] BiReservation size + * @property {Array.|null} [preferredTables] BiReservation preferredTables + */ + + /** + * Constructs a new BiReservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a BiReservation. + * @implements IBiReservation + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IBiReservation=} [properties] Properties to set + */ + function BiReservation(properties) { + this.preferredTables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BiReservation name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.name = ""; + + /** + * BiReservation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.updateTime = null; + + /** + * BiReservation size. + * @member {number|Long} size + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BiReservation preferredTables. + * @member {Array.} preferredTables + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.preferredTables = $util.emptyArray; + + /** + * Creates a new BiReservation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation instance + */ + BiReservation.create = function create(properties) { + return new BiReservation(properties); + }; + + /** + * Encodes the specified BiReservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation} message BiReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiReservation.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); + if (message.preferredTables != null && message.preferredTables.length) + for (var i = 0; i < message.preferredTables.length; ++i) + $root.google.cloud.bigquery.reservation.v1.TableReference.encode(message.preferredTables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BiReservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation} message BiReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiReservation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BiReservation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiReservation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.BiReservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.size = reader.int64(); + break; + } + case 5: { + if (!(message.preferredTables && message.preferredTables.length)) + message.preferredTables = []; + message.preferredTables.push($root.google.cloud.bigquery.reservation.v1.TableReference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BiReservation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiReservation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BiReservation message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BiReservation.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.preferredTables != null && message.hasOwnProperty("preferredTables")) { + if (!Array.isArray(message.preferredTables)) + return "preferredTables: array expected"; + for (var i = 0; i < message.preferredTables.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.TableReference.verify(message.preferredTables[i]); + if (error) + return "preferredTables." + error; + } + } + return null; + }; + + /** + * Creates a BiReservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + */ + BiReservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.BiReservation) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.BiReservation(); + if (object.name != null) + message.name = String(object.name); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.preferredTables) { + if (!Array.isArray(object.preferredTables)) + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.preferredTables: array expected"); + message.preferredTables = []; + for (var i = 0; i < object.preferredTables.length; ++i) { + if (typeof object.preferredTables[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.preferredTables: object expected"); + message.preferredTables[i] = $root.google.cloud.bigquery.reservation.v1.TableReference.fromObject(object.preferredTables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BiReservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.BiReservation} message BiReservation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BiReservation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.preferredTables = []; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.preferredTables && message.preferredTables.length) { + object.preferredTables = []; + for (var j = 0; j < message.preferredTables.length; ++j) + object.preferredTables[j] = $root.google.cloud.bigquery.reservation.v1.TableReference.toObject(message.preferredTables[j], options); + } + return object; + }; + + /** + * Converts this BiReservation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + * @returns {Object.} JSON object + */ + BiReservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BiReservation + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BiReservation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.BiReservation"; + }; + + return BiReservation; + })(); + + v1.GetBiReservationRequest = (function() { + + /** + * Properties of a GetBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetBiReservationRequest + * @property {string|null} [name] GetBiReservationRequest name + */ + + /** + * Constructs a new GetBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetBiReservationRequest. + * @implements IGetBiReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest=} [properties] Properties to set + */ + function GetBiReservationRequest(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]]; + } + + /** + * GetBiReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @instance + */ + GetBiReservationRequest.prototype.name = ""; + + /** + * Creates a new GetBiReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest instance + */ + GetBiReservationRequest.create = function create(properties) { + return new GetBiReservationRequest(properties); + }; + + /** + * Encodes the specified GetBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} message GetBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBiReservationRequest.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 GetBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} message GetBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBiReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBiReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(); + 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 GetBiReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBiReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBiReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBiReservationRequest.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 GetBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + */ + GetBiReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBiReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} message GetBiReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBiReservationRequest.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 GetBiReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetBiReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBiReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBiReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetBiReservationRequest"; + }; + + return GetBiReservationRequest; + })(); + + v1.UpdateBiReservationRequest = (function() { + + /** + * Properties of an UpdateBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateBiReservationRequest + * @property {google.cloud.bigquery.reservation.v1.IBiReservation|null} [biReservation] UpdateBiReservationRequest biReservation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBiReservationRequest updateMask + */ + + /** + * Constructs a new UpdateBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateBiReservationRequest. + * @implements IUpdateBiReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest=} [properties] Properties to set + */ + function UpdateBiReservationRequest(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]]; + } + + /** + * UpdateBiReservationRequest biReservation. + * @member {google.cloud.bigquery.reservation.v1.IBiReservation|null|undefined} biReservation + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + */ + UpdateBiReservationRequest.prototype.biReservation = null; + + /** + * UpdateBiReservationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + */ + UpdateBiReservationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBiReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest instance + */ + UpdateBiReservationRequest.create = function create(properties) { + return new UpdateBiReservationRequest(properties); + }; + + /** + * Encodes the specified UpdateBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} message UpdateBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBiReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.biReservation != null && Object.hasOwnProperty.call(message, "biReservation")) + $root.google.cloud.bigquery.reservation.v1.BiReservation.encode(message.biReservation, 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 UpdateBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} message UpdateBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBiReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBiReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.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 UpdateBiReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBiReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBiReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBiReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.biReservation != null && message.hasOwnProperty("biReservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.BiReservation.verify(message.biReservation); + if (error) + return "biReservation." + 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 UpdateBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + */ + UpdateBiReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(); + if (object.biReservation != null) { + if (typeof object.biReservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.biReservation: object expected"); + message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.fromObject(object.biReservation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBiReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} message UpdateBiReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBiReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.biReservation = null; + object.updateMask = null; + } + if (message.biReservation != null && message.hasOwnProperty("biReservation")) + object.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.toObject(message.biReservation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBiReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBiReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBiReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBiReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest"; + }; + + return UpdateBiReservationRequest; + })(); + + return v1; + })(); + + return reservation; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.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; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json new file mode 100644 index 000000000000..f2d4d04d1423 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -0,0 +1,2285 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "reservation": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.Reservation.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation", + "java_multiple_files": true, + "java_outer_classname": "ReservationProto", + "java_package": "com.google.cloud.bigquery.reservation.v1", + "php_namespace": "Google\\Cloud\\BigQuery\\Reservation\\V1" + }, + "nested": { + "ReservationService": { + "options": { + "(google.api.default_host)": "bigqueryreservation.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateReservation": { + "requestType": "CreateReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/reservations", + "(google.api.http).body": "reservation", + "(google.api.method_signature)": "parent,reservation,reservation_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/reservations", + "body": "reservation" + } + }, + { + "(google.api.method_signature)": "parent,reservation,reservation_id" + } + ] + }, + "ListReservations": { + "requestType": "ListReservationsRequest", + "responseType": "ListReservationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/reservations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/reservations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetReservation": { + "requestType": "GetReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/reservations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/reservations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteReservation": { + "requestType": "DeleteReservationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/reservations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateReservation": { + "requestType": "UpdateReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).patch": "/v1/{reservation.name=projects/*/locations/*/reservations/*}", + "(google.api.http).body": "reservation", + "(google.api.method_signature)": "reservation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{reservation.name=projects/*/locations/*/reservations/*}", + "body": "reservation" + } + }, + { + "(google.api.method_signature)": "reservation,update_mask" + } + ] + }, + "CreateCapacityCommitment": { + "requestType": "CreateCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "(google.api.http).body": "capacity_commitment", + "(google.api.method_signature)": "parent,capacity_commitment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "body": "capacity_commitment" + } + }, + { + "(google.api.method_signature)": "parent,capacity_commitment" + } + ] + }, + "ListCapacityCommitments": { + "requestType": "ListCapacityCommitmentsRequest", + "responseType": "ListCapacityCommitmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/capacityCommitments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCapacityCommitment": { + "requestType": "GetCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteCapacityCommitment": { + "requestType": "DeleteCapacityCommitmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCapacityCommitment": { + "requestType": "UpdateCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).patch": "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.http).body": "capacity_commitment", + "(google.api.method_signature)": "capacity_commitment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}", + "body": "capacity_commitment" + } + }, + { + "(google.api.method_signature)": "capacity_commitment,update_mask" + } + ] + }, + "SplitCapacityCommitment": { + "requestType": "SplitCapacityCommitmentRequest", + "responseType": "SplitCapacityCommitmentResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,slot_count" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,slot_count" + } + ] + }, + "MergeCapacityCommitments": { + "requestType": "MergeCapacityCommitmentsRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,capacity_commitment_ids" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,capacity_commitment_ids" + } + ] + }, + "CreateAssignment": { + "requestType": "CreateAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "(google.api.http).body": "assignment", + "(google.api.method_signature)": "parent,assignment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "body": "assignment" + } + }, + { + "(google.api.method_signature)": "parent,assignment" + } + ] + }, + "ListAssignments": { + "requestType": "ListAssignmentsRequest", + "responseType": "ListAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteAssignment": { + "requestType": "DeleteAssignmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchAssignments": { + "requestType": "SearchAssignmentsRequest", + "responseType": "SearchAssignmentsResponse", + "options": { + "deprecated": true, + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAssignments", + "(google.api.method_signature)": "parent,query" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}:searchAssignments" + } + }, + { + "(google.api.method_signature)": "parent,query" + } + ] + }, + "SearchAllAssignments": { + "requestType": "SearchAllAssignmentsRequest", + "responseType": "SearchAllAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAllAssignments", + "(google.api.method_signature)": "parent,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}:searchAllAssignments" + } + }, + { + "(google.api.method_signature)": "parent,query" + } + ] + }, + "MoveAssignment": { + "requestType": "MoveAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,destination_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,destination_id" + } + ] + }, + "UpdateAssignment": { + "requestType": "UpdateAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).patch": "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}", + "(google.api.http).body": "assignment", + "(google.api.method_signature)": "assignment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}", + "body": "assignment" + } + }, + { + "(google.api.method_signature)": "assignment,update_mask" + } + ] + }, + "GetBiReservation": { + "requestType": "GetBiReservationRequest", + "responseType": "BiReservation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/biReservation}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/biReservation}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBiReservation": { + "requestType": "UpdateBiReservationRequest", + "responseType": "BiReservation", + "options": { + "(google.api.http).patch": "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}", + "(google.api.http).body": "bi_reservation", + "(google.api.method_signature)": "bi_reservation,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}", + "body": "bi_reservation" + } + }, + { + "(google.api.method_signature)": "bi_reservation,update_mask" + } + ] + } + } + }, + "Reservation": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/Reservation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reservations/{reservation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "slotCapacity": { + "type": "int64", + "id": 2 + }, + "ignoreIdleSlots": { + "type": "bool", + "id": 4 + }, + "concurrency": { + "type": "int64", + "id": 16 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "multiRegionAuxiliary": { + "type": "bool", + "id": 14 + } + } + }, + "CapacityCommitment": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/CapacityCommitment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slotCount": { + "type": "int64", + "id": 2 + }, + "plan": { + "type": "CommitmentPlan", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "commitmentStartTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "commitmentEndTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureStatus": { + "type": "google.rpc.Status", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renewalPlan": { + "type": "CommitmentPlan", + "id": 8 + }, + "multiRegionAuxiliary": { + "type": "bool", + "id": 10 + } + }, + "nested": { + "CommitmentPlan": { + "values": { + "COMMITMENT_PLAN_UNSPECIFIED": 0, + "FLEX": 3, + "TRIAL": 5, + "MONTHLY": 2, + "ANNUAL": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ACTIVE": 2, + "FAILED": 3 + } + } + } + }, + "CreateReservationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Reservation" + } + }, + "reservationId": { + "type": "string", + "id": 2 + }, + "reservation": { + "type": "Reservation", + "id": 3 + } + } + }, + "ListReservationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Reservation" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReservationsResponse": { + "fields": { + "reservations": { + "rule": "repeated", + "type": "Reservation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation" + } + } + } + }, + "DeleteReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation" + } + } + } + }, + "UpdateReservationRequest": { + "fields": { + "reservation": { + "type": "Reservation", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateCapacityCommitmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "capacityCommitment": { + "type": "CapacityCommitment", + "id": 2 + }, + "enforceSingleAdminProjectPerOrg": { + "type": "bool", + "id": 4 + }, + "capacityCommitmentId": { + "type": "string", + "id": 5 + } + } + }, + "ListCapacityCommitmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCapacityCommitmentsResponse": { + "fields": { + "capacityCommitments": { + "rule": "repeated", + "type": "CapacityCommitment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + } + } + }, + "DeleteCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateCapacityCommitmentRequest": { + "fields": { + "capacityCommitment": { + "type": "CapacityCommitment", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "SplitCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "slotCount": { + "type": "int64", + "id": 2 + } + } + }, + "SplitCapacityCommitmentResponse": { + "fields": { + "first": { + "type": "CapacityCommitment", + "id": 1 + }, + "second": { + "type": "CapacityCommitment", + "id": 2 + } + } + }, + "MergeCapacityCommitmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "capacityCommitmentIds": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Assignment": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/Assignment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "assignee": { + "type": "string", + "id": 4 + }, + "jobType": { + "type": "JobType", + "id": 3 + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "JobType": { + "values": { + "JOB_TYPE_UNSPECIFIED": 0, + "PIPELINE": 1, + "QUERY": 2, + "ML_EXTERNAL": 3 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ACTIVE": 2 + } + } + } + }, + "CreateAssignmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "assignment": { + "type": "Assignment", + "id": 2 + }, + "assignmentId": { + "type": "string", + "id": 4 + } + } + }, + "ListAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Assignment" + } + } + } + }, + "SearchAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "SearchAllAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "SearchAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "MoveAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "destinationId": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + } + } + }, + "UpdateAssignmentRequest": { + "fields": { + "assignment": { + "type": "Assignment", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "TableReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "datasetId": { + "type": "string", + "id": 2 + }, + "tableId": { + "type": "string", + "id": 3 + } + } + }, + "BiReservation": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/BiReservation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/biReservation" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "size": { + "type": "int64", + "id": 4 + }, + "preferredTables": { + "rule": "repeated", + "type": "TableReference", + "id": 5 + } + } + }, + "GetBiReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/BiReservation" + } + } + } + }, + "UpdateBiReservationRequest": { + "fields": { + "biReservation": { + "type": "BiReservation", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/samples/README.md b/packages/google-cloud-bigquery-reservation/samples/README.md new file mode 100644 index 000000000000..ad941a328f25 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/README.md @@ -0,0 +1,446 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Reservation: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Reservation_service.create_assignment](#reservation_service.create_assignment) + * [Reservation_service.create_capacity_commitment](#reservation_service.create_capacity_commitment) + * [Reservation_service.create_reservation](#reservation_service.create_reservation) + * [Reservation_service.delete_assignment](#reservation_service.delete_assignment) + * [Reservation_service.delete_capacity_commitment](#reservation_service.delete_capacity_commitment) + * [Reservation_service.delete_reservation](#reservation_service.delete_reservation) + * [Reservation_service.get_bi_reservation](#reservation_service.get_bi_reservation) + * [Reservation_service.get_capacity_commitment](#reservation_service.get_capacity_commitment) + * [Reservation_service.get_reservation](#reservation_service.get_reservation) + * [Reservation_service.list_assignments](#reservation_service.list_assignments) + * [Reservation_service.list_capacity_commitments](#reservation_service.list_capacity_commitments) + * [Reservation_service.list_reservations](#reservation_service.list_reservations) + * [Reservation_service.merge_capacity_commitments](#reservation_service.merge_capacity_commitments) + * [Reservation_service.move_assignment](#reservation_service.move_assignment) + * [Reservation_service.search_all_assignments](#reservation_service.search_all_assignments) + * [Reservation_service.search_assignments](#reservation_service.search_assignments) + * [Reservation_service.split_capacity_commitment](#reservation_service.split_capacity_commitment) + * [Reservation_service.update_assignment](#reservation_service.update_assignment) + * [Reservation_service.update_bi_reservation](#reservation_service.update_bi_reservation) + * [Reservation_service.update_capacity_commitment](#reservation_service.update_capacity_commitment) + * [Reservation_service.update_reservation](#reservation_service.update_reservation) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Reservation_service.create_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js` + + +----- + + + + +### Reservation_service.create_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js` + + +----- + + + + +### Reservation_service.create_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js` + + +----- + + + + +### Reservation_service.delete_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js` + + +----- + + + + +### Reservation_service.delete_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js` + + +----- + + + + +### Reservation_service.delete_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js` + + +----- + + + + +### Reservation_service.get_bi_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js` + + +----- + + + + +### Reservation_service.get_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js` + + +----- + + + + +### Reservation_service.get_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js` + + +----- + + + + +### Reservation_service.list_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js` + + +----- + + + + +### Reservation_service.list_capacity_commitments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js` + + +----- + + + + +### Reservation_service.list_reservations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js` + + +----- + + + + +### Reservation_service.merge_capacity_commitments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js` + + +----- + + + + +### Reservation_service.move_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js` + + +----- + + + + +### Reservation_service.search_all_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js` + + +----- + + + + +### Reservation_service.search_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js` + + +----- + + + + +### Reservation_service.split_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js` + + +----- + + + + +### Reservation_service.update_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js` + + +----- + + + + +### Reservation_service.update_bi_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js` + + +----- + + + + +### Reservation_service.update_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js` + + +----- + + + + +### Reservation_service.update_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js new file mode 100644 index 000000000000..2b732b3dbbac --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + */ + // const parent = 'abc123' + /** + * Assignment resource to create. + */ + // const assignment = {} + /** + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + */ + // const assignmentId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callCreateAssignment() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createAssignment(request); + console.log(response); + } + + callCreateAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js new file mode 100644 index 000000000000..64c0a140024b --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -0,0 +1,79 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * Content of the capacity commitment to create. + */ + // const capacityCommitment = {} + /** + * If true, fail the request if another project in the organization has a + * capacity commitment. + */ + // const enforceSingleAdminProjectPerOrg = true + /** + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + */ + // const capacityCommitmentId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callCreateCapacityCommitment() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createCapacityCommitment(request); + console.log(response); + } + + callCreateCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js new file mode 100644 index 000000000000..c549cf1ff904 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + */ + // const reservationId = 'abc123' + /** + * Definition of the new reservation to create. + */ + // const reservation = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callCreateReservation() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createReservation(request); + console.log(response); + } + + callCreateReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js new file mode 100644 index 000000000000..7cc025dca1fd --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callDeleteAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteAssignment(request); + console.log(response); + } + + callDeleteAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js new file mode 100644 index 000000000000..e4cff5a4d7b2 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + /** + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + */ + // const force = true + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callDeleteCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteCapacityCommitment(request); + console.log(response); + } + + callDeleteCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js new file mode 100644 index 000000000000..abd52b3b07f1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callDeleteReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteReservation(request); + console.log(response); + } + + callDeleteReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js new file mode 100644 index 000000000000..8544ae823cd9 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callGetBiReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getBiReservation(request); + console.log(response); + } + + callGetBiReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js new file mode 100644 index 000000000000..8d06a67bfe01 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callGetCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getCapacityCommitment(request); + console.log(response); + } + + callGetCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js new file mode 100644 index 000000000000..e97f8a2ec7d3 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callGetReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getReservation(request); + console.log(response); + } + + callGetReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_GetReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js new file mode 100644 index 000000000000..d90a7238eba1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callListAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js new file mode 100644 index 000000000000..27757e405ef8 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callListCapacityCommitments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listCapacityCommitmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCapacityCommitments(); + // [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js new file mode 100644 index 000000000000..135ca136f1b7 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_ListReservations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callListReservations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listReservationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReservations(); + // [END bigqueryreservation_v1_generated_ReservationService_ListReservations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js new file mode 100644 index 000000000000..1f6d5f846960 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + */ + // const parent = 'abc123' + /** + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + */ + // const capacityCommitmentIds = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callMergeCapacityCommitments() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.mergeCapacityCommitments(request); + console.log(response); + } + + callMergeCapacityCommitments(); + // [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js new file mode 100644 index 000000000000..4955768ebb44 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + */ + // const name = 'abc123' + /** + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + */ + // const destinationId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callMoveAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.moveAssignment(request); + console.log(response); + } + + callMoveAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js new file mode 100644 index 000000000000..64dbdbfb0450 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -0,0 +1,81 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + */ + // const parent = 'abc123' + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + */ + // const query = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callSearchAllAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.searchAllAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAllAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js new file mode 100644 index 000000000000..6ff7affa339d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -0,0 +1,81 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + */ + // const parent = 'abc123' + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + */ + // const query = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callSearchAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.searchAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js new file mode 100644 index 000000000000..be3934c919b1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + /** + * Number of slots in the capacity commitment after the split. + */ + // const slotCount = 1234 + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callSplitCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.splitCapacityCommitment(request); + console.log(response); + } + + callSplitCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js new file mode 100644 index 000000000000..2eb24b71228b --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the assignment to update. + */ + // const assignment = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callUpdateAssignment() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.updateAssignment(request); + console.log(response); + } + + callUpdateAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js new file mode 100644 index 000000000000..57eef5697cd9 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A reservation to update. + */ + // const biReservation = {} + /** + * A list of fields to be updated in this request. + */ + // const updateMask = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callUpdateBiReservation() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.updateBiReservation(request); + console.log(response); + } + + callUpdateBiReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js new file mode 100644 index 000000000000..e14a513cf268 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the capacity commitment to update. + */ + // const capacityCommitment = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callUpdateCapacityCommitment() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.updateCapacityCommitment(request); + console.log(response); + } + + callUpdateCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js new file mode 100644 index 000000000000..292640e8f093 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the reservation to update. + */ + // const reservation = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callUpdateReservation() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.updateReservation(request); + console.log(response); + } + + callUpdateReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json new file mode 100644 index 000000000000..62fa4322f2d5 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -0,0 +1,963 @@ +{ + "clientLibrary": { + "name": "nodejs-reservation", + "version": "2.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.reservation.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_async", + "title": "ReservationService createReservation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reservation resource.", + "canonical": true, + "file": "reservation_service.create_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "reservation_id", + "type": "TYPE_STRING" + }, + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_async", + "title": "ReservationService listReservations Sample", + "origin": "API_DEFINITION", + "description": " Lists all the reservations for the project in the specified location.", + "canonical": true, + "file": "reservation_service.list_reservations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListReservationsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_async", + "title": "ReservationService getReservation Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the reservation.", + "canonical": true, + "file": "reservation_service.get_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async", + "title": "ReservationService deleteReservation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments.", + "canonical": true, + "file": "reservation_service.delete_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async", + "title": "ReservationService updateReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing reservation resource.", + "canonical": true, + "file": "reservation_service.update_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "async": true, + "parameters": [ + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async", + "title": "ReservationService createCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new capacity commitment resource.", + "canonical": true, + "file": "reservation_service.create_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "enforce_single_admin_project_per_org", + "type": "TYPE_BOOL" + }, + { + "name": "capacity_commitment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async", + "title": "ReservationService listCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Lists all the capacity commitments for the admin project.", + "canonical": true, + "file": "reservation_service.list_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async", + "title": "ReservationService getCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the capacity commitment.", + "canonical": true, + "file": "reservation_service.get_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async", + "title": "ReservationService deleteCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.delete_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async", + "title": "ReservationService updateCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing capacity commitment. Only `plan` and `renewal_plan` fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.update_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async", + "title": "ReservationService splitCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.", + "canonical": true, + "file": "reservation_service.split_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "slot_count", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async", + "title": "ReservationService mergeCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Merges capacity commitments of the same plan into a single commitment. The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.merge_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async", + "title": "ReservationService createAssignment Sample", + "origin": "API_DEFINITION", + "description": " Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type. Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. Example: * The organization `organizationA` contains two projects, `project1` and `project2`. * Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations. \"None\" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a \"None\" assignment, use \"none\" as a reservation_id in the parent. Example parent: `projects/myproject/locations/US/reservations/none`. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.", + "canonical": true, + "file": "reservation_service.create_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "assignment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_async", + "title": "ReservationService listAssignments Sample", + "origin": "API_DEFINITION", + "description": " Lists assignments. Only explicitly created assignments will be returned. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, ListAssignments will just return the above two assignments for reservation `res1`, and no expansion/merge will happen. The wildcard \"-\" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.list_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async", + "title": "ReservationService deleteAssignment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a assignment. No expansion will happen. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, deletion of the `` assignment won't affect the other assignment ``. After said deletion, queries from `project1` will still use `res1` while queries from `project2` will switch to use on-demand mode.", + "canonical": true, + "file": "reservation_service.delete_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async", + "title": "ReservationService searchAssignments Sample", + "origin": "API_DEFINITION", + "description": " Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.search_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async", + "title": "ReservationService searchAllAssignments Sample", + "origin": "API_DEFINITION", + "description": " Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.", + "canonical": true, + "file": "reservation_service.search_all_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async", + "title": "ReservationService moveAssignment Sample", + "origin": "API_DEFINITION", + "description": " Moves an assignment under a new reservation. This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.", + "canonical": true, + "file": "reservation_service.move_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async", + "title": "ReservationService updateAssignment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing assignment. Only the `priority` field can be updated.", + "canonical": true, + "file": "reservation_service.update_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "async": true, + "parameters": [ + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async", + "title": "ReservationService getBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a BI reservation.", + "canonical": true, + "file": "reservation_service.get_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async", + "title": "ReservationService updateBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.", + "canonical": true, + "file": "reservation_service.update_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "async": true, + "parameters": [ + { + "name": "bi_reservation", + "type": ".google.cloud.bigquery.reservation.v1.BiReservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json new file mode 100644 index 000000000000..7cebb11c5661 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "@google-cloud/bigquery-reservation-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/bigquery-reservation": "^2.0.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/samples/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/quickstart.js new file mode 100644 index 000000000000..d4dc02df6532 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/quickstart.js @@ -0,0 +1,61 @@ +// Copyright 2020 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. +// + +'use strict'; + +async function quickstart( + project = 'my-project', // Project to list reservations for. + location = 'US' // BigQuery location. +) { + // [START bigqueryreservation_quickstart] + // Imports the Google Cloud client library + const { + ReservationServiceClient, + } = require('@google-cloud/bigquery-reservation'); + + // Creates a client + const client = new ReservationServiceClient(); + + // project = 'my-project' // Project to list reservations for. + // location = 'US' // BigQuery location. + + async function listReservations() { + const [reservations] = await client.listReservations({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${reservations.length} reservations`); + console.info(reservations); + } + + async function listCapacityCommitments() { + const [commitments] = await client.listCapacityCommitments({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${commitments.length} commitments`); + console.info(commitments); + } + + listReservations(); + listCapacityCommitments(); + // [END bigqueryreservation_quickstart] +} + +const args = process.argv.slice(2); +quickstart(...args).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js new file mode 100644 index 000000000000..316b9ec80c82 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -0,0 +1,41 @@ +// Copyright 2020 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'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const { + ReservationServiceClient, +} = require('@google-cloud/bigquery-reservation'); +const client = new ReservationServiceClient(); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('Quickstart', () => { + let projectId; + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`); + assert.match(stdout, /found [0-9]+ reservations/); + assert.match(stdout, /found [0-9]+ commitments/); + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts new file mode 100644 index 000000000000..0ce0e5367a43 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ReservationServiceClient = v1.ReservationServiceClient; +type ReservationServiceClient = v1.ReservationServiceClient; + +export {v1, ReservationServiceClient}; +export default {v1, ReservationServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..03838a39d9b5 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json @@ -0,0 +1,253 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "@google-cloud/bigquery-reservation", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "ReservationServiceClient", + "rpcs": { + "CreateReservation": { + "methods": [ + "createReservation" + ] + }, + "GetReservation": { + "methods": [ + "getReservation" + ] + }, + "DeleteReservation": { + "methods": [ + "deleteReservation" + ] + }, + "UpdateReservation": { + "methods": [ + "updateReservation" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "createCapacityCommitment" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "getCapacityCommitment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "deleteCapacityCommitment" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "updateCapacityCommitment" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "splitCapacityCommitment" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "mergeCapacityCommitments" + ] + }, + "CreateAssignment": { + "methods": [ + "createAssignment" + ] + }, + "DeleteAssignment": { + "methods": [ + "deleteAssignment" + ] + }, + "MoveAssignment": { + "methods": [ + "moveAssignment" + ] + }, + "UpdateAssignment": { + "methods": [ + "updateAssignment" + ] + }, + "GetBiReservation": { + "methods": [ + "getBiReservation" + ] + }, + "UpdateBiReservation": { + "methods": [ + "updateBiReservation" + ] + }, + "ListReservations": { + "methods": [ + "listReservations", + "listReservationsStream", + "listReservationsAsync" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "listCapacityCommitments", + "listCapacityCommitmentsStream", + "listCapacityCommitmentsAsync" + ] + }, + "ListAssignments": { + "methods": [ + "listAssignments", + "listAssignmentsStream", + "listAssignmentsAsync" + ] + }, + "SearchAssignments": { + "methods": [ + "searchAssignments", + "searchAssignmentsStream", + "searchAssignmentsAsync" + ] + }, + "SearchAllAssignments": { + "methods": [ + "searchAllAssignments", + "searchAllAssignmentsStream", + "searchAllAssignmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ReservationServiceClient", + "rpcs": { + "CreateReservation": { + "methods": [ + "createReservation" + ] + }, + "GetReservation": { + "methods": [ + "getReservation" + ] + }, + "DeleteReservation": { + "methods": [ + "deleteReservation" + ] + }, + "UpdateReservation": { + "methods": [ + "updateReservation" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "createCapacityCommitment" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "getCapacityCommitment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "deleteCapacityCommitment" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "updateCapacityCommitment" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "splitCapacityCommitment" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "mergeCapacityCommitments" + ] + }, + "CreateAssignment": { + "methods": [ + "createAssignment" + ] + }, + "DeleteAssignment": { + "methods": [ + "deleteAssignment" + ] + }, + "MoveAssignment": { + "methods": [ + "moveAssignment" + ] + }, + "UpdateAssignment": { + "methods": [ + "updateAssignment" + ] + }, + "GetBiReservation": { + "methods": [ + "getBiReservation" + ] + }, + "UpdateBiReservation": { + "methods": [ + "updateBiReservation" + ] + }, + "ListReservations": { + "methods": [ + "listReservations", + "listReservationsStream", + "listReservationsAsync" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "listCapacityCommitments", + "listCapacityCommitmentsStream", + "listCapacityCommitmentsAsync" + ] + }, + "ListAssignments": { + "methods": [ + "listAssignments", + "listAssignmentsStream", + "listAssignmentsAsync" + ] + }, + "SearchAssignments": { + "methods": [ + "searchAssignments", + "searchAssignmentsStream", + "searchAssignmentsAsync" + ] + }, + "SearchAllAssignments": { + "methods": [ + "searchAllAssignments", + "searchAllAssignmentsStream", + "searchAllAssignmentsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/index.ts b/packages/google-cloud-bigquery-reservation/src/v1/index.ts new file mode 100644 index 000000000000..6bedd9fcf4a1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {ReservationServiceClient} from './reservation_service_client'; diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts new file mode 100644 index 000000000000..dfd5926fa261 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -0,0 +1,3530 @@ +// Copyright 2022 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, +} 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/reservation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './reservation_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This API allows users to manage their flat-rate BigQuery reservations. + * + * A reservation provides computational resource guarantees, in the form of + * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + * unit of computational power in BigQuery, and serves as the basic unit of + * parallelism. In a scan of a multi-partitioned table, a single slot operates + * on a single partition of the table. A reservation resource exists as a child + * resource of the admin project and location, e.g.: + * `projects/myproject/locations/US/reservations/reservationName`. + * + * A capacity commitment is a way to purchase compute capacity for BigQuery jobs + * (in the form of slots) with some committed period of usage. A capacity + * commitment resource exists as a child resource of the admin project and + * location, e.g.: + * `projects/myproject/locations/US/capacityCommitments/id`. + * @class + * @memberof v1 + */ +export class ReservationServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + reservationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ReservationServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 ReservationServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ReservationServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + assignmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}' + ), + biReservationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/biReservation' + ), + capacityCommitmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + reservationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reservations/{reservation}' + ), + }; + + // 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 = { + listReservations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'reservations' + ), + listCapacityCommitments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'capacityCommitments' + ), + listAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), + searchAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), + searchAllAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.reservation.v1.ReservationService', + 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.reservationServiceStub) { + return this.reservationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.reservation.v1.ReservationService. + this.reservationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.reservation.v1.ReservationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.reservation.v1 + .ReservationService, + 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 reservationServiceStubMethods = [ + 'createReservation', + 'listReservations', + 'getReservation', + 'deleteReservation', + 'updateReservation', + 'createCapacityCommitment', + 'listCapacityCommitments', + 'getCapacityCommitment', + 'deleteCapacityCommitment', + 'updateCapacityCommitment', + 'splitCapacityCommitment', + 'mergeCapacityCommitments', + 'createAssignment', + 'listAssignments', + 'deleteAssignment', + 'searchAssignments', + 'searchAllAssignments', + 'moveAssignment', + 'updateAssignment', + 'getBiReservation', + 'updateBiReservation', + ]; + for (const methodName of reservationServiceStubMethods) { + const callPromise = this.reservationServiceStub.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.reservationServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'bigqueryreservation.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'bigqueryreservation.googleapis.com'; + } + + /** + * 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/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + 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 new reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * @param {string} request.reservationId + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Definition of the new reservation to create. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.create_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateReservation_async + */ + createReservation( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | undefined + ), + {} | undefined + ] + >; + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createReservation( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | 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.createReservation(request, options, callback); + } + /** + * Returns information about the reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.get_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetReservation_async + */ + getReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | undefined + ), + {} | undefined + ] + >; + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | 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.getReservation(request, options, callback); + } + /** + * Deletes a reservation. + * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.delete_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async + */ + deleteReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | undefined + ), + {} | undefined + ] + >; + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | 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.deleteReservation(request, options, callback); + } + /** + * Updates an existing reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Content of the reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.update_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async + */ + updateReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | undefined + ), + {} | undefined + ] + >; + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | 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({ + 'reservation.name': request.reservation!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateReservation(request, options, callback); + } + /** + * Creates a new capacity commitment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to create. + * @param {boolean} request.enforceSingleAdminProjectPerOrg + * If true, fail the request if another project in the organization has a + * capacity commitment. + * @param {string} request.capacityCommitmentId + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.create_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async + */ + createCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | 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.createCapacityCommitment( + request, + options, + callback + ); + } + /** + * Returns information about the capacity commitment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.get_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async + */ + getCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | 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.getCapacityCommitment(request, options, callback); + } + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment + * before its commitment_end_time will fail with the error code + * `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @param {boolean} request.force + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.delete_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async + */ + deleteCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | 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.deleteCapacityCommitment( + request, + options, + callback + ); + } + /** + * Updates an existing capacity commitment. + * + * Only `plan` and `renewal_plan` fields can be updated. + * + * Plan can only be changed to a plan of a longer commitment period. + * Attempting to change to a plan with shorter commitment period will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.update_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async + */ + updateCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | 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({ + 'capacity_commitment.name': request.capacityCommitment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCapacityCommitment( + request, + options, + callback + ); + } + /** + * Splits capacity commitment to two commitments of the same plan and + * `commitment_end_time`. + * + * A common use case is to enable downgrading commitments. + * + * For example, in order to downgrade from 10000 slots to 8000, you might + * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + * you delete the first one after the commitment end time passes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * @param {number} request.slotCount + * Number of slots in the capacity commitment after the split. + * @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 [SplitCapacityCommitmentResponse]{@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.split_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async + */ + splitCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + ( + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + splitCapacityCommitment( + request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + ( + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | 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.splitCapacityCommitment( + request, + options, + callback + ); + } + /** + * Merges capacity commitments of the same plan into a single commitment. + * + * The resulting capacity commitment has the greater commitment_end_time + * out of the to-be-merged capacity commitments. + * + * Attempting to merge capacity commitments of different plan will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * @param {string[]} request.capacityCommitmentIds + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.merge_capacity_commitments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async + */ + mergeCapacityCommitments( + request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | undefined + ), + {} | undefined + ] + >; + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + mergeCapacityCommitments( + request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | 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.mergeCapacityCommitments( + request, + options, + callback + ); + } + /** + * Creates an assignment object which allows the given project to submit jobs + * of a certain type using slots from the specified reservation. + * + * Currently a + * resource (project, folder, organization) can only have one assignment per + * each (job_type, location) combination, and that reservation will be used + * for all jobs of the matching type. + * + * Different assignments can be created on different levels of the + * projects, folders or organization hierarchy. During query execution, + * the assignment is looked up at the project, folder and organization levels + * in that order. The first assignment found is applied to the query. + * + * When creating assignments, it does not matter if other assignments exist at + * higher levels. + * + * Example: + * + * * The organization `organizationA` contains two projects, `project1` + * and `project2`. + * * Assignments for all three entities (`organizationA`, `project1`, and + * `project2`) could all be created and mapped to the same or different + * reservations. + * + * "None" assignments represent an absence of the assignment. Projects + * assigned to None use on-demand pricing. To create a "None" assignment, use + * "none" as a reservation_id in the parent. Example parent: + * `projects/myproject/locations/US/reservations/none`. + * + * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + * 'bigquery.admin' permissions on the project using the reservation + * and the project that owns this reservation. + * + * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + * does not match location of the reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * @param {google.cloud.bigquery.reservation.v1.Assignment} request.assignment + * Assignment resource to create. + * @param {string} request.assignmentId + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dashes. + * Max length is 64 characters. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.create_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async + */ + createAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | 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.createAssignment(request, options, callback); + } + /** + * Deletes a assignment. No expansion will happen. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, deletion of the `` assignment won't + * affect the other assignment ``. After said deletion, + * queries from `project1` will still use `res1` while queries from + * `project2` will switch to use on-demand mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.delete_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async + */ + deleteAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | 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.deleteAssignment(request, options, callback); + } + /** + * Moves an assignment under a new reservation. + * + * This differs from removing an existing assignment and recreating a new one + * by providing a transactional change that ensures an assignee always has an + * associated reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @param {string} request.destinationId + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.move_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async + */ + moveAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moveAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | 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.moveAssignment(request, options, callback); + } + /** + * Updates an existing assignment. + * + * Only the `priority` field can be updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.Assignment} request.assignment + * Content of the assignment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.update_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async + */ + updateAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + updateAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | 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({ + 'assignment.name': request.assignment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAssignment(request, options, callback); + } + /** + * Retrieves a BI reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.get_bi_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async + */ + getBiReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | undefined + ), + {} | undefined + ] + >; + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBiReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | 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.getBiReservation(request, options, callback); + } + /** + * Updates a BI reservation. + * + * Only fields specified in the `field_mask` are updated. + * + * A singleton BI reservation always exists with default size 0. + * In order to reserve BI capacity it needs to be updated to an amount + * greater than 0. In order to release BI capacity reservation size + * must be set to 0. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.BiReservation} request.biReservation + * A reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of fields to be updated in this request. + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.update_bi_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async + */ + updateBiReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | undefined + ), + {} | undefined + ] + >; + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBiReservation( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | 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({ + 'bi_reservation.name': request.biReservation!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBiReservation(request, options, callback); + } + + /** + * Lists all the reservations for the project in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * 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 `listReservationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listReservations( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + ] + >; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; + listReservations( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + ] + > | 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.listReservations(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 parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation} 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 `listReservationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listReservationsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + 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['listReservations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReservations.createStream( + this.innerApiCalls.listReservations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReservations`, 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 parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.list_reservations.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListReservations_async + */ + listReservationsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + 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['listReservations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReservations.asyncIterate( + this.innerApiCalls['listReservations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all the capacity commitments for the admin project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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 `listCapacityCommitmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCapacityCommitments( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + ] + >; + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): void; + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): void; + listCapacityCommitments( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + ] + > | 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.listCapacityCommitments( + 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. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment} 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 `listCapacityCommitmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCapacityCommitmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + 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['listCapacityCommitments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCapacityCommitments.createStream( + this.innerApiCalls.listCapacityCommitments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCapacityCommitments`, 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. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.list_capacity_commitments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async + */ + listCapacityCommitmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + 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['listCapacityCommitments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCapacityCommitments.asyncIterate( + this.innerApiCalls['listCapacityCommitments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists assignments. + * + * Only explicitly created assignments will be returned. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, ListAssignments will just return the above two assignments + * for reservation `res1`, and no expansion/merge will happen. + * + * The wildcard "-" can be used for + * reservations in the request. In that case all assignments belongs to the + * specified project and location will be listed. + * + * **Note** "-" cannot be used for projects nor locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 `listAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + ] + >; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + listAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + ] + > | 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.listAssignments(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 parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `listAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + 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['listAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssignments.createStream( + this.innerApiCalls.listAssignments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssignments`, 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 parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.list_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListAssignments_async + */ + listAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + 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['listAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssignments.asyncIterate( + this.innerApiCalls['listAssignments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Deprecated: Looks up assignments for a specified resource for a particular + * region. If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/* /locations/*`, instead of + * `projects/* /locations/*reservations/*`. + * + * **Note** "-" cannot be used for projects + * nor locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 `searchAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @deprecated SearchAssignments is deprecated and may be removed in a future version. + */ + searchAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + ] + >; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + ] + > | 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(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.innerApiCalls.searchAssignments(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 resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `searchAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @deprecated SearchAssignments is deprecated and may be removed in a future version. + */ + searchAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + 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['searchAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.descriptors.page.searchAssignments.createStream( + this.innerApiCalls.searchAssignments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchAssignments`, 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 resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.search_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async + * @deprecated SearchAssignments is deprecated and may be removed in a future version. + */ + searchAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + 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['searchAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); + return this.descriptors.page.searchAssignments.asyncIterate( + this.innerApiCalls['searchAssignments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Looks up assignments for a specified resource for a particular region. + * If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/* /locations/*`, instead of + * `projects/* /locations/*reservations/*`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 `searchAllAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchAllAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + ] + >; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAllAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + ] + > | 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.searchAllAssignments(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 resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `searchAllAssignmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchAllAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + 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['searchAllAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllAssignments.createStream( + this.innerApiCalls.searchAllAssignments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchAllAssignments`, 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 resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/reservation_service.search_all_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async + */ + searchAllAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + 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['searchAllAssignments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllAssignments.asyncIterate( + this.innerApiCalls['searchAllAssignments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified assignment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reservation + * @param {string} assignment + * @returns {string} Resource name string. + */ + assignmentPath( + project: string, + location: string, + reservation: string, + assignment: string + ) { + return this.pathTemplates.assignmentPathTemplate.render({ + project: project, + location: location, + reservation: reservation, + assignment: assignment, + }); + } + + /** + * Parse the project from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .project; + } + + /** + * Parse the location from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .location; + } + + /** + * Parse the reservation from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the reservation. + */ + matchReservationFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .reservation; + } + + /** + * Parse the assignment from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the assignment. + */ + matchAssignmentFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .assignment; + } + + /** + * Return a fully-qualified biReservation resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + biReservationPath(project: string, location: string) { + return this.pathTemplates.biReservationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from BiReservation resource. + * + * @param {string} biReservationName + * A fully-qualified path representing BiReservation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBiReservationName(biReservationName: string) { + return this.pathTemplates.biReservationPathTemplate.match(biReservationName) + .project; + } + + /** + * Parse the location from BiReservation resource. + * + * @param {string} biReservationName + * A fully-qualified path representing BiReservation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBiReservationName(biReservationName: string) { + return this.pathTemplates.biReservationPathTemplate.match(biReservationName) + .location; + } + + /** + * Return a fully-qualified capacityCommitment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} capacity_commitment + * @returns {string} Resource name string. + */ + capacityCommitmentPath( + project: string, + location: string, + capacityCommitment: string + ) { + return this.pathTemplates.capacityCommitmentPathTemplate.render({ + project: project, + location: location, + capacity_commitment: capacityCommitment, + }); + } + + /** + * Parse the project from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCapacityCommitmentName(capacityCommitmentName: string) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).project; + } + + /** + * Parse the location from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCapacityCommitmentName(capacityCommitmentName: string) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).location; + } + + /** + * Parse the capacity_commitment from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the capacity_commitment. + */ + matchCapacityCommitmentFromCapacityCommitmentName( + capacityCommitmentName: string + ) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).capacity_commitment; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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 reservation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reservation + * @returns {string} Resource name string. + */ + reservationPath(project: string, location: string, reservation: string) { + return this.pathTemplates.reservationPathTemplate.render({ + project: project, + location: location, + reservation: reservation, + }); + } + + /** + * Parse the project from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .project; + } + + /** + * Parse the location from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .location; + } + + /** + * Parse the reservation from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the reservation. + */ + matchReservationFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .reservation; + } + + /** + * 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.reservationServiceStub && !this._terminated) { + return this.reservationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json new file mode 100644 index 000000000000..2ac442ba0273 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -0,0 +1,129 @@ +{ + "interfaces": { + "google.cloud.bigquery.reservation.v1.ReservationService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "CreateReservation": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReservations": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetReservation": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteReservation": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateReservation": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCapacityCommitments": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SplitCapacityCommitment": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MergeCapacityCommitments": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssignments": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAssignments": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllAssignments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveAssignment": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAssignment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBiReservation": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateBiReservation": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json new file mode 100644 index 000000000000..8746e8df5c9d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/bigquery/reservation/v1/reservation.proto" +] diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..28484c72afb5 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const reservation = require('@google-cloud/bigquery-reservation'); + +function main() { + const reservationServiceClient = new reservation.ReservationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..cb2774d6400e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {ReservationServiceClient} from '@google-cloud/bigquery-reservation'; + +// check that the client class type name can be used +function doStuffWithReservationServiceClient(client: ReservationServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const reservationServiceClient = new ReservationServiceClient(); + doStuffWithReservationServiceClient(reservationServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts new file mode 100644 index 000000000000..1237a39a172c --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -0,0 +1,4440 @@ +// Copyright 2022 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 reservationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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.ReservationServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + reservationserviceModule.v1.ReservationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = reservationserviceModule.v1.ReservationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + await client.initialize(); + assert(client.reservationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.reservationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + 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 reservationserviceModule.v1.ReservationServiceClient({ + 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('createReservation', () => { + it('invokes createReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.createReservation = stubSimpleCall(expectedResponse); + const [response] = await client.createReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.createReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createReservation(request), expectedError); + }); + }); + + describe('getReservation', () => { + it('invokes getReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.getReservation = stubSimpleCall(expectedResponse); + const [response] = await client.getReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.getReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getReservation(request), expectedError); + }); + }); + + describe('deleteReservation', () => { + it('invokes deleteReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReservation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteReservation( + 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.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteReservation(request), expectedError); + }); + }); + + describe('updateReservation', () => { + it('invokes updateReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.updateReservation = stubSimpleCall(expectedResponse); + const [response] = await client.updateReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.updateReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); + request.reservation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateReservation(request), expectedError); + }); + }); + + describe('createCapacityCommitment', () => { + it('invokes createCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.createCapacityCommitment = + stubSimpleCall(expectedResponse); + const [response] = await client.createCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.createCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createCapacityCommitment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createCapacityCommitment(request), + expectedError + ); + }); + }); + + describe('getCapacityCommitment', () => { + it('invokes getCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.getCapacityCommitment = + stubSimpleCall(expectedResponse); + const [response] = await client.getCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.getCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getCapacityCommitment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getCapacityCommitment(request), + expectedError + ); + }); + }); + + describe('deleteCapacityCommitment', () => { + it('invokes deleteCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCapacityCommitment = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCapacityCommitment( + 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.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteCapacityCommitment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteCapacityCommitment(request), + expectedError + ); + }); + }); + + describe('updateCapacityCommitment', () => { + it('invokes updateCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.updateCapacityCommitment = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.updateCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateCapacityCommitment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateCapacityCommitment(request), + expectedError + ); + }); + }); + + describe('splitCapacityCommitment', () => { + it('invokes splitCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() + ); + client.innerApiCalls.splitCapacityCommitment = + stubSimpleCall(expectedResponse); + const [response] = await client.splitCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes splitCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() + ); + client.innerApiCalls.splitCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.splitCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes splitCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.splitCapacityCommitment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes splitCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.splitCapacityCommitment(request), + expectedError + ); + }); + }); + + describe('mergeCapacityCommitments', () => { + it('invokes mergeCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.mergeCapacityCommitments = + stubSimpleCall(expectedResponse); + const [response] = await client.mergeCapacityCommitments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeCapacityCommitments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.mergeCapacityCommitments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mergeCapacityCommitments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.mergeCapacityCommitments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeCapacityCommitments with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.mergeCapacityCommitments(request), + expectedError + ); + }); + }); + + describe('createAssignment', () => { + it('invokes createAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.createAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.createAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createAssignment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAssignment(request), expectedError); + }); + }); + + describe('deleteAssignment', () => { + it('invokes deleteAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAssignment( + 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.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAssignment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAssignment(request), expectedError); + }); + }); + + describe('moveAssignment', () => { + it('invokes moveAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.moveAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.moveAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.moveAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.moveAssignment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveAssignment(request), expectedError); + }); + }); + + describe('updateAssignment', () => { + it('invokes updateAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.updateAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.updateAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.updateAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAssignment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); + request.assignment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAssignment(request), expectedError); + }); + }); + + describe('getBiReservation', () => { + it('invokes getBiReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.getBiReservation = stubSimpleCall(expectedResponse); + const [response] = await client.getBiReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBiReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.getBiReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBiReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IBiReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBiReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBiReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBiReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBiReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBiReservation(request), expectedError); + }); + }); + + describe('updateBiReservation', () => { + it('invokes updateBiReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.updateBiReservation = + stubSimpleCall(expectedResponse); + const [response] = await client.updateBiReservation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBiReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.updateBiReservation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBiReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IBiReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBiReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBiReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBiReservation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBiReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); + request.biReservation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBiReservation(request), expectedError); + }); + }); + + describe('listReservations', () => { + it('invokes listReservations without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.innerApiCalls.listReservations = stubSimpleCall(expectedResponse); + const [response] = await client.listReservations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReservations without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.innerApiCalls.listReservations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReservations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IReservation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReservations with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReservations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReservations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReservationsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.descriptors.page.listReservations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReservationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Reservation + ) => { + 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.listReservations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReservations, request) + ); + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReservationsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReservations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listReservationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Reservation + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReservations, request) + ); + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReservations without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.descriptors.page.listReservations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = + []; + const iterable = client.listReservationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReservations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReservations with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReservations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReservationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReservations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCapacityCommitments', () => { + it('invokes listCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.innerApiCalls.listCapacityCommitments = + stubSimpleCall(expectedResponse); + const [response] = await client.listCapacityCommitments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCapacityCommitments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.innerApiCalls.listCapacityCommitments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCapacityCommitments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCapacityCommitments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listCapacityCommitments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCapacityCommitmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.descriptors.page.listCapacityCommitments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCapacityCommitmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment + ) => { + 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.listCapacityCommitments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCapacityCommitments, request) + ); + assert( + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCapacityCommitmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCapacityCommitments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCapacityCommitmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCapacityCommitments, request) + ); + assert( + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.descriptors.page.listCapacityCommitments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = + []; + const iterable = client.listCapacityCommitmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCapacityCommitments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCapacityCommitmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssignments', () => { + it('invokes listAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.listAssignments = stubSimpleCall(expectedResponse); + const [response] = await client.listAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.listAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssignments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.listAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + 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.listAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssignments, request) + ); + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssignments, request) + ); + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.listAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + const iterable = client.listAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchAssignments', () => { + it('invokes searchAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAssignments = stubSimpleCall(expectedResponse); + const [response] = await client.searchAssignments(request); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAssignments(request), expectedError); + assert(stub.calledOnce); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssignments, request) + ); + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert(stub.calledOnce); + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssignments, request) + ); + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + const iterable = client.searchAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert(stub.calledOnce); + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert(stub.calledOnce); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchAllAssignments', () => { + it('invokes searchAllAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAllAssignments = + stubSimpleCall(expectedResponse); + const [response] = await client.searchAllAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAllAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllAssignments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAllAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchAllAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + 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.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllAssignments, request) + ); + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAllAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllAssignments, request) + ); + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAllAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + const iterable = client.searchAllAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('assignment', () => { + const fakePath = '/rendered/path/assignment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reservation: 'reservationValue', + assignment: 'assignmentValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assignmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assignmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assignmentPath', () => { + const result = client.assignmentPath( + 'projectValue', + 'locationValue', + 'reservationValue', + 'assignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assignmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssignmentName', () => { + const result = client.matchProjectFromAssignmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAssignmentName', () => { + const result = client.matchLocationFromAssignmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReservationFromAssignmentName', () => { + const result = client.matchReservationFromAssignmentName(fakePath); + assert.strictEqual(result, 'reservationValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssignmentFromAssignmentName', () => { + const result = client.matchAssignmentFromAssignmentName(fakePath); + assert.strictEqual(result, 'assignmentValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('biReservation', () => { + const fakePath = '/rendered/path/biReservation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.biReservationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.biReservationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('biReservationPath', () => { + const result = client.biReservationPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.biReservationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBiReservationName', () => { + const result = client.matchProjectFromBiReservationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.biReservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBiReservationName', () => { + const result = client.matchLocationFromBiReservationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.biReservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('capacityCommitment', () => { + const fakePath = '/rendered/path/capacityCommitment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + capacity_commitment: 'capacityCommitmentValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.capacityCommitmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.capacityCommitmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('capacityCommitmentPath', () => { + const result = client.capacityCommitmentPath( + 'projectValue', + 'locationValue', + 'capacityCommitmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.capacityCommitmentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCapacityCommitmentName', () => { + const result = client.matchProjectFromCapacityCommitmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCapacityCommitmentName', () => { + const result = client.matchLocationFromCapacityCommitmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCapacityCommitmentFromCapacityCommitmentName', () => { + const result = + client.matchCapacityCommitmentFromCapacityCommitmentName(fakePath); + assert.strictEqual(result, 'capacityCommitmentValue'); + assert( + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + 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('reservation', () => { + const fakePath = '/rendered/path/reservation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reservation: 'reservationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reservationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reservationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reservationPath', () => { + const result = client.reservationPath( + 'projectValue', + 'locationValue', + 'reservationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reservationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReservationName', () => { + const result = client.matchProjectFromReservationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReservationName', () => { + const result = client.matchLocationFromReservationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReservationFromReservationName', () => { + const result = client.matchReservationFromReservationName(fakePath); + assert.strictEqual(result, 'reservationValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/tsconfig.json b/packages/google-cloud-bigquery-reservation/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/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/packages/google-cloud-bigquery-reservation/webpack.config.js b/packages/google-cloud-bigquery-reservation/webpack.config.js new file mode 100644 index 000000000000..8c448d5547d0 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/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: 'ReservationService', + filename: './reservation-service.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/packages/google-cloud-certificatemanager/.OwlBot.yaml b/packages/google-cloud-certificatemanager/.OwlBot.yaml new file mode 100644 index 000000000000..2a4b082fcfc0 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/certificatemanager/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-certificatemanager/$1 diff --git a/packages/google-cloud-certificatemanager/.eslintignore b/packages/google-cloud-certificatemanager/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-certificatemanager/.eslintrc.json b/packages/google-cloud-certificatemanager/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-certificatemanager/.gitattributes b/packages/google-cloud-certificatemanager/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-certificatemanager/.gitignore b/packages/google-cloud-certificatemanager/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.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/packages/google-cloud-certificatemanager/.jsdoc.js b/packages/google-cloud-certificatemanager/.jsdoc.js new file mode 100644 index 000000000000..a281c1166fbd --- /dev/null +++ b/packages/google-cloud-certificatemanager/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/certificate-manager', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-certificatemanager/.mocharc.js b/packages/google-cloud-certificatemanager/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-certificatemanager/.nycrc b/packages/google-cloud-certificatemanager/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-certificatemanager/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-certificatemanager/.prettierignore b/packages/google-cloud-certificatemanager/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-certificatemanager/.prettierrc.js b/packages/google-cloud-certificatemanager/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-certificatemanager/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-certificatemanager/.repo-metadata.json b/packages/google-cloud-certificatemanager/.repo-metadata.json new file mode 100644 index 000000000000..fec45640433a --- /dev/null +++ b/packages/google-cloud-certificatemanager/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "certificatemanager", + "name_pretty": "Certificate Manager", + "product_documentation": "https://cloud.google.com/certificate-manager/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/certificate-manager/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/certificate-manager", + "api_id": "certificatemanager.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "certificatemanager", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-certificatemanager/CHANGELOG.md b/packages/google-cloud-certificatemanager/CHANGELOG.md new file mode 100644 index 000000000000..6d05fe4eee3b --- /dev/null +++ b/packages/google-cloud-certificatemanager/CHANGELOG.md @@ -0,0 +1,78 @@ +# Changelog + +## [0.6.0](https://github.com/googleapis/nodejs-certificate-manager/compare/v0.5.0...v0.6.0) (2022-10-04) + + +### Features + +* Added support for Private Trust to Certificate Manager API ([#55](https://github.com/googleapis/nodejs-certificate-manager/issues/55)) ([d9ff953](https://github.com/googleapis/nodejs-certificate-manager/commit/d9ff953cc5ea584970e831171a91b4320832fd3d)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#49](https://github.com/googleapis/nodejs-certificate-manager/issues/49)) ([f8f86e5](https://github.com/googleapis/nodejs-certificate-manager/commit/f8f86e5b29e5e7dc2896f8bd71c1de8804a0d92b)) +* Better support for fallback mode ([#44](https://github.com/googleapis/nodejs-certificate-manager/issues/44)) ([75c72a9](https://github.com/googleapis/nodejs-certificate-manager/commit/75c72a92beb6890ec4429cb3ecdcf8d40238a175)) +* Change import long to require ([#45](https://github.com/googleapis/nodejs-certificate-manager/issues/45)) ([1dc45d7](https://github.com/googleapis/nodejs-certificate-manager/commit/1dc45d71c836a8f87ed6b4f5fc0a3750034cb84f)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-certificate-manager/issues/1553)) ([#48](https://github.com/googleapis/nodejs-certificate-manager/issues/48)) ([96e4038](https://github.com/googleapis/nodejs-certificate-manager/commit/96e403827bf1ac75c6c4d38f100db9a6f9bd8b35)) +* Preserve default values in x-goog-request-params header ([#51](https://github.com/googleapis/nodejs-certificate-manager/issues/51)) ([13c6ab0](https://github.com/googleapis/nodejs-certificate-manager/commit/13c6ab08318349e4061ff52e4fd6b62c9f3482dd)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-certificate-manager/issues/1546)) ([#47](https://github.com/googleapis/nodejs-certificate-manager/issues/47)) ([c5002fd](https://github.com/googleapis/nodejs-certificate-manager/commit/c5002fd71850233f5aac6daffb3fb09ace696229)) +* use google-gax v3.3.0 ([96e4038](https://github.com/googleapis/nodejs-certificate-manager/commit/96e403827bf1ac75c6c4d38f100db9a6f9bd8b35)) + +## [0.5.0](https://github.com/googleapis/nodejs-certificate-manager/compare/v0.4.0...v0.5.0) (2022-07-08) + + +### ⚠ BREAKING CHANGES + +* Removed resource definition of Compute API resources and incorrect resource references that used them + +### Bug Fixes + +* Removed resource definition of Compute API resources and incorrect resource references that used them ([4ee1fc4](https://github.com/googleapis/nodejs-certificate-manager/commit/4ee1fc45a5bee07edf888719dee13d600f5a9733)) + +## [0.4.0](https://github.com/googleapis/nodejs-certificate-manager/compare/v0.3.0...v0.4.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#38](https://github.com/googleapis/nodejs-certificate-manager/issues/38)) ([0d7b185](https://github.com/googleapis/nodejs-certificate-manager/commit/0d7b18581a8141caa1e9091450b1da603cb2bbe9)) + +## [0.3.0](https://github.com/googleapis/nodejs-certificate-manager/compare/v0.2.0...v0.3.0) (2022-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade to stable (#32) +* update library to use Node 12 (#29) + +### Features + +* upgrade to stable ([#32](https://github.com/googleapis/nodejs-certificate-manager/issues/32)) ([711b55e](https://github.com/googleapis/nodejs-certificate-manager/commit/711b55e0ae8103cf427e4b8de0da35dd10b1b229)) + + +### Build System + +* update library to use Node 12 ([#29](https://github.com/googleapis/nodejs-certificate-manager/issues/29)) ([9e101c9](https://github.com/googleapis/nodejs-certificate-manager/commit/9e101c96af3a9b58807cc7ee399cf6e71d5e4d97)) + + +### Miscellaneous Chores + +* release v0.3.0 ([#33](https://github.com/googleapis/nodejs-certificate-manager/issues/33)) ([eeb8d9b](https://github.com/googleapis/nodejs-certificate-manager/commit/eeb8d9bd45620039a3613fe813a9e9b27647358a)) + +## [0.2.0](https://github.com/googleapis/nodejs-certificate-manager/compare/v0.1.0...v0.2.0) (2022-04-12) + + +### ⚠ BREAKING CHANGES + +* Updated resource patterns to comply with https://google.aip.dev/123#annotating-resource-types + +### Bug Fixes + +* Updated resource patterns to comply with https://google.aip.dev/123#annotating-resource-types ([32bfafc](https://github.com/googleapis/nodejs-certificate-manager/commit/32bfafc79bcfef7e0edaf00155ab71eaa2db0720)) + +## 0.1.0 (2022-03-22) + + +### Features + +* initial generation of library ([6c2c450](https://github.com/googleapis/nodejs-certificate-manager/commit/6c2c4504ba839aa4ac568fad9b86603b6b8531b6)) +* initial stub of library ([be43c7f](https://github.com/googleapis/nodejs-certificate-manager/commit/be43c7f481f39517f8593bec01d8087d8b4047af)) diff --git a/packages/google-cloud-certificatemanager/CODE_OF_CONDUCT.md b/packages/google-cloud-certificatemanager/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-certificatemanager/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-certificatemanager/CONTRIBUTING.md b/packages/google-cloud-certificatemanager/CONTRIBUTING.md new file mode 100644 index 000000000000..bb8ce6224402 --- /dev/null +++ b/packages/google-cloud-certificatemanager/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Certificate Manager API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=certificatemanager.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-certificatemanager/LICENSE b/packages/google-cloud-certificatemanager/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-certificatemanager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-certificatemanager/README.md b/packages/google-cloud-certificatemanager/README.md new file mode 100644 index 000000000000..dc7dd440a513 --- /dev/null +++ b/packages/google-cloud-certificatemanager/README.md @@ -0,0 +1,218 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Certificate Manager: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/certificate-manager.svg)](https://www.npmjs.org/package/@google-cloud/certificate-manager) + + + + +certificatemanager client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Certificate Manager Node.js Client API Reference][client-docs] +* [Certificate Manager Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Certificate Manager API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/certificate-manager +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The project and location from which the certificate should be listed, + * specified in the format `projects/* /locations/*`. + */ +// const parent = 'abc123' +/** + * Maximum number of certificates to return per call. + */ +// const pageSize = 1234 +/** + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + */ +// const pageToken = 'abc123' +/** + * Filter expression to restrict the Certificates returned. + */ +// const filter = 'abc123' +/** + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + */ +// const orderBy = 'abc123' + +// Imports the Certificatemanager library +const {CertificateManagerClient} = + require('@google-cloud/certificate-manager').v1; + +// Instantiates a client +const certificatemanagerClient = new CertificateManagerClient(); + +async function callListCertificates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificatesAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } +} + +callListCertificates(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Certificate_manager.create_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js,samples/README.md) | +| Certificate_manager.create_certificate_issuance_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js,samples/README.md) | +| Certificate_manager.create_certificate_map | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js,samples/README.md) | +| Certificate_manager.create_certificate_map_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js,samples/README.md) | +| Certificate_manager.create_dns_authorization | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js,samples/README.md) | +| Certificate_manager.delete_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js,samples/README.md) | +| Certificate_manager.delete_certificate_issuance_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js,samples/README.md) | +| Certificate_manager.delete_certificate_map | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js,samples/README.md) | +| Certificate_manager.delete_certificate_map_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js,samples/README.md) | +| Certificate_manager.delete_dns_authorization | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js,samples/README.md) | +| Certificate_manager.get_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js,samples/README.md) | +| Certificate_manager.get_certificate_issuance_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js,samples/README.md) | +| Certificate_manager.get_certificate_map | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js,samples/README.md) | +| Certificate_manager.get_certificate_map_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js,samples/README.md) | +| Certificate_manager.get_dns_authorization | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js,samples/README.md) | +| Certificate_manager.list_certificate_issuance_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js,samples/README.md) | +| Certificate_manager.list_certificate_map_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js,samples/README.md) | +| Certificate_manager.list_certificate_maps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js,samples/README.md) | +| Certificate_manager.list_certificates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js,samples/README.md) | +| Certificate_manager.list_dns_authorizations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js,samples/README.md) | +| Certificate_manager.update_certificate | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js,samples/README.md) | +| Certificate_manager.update_certificate_map | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js,samples/README.md) | +| Certificate_manager.update_certificate_map_entry | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js,samples/README.md) | +| Certificate_manager.update_dns_authorization | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/test/quickstart.js,samples/README.md) | + + + +The [Certificate Manager Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/certificate-manager@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/certificate-manager/latest +[product-docs]: https://cloud.google.com/certificate-manager/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=certificatemanager.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-certificatemanager/linkinator.config.json b/packages/google-cloud-certificatemanager/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-certificatemanager/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-certificatemanager/package.json b/packages/google-cloud-certificatemanager/package.json new file mode 100644 index 000000000000..9a0e23aad82b --- /dev/null +++ b/packages/google-cloud-certificatemanager/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/certificate-manager", + "version": "0.6.0", + "description": "certificatemanager client for Node.js", + "repository": "googleapis/nodejs-certificate-manager", + "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 certificatemanager", + "certificatemanager", + "certificatemanager service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto new file mode 100644 index 000000000000..629cb5944f93 --- /dev/null +++ b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto @@ -0,0 +1,200 @@ +// Copyright 2022 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.cloud.certificatemanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CertificateManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/certificatemanager/v1;certificatemanager"; +option java_multiple_files = true; +option java_outer_classname = "CertificateIssuanceConfigProto"; +option java_package = "com.google.cloud.certificatemanager.v1"; +option php_namespace = "Google\\Cloud\\CertificateManager\\V1"; +option ruby_package = "Google::Cloud::CertificateManager::V1"; +option (google.api.resource_definition) = { + type: "privateca.googleapis.com/CaPool" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}" +}; + +// Request for the `ListCertificateIssuanceConfigs` method. +message ListCertificateIssuanceConfigsRequest { + // Required. The project and location from which the certificate should be + // listed, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of certificate configs to return per call. + int32 page_size = 2; + + // The value returned by the last `ListCertificateIssuanceConfigsResponse`. + // Indicates that this is a continuation of a prior + // `ListCertificateIssuanceConfigs` call, and that the system should return + // the next page of data. + string page_token = 3; + + // Filter expression to restrict the Certificates Configs returned. + string filter = 4; + + // A list of Certificate Config field names used to specify the order of the + // returned results. The default sorting order is ascending. To specify + // descending order for a field, add a suffix " desc". + string order_by = 5; +} + +// Response for the `ListCertificateIssuanceConfigs` method. +message ListCertificateIssuanceConfigsResponse { + // A list of certificate configs for the parent resource. + repeated CertificateIssuanceConfig certificate_issuance_configs = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the `GetCertificateIssuanceConfig` method. +message GetCertificateIssuanceConfigRequest { + // Required. A name of the certificate issuance config to describe. Must be in + // the format `projects/*/locations/*/certificateIssuanceConfigs/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + ]; +} + +// Request for the `CreateCertificateIssuanceConfig` method. +message CreateCertificateIssuanceConfigRequest { + // Required. The parent resource of the certificate issuance config. Must be + // in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A user-provided name of the certificate config. + string certificate_issuance_config_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A definition of the certificate issuance config to create. + CertificateIssuanceConfig certificate_issuance_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteCertificateIssuanceConfig` method. +message DeleteCertificateIssuanceConfigRequest { + // Required. A name of the certificate issuance config to delete. Must be in + // the format `projects/*/locations/*/certificateIssuanceConfigs/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + ]; +} + +// CertificateIssuanceConfig specifies how to issue and manage a certificate. +message CertificateIssuanceConfig { + option (google.api.resource) = { + type: "certificatemanager.googleapis.com/CertificateIssuanceConfig" + pattern: "projects/{project}/locations/{location}/certificateIssuanceConfigs/{certificate_issuance_config}" + }; + + // The CA that issues the workload certificate. It includes CA address, type, + // authentication to CA service, etc. + message CertificateAuthorityConfig { + // Contains information required to contact CA service. + message CertificateAuthorityServiceConfig { + // Required. A CA pool resource used to issue a certificate. + // The CA pool string has a relative resource path following the form + // "projects/{project}/locations/{location}/caPools/{ca_pool}". + string ca_pool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + } + + oneof kind { + // Defines a CertificateAuthorityServiceConfig. + CertificateAuthorityServiceConfig certificate_authority_service_config = + 1; + } + } + + // The type of keypair to generate. + enum KeyAlgorithm { + // Unspecified key algorithm. + KEY_ALGORITHM_UNSPECIFIED = 0; + + // Specifies RSA with a 2048-bit modulus. + RSA_2048 = 1; + + // Specifies ECDSA with curve P256. + ECDSA_P256 = 4; + } + + // A user-defined name of the certificate issuance config. + // CertificateIssuanceConfig names must be unique globally and match pattern + // `projects/*/locations/*/certificateIssuanceConfigs/*`. + string name = 1; + + // Output only. The creation timestamp of a CertificateIssuanceConfig. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a CertificateIssuanceConfig. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of labels associated with a CertificateIssuanceConfig. + map labels = 4; + + // One or more paragraphs of text description of a CertificateIssuanceConfig. + string description = 5; + + // Required. The CA that issues the workload certificate. It includes the CA + // address, type, authentication to CA service, etc. + CertificateAuthorityConfig certificate_authority_config = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Workload certificate lifetime requested. + google.protobuf.Duration lifetime = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the percentage of elapsed time of the certificate + // lifetime to wait before renewing the certificate. Must be a number between + // 1-99, inclusive. + int32 rotation_window_percentage = 8 [(google.api.field_behavior) = REQUIRED]; + + // Required. The key algorithm to use when generating the private key. + KeyAlgorithm key_algorithm = 9 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto new file mode 100644 index 000000000000..07b4c0859579 --- /dev/null +++ b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto @@ -0,0 +1,1178 @@ +// Copyright 2022 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.cloud.certificatemanager.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/certificatemanager/v1/certificate_issuance_config.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CertificateManager.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/certificatemanager/v1;certificatemanager"; +option java_multiple_files = true; +option java_outer_classname = "CertificateManagerProto"; +option java_package = "com.google.cloud.certificatemanager.v1"; +option php_namespace = "Google\\Cloud\\CertificateManager\\V1"; +option ruby_package = "Google::Cloud::CertificateManager::V1"; + +// API Overview +// +// Certificates Manager API allows customers to see and manage all their TLS +// certificates. +// +// Certificates Manager API service provides methods to manage certificates, +// group them into collections, and create serving configuration that can be +// easily applied to other Cloud resources e.g. Target Proxies. +// +// Data Model +// +// The Certificates Manager service exposes the following resources: +// +// * `Certificate` which describes a single TLS certificate. +// * `CertificateMap` which describes a collection of certificates that can be +// attached to a target resource. +// * `CertificateMapEntry` which describes a single configuration entry that +// consists of a SNI and a group of certificates. It's a subresource of +// CertificateMap. +// +// Certificate, CertificateMap and CertificateMapEntry IDs +// have to match "^[a-z0-9-]{1,63}$" regexp, which means that +// - only lower case letters, digits, and hyphen are allowed +// - length of the resource ID has to be in [1,63] range. +// +// Provides methods to manage Cloud Certificate Manager entities. +service CertificateManager { + option (google.api.default_host) = "certificatemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Certificates in a given project and location. + rpc ListCertificates(ListCertificatesRequest) + returns (ListCertificatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/certificates" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Certificate. + rpc GetCertificate(GetCertificateRequest) returns (Certificate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/certificates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Certificate in a given project and location. + rpc CreateCertificate(CreateCertificateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/certificates" + body: "certificate" + }; + option (google.api.method_signature) = "parent,certificate,certificate_id"; + option (google.longrunning.operation_info) = { + response_type: "Certificate" + metadata_type: "OperationMetadata" + }; + } + + // Updates a Certificate. + rpc UpdateCertificate(UpdateCertificateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate.name=projects/*/locations/*/certificates/*}" + body: "certificate" + }; + option (google.api.method_signature) = "certificate,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Certificate" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Certificate. + rpc DeleteCertificate(DeleteCertificateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/certificates/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists CertificateMaps in a given project and location. + rpc ListCertificateMaps(ListCertificateMapsRequest) + returns (ListCertificateMapsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/certificateMaps" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single CertificateMap. + rpc GetCertificateMap(GetCertificateMapRequest) returns (CertificateMap) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/certificateMaps/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new CertificateMap in a given project and location. + rpc CreateCertificateMap(CreateCertificateMapRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/certificateMaps" + body: "certificate_map" + }; + option (google.api.method_signature) = + "parent,certificate_map,certificate_map_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateMap" + metadata_type: "OperationMetadata" + }; + } + + // Updates a CertificateMap. + rpc UpdateCertificateMap(UpdateCertificateMapRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate_map.name=projects/*/locations/*/certificateMaps/*}" + body: "certificate_map" + }; + option (google.api.method_signature) = "certificate_map,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateMap" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single CertificateMap. A Certificate Map can't be deleted + // if it contains Certificate Map Entries. Remove all the entries from + // the map before calling this method. + rpc DeleteCertificateMap(DeleteCertificateMapRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/certificateMaps/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists CertificateMapEntries in a given project and location. + rpc ListCertificateMapEntries(ListCertificateMapEntriesRequest) + returns (ListCertificateMapEntriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single CertificateMapEntry. + rpc GetCertificateMapEntry(GetCertificateMapEntryRequest) + returns (CertificateMapEntry) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new CertificateMapEntry in a given project and location. + rpc CreateCertificateMapEntry(CreateCertificateMapEntryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries" + body: "certificate_map_entry" + }; + option (google.api.method_signature) = + "parent,certificate_map_entry,certificate_map_entry_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateMapEntry" + metadata_type: "OperationMetadata" + }; + } + + // Updates a CertificateMapEntry. + rpc UpdateCertificateMapEntry(UpdateCertificateMapEntryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{certificate_map_entry.name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}" + body: "certificate_map_entry" + }; + option (google.api.method_signature) = "certificate_map_entry,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "CertificateMapEntry" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single CertificateMapEntry. + rpc DeleteCertificateMapEntry(DeleteCertificateMapEntryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DnsAuthorizations in a given project and location. + rpc ListDnsAuthorizations(ListDnsAuthorizationsRequest) + returns (ListDnsAuthorizationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dnsAuthorizations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single DnsAuthorization. + rpc GetDnsAuthorization(GetDnsAuthorizationRequest) + returns (DnsAuthorization) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new DnsAuthorization in a given project and location. + rpc CreateDnsAuthorization(CreateDnsAuthorizationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dnsAuthorizations" + body: "dns_authorization" + }; + option (google.api.method_signature) = + "parent,dns_authorization,dns_authorization_id"; + option (google.longrunning.operation_info) = { + response_type: "DnsAuthorization" + metadata_type: "OperationMetadata" + }; + } + + // Updates a DnsAuthorization. + rpc UpdateDnsAuthorization(UpdateDnsAuthorizationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{dns_authorization.name=projects/*/locations/*/dnsAuthorizations/*}" + body: "dns_authorization" + }; + option (google.api.method_signature) = "dns_authorization,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DnsAuthorization" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single DnsAuthorization. + rpc DeleteDnsAuthorization(DeleteDnsAuthorizationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists CertificateIssuanceConfigs in a given project and location. + rpc ListCertificateIssuanceConfigs(ListCertificateIssuanceConfigsRequest) + returns (ListCertificateIssuanceConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single CertificateIssuanceConfig. + rpc GetCertificateIssuanceConfig(GetCertificateIssuanceConfigRequest) + returns (CertificateIssuanceConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new CertificateIssuanceConfig in a given project and location. + rpc CreateCertificateIssuanceConfig(CreateCertificateIssuanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs" + body: "certificate_issuance_config" + }; + option (google.api.method_signature) = + "parent,certificate_issuance_config,certificate_issuance_config_id"; + option (google.longrunning.operation_info) = { + response_type: "CertificateIssuanceConfig" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single CertificateIssuanceConfig. + rpc DeleteCertificateIssuanceConfig(DeleteCertificateIssuanceConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Request for the `ListCertificates` method. +message ListCertificatesRequest { + // Required. The project and location from which the certificate should be + // listed, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of certificates to return per call. + int32 page_size = 2; + + // The value returned by the last `ListCertificatesResponse`. Indicates that + // this is a continuation of a prior `ListCertificates` call, and that the + // system should return the next page of data. + string page_token = 3; + + // Filter expression to restrict the Certificates returned. + string filter = 4; + + // A list of Certificate field names used to specify the order of the returned + // results. The default sorting order is ascending. To specify descending + // order for a field, add a suffix " desc". + string order_by = 5; +} + +// Response for the `ListCertificates` method. +message ListCertificatesResponse { + // A list of certificates for the parent resource. + repeated Certificate certificates = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // A list of locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the `GetCertificate` method. +message GetCertificateRequest { + // Required. A name of the certificate to describe. Must be in the format + // `projects/*/locations/*/certificates/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/Certificate" + } + ]; +} + +// Request for the `CreateCertificate` method. +message CreateCertificateRequest { + // Required. The parent resource of the certificate. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A user-provided name of the certificate. + string certificate_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A definition of the certificate to create. + Certificate certificate = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `UpdateCertificate` method. +message UpdateCertificateRequest { + // Required. A definition of the certificate to update. + Certificate certificate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteCertificate` method. +message DeleteCertificateRequest { + // Required. A name of the certificate to delete. Must be in the format + // `projects/*/locations/*/certificates/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/Certificate" + } + ]; +} + +// Request for the `ListCertificateMaps` method. +message ListCertificateMapsRequest { + // Required. The project and location from which the certificate maps should + // be listed, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of certificate maps to return per call. + int32 page_size = 2; + + // The value returned by the last `ListCertificateMapsResponse`. Indicates + // that this is a continuation of a prior `ListCertificateMaps` call, and that + // the system should return the next page of data. + string page_token = 3; + + // Filter expression to restrict the Certificates Maps returned. + string filter = 4; + + // A list of Certificate Map field names used to specify the order of the + // returned results. The default sorting order is ascending. To specify + // descending order for a field, add a suffix " desc". + string order_by = 5; +} + +// Response for the `ListCertificateMaps` method. +message ListCertificateMapsResponse { + // A list of certificate maps for the parent resource. + repeated CertificateMap certificate_maps = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the `GetCertificateMap` method. +message GetCertificateMapRequest { + // Required. A name of the certificate map to describe. Must be in the format + // `projects/*/locations/*/certificateMaps/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMap" + } + ]; +} + +// Request for the `CreateCertificateMap` method. +message CreateCertificateMapRequest { + // Required. The parent resource of the certificate map. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A user-provided name of the certificate map. + string certificate_map_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A definition of the certificate map to create. + CertificateMap certificate_map = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `UpdateCertificateMap` method. +message UpdateCertificateMapRequest { + // Required. A definition of the certificate map to update. + CertificateMap certificate_map = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteCertificateMap` method. +message DeleteCertificateMapRequest { + // Required. A name of the certificate map to delete. Must be in the format + // `projects/*/locations/*/certificateMaps/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMap" + } + ]; +} + +// Request for the `ListCertificateMapEntries` method. +message ListCertificateMapEntriesRequest { + // Required. The project, location and certificate map from which the + // certificate map entries should be listed, specified in the format + // `projects/*/locations/*/certificateMaps/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMap" + } + ]; + + // Maximum number of certificate map entries to return. The service may return + // fewer than this value. + // If unspecified, at most 50 certificate map entries will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // The value returned by the last `ListCertificateMapEntriesResponse`. + // Indicates that this is a continuation of a prior + // `ListCertificateMapEntries` call, and that the system should return the + // next page of data. + string page_token = 3; + + // Filter expression to restrict the returned Certificate Map Entries. + string filter = 4; + + // A list of Certificate Map Entry field names used to specify + // the order of the returned results. The default sorting order is ascending. + // To specify descending order for a field, add a suffix " desc". + string order_by = 5; +} + +// Response for the `ListCertificateMapEntries` method. +message ListCertificateMapEntriesResponse { + // A list of certificate map entries for the parent resource. + repeated CertificateMapEntry certificate_map_entries = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the `GetCertificateMapEntry` method. +message GetCertificateMapEntryRequest { + // Required. A name of the certificate map entry to describe. Must be in the + // format `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMapEntry" + } + ]; +} + +// Request for the `CreateCertificateMapEntry` method. +message CreateCertificateMapEntryRequest { + // Required. The parent resource of the certificate map entry. Must be in the + // format `projects/*/locations/*/certificateMaps/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMap" + } + ]; + + // Required. A user-provided name of the certificate map entry. + string certificate_map_entry_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A definition of the certificate map entry to create. + CertificateMapEntry certificate_map_entry = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `UpdateCertificateMapEntry` method. +message UpdateCertificateMapEntryRequest { + // Required. A definition of the certificate map entry to create map entry. + CertificateMapEntry certificate_map_entry = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteCertificateMapEntry` method. +message DeleteCertificateMapEntryRequest { + // Required. A name of the certificate map entry to delete. Must be in the + // format `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateMapEntry" + } + ]; +} + +// Request for the `ListDnsAuthorizations` method. +message ListDnsAuthorizationsRequest { + // Required. The project and location from which the dns authorizations should + // be listed, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of dns authorizations to return per call. + int32 page_size = 2; + + // The value returned by the last `ListDnsAuthorizationsResponse`. Indicates + // that this is a continuation of a prior `ListDnsAuthorizations` call, and + // that the system should return the next page of data. + string page_token = 3; + + // Filter expression to restrict the Dns Authorizations returned. + string filter = 4; + + // A list of Dns Authorization field names used to specify the order of the + // returned results. The default sorting order is ascending. To specify + // descending order for a field, add a suffix " desc". + string order_by = 5; +} + +// Response for the `ListDnsAuthorizations` method. +message ListDnsAuthorizationsResponse { + // A list of dns authorizations for the parent resource. + repeated DnsAuthorization dns_authorizations = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the `GetDnsAuthorization` method. +message GetDnsAuthorizationRequest { + // Required. A name of the dns authorization to describe. Must be in the + // format `projects/*/locations/*/dnsAuthorizations/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/DnsAuthorization" + } + ]; +} + +// Request for the `CreateDnsAuthorization` method. +message CreateDnsAuthorizationRequest { + // Required. The parent resource of the dns authorization. Must be in the + // format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A user-provided name of the dns authorization. + string dns_authorization_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A definition of the dns authorization to create. + DnsAuthorization dns_authorization = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `UpdateDnsAuthorization` method. +message UpdateDnsAuthorizationRequest { + // Required. A definition of the dns authorization to update. + DnsAuthorization dns_authorization = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteDnsAuthorization` method. +message DeleteDnsAuthorizationRequest { + // Required. A name of the dns authorization to delete. Must be in the format + // `projects/*/locations/*/dnsAuthorizations/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/DnsAuthorization" + } + ]; +} + +// Represents the metadata of the long-running operation. Output only. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_message = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// Defines TLS certificate. +message Certificate { + option (google.api.resource) = { + type: "certificatemanager.googleapis.com/Certificate" + pattern: "projects/{project}/locations/{location}/certificates/{certificate}" + }; + + // Certificate data for a SelfManaged Certificate. + // SelfManaged Certificates are uploaded by the user. Updating such + // certificates before they expire remains the user's responsibility. + message SelfManagedCertificate { + // Input only. The PEM-encoded certificate chain. + // Leaf certificate comes first, followed by intermediate ones if any. + string pem_certificate = 1 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. The PEM-encoded private key of the leaf certificate. + string pem_private_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Configuration and state of a Managed Certificate. + // Certificate Manager provisions and renews Managed Certificates + // automatically, for as long as it's authorized to do so. + message ManagedCertificate { + enum State { + STATE_UNSPECIFIED = 0; + + // Certificate Manager attempts to provision or renew the certificate. + // If the process takes longer than expected, consult the + // `provisioning_issue` field. + PROVISIONING = 1; + + // Multiple certificate provisioning attempts failed and Certificate + // Manager gave up. To try again, delete and create a new managed + // Certificate resource. + // For details see the `provisioning_issue` field. + FAILED = 2; + + // The certificate management is working, and a certificate has been + // provisioned. + ACTIVE = 3; + } + + // Information about issues with provisioning a Managed Certificate. + message ProvisioningIssue { + enum Reason { + REASON_UNSPECIFIED = 0; + + // Certificate provisioning failed due to an issue with one or more of + // the domains on the certificate. + // For details of which domains failed, consult the + // `authorization_attempt_info` field. + AUTHORIZATION_ISSUE = 1; + + // Exceeded Certificate Authority quotas or internal rate limits of the + // system. Provisioning may take longer to complete. + RATE_LIMITED = 2; + } + + // Output only. Reason for provisioning failures. + Reason reason = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human readable explanation about the issue. Provided to + // help address the configuration issues. Not guaranteed to be stable. For + // programmatic access use Reason enum. + string details = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // State of the latest attempt to authorize a domain for certificate + // issuance. + message AuthorizationAttemptInfo { + enum State { + STATE_UNSPECIFIED = 0; + + // Certificate provisioning for this domain is under way. GCP will + // attempt to authorize the domain. + AUTHORIZING = 1; + + // A managed certificate can be provisioned, no issues for this domain. + AUTHORIZED = 6; + + // Attempt to authorize the domain failed. This prevents the Managed + // Certificate from being issued. + // See `failure_reason` and `details` fields for more information. + FAILED = 7; + } + + enum FailureReason { + FAILURE_REASON_UNSPECIFIED = 0; + + // There was a problem with the user's DNS or load balancer + // configuration for this domain. + CONFIG = 1; + + // Certificate issuance forbidden by an explicit CAA record for the + // domain or a failure to check CAA records for the domain. + CAA = 2; + + // Reached a CA or internal rate-limit for the domain, + // e.g. for certificates per top-level private domain. + RATE_LIMITED = 3; + } + + // Domain name of the authorization attempt. + string domain = 1; + + // Output only. State of the domain for managed certificate issuance. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reason for failure of the authorization attempt for the + // domain. + FailureReason failure_reason = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human readable explanation for reaching the state. + // Provided to help address the configuration issues. Not guaranteed to be + // stable. For programmatic access use FailureReason enum. + string details = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Immutable. The domains for which a managed SSL certificate will be + // generated. Wildcard domains are only supported with DNS challenge + // resolution. + repeated string domains = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Authorizations that will be used for performing domain + // authorization. + repeated string dns_authorizations = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/DnsAuthorization" + } + ]; + + // The resource name for a + // [CertificateIssuanceConfig][google.cloud.certificatemanager.v1.CertificateIssuanceConfig] + // used to configure private PKI certificates in the format + // `projects/*/locations/*/certificateIssuanceConfigs/*`. + // If this field is not set, the certificates will instead be publicly + // signed as documented at + // https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. + string issuance_config = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + ]; + + // Output only. State of the managed certificate resource. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about issues with provisioning a Managed + // Certificate. + ProvisioningIssue provisioning_issue = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Detailed state of the latest authorization attempt for each + // domain specified for managed certificate resource. + repeated AuthorizationAttemptInfo authorization_attempt_info = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Certificate scope. + enum Scope { + // Certificates with default scope are served from core Google data centers. + // If unsure, choose this option. + DEFAULT = 0; + + // Certificates with scope EDGE_CACHE are special-purposed certificates, + // served from non-core Google data centers. + EDGE_CACHE = 1; + } + + // A user-defined name of the certificate. Certificate names must be unique + // globally and match pattern `projects/*/locations/*/certificates/*`. + string name = 1; + + // One or more paragraphs of text description of a certificate. + string description = 8; + + // Output only. The creation timestamp of a Certificate. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a Certificate. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of labels associated with a Certificate. + map labels = 4; + + oneof type { + // If set, defines data of a self-managed certificate. + SelfManagedCertificate self_managed = 5; + + // If set, contains configuration and state of a managed certificate. + ManagedCertificate managed = 11; + } + + // Output only. The list of Subject Alternative Names of dnsName type defined + // in the certificate (see RFC 5280 4.2.1.6). Managed certificates that + // haven't been provisioned yet have this field populated with a value of the + // managed.domains field. + repeated string san_dnsnames = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The PEM-encoded certificate chain. + string pem_certificate = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The expiry timestamp of a Certificate. + google.protobuf.Timestamp expire_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The scope of the certificate. + Scope scope = 12 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Defines a collection of certificate configurations. +message CertificateMap { + option (google.api.resource) = { + type: "certificatemanager.googleapis.com/CertificateMap" + pattern: "projects/{project}/locations/{location}/certificateMaps/{certificate_map}" + }; + + // Describes a Target Proxy which uses this Certificate Map. + message GclbTarget { + // Defines IP configuration where this Certificate Map is serving. + message IpConfig { + // Output only. An external IP address. + string ip_address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Ports. + repeated uint32 ports = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A Target Proxy to which this map is attached to. + oneof target_proxy { + // Output only. This field returns the resource name in the following + // format: + // `//compute.googleapis.com/projects/*/global/targetHttpsProxies/*`. + string target_https_proxy = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This field returns the resource name in the following + // format: + // `//compute.googleapis.com/projects/*/global/targetSslProxies/*`. + string target_ssl_proxy = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. IP configurations for this Target Proxy where the + // Certificate Map is serving. + repeated IpConfig ip_configs = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A user-defined name of the Certificate Map. Certificate Map names must be + // unique globally and match pattern + // `projects/*/locations/*/certificateMaps/*`. + string name = 1; + + // One or more paragraphs of text description of a certificate map. + string description = 5; + + // Output only. The creation timestamp of a Certificate Map. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp of a Certificate Map. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of labels associated with a Certificate Map. + map labels = 3; + + // Output only. A list of GCLB targets which use this Certificate Map. + // A Target Proxy is only present on this list if it's attached to a + // Forwarding Rule. + repeated GclbTarget gclb_targets = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines a certificate map entry. +message CertificateMapEntry { + option (google.api.resource) = { + type: "certificatemanager.googleapis.com/CertificateMapEntry" + pattern: "projects/{project}/locations/{location}/certificateMaps/{certificate_map}/certificateMapEntries/{certificate_map_entry}" + }; + + // Defines predefined cases other than SNI-hostname match when this + // configuration should be applied. + enum Matcher { + // A matcher has't been recognized. + MATCHER_UNSPECIFIED = 0; + + // A primary certificate that is served when SNI wasn't specified in the + // request or SNI couldn't be found in the map. + PRIMARY = 1; + } + + // A user-defined name of the Certificate Map Entry. Certificate Map Entry + // names must be unique globally and match pattern + // `projects/*/locations/*/certificateMaps/*/certificateMapEntries/*`. + string name = 1; + + // One or more paragraphs of text description of a certificate map entry. + string description = 9; + + // Output only. The creation timestamp of a Certificate Map Entry. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update timestamp of a Certificate Map Entry. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of labels associated with a Certificate Map Entry. + map labels = 4; + + oneof match { + // A Hostname (FQDN, e.g. `example.com`) or a wildcard hostname expression + // (`*.example.com`) for a set of hostnames with common suffix. Used as + // Server Name Indication (SNI) for selecting a proper certificate. + string hostname = 5; + + // A predefined matcher for particular cases, other than SNI selection. + Matcher matcher = 10; + } + + // A set of Certificates defines for the given `hostname`. There can be + // defined up to fifteen certificates in each Certificate Map Entry. Each + // certificate must match pattern `projects/*/locations/*/certificates/*`. + repeated string certificates = 7 [(google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/Certificate" + }]; + + // Output only. A serving state of this Certificate Map Entry. + ServingState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A DnsAuthorization resource describes a way to perform domain authorization +// for certificate issuance. +message DnsAuthorization { + option (google.api.resource) = { + type: "certificatemanager.googleapis.com/DnsAuthorization" + pattern: "projects/{project}/locations/{location}/dnsAuthorizations/{dns_authorization}" + }; + + // The structure describing the DNS Resource Record that needs to be added + // to DNS configuration for the authorization to be usable by + // certificate. + message DnsResourceRecord { + // Output only. Fully qualified name of the DNS Resource Record. + // e.g. `_acme-challenge.example.com` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the DNS Resource Record. + // Currently always set to "CNAME". + string type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Data of the DNS Resource Record. + string data = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A user-defined name of the dns authorization. DnsAuthorization names must + // be unique globally and match pattern + // `projects/*/locations/*/dnsAuthorizations/*`. + string name = 1; + + // Output only. The creation timestamp of a DnsAuthorization. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a DnsAuthorization. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of labels associated with a DnsAuthorization. + map labels = 4; + + // One or more paragraphs of text description of a DnsAuthorization. + string description = 5; + + // Required. Immutable. A domain which is being authorized. A DnsAuthorization + // resource covers a single domain and its wildcard, e.g. authorization for + // `example.com` can be used to issue certificates for `example.com` and + // `*.example.com`. + string domain = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. DNS Resource Record that needs to be added to DNS + // configuration. + DnsResourceRecord dns_resource_record = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Defines set of serving states associated with a resource. +enum ServingState { + // The status is undefined. + SERVING_STATE_UNSPECIFIED = 0; + + // The configuration is serving. + ACTIVE = 1; + + // Update is in progress. Some frontends may serve this configuration. + PENDING = 2; +} diff --git a/packages/google-cloud-certificatemanager/protos/protos.d.ts b/packages/google-cloud-certificatemanager/protos/protos.d.ts new file mode 100644 index 000000000000..a0d2aa38736f --- /dev/null +++ b/packages/google-cloud-certificatemanager/protos/protos.d.ts @@ -0,0 +1,11098 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace certificatemanager. */ + namespace certificatemanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a ListCertificateIssuanceConfigsRequest. */ + interface IListCertificateIssuanceConfigsRequest { + + /** ListCertificateIssuanceConfigsRequest parent */ + parent?: (string|null); + + /** ListCertificateIssuanceConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateIssuanceConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateIssuanceConfigsRequest filter */ + filter?: (string|null); + + /** ListCertificateIssuanceConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateIssuanceConfigsRequest. */ + class ListCertificateIssuanceConfigsRequest implements IListCertificateIssuanceConfigsRequest { + + /** + * Constructs a new ListCertificateIssuanceConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest); + + /** ListCertificateIssuanceConfigsRequest parent. */ + public parent: string; + + /** ListCertificateIssuanceConfigsRequest pageSize. */ + public pageSize: number; + + /** ListCertificateIssuanceConfigsRequest pageToken. */ + public pageToken: string; + + /** ListCertificateIssuanceConfigsRequest filter. */ + public filter: string; + + /** ListCertificateIssuanceConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateIssuanceConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateIssuanceConfigsRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest; + + /** + * Encodes the specified ListCertificateIssuanceConfigsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest.verify|verify} messages. + * @param message ListCertificateIssuanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateIssuanceConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest.verify|verify} messages. + * @param message ListCertificateIssuanceConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateIssuanceConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateIssuanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest; + + /** + * Decodes a ListCertificateIssuanceConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateIssuanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest; + + /** + * Verifies a ListCertificateIssuanceConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateIssuanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateIssuanceConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest; + + /** + * Creates a plain object from a ListCertificateIssuanceConfigsRequest message. Also converts values to other types if specified. + * @param message ListCertificateIssuanceConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateIssuanceConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateIssuanceConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateIssuanceConfigsResponse. */ + interface IListCertificateIssuanceConfigsResponse { + + /** ListCertificateIssuanceConfigsResponse certificateIssuanceConfigs */ + certificateIssuanceConfigs?: (google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[]|null); + + /** ListCertificateIssuanceConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateIssuanceConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateIssuanceConfigsResponse. */ + class ListCertificateIssuanceConfigsResponse implements IListCertificateIssuanceConfigsResponse { + + /** + * Constructs a new ListCertificateIssuanceConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse); + + /** ListCertificateIssuanceConfigsResponse certificateIssuanceConfigs. */ + public certificateIssuanceConfigs: google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[]; + + /** ListCertificateIssuanceConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateIssuanceConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateIssuanceConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateIssuanceConfigsResponse instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse; + + /** + * Encodes the specified ListCertificateIssuanceConfigsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.verify|verify} messages. + * @param message ListCertificateIssuanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateIssuanceConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.verify|verify} messages. + * @param message ListCertificateIssuanceConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateIssuanceConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateIssuanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse; + + /** + * Decodes a ListCertificateIssuanceConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateIssuanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse; + + /** + * Verifies a ListCertificateIssuanceConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateIssuanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateIssuanceConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse; + + /** + * Creates a plain object from a ListCertificateIssuanceConfigsResponse message. Also converts values to other types if specified. + * @param message ListCertificateIssuanceConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateIssuanceConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateIssuanceConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateIssuanceConfigRequest. */ + interface IGetCertificateIssuanceConfigRequest { + + /** GetCertificateIssuanceConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateIssuanceConfigRequest. */ + class GetCertificateIssuanceConfigRequest implements IGetCertificateIssuanceConfigRequest { + + /** + * Constructs a new GetCertificateIssuanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest); + + /** GetCertificateIssuanceConfigRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateIssuanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateIssuanceConfigRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest): google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest; + + /** + * Encodes the specified GetCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message GetCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message GetCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest; + + /** + * Decodes a GetCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest; + + /** + * Verifies a GetCertificateIssuanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateIssuanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest; + + /** + * Creates a plain object from a GetCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @param message GetCertificateIssuanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateIssuanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateIssuanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateIssuanceConfigRequest. */ + interface ICreateCertificateIssuanceConfigRequest { + + /** CreateCertificateIssuanceConfigRequest parent */ + parent?: (string|null); + + /** CreateCertificateIssuanceConfigRequest certificateIssuanceConfigId */ + certificateIssuanceConfigId?: (string|null); + + /** CreateCertificateIssuanceConfigRequest certificateIssuanceConfig */ + certificateIssuanceConfig?: (google.cloud.certificatemanager.v1.ICertificateIssuanceConfig|null); + } + + /** Represents a CreateCertificateIssuanceConfigRequest. */ + class CreateCertificateIssuanceConfigRequest implements ICreateCertificateIssuanceConfigRequest { + + /** + * Constructs a new CreateCertificateIssuanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest); + + /** CreateCertificateIssuanceConfigRequest parent. */ + public parent: string; + + /** CreateCertificateIssuanceConfigRequest certificateIssuanceConfigId. */ + public certificateIssuanceConfigId: string; + + /** CreateCertificateIssuanceConfigRequest certificateIssuanceConfig. */ + public certificateIssuanceConfig?: (google.cloud.certificatemanager.v1.ICertificateIssuanceConfig|null); + + /** + * Creates a new CreateCertificateIssuanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateIssuanceConfigRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest): google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest; + + /** + * Encodes the specified CreateCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message CreateCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message CreateCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest; + + /** + * Decodes a CreateCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest; + + /** + * Verifies a CreateCertificateIssuanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateIssuanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest; + + /** + * Creates a plain object from a CreateCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @param message CreateCertificateIssuanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateIssuanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateIssuanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateIssuanceConfigRequest. */ + interface IDeleteCertificateIssuanceConfigRequest { + + /** DeleteCertificateIssuanceConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCertificateIssuanceConfigRequest. */ + class DeleteCertificateIssuanceConfigRequest implements IDeleteCertificateIssuanceConfigRequest { + + /** + * Constructs a new DeleteCertificateIssuanceConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest); + + /** DeleteCertificateIssuanceConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteCertificateIssuanceConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateIssuanceConfigRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest): google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest; + + /** + * Encodes the specified DeleteCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message DeleteCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest.verify|verify} messages. + * @param message DeleteCertificateIssuanceConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest; + + /** + * Decodes a DeleteCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest; + + /** + * Verifies a DeleteCertificateIssuanceConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateIssuanceConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest; + + /** + * Creates a plain object from a DeleteCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateIssuanceConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateIssuanceConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateIssuanceConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateIssuanceConfig. */ + interface ICertificateIssuanceConfig { + + /** CertificateIssuanceConfig name */ + name?: (string|null); + + /** CertificateIssuanceConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateIssuanceConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateIssuanceConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** CertificateIssuanceConfig description */ + description?: (string|null); + + /** CertificateIssuanceConfig certificateAuthorityConfig */ + certificateAuthorityConfig?: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig|null); + + /** CertificateIssuanceConfig lifetime */ + lifetime?: (google.protobuf.IDuration|null); + + /** CertificateIssuanceConfig rotationWindowPercentage */ + rotationWindowPercentage?: (number|null); + + /** CertificateIssuanceConfig keyAlgorithm */ + keyAlgorithm?: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm|keyof typeof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm|null); + } + + /** Represents a CertificateIssuanceConfig. */ + class CertificateIssuanceConfig implements ICertificateIssuanceConfig { + + /** + * Constructs a new CertificateIssuanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICertificateIssuanceConfig); + + /** CertificateIssuanceConfig name. */ + public name: string; + + /** CertificateIssuanceConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateIssuanceConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateIssuanceConfig labels. */ + public labels: { [k: string]: string }; + + /** CertificateIssuanceConfig description. */ + public description: string; + + /** CertificateIssuanceConfig certificateAuthorityConfig. */ + public certificateAuthorityConfig?: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig|null); + + /** CertificateIssuanceConfig lifetime. */ + public lifetime?: (google.protobuf.IDuration|null); + + /** CertificateIssuanceConfig rotationWindowPercentage. */ + public rotationWindowPercentage: number; + + /** CertificateIssuanceConfig keyAlgorithm. */ + public keyAlgorithm: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm|keyof typeof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm); + + /** + * Creates a new CertificateIssuanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateIssuanceConfig instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICertificateIssuanceConfig): google.cloud.certificatemanager.v1.CertificateIssuanceConfig; + + /** + * Encodes the specified CertificateIssuanceConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify|verify} messages. + * @param message CertificateIssuanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateIssuanceConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify|verify} messages. + * @param message CertificateIssuanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateIssuanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateIssuanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateIssuanceConfig; + + /** + * Decodes a CertificateIssuanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateIssuanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateIssuanceConfig; + + /** + * Verifies a CertificateIssuanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateIssuanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateIssuanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateIssuanceConfig; + + /** + * Creates a plain object from a CertificateIssuanceConfig message. Also converts values to other types if specified. + * @param message CertificateIssuanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateIssuanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateIssuanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateIssuanceConfig { + + /** Properties of a CertificateAuthorityConfig. */ + interface ICertificateAuthorityConfig { + + /** CertificateAuthorityConfig certificateAuthorityServiceConfig */ + certificateAuthorityServiceConfig?: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig|null); + } + + /** Represents a CertificateAuthorityConfig. */ + class CertificateAuthorityConfig implements ICertificateAuthorityConfig { + + /** + * Constructs a new CertificateAuthorityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig); + + /** CertificateAuthorityConfig certificateAuthorityServiceConfig. */ + public certificateAuthorityServiceConfig?: (google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig|null); + + /** CertificateAuthorityConfig kind. */ + public kind?: "certificateAuthorityServiceConfig"; + + /** + * Creates a new CertificateAuthorityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateAuthorityConfig instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig; + + /** + * Encodes the specified CertificateAuthorityConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.verify|verify} messages. + * @param message CertificateAuthorityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateAuthorityConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.verify|verify} messages. + * @param message CertificateAuthorityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateAuthorityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateAuthorityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig; + + /** + * Decodes a CertificateAuthorityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateAuthorityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig; + + /** + * Verifies a CertificateAuthorityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateAuthorityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateAuthorityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig; + + /** + * Creates a plain object from a CertificateAuthorityConfig message. Also converts values to other types if specified. + * @param message CertificateAuthorityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateAuthorityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateAuthorityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateAuthorityConfig { + + /** Properties of a CertificateAuthorityServiceConfig. */ + interface ICertificateAuthorityServiceConfig { + + /** CertificateAuthorityServiceConfig caPool */ + caPool?: (string|null); + } + + /** Represents a CertificateAuthorityServiceConfig. */ + class CertificateAuthorityServiceConfig implements ICertificateAuthorityServiceConfig { + + /** + * Constructs a new CertificateAuthorityServiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig); + + /** CertificateAuthorityServiceConfig caPool. */ + public caPool: string; + + /** + * Creates a new CertificateAuthorityServiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateAuthorityServiceConfig instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig; + + /** + * Encodes the specified CertificateAuthorityServiceConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.verify|verify} messages. + * @param message CertificateAuthorityServiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateAuthorityServiceConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.verify|verify} messages. + * @param message CertificateAuthorityServiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateAuthorityServiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateAuthorityServiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig; + + /** + * Decodes a CertificateAuthorityServiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateAuthorityServiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig; + + /** + * Verifies a CertificateAuthorityServiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateAuthorityServiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateAuthorityServiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig; + + /** + * Creates a plain object from a CertificateAuthorityServiceConfig message. Also converts values to other types if specified. + * @param message CertificateAuthorityServiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateAuthorityServiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateAuthorityServiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** KeyAlgorithm enum. */ + enum KeyAlgorithm { + KEY_ALGORITHM_UNSPECIFIED = 0, + RSA_2048 = 1, + ECDSA_P256 = 4 + } + } + + /** Represents a CertificateManager */ + class CertificateManager extends $protobuf.rpc.Service { + + /** + * Constructs a new CertificateManager 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 CertificateManager 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): CertificateManager; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificatesResponse + */ + public listCertificates(request: google.cloud.certificatemanager.v1.IListCertificatesRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.ListCertificatesCallback): void; + + /** + * Calls ListCertificates. + * @param request ListCertificatesRequest message or plain object + * @returns Promise + */ + public listCertificates(request: google.cloud.certificatemanager.v1.IListCertificatesRequest): Promise; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Certificate + */ + public getCertificate(request: google.cloud.certificatemanager.v1.IGetCertificateRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.GetCertificateCallback): void; + + /** + * Calls GetCertificate. + * @param request GetCertificateRequest message or plain object + * @returns Promise + */ + public getCertificate(request: google.cloud.certificatemanager.v1.IGetCertificateRequest): Promise; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificate(request: google.cloud.certificatemanager.v1.ICreateCertificateRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateCallback): void; + + /** + * Calls CreateCertificate. + * @param request CreateCertificateRequest message or plain object + * @returns Promise + */ + public createCertificate(request: google.cloud.certificatemanager.v1.ICreateCertificateRequest): Promise; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificate(request: google.cloud.certificatemanager.v1.IUpdateCertificateRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateCallback): void; + + /** + * Calls UpdateCertificate. + * @param request UpdateCertificateRequest message or plain object + * @returns Promise + */ + public updateCertificate(request: google.cloud.certificatemanager.v1.IUpdateCertificateRequest): Promise; + + /** + * Calls DeleteCertificate. + * @param request DeleteCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificate(request: google.cloud.certificatemanager.v1.IDeleteCertificateRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateCallback): void; + + /** + * Calls DeleteCertificate. + * @param request DeleteCertificateRequest message or plain object + * @returns Promise + */ + public deleteCertificate(request: google.cloud.certificatemanager.v1.IDeleteCertificateRequest): Promise; + + /** + * Calls ListCertificateMaps. + * @param request ListCertificateMapsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateMapsResponse + */ + public listCertificateMaps(request: google.cloud.certificatemanager.v1.IListCertificateMapsRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapsCallback): void; + + /** + * Calls ListCertificateMaps. + * @param request ListCertificateMapsRequest message or plain object + * @returns Promise + */ + public listCertificateMaps(request: google.cloud.certificatemanager.v1.IListCertificateMapsRequest): Promise; + + /** + * Calls GetCertificateMap. + * @param request GetCertificateMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateMap + */ + public getCertificateMap(request: google.cloud.certificatemanager.v1.IGetCertificateMapRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapCallback): void; + + /** + * Calls GetCertificateMap. + * @param request GetCertificateMapRequest message or plain object + * @returns Promise + */ + public getCertificateMap(request: google.cloud.certificatemanager.v1.IGetCertificateMapRequest): Promise; + + /** + * Calls CreateCertificateMap. + * @param request CreateCertificateMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateMap(request: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapCallback): void; + + /** + * Calls CreateCertificateMap. + * @param request CreateCertificateMapRequest message or plain object + * @returns Promise + */ + public createCertificateMap(request: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest): Promise; + + /** + * Calls UpdateCertificateMap. + * @param request UpdateCertificateMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateMap(request: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapCallback): void; + + /** + * Calls UpdateCertificateMap. + * @param request UpdateCertificateMapRequest message or plain object + * @returns Promise + */ + public updateCertificateMap(request: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest): Promise; + + /** + * Calls DeleteCertificateMap. + * @param request DeleteCertificateMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificateMap(request: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapCallback): void; + + /** + * Calls DeleteCertificateMap. + * @param request DeleteCertificateMapRequest message or plain object + * @returns Promise + */ + public deleteCertificateMap(request: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest): Promise; + + /** + * Calls ListCertificateMapEntries. + * @param request ListCertificateMapEntriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateMapEntriesResponse + */ + public listCertificateMapEntries(request: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapEntriesCallback): void; + + /** + * Calls ListCertificateMapEntries. + * @param request ListCertificateMapEntriesRequest message or plain object + * @returns Promise + */ + public listCertificateMapEntries(request: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest): Promise; + + /** + * Calls GetCertificateMapEntry. + * @param request GetCertificateMapEntryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateMapEntry + */ + public getCertificateMapEntry(request: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapEntryCallback): void; + + /** + * Calls GetCertificateMapEntry. + * @param request GetCertificateMapEntryRequest message or plain object + * @returns Promise + */ + public getCertificateMapEntry(request: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest): Promise; + + /** + * Calls CreateCertificateMapEntry. + * @param request CreateCertificateMapEntryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateMapEntry(request: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapEntryCallback): void; + + /** + * Calls CreateCertificateMapEntry. + * @param request CreateCertificateMapEntryRequest message or plain object + * @returns Promise + */ + public createCertificateMapEntry(request: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest): Promise; + + /** + * Calls UpdateCertificateMapEntry. + * @param request UpdateCertificateMapEntryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCertificateMapEntry(request: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapEntryCallback): void; + + /** + * Calls UpdateCertificateMapEntry. + * @param request UpdateCertificateMapEntryRequest message or plain object + * @returns Promise + */ + public updateCertificateMapEntry(request: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest): Promise; + + /** + * Calls DeleteCertificateMapEntry. + * @param request DeleteCertificateMapEntryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificateMapEntry(request: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapEntryCallback): void; + + /** + * Calls DeleteCertificateMapEntry. + * @param request DeleteCertificateMapEntryRequest message or plain object + * @returns Promise + */ + public deleteCertificateMapEntry(request: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest): Promise; + + /** + * Calls ListDnsAuthorizations. + * @param request ListDnsAuthorizationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDnsAuthorizationsResponse + */ + public listDnsAuthorizations(request: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.ListDnsAuthorizationsCallback): void; + + /** + * Calls ListDnsAuthorizations. + * @param request ListDnsAuthorizationsRequest message or plain object + * @returns Promise + */ + public listDnsAuthorizations(request: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest): Promise; + + /** + * Calls GetDnsAuthorization. + * @param request GetDnsAuthorizationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DnsAuthorization + */ + public getDnsAuthorization(request: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.GetDnsAuthorizationCallback): void; + + /** + * Calls GetDnsAuthorization. + * @param request GetDnsAuthorizationRequest message or plain object + * @returns Promise + */ + public getDnsAuthorization(request: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest): Promise; + + /** + * Calls CreateDnsAuthorization. + * @param request CreateDnsAuthorizationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDnsAuthorization(request: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.CreateDnsAuthorizationCallback): void; + + /** + * Calls CreateDnsAuthorization. + * @param request CreateDnsAuthorizationRequest message or plain object + * @returns Promise + */ + public createDnsAuthorization(request: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest): Promise; + + /** + * Calls UpdateDnsAuthorization. + * @param request UpdateDnsAuthorizationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDnsAuthorization(request: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.UpdateDnsAuthorizationCallback): void; + + /** + * Calls UpdateDnsAuthorization. + * @param request UpdateDnsAuthorizationRequest message or plain object + * @returns Promise + */ + public updateDnsAuthorization(request: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest): Promise; + + /** + * Calls DeleteDnsAuthorization. + * @param request DeleteDnsAuthorizationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDnsAuthorization(request: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.DeleteDnsAuthorizationCallback): void; + + /** + * Calls DeleteDnsAuthorization. + * @param request DeleteDnsAuthorizationRequest message or plain object + * @returns Promise + */ + public deleteDnsAuthorization(request: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest): Promise; + + /** + * Calls ListCertificateIssuanceConfigs. + * @param request ListCertificateIssuanceConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCertificateIssuanceConfigsResponse + */ + public listCertificateIssuanceConfigs(request: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.ListCertificateIssuanceConfigsCallback): void; + + /** + * Calls ListCertificateIssuanceConfigs. + * @param request ListCertificateIssuanceConfigsRequest message or plain object + * @returns Promise + */ + public listCertificateIssuanceConfigs(request: google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest): Promise; + + /** + * Calls GetCertificateIssuanceConfig. + * @param request GetCertificateIssuanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CertificateIssuanceConfig + */ + public getCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.GetCertificateIssuanceConfigCallback): void; + + /** + * Calls GetCertificateIssuanceConfig. + * @param request GetCertificateIssuanceConfigRequest message or plain object + * @returns Promise + */ + public getCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest): Promise; + + /** + * Calls CreateCertificateIssuanceConfig. + * @param request CreateCertificateIssuanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateIssuanceConfigCallback): void; + + /** + * Calls CreateCertificateIssuanceConfig. + * @param request CreateCertificateIssuanceConfigRequest message or plain object + * @returns Promise + */ + public createCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest): Promise; + + /** + * Calls DeleteCertificateIssuanceConfig. + * @param request DeleteCertificateIssuanceConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, callback: google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateIssuanceConfigCallback): void; + + /** + * Calls DeleteCertificateIssuanceConfig. + * @param request DeleteCertificateIssuanceConfigRequest message or plain object + * @returns Promise + */ + public deleteCertificateIssuanceConfig(request: google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest): Promise; + } + + namespace CertificateManager { + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificates}. + * @param error Error, if any + * @param [response] ListCertificatesResponse + */ + type ListCertificatesCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.ListCertificatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificate}. + * @param error Error, if any + * @param [response] Certificate + */ + type GetCertificateCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.Certificate) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificate}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificate}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificate}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateMaps}. + * @param error Error, if any + * @param [response] ListCertificateMapsResponse + */ + type ListCertificateMapsCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.ListCertificateMapsResponse) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateMap}. + * @param error Error, if any + * @param [response] CertificateMap + */ + type GetCertificateMapCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.CertificateMap) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateMap}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateMapCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificateMap}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateMapCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateMap}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateMapCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateMapEntries}. + * @param error Error, if any + * @param [response] ListCertificateMapEntriesResponse + */ + type ListCertificateMapEntriesCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateMapEntry}. + * @param error Error, if any + * @param [response] CertificateMapEntry + */ + type GetCertificateMapEntryCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.CertificateMapEntry) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateMapEntry}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateMapEntryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificateMapEntry}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCertificateMapEntryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateMapEntry}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateMapEntryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listDnsAuthorizations}. + * @param error Error, if any + * @param [response] ListDnsAuthorizationsResponse + */ + type ListDnsAuthorizationsCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getDnsAuthorization}. + * @param error Error, if any + * @param [response] DnsAuthorization + */ + type GetDnsAuthorizationCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.DnsAuthorization) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createDnsAuthorization}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDnsAuthorizationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateDnsAuthorization}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDnsAuthorizationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteDnsAuthorization}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDnsAuthorizationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateIssuanceConfigs}. + * @param error Error, if any + * @param [response] ListCertificateIssuanceConfigsResponse + */ + type ListCertificateIssuanceConfigsCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateIssuanceConfig}. + * @param error Error, if any + * @param [response] CertificateIssuanceConfig + */ + type GetCertificateIssuanceConfigCallback = (error: (Error|null), response?: google.cloud.certificatemanager.v1.CertificateIssuanceConfig) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateIssuanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCertificateIssuanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateIssuanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCertificateIssuanceConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListCertificatesRequest. */ + interface IListCertificatesRequest { + + /** ListCertificatesRequest parent */ + parent?: (string|null); + + /** ListCertificatesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificatesRequest filter */ + filter?: (string|null); + + /** ListCertificatesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificatesRequest. */ + class ListCertificatesRequest implements IListCertificatesRequest { + + /** + * Constructs a new ListCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificatesRequest); + + /** ListCertificatesRequest parent. */ + public parent: string; + + /** ListCertificatesRequest pageSize. */ + public pageSize: number; + + /** ListCertificatesRequest pageToken. */ + public pageToken: string; + + /** ListCertificatesRequest filter. */ + public filter: string; + + /** ListCertificatesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificatesRequest): google.cloud.certificatemanager.v1.ListCertificatesRequest; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesRequest.verify|verify} messages. + * @param message ListCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificatesRequest; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificatesRequest; + + /** + * Verifies a ListCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificatesRequest; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @param message ListCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificatesResponse. */ + interface IListCertificatesResponse { + + /** ListCertificatesResponse certificates */ + certificates?: (google.cloud.certificatemanager.v1.ICertificate[]|null); + + /** ListCertificatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificatesResponse. */ + class ListCertificatesResponse implements IListCertificatesResponse { + + /** + * Constructs a new ListCertificatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificatesResponse); + + /** ListCertificatesResponse certificates. */ + public certificates: google.cloud.certificatemanager.v1.ICertificate[]; + + /** ListCertificatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificatesResponse instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificatesResponse): google.cloud.certificatemanager.v1.ListCertificatesResponse; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesResponse.verify|verify} messages. + * @param message ListCertificatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificatesResponse; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificatesResponse; + + /** + * Verifies a ListCertificatesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificatesResponse; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @param message ListCertificatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateRequest. */ + interface IGetCertificateRequest { + + /** GetCertificateRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateRequest. */ + class GetCertificateRequest implements IGetCertificateRequest { + + /** + * Constructs a new GetCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IGetCertificateRequest); + + /** GetCertificateRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IGetCertificateRequest): google.cloud.certificatemanager.v1.GetCertificateRequest; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateRequest.verify|verify} messages. + * @param message GetCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IGetCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.GetCertificateRequest; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.GetCertificateRequest; + + /** + * Verifies a GetCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.GetCertificateRequest; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @param message GetCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.GetCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateRequest. */ + interface ICreateCertificateRequest { + + /** CreateCertificateRequest parent */ + parent?: (string|null); + + /** CreateCertificateRequest certificateId */ + certificateId?: (string|null); + + /** CreateCertificateRequest certificate */ + certificate?: (google.cloud.certificatemanager.v1.ICertificate|null); + } + + /** Represents a CreateCertificateRequest. */ + class CreateCertificateRequest implements ICreateCertificateRequest { + + /** + * Constructs a new CreateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICreateCertificateRequest); + + /** CreateCertificateRequest parent. */ + public parent: string; + + /** CreateCertificateRequest certificateId. */ + public certificateId: string; + + /** CreateCertificateRequest certificate. */ + public certificate?: (google.cloud.certificatemanager.v1.ICertificate|null); + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICreateCertificateRequest): google.cloud.certificatemanager.v1.CreateCertificateRequest; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateRequest.verify|verify} messages. + * @param message CreateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICreateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CreateCertificateRequest; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CreateCertificateRequest; + + /** + * Verifies a CreateCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CreateCertificateRequest; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @param message CreateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CreateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateRequest. */ + interface IUpdateCertificateRequest { + + /** UpdateCertificateRequest certificate */ + certificate?: (google.cloud.certificatemanager.v1.ICertificate|null); + + /** UpdateCertificateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCertificateRequest. */ + class UpdateCertificateRequest implements IUpdateCertificateRequest { + + /** + * Constructs a new UpdateCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateRequest); + + /** UpdateCertificateRequest certificate. */ + public certificate?: (google.cloud.certificatemanager.v1.ICertificate|null); + + /** UpdateCertificateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateRequest): google.cloud.certificatemanager.v1.UpdateCertificateRequest; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateRequest.verify|verify} messages. + * @param message UpdateCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IUpdateCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.UpdateCertificateRequest; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.UpdateCertificateRequest; + + /** + * Verifies an UpdateCertificateRequest message. + * @param message Plain 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.UpdateCertificateRequest; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.UpdateCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateRequest. */ + interface IDeleteCertificateRequest { + + /** DeleteCertificateRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCertificateRequest. */ + class DeleteCertificateRequest implements IDeleteCertificateRequest { + + /** + * Constructs a new DeleteCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateRequest); + + /** DeleteCertificateRequest name. */ + public name: string; + + /** + * Creates a new DeleteCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateRequest): google.cloud.certificatemanager.v1.DeleteCertificateRequest; + + /** + * Encodes the specified DeleteCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateRequest.verify|verify} messages. + * @param message DeleteCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDeleteCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateRequest.verify|verify} messages. + * @param message DeleteCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDeleteCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DeleteCertificateRequest; + + /** + * Decodes a DeleteCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DeleteCertificateRequest; + + /** + * Verifies a DeleteCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DeleteCertificateRequest; + + /** + * Creates a plain object from a DeleteCertificateRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DeleteCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateMapsRequest. */ + interface IListCertificateMapsRequest { + + /** ListCertificateMapsRequest parent */ + parent?: (string|null); + + /** ListCertificateMapsRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateMapsRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateMapsRequest filter */ + filter?: (string|null); + + /** ListCertificateMapsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateMapsRequest. */ + class ListCertificateMapsRequest implements IListCertificateMapsRequest { + + /** + * Constructs a new ListCertificateMapsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateMapsRequest); + + /** ListCertificateMapsRequest parent. */ + public parent: string; + + /** ListCertificateMapsRequest pageSize. */ + public pageSize: number; + + /** ListCertificateMapsRequest pageToken. */ + public pageToken: string; + + /** ListCertificateMapsRequest filter. */ + public filter: string; + + /** ListCertificateMapsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateMapsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateMapsRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateMapsRequest): google.cloud.certificatemanager.v1.ListCertificateMapsRequest; + + /** + * Encodes the specified ListCertificateMapsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsRequest.verify|verify} messages. + * @param message ListCertificateMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateMapsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsRequest.verify|verify} messages. + * @param message ListCertificateMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateMapsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateMapsRequest; + + /** + * Decodes a ListCertificateMapsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateMapsRequest; + + /** + * Verifies a ListCertificateMapsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateMapsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateMapsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateMapsRequest; + + /** + * Creates a plain object from a ListCertificateMapsRequest message. Also converts values to other types if specified. + * @param message ListCertificateMapsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateMapsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateMapsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateMapsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateMapsResponse. */ + interface IListCertificateMapsResponse { + + /** ListCertificateMapsResponse certificateMaps */ + certificateMaps?: (google.cloud.certificatemanager.v1.ICertificateMap[]|null); + + /** ListCertificateMapsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateMapsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateMapsResponse. */ + class ListCertificateMapsResponse implements IListCertificateMapsResponse { + + /** + * Constructs a new ListCertificateMapsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateMapsResponse); + + /** ListCertificateMapsResponse certificateMaps. */ + public certificateMaps: google.cloud.certificatemanager.v1.ICertificateMap[]; + + /** ListCertificateMapsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateMapsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateMapsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateMapsResponse instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateMapsResponse): google.cloud.certificatemanager.v1.ListCertificateMapsResponse; + + /** + * Encodes the specified ListCertificateMapsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsResponse.verify|verify} messages. + * @param message ListCertificateMapsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateMapsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateMapsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsResponse.verify|verify} messages. + * @param message ListCertificateMapsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateMapsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateMapsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateMapsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateMapsResponse; + + /** + * Decodes a ListCertificateMapsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateMapsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateMapsResponse; + + /** + * Verifies a ListCertificateMapsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateMapsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateMapsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateMapsResponse; + + /** + * Creates a plain object from a ListCertificateMapsResponse message. Also converts values to other types if specified. + * @param message ListCertificateMapsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateMapsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateMapsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateMapsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateMapRequest. */ + interface IGetCertificateMapRequest { + + /** GetCertificateMapRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateMapRequest. */ + class GetCertificateMapRequest implements IGetCertificateMapRequest { + + /** + * Constructs a new GetCertificateMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IGetCertificateMapRequest); + + /** GetCertificateMapRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateMapRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IGetCertificateMapRequest): google.cloud.certificatemanager.v1.GetCertificateMapRequest; + + /** + * Encodes the specified GetCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapRequest.verify|verify} messages. + * @param message GetCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IGetCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapRequest.verify|verify} messages. + * @param message GetCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IGetCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.GetCertificateMapRequest; + + /** + * Decodes a GetCertificateMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.GetCertificateMapRequest; + + /** + * Verifies a GetCertificateMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.GetCertificateMapRequest; + + /** + * Creates a plain object from a GetCertificateMapRequest message. Also converts values to other types if specified. + * @param message GetCertificateMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.GetCertificateMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateMapRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateMapRequest. */ + interface ICreateCertificateMapRequest { + + /** CreateCertificateMapRequest parent */ + parent?: (string|null); + + /** CreateCertificateMapRequest certificateMapId */ + certificateMapId?: (string|null); + + /** CreateCertificateMapRequest certificateMap */ + certificateMap?: (google.cloud.certificatemanager.v1.ICertificateMap|null); + } + + /** Represents a CreateCertificateMapRequest. */ + class CreateCertificateMapRequest implements ICreateCertificateMapRequest { + + /** + * Constructs a new CreateCertificateMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest); + + /** CreateCertificateMapRequest parent. */ + public parent: string; + + /** CreateCertificateMapRequest certificateMapId. */ + public certificateMapId: string; + + /** CreateCertificateMapRequest certificateMap. */ + public certificateMap?: (google.cloud.certificatemanager.v1.ICertificateMap|null); + + /** + * Creates a new CreateCertificateMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateMapRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest): google.cloud.certificatemanager.v1.CreateCertificateMapRequest; + + /** + * Encodes the specified CreateCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapRequest.verify|verify} messages. + * @param message CreateCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapRequest.verify|verify} messages. + * @param message CreateCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CreateCertificateMapRequest; + + /** + * Decodes a CreateCertificateMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CreateCertificateMapRequest; + + /** + * Verifies a CreateCertificateMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CreateCertificateMapRequest; + + /** + * Creates a plain object from a CreateCertificateMapRequest message. Also converts values to other types if specified. + * @param message CreateCertificateMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CreateCertificateMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateMapRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateMapRequest. */ + interface IUpdateCertificateMapRequest { + + /** UpdateCertificateMapRequest certificateMap */ + certificateMap?: (google.cloud.certificatemanager.v1.ICertificateMap|null); + + /** UpdateCertificateMapRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCertificateMapRequest. */ + class UpdateCertificateMapRequest implements IUpdateCertificateMapRequest { + + /** + * Constructs a new UpdateCertificateMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest); + + /** UpdateCertificateMapRequest certificateMap. */ + public certificateMap?: (google.cloud.certificatemanager.v1.ICertificateMap|null); + + /** UpdateCertificateMapRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCertificateMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateMapRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest): google.cloud.certificatemanager.v1.UpdateCertificateMapRequest; + + /** + * Encodes the specified UpdateCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.verify|verify} messages. + * @param message UpdateCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.verify|verify} messages. + * @param message UpdateCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.UpdateCertificateMapRequest; + + /** + * Decodes an UpdateCertificateMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.UpdateCertificateMapRequest; + + /** + * Verifies an UpdateCertificateMapRequest message. + * @param message Plain 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 UpdateCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.UpdateCertificateMapRequest; + + /** + * Creates a plain object from an UpdateCertificateMapRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.UpdateCertificateMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateMapRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateMapRequest. */ + interface IDeleteCertificateMapRequest { + + /** DeleteCertificateMapRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCertificateMapRequest. */ + class DeleteCertificateMapRequest implements IDeleteCertificateMapRequest { + + /** + * Constructs a new DeleteCertificateMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest); + + /** DeleteCertificateMapRequest name. */ + public name: string; + + /** + * Creates a new DeleteCertificateMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateMapRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest): google.cloud.certificatemanager.v1.DeleteCertificateMapRequest; + + /** + * Encodes the specified DeleteCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapRequest.verify|verify} messages. + * @param message DeleteCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapRequest.verify|verify} messages. + * @param message DeleteCertificateMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DeleteCertificateMapRequest; + + /** + * Decodes a DeleteCertificateMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DeleteCertificateMapRequest; + + /** + * Verifies a DeleteCertificateMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DeleteCertificateMapRequest; + + /** + * Creates a plain object from a DeleteCertificateMapRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DeleteCertificateMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateMapRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateMapEntriesRequest. */ + interface IListCertificateMapEntriesRequest { + + /** ListCertificateMapEntriesRequest parent */ + parent?: (string|null); + + /** ListCertificateMapEntriesRequest pageSize */ + pageSize?: (number|null); + + /** ListCertificateMapEntriesRequest pageToken */ + pageToken?: (string|null); + + /** ListCertificateMapEntriesRequest filter */ + filter?: (string|null); + + /** ListCertificateMapEntriesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCertificateMapEntriesRequest. */ + class ListCertificateMapEntriesRequest implements IListCertificateMapEntriesRequest { + + /** + * Constructs a new ListCertificateMapEntriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest); + + /** ListCertificateMapEntriesRequest parent. */ + public parent: string; + + /** ListCertificateMapEntriesRequest pageSize. */ + public pageSize: number; + + /** ListCertificateMapEntriesRequest pageToken. */ + public pageToken: string; + + /** ListCertificateMapEntriesRequest filter. */ + public filter: string; + + /** ListCertificateMapEntriesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCertificateMapEntriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateMapEntriesRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest): google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest; + + /** + * Encodes the specified ListCertificateMapEntriesRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest.verify|verify} messages. + * @param message ListCertificateMapEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateMapEntriesRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest.verify|verify} messages. + * @param message ListCertificateMapEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateMapEntriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateMapEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest; + + /** + * Decodes a ListCertificateMapEntriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateMapEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest; + + /** + * Verifies a ListCertificateMapEntriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateMapEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateMapEntriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest; + + /** + * Creates a plain object from a ListCertificateMapEntriesRequest message. Also converts values to other types if specified. + * @param message ListCertificateMapEntriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateMapEntriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateMapEntriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCertificateMapEntriesResponse. */ + interface IListCertificateMapEntriesResponse { + + /** ListCertificateMapEntriesResponse certificateMapEntries */ + certificateMapEntries?: (google.cloud.certificatemanager.v1.ICertificateMapEntry[]|null); + + /** ListCertificateMapEntriesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCertificateMapEntriesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCertificateMapEntriesResponse. */ + class ListCertificateMapEntriesResponse implements IListCertificateMapEntriesResponse { + + /** + * Constructs a new ListCertificateMapEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse); + + /** ListCertificateMapEntriesResponse certificateMapEntries. */ + public certificateMapEntries: google.cloud.certificatemanager.v1.ICertificateMapEntry[]; + + /** ListCertificateMapEntriesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCertificateMapEntriesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCertificateMapEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCertificateMapEntriesResponse instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse): google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse; + + /** + * Encodes the specified ListCertificateMapEntriesResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.verify|verify} messages. + * @param message ListCertificateMapEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCertificateMapEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.verify|verify} messages. + * @param message ListCertificateMapEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCertificateMapEntriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCertificateMapEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse; + + /** + * Decodes a ListCertificateMapEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCertificateMapEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse; + + /** + * Verifies a ListCertificateMapEntriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCertificateMapEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCertificateMapEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse; + + /** + * Creates a plain object from a ListCertificateMapEntriesResponse message. Also converts values to other types if specified. + * @param message ListCertificateMapEntriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCertificateMapEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCertificateMapEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCertificateMapEntryRequest. */ + interface IGetCertificateMapEntryRequest { + + /** GetCertificateMapEntryRequest name */ + name?: (string|null); + } + + /** Represents a GetCertificateMapEntryRequest. */ + class GetCertificateMapEntryRequest implements IGetCertificateMapEntryRequest { + + /** + * Constructs a new GetCertificateMapEntryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest); + + /** GetCertificateMapEntryRequest name. */ + public name: string; + + /** + * Creates a new GetCertificateMapEntryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCertificateMapEntryRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest): google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest; + + /** + * Encodes the specified GetCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest.verify|verify} messages. + * @param message GetCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest.verify|verify} messages. + * @param message GetCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCertificateMapEntryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest; + + /** + * Decodes a GetCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest; + + /** + * Verifies a GetCertificateMapEntryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCertificateMapEntryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest; + + /** + * Creates a plain object from a GetCertificateMapEntryRequest message. Also converts values to other types if specified. + * @param message GetCertificateMapEntryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCertificateMapEntryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCertificateMapEntryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCertificateMapEntryRequest. */ + interface ICreateCertificateMapEntryRequest { + + /** CreateCertificateMapEntryRequest parent */ + parent?: (string|null); + + /** CreateCertificateMapEntryRequest certificateMapEntryId */ + certificateMapEntryId?: (string|null); + + /** CreateCertificateMapEntryRequest certificateMapEntry */ + certificateMapEntry?: (google.cloud.certificatemanager.v1.ICertificateMapEntry|null); + } + + /** Represents a CreateCertificateMapEntryRequest. */ + class CreateCertificateMapEntryRequest implements ICreateCertificateMapEntryRequest { + + /** + * Constructs a new CreateCertificateMapEntryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest); + + /** CreateCertificateMapEntryRequest parent. */ + public parent: string; + + /** CreateCertificateMapEntryRequest certificateMapEntryId. */ + public certificateMapEntryId: string; + + /** CreateCertificateMapEntryRequest certificateMapEntry. */ + public certificateMapEntry?: (google.cloud.certificatemanager.v1.ICertificateMapEntry|null); + + /** + * Creates a new CreateCertificateMapEntryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCertificateMapEntryRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest): google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest; + + /** + * Encodes the specified CreateCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.verify|verify} messages. + * @param message CreateCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.verify|verify} messages. + * @param message CreateCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCertificateMapEntryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest; + + /** + * Decodes a CreateCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest; + + /** + * Verifies a CreateCertificateMapEntryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCertificateMapEntryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest; + + /** + * Creates a plain object from a CreateCertificateMapEntryRequest message. Also converts values to other types if specified. + * @param message CreateCertificateMapEntryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCertificateMapEntryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCertificateMapEntryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCertificateMapEntryRequest. */ + interface IUpdateCertificateMapEntryRequest { + + /** UpdateCertificateMapEntryRequest certificateMapEntry */ + certificateMapEntry?: (google.cloud.certificatemanager.v1.ICertificateMapEntry|null); + + /** UpdateCertificateMapEntryRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCertificateMapEntryRequest. */ + class UpdateCertificateMapEntryRequest implements IUpdateCertificateMapEntryRequest { + + /** + * Constructs a new UpdateCertificateMapEntryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest); + + /** UpdateCertificateMapEntryRequest certificateMapEntry. */ + public certificateMapEntry?: (google.cloud.certificatemanager.v1.ICertificateMapEntry|null); + + /** UpdateCertificateMapEntryRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCertificateMapEntryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCertificateMapEntryRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest): google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest; + + /** + * Encodes the specified UpdateCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.verify|verify} messages. + * @param message UpdateCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.verify|verify} messages. + * @param message UpdateCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCertificateMapEntryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest; + + /** + * Decodes an UpdateCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest; + + /** + * Verifies an UpdateCertificateMapEntryRequest message. + * @param message Plain 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 UpdateCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCertificateMapEntryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest; + + /** + * Creates a plain object from an UpdateCertificateMapEntryRequest message. Also converts values to other types if specified. + * @param message UpdateCertificateMapEntryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCertificateMapEntryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCertificateMapEntryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCertificateMapEntryRequest. */ + interface IDeleteCertificateMapEntryRequest { + + /** DeleteCertificateMapEntryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCertificateMapEntryRequest. */ + class DeleteCertificateMapEntryRequest implements IDeleteCertificateMapEntryRequest { + + /** + * Constructs a new DeleteCertificateMapEntryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest); + + /** DeleteCertificateMapEntryRequest name. */ + public name: string; + + /** + * Creates a new DeleteCertificateMapEntryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCertificateMapEntryRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest): google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest; + + /** + * Encodes the specified DeleteCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest.verify|verify} messages. + * @param message DeleteCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest.verify|verify} messages. + * @param message DeleteCertificateMapEntryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCertificateMapEntryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest; + + /** + * Decodes a DeleteCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest; + + /** + * Verifies a DeleteCertificateMapEntryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCertificateMapEntryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest; + + /** + * Creates a plain object from a DeleteCertificateMapEntryRequest message. Also converts values to other types if specified. + * @param message DeleteCertificateMapEntryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCertificateMapEntryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCertificateMapEntryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDnsAuthorizationsRequest. */ + interface IListDnsAuthorizationsRequest { + + /** ListDnsAuthorizationsRequest parent */ + parent?: (string|null); + + /** ListDnsAuthorizationsRequest pageSize */ + pageSize?: (number|null); + + /** ListDnsAuthorizationsRequest pageToken */ + pageToken?: (string|null); + + /** ListDnsAuthorizationsRequest filter */ + filter?: (string|null); + + /** ListDnsAuthorizationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDnsAuthorizationsRequest. */ + class ListDnsAuthorizationsRequest implements IListDnsAuthorizationsRequest { + + /** + * Constructs a new ListDnsAuthorizationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest); + + /** ListDnsAuthorizationsRequest parent. */ + public parent: string; + + /** ListDnsAuthorizationsRequest pageSize. */ + public pageSize: number; + + /** ListDnsAuthorizationsRequest pageToken. */ + public pageToken: string; + + /** ListDnsAuthorizationsRequest filter. */ + public filter: string; + + /** ListDnsAuthorizationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDnsAuthorizationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsAuthorizationsRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest): google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest; + + /** + * Encodes the specified ListDnsAuthorizationsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest.verify|verify} messages. + * @param message ListDnsAuthorizationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsAuthorizationsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest.verify|verify} messages. + * @param message ListDnsAuthorizationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsAuthorizationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsAuthorizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest; + + /** + * Decodes a ListDnsAuthorizationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsAuthorizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest; + + /** + * Verifies a ListDnsAuthorizationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsAuthorizationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsAuthorizationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest; + + /** + * Creates a plain object from a ListDnsAuthorizationsRequest message. Also converts values to other types if specified. + * @param message ListDnsAuthorizationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsAuthorizationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsAuthorizationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDnsAuthorizationsResponse. */ + interface IListDnsAuthorizationsResponse { + + /** ListDnsAuthorizationsResponse dnsAuthorizations */ + dnsAuthorizations?: (google.cloud.certificatemanager.v1.IDnsAuthorization[]|null); + + /** ListDnsAuthorizationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDnsAuthorizationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDnsAuthorizationsResponse. */ + class ListDnsAuthorizationsResponse implements IListDnsAuthorizationsResponse { + + /** + * Constructs a new ListDnsAuthorizationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse); + + /** ListDnsAuthorizationsResponse dnsAuthorizations. */ + public dnsAuthorizations: google.cloud.certificatemanager.v1.IDnsAuthorization[]; + + /** ListDnsAuthorizationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDnsAuthorizationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDnsAuthorizationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsAuthorizationsResponse instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse): google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse; + + /** + * Encodes the specified ListDnsAuthorizationsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.verify|verify} messages. + * @param message ListDnsAuthorizationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsAuthorizationsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.verify|verify} messages. + * @param message ListDnsAuthorizationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsAuthorizationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsAuthorizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse; + + /** + * Decodes a ListDnsAuthorizationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsAuthorizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse; + + /** + * Verifies a ListDnsAuthorizationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsAuthorizationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsAuthorizationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse; + + /** + * Creates a plain object from a ListDnsAuthorizationsResponse message. Also converts values to other types if specified. + * @param message ListDnsAuthorizationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsAuthorizationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsAuthorizationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDnsAuthorizationRequest. */ + interface IGetDnsAuthorizationRequest { + + /** GetDnsAuthorizationRequest name */ + name?: (string|null); + } + + /** Represents a GetDnsAuthorizationRequest. */ + class GetDnsAuthorizationRequest implements IGetDnsAuthorizationRequest { + + /** + * Constructs a new GetDnsAuthorizationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest); + + /** GetDnsAuthorizationRequest name. */ + public name: string; + + /** + * Creates a new GetDnsAuthorizationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDnsAuthorizationRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest): google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest; + + /** + * Encodes the specified GetDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest.verify|verify} messages. + * @param message GetDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest.verify|verify} messages. + * @param message GetDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDnsAuthorizationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest; + + /** + * Decodes a GetDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest; + + /** + * Verifies a GetDnsAuthorizationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDnsAuthorizationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest; + + /** + * Creates a plain object from a GetDnsAuthorizationRequest message. Also converts values to other types if specified. + * @param message GetDnsAuthorizationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDnsAuthorizationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDnsAuthorizationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDnsAuthorizationRequest. */ + interface ICreateDnsAuthorizationRequest { + + /** CreateDnsAuthorizationRequest parent */ + parent?: (string|null); + + /** CreateDnsAuthorizationRequest dnsAuthorizationId */ + dnsAuthorizationId?: (string|null); + + /** CreateDnsAuthorizationRequest dnsAuthorization */ + dnsAuthorization?: (google.cloud.certificatemanager.v1.IDnsAuthorization|null); + } + + /** Represents a CreateDnsAuthorizationRequest. */ + class CreateDnsAuthorizationRequest implements ICreateDnsAuthorizationRequest { + + /** + * Constructs a new CreateDnsAuthorizationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest); + + /** CreateDnsAuthorizationRequest parent. */ + public parent: string; + + /** CreateDnsAuthorizationRequest dnsAuthorizationId. */ + public dnsAuthorizationId: string; + + /** CreateDnsAuthorizationRequest dnsAuthorization. */ + public dnsAuthorization?: (google.cloud.certificatemanager.v1.IDnsAuthorization|null); + + /** + * Creates a new CreateDnsAuthorizationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDnsAuthorizationRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest): google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest; + + /** + * Encodes the specified CreateDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.verify|verify} messages. + * @param message CreateDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.verify|verify} messages. + * @param message CreateDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDnsAuthorizationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest; + + /** + * Decodes a CreateDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest; + + /** + * Verifies a CreateDnsAuthorizationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDnsAuthorizationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest; + + /** + * Creates a plain object from a CreateDnsAuthorizationRequest message. Also converts values to other types if specified. + * @param message CreateDnsAuthorizationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDnsAuthorizationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDnsAuthorizationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDnsAuthorizationRequest. */ + interface IUpdateDnsAuthorizationRequest { + + /** UpdateDnsAuthorizationRequest dnsAuthorization */ + dnsAuthorization?: (google.cloud.certificatemanager.v1.IDnsAuthorization|null); + + /** UpdateDnsAuthorizationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDnsAuthorizationRequest. */ + class UpdateDnsAuthorizationRequest implements IUpdateDnsAuthorizationRequest { + + /** + * Constructs a new UpdateDnsAuthorizationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest); + + /** UpdateDnsAuthorizationRequest dnsAuthorization. */ + public dnsAuthorization?: (google.cloud.certificatemanager.v1.IDnsAuthorization|null); + + /** UpdateDnsAuthorizationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDnsAuthorizationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDnsAuthorizationRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest): google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest; + + /** + * Encodes the specified UpdateDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.verify|verify} messages. + * @param message UpdateDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.verify|verify} messages. + * @param message UpdateDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDnsAuthorizationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest; + + /** + * Decodes an UpdateDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest; + + /** + * Verifies an UpdateDnsAuthorizationRequest message. + * @param message Plain 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 UpdateDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDnsAuthorizationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest; + + /** + * Creates a plain object from an UpdateDnsAuthorizationRequest message. Also converts values to other types if specified. + * @param message UpdateDnsAuthorizationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDnsAuthorizationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDnsAuthorizationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDnsAuthorizationRequest. */ + interface IDeleteDnsAuthorizationRequest { + + /** DeleteDnsAuthorizationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDnsAuthorizationRequest. */ + class DeleteDnsAuthorizationRequest implements IDeleteDnsAuthorizationRequest { + + /** + * Constructs a new DeleteDnsAuthorizationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest); + + /** DeleteDnsAuthorizationRequest name. */ + public name: string; + + /** + * Creates a new DeleteDnsAuthorizationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDnsAuthorizationRequest instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest): google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest; + + /** + * Encodes the specified DeleteDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest.verify|verify} messages. + * @param message DeleteDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest.verify|verify} messages. + * @param message DeleteDnsAuthorizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDnsAuthorizationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest; + + /** + * Decodes a DeleteDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest; + + /** + * Verifies a DeleteDnsAuthorizationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDnsAuthorizationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest; + + /** + * Creates a plain object from a DeleteDnsAuthorizationRequest message. Also converts values to other types if specified. + * @param message DeleteDnsAuthorizationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDnsAuthorizationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDnsAuthorizationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IOperationMetadata): google.cloud.certificatemanager.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.certificatemanager.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Certificate. */ + interface ICertificate { + + /** Certificate name */ + name?: (string|null); + + /** Certificate description */ + description?: (string|null); + + /** Certificate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels */ + labels?: ({ [k: string]: string }|null); + + /** Certificate selfManaged */ + selfManaged?: (google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate|null); + + /** Certificate managed */ + managed?: (google.cloud.certificatemanager.v1.Certificate.IManagedCertificate|null); + + /** Certificate sanDnsnames */ + sanDnsnames?: (string[]|null); + + /** Certificate pemCertificate */ + pemCertificate?: (string|null); + + /** Certificate expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Certificate scope */ + scope?: (google.cloud.certificatemanager.v1.Certificate.Scope|keyof typeof google.cloud.certificatemanager.v1.Certificate.Scope|null); + } + + /** Represents a Certificate. */ + class Certificate implements ICertificate { + + /** + * Constructs a new Certificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICertificate); + + /** Certificate name. */ + public name: string; + + /** Certificate description. */ + public description: string; + + /** Certificate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Certificate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Certificate labels. */ + public labels: { [k: string]: string }; + + /** Certificate selfManaged. */ + public selfManaged?: (google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate|null); + + /** Certificate managed. */ + public managed?: (google.cloud.certificatemanager.v1.Certificate.IManagedCertificate|null); + + /** Certificate sanDnsnames. */ + public sanDnsnames: string[]; + + /** Certificate pemCertificate. */ + public pemCertificate: string; + + /** Certificate expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Certificate scope. */ + public scope: (google.cloud.certificatemanager.v1.Certificate.Scope|keyof typeof google.cloud.certificatemanager.v1.Certificate.Scope); + + /** Certificate type. */ + public type?: ("selfManaged"|"managed"); + + /** + * Creates a new Certificate instance using the specified properties. + * @param [properties] Properties to set + * @returns Certificate instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICertificate): google.cloud.certificatemanager.v1.Certificate; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.verify|verify} messages. + * @param message Certificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.Certificate; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.Certificate; + + /** + * Verifies a Certificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Certificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Certificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.Certificate; + + /** + * Creates a plain object from a Certificate message. Also converts values to other types if specified. + * @param message Certificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.Certificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Certificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Certificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Certificate { + + /** Properties of a SelfManagedCertificate. */ + interface ISelfManagedCertificate { + + /** SelfManagedCertificate pemCertificate */ + pemCertificate?: (string|null); + + /** SelfManagedCertificate pemPrivateKey */ + pemPrivateKey?: (string|null); + } + + /** Represents a SelfManagedCertificate. */ + class SelfManagedCertificate implements ISelfManagedCertificate { + + /** + * Constructs a new SelfManagedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate); + + /** SelfManagedCertificate pemCertificate. */ + public pemCertificate: string; + + /** SelfManagedCertificate pemPrivateKey. */ + public pemPrivateKey: string; + + /** + * Creates a new SelfManagedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns SelfManagedCertificate instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate): google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate; + + /** + * Encodes the specified SelfManagedCertificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.verify|verify} messages. + * @param message SelfManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelfManagedCertificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.verify|verify} messages. + * @param message SelfManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelfManagedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelfManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate; + + /** + * Decodes a SelfManagedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelfManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate; + + /** + * Verifies a SelfManagedCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelfManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelfManagedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate; + + /** + * Creates a plain object from a SelfManagedCertificate message. Also converts values to other types if specified. + * @param message SelfManagedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelfManagedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelfManagedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagedCertificate. */ + interface IManagedCertificate { + + /** ManagedCertificate domains */ + domains?: (string[]|null); + + /** ManagedCertificate dnsAuthorizations */ + dnsAuthorizations?: (string[]|null); + + /** ManagedCertificate issuanceConfig */ + issuanceConfig?: (string|null); + + /** ManagedCertificate state */ + state?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State|null); + + /** ManagedCertificate provisioningIssue */ + provisioningIssue?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue|null); + + /** ManagedCertificate authorizationAttemptInfo */ + authorizationAttemptInfo?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo[]|null); + } + + /** Represents a ManagedCertificate. */ + class ManagedCertificate implements IManagedCertificate { + + /** + * Constructs a new ManagedCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.Certificate.IManagedCertificate); + + /** ManagedCertificate domains. */ + public domains: string[]; + + /** ManagedCertificate dnsAuthorizations. */ + public dnsAuthorizations: string[]; + + /** ManagedCertificate issuanceConfig. */ + public issuanceConfig: string; + + /** ManagedCertificate state. */ + public state: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State); + + /** ManagedCertificate provisioningIssue. */ + public provisioningIssue?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue|null); + + /** ManagedCertificate authorizationAttemptInfo. */ + public authorizationAttemptInfo: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo[]; + + /** + * Creates a new ManagedCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedCertificate instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.Certificate.IManagedCertificate): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate; + + /** + * Encodes the specified ManagedCertificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.verify|verify} messages. + * @param message ManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.Certificate.IManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedCertificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.verify|verify} messages. + * @param message ManagedCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.Certificate.IManagedCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate; + + /** + * Verifies a ManagedCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate; + + /** + * Creates a plain object from a ManagedCertificate message. Also converts values to other types if specified. + * @param message ManagedCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedCertificate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ManagedCertificate { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROVISIONING = 1, + FAILED = 2, + ACTIVE = 3 + } + + /** Properties of a ProvisioningIssue. */ + interface IProvisioningIssue { + + /** ProvisioningIssue reason */ + reason?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason|null); + + /** ProvisioningIssue details */ + details?: (string|null); + } + + /** Represents a ProvisioningIssue. */ + class ProvisioningIssue implements IProvisioningIssue { + + /** + * Constructs a new ProvisioningIssue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue); + + /** ProvisioningIssue reason. */ + public reason: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason); + + /** ProvisioningIssue details. */ + public details: string; + + /** + * Creates a new ProvisioningIssue instance using the specified properties. + * @param [properties] Properties to set + * @returns ProvisioningIssue instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue; + + /** + * Encodes the specified ProvisioningIssue message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.verify|verify} messages. + * @param message ProvisioningIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProvisioningIssue message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.verify|verify} messages. + * @param message ProvisioningIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProvisioningIssue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProvisioningIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue; + + /** + * Decodes a ProvisioningIssue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProvisioningIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue; + + /** + * Verifies a ProvisioningIssue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProvisioningIssue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProvisioningIssue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue; + + /** + * Creates a plain object from a ProvisioningIssue message. Also converts values to other types if specified. + * @param message ProvisioningIssue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProvisioningIssue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProvisioningIssue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProvisioningIssue { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + AUTHORIZATION_ISSUE = 1, + RATE_LIMITED = 2 + } + } + + /** Properties of an AuthorizationAttemptInfo. */ + interface IAuthorizationAttemptInfo { + + /** AuthorizationAttemptInfo domain */ + domain?: (string|null); + + /** AuthorizationAttemptInfo state */ + state?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State|null); + + /** AuthorizationAttemptInfo failureReason */ + failureReason?: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason|null); + + /** AuthorizationAttemptInfo details */ + details?: (string|null); + } + + /** Represents an AuthorizationAttemptInfo. */ + class AuthorizationAttemptInfo implements IAuthorizationAttemptInfo { + + /** + * Constructs a new AuthorizationAttemptInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo); + + /** AuthorizationAttemptInfo domain. */ + public domain: string; + + /** AuthorizationAttemptInfo state. */ + public state: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State); + + /** AuthorizationAttemptInfo failureReason. */ + public failureReason: (google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason|keyof typeof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason); + + /** AuthorizationAttemptInfo details. */ + public details: string; + + /** + * Creates a new AuthorizationAttemptInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizationAttemptInfo instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo; + + /** + * Encodes the specified AuthorizationAttemptInfo message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.verify|verify} messages. + * @param message AuthorizationAttemptInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizationAttemptInfo message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.verify|verify} messages. + * @param message AuthorizationAttemptInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizationAttemptInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizationAttemptInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo; + + /** + * Decodes an AuthorizationAttemptInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizationAttemptInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo; + + /** + * Verifies an AuthorizationAttemptInfo message. + * @param message Plain 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 AuthorizationAttemptInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizationAttemptInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo; + + /** + * Creates a plain object from an AuthorizationAttemptInfo message. Also converts values to other types if specified. + * @param message AuthorizationAttemptInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizationAttemptInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizationAttemptInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthorizationAttemptInfo { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + AUTHORIZING = 1, + AUTHORIZED = 6, + FAILED = 7 + } + + /** FailureReason enum. */ + enum FailureReason { + FAILURE_REASON_UNSPECIFIED = 0, + CONFIG = 1, + CAA = 2, + RATE_LIMITED = 3 + } + } + } + + /** Scope enum. */ + enum Scope { + DEFAULT = 0, + EDGE_CACHE = 1 + } + } + + /** Properties of a CertificateMap. */ + interface ICertificateMap { + + /** CertificateMap name */ + name?: (string|null); + + /** CertificateMap description */ + description?: (string|null); + + /** CertificateMap createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMap updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMap labels */ + labels?: ({ [k: string]: string }|null); + + /** CertificateMap gclbTargets */ + gclbTargets?: (google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget[]|null); + } + + /** Represents a CertificateMap. */ + class CertificateMap implements ICertificateMap { + + /** + * Constructs a new CertificateMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICertificateMap); + + /** CertificateMap name. */ + public name: string; + + /** CertificateMap description. */ + public description: string; + + /** CertificateMap createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMap updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMap labels. */ + public labels: { [k: string]: string }; + + /** CertificateMap gclbTargets. */ + public gclbTargets: google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget[]; + + /** + * Creates a new CertificateMap instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateMap instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICertificateMap): google.cloud.certificatemanager.v1.CertificateMap; + + /** + * Encodes the specified CertificateMap message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.verify|verify} messages. + * @param message CertificateMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICertificateMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateMap message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.verify|verify} messages. + * @param message CertificateMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICertificateMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateMap; + + /** + * Decodes a CertificateMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateMap; + + /** + * Verifies a CertificateMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateMap; + + /** + * Creates a plain object from a CertificateMap message. Also converts values to other types if specified. + * @param message CertificateMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateMap { + + /** Properties of a GclbTarget. */ + interface IGclbTarget { + + /** GclbTarget targetHttpsProxy */ + targetHttpsProxy?: (string|null); + + /** GclbTarget targetSslProxy */ + targetSslProxy?: (string|null); + + /** GclbTarget ipConfigs */ + ipConfigs?: (google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig[]|null); + } + + /** Represents a GclbTarget. */ + class GclbTarget implements IGclbTarget { + + /** + * Constructs a new GclbTarget. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget); + + /** GclbTarget targetHttpsProxy. */ + public targetHttpsProxy?: (string|null); + + /** GclbTarget targetSslProxy. */ + public targetSslProxy?: (string|null); + + /** GclbTarget ipConfigs. */ + public ipConfigs: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig[]; + + /** GclbTarget targetProxy. */ + public targetProxy?: ("targetHttpsProxy"|"targetSslProxy"); + + /** + * Creates a new GclbTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns GclbTarget instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget; + + /** + * Encodes the specified GclbTarget message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.verify|verify} messages. + * @param message GclbTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GclbTarget message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.verify|verify} messages. + * @param message GclbTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GclbTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GclbTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget; + + /** + * Decodes a GclbTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GclbTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget; + + /** + * Verifies a GclbTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GclbTarget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GclbTarget + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget; + + /** + * Creates a plain object from a GclbTarget message. Also converts values to other types if specified. + * @param message GclbTarget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GclbTarget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GclbTarget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GclbTarget { + + /** Properties of an IpConfig. */ + interface IIpConfig { + + /** IpConfig ipAddress */ + ipAddress?: (string|null); + + /** IpConfig ports */ + ports?: (number[]|null); + } + + /** Represents an IpConfig. */ + class IpConfig implements IIpConfig { + + /** + * Constructs a new IpConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig); + + /** IpConfig ipAddress. */ + public ipAddress: string; + + /** IpConfig ports. */ + public ports: number[]; + + /** + * Creates a new IpConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IpConfig instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig; + + /** + * Encodes the specified IpConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.verify|verify} messages. + * @param message IpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.verify|verify} messages. + * @param message IpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig; + + /** + * Decodes an IpConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig; + + /** + * Verifies an IpConfig message. + * @param message Plain 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 IpConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig; + + /** + * Creates a plain object from an IpConfig message. Also converts values to other types if specified. + * @param message IpConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a CertificateMapEntry. */ + interface ICertificateMapEntry { + + /** CertificateMapEntry name */ + name?: (string|null); + + /** CertificateMapEntry description */ + description?: (string|null); + + /** CertificateMapEntry createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMapEntry updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMapEntry labels */ + labels?: ({ [k: string]: string }|null); + + /** CertificateMapEntry hostname */ + hostname?: (string|null); + + /** CertificateMapEntry matcher */ + matcher?: (google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|keyof typeof google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|null); + + /** CertificateMapEntry certificates */ + certificates?: (string[]|null); + + /** CertificateMapEntry state */ + state?: (google.cloud.certificatemanager.v1.ServingState|keyof typeof google.cloud.certificatemanager.v1.ServingState|null); + } + + /** Represents a CertificateMapEntry. */ + class CertificateMapEntry implements ICertificateMapEntry { + + /** + * Constructs a new CertificateMapEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.ICertificateMapEntry); + + /** CertificateMapEntry name. */ + public name: string; + + /** CertificateMapEntry description. */ + public description: string; + + /** CertificateMapEntry createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMapEntry updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CertificateMapEntry labels. */ + public labels: { [k: string]: string }; + + /** CertificateMapEntry hostname. */ + public hostname?: (string|null); + + /** CertificateMapEntry matcher. */ + public matcher?: (google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|keyof typeof google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|null); + + /** CertificateMapEntry certificates. */ + public certificates: string[]; + + /** CertificateMapEntry state. */ + public state: (google.cloud.certificatemanager.v1.ServingState|keyof typeof google.cloud.certificatemanager.v1.ServingState); + + /** CertificateMapEntry match. */ + public match?: ("hostname"|"matcher"); + + /** + * Creates a new CertificateMapEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateMapEntry instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.ICertificateMapEntry): google.cloud.certificatemanager.v1.CertificateMapEntry; + + /** + * Encodes the specified CertificateMapEntry message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMapEntry.verify|verify} messages. + * @param message CertificateMapEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.ICertificateMapEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateMapEntry message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMapEntry.verify|verify} messages. + * @param message CertificateMapEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.ICertificateMapEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateMapEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateMapEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.CertificateMapEntry; + + /** + * Decodes a CertificateMapEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateMapEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.CertificateMapEntry; + + /** + * Verifies a CertificateMapEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateMapEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateMapEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.CertificateMapEntry; + + /** + * Creates a plain object from a CertificateMapEntry message. Also converts values to other types if specified. + * @param message CertificateMapEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.CertificateMapEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateMapEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateMapEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CertificateMapEntry { + + /** Matcher enum. */ + enum Matcher { + MATCHER_UNSPECIFIED = 0, + PRIMARY = 1 + } + } + + /** Properties of a DnsAuthorization. */ + interface IDnsAuthorization { + + /** DnsAuthorization name */ + name?: (string|null); + + /** DnsAuthorization createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DnsAuthorization updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DnsAuthorization labels */ + labels?: ({ [k: string]: string }|null); + + /** DnsAuthorization description */ + description?: (string|null); + + /** DnsAuthorization domain */ + domain?: (string|null); + + /** DnsAuthorization dnsResourceRecord */ + dnsResourceRecord?: (google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord|null); + } + + /** Represents a DnsAuthorization. */ + class DnsAuthorization implements IDnsAuthorization { + + /** + * Constructs a new DnsAuthorization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.IDnsAuthorization); + + /** DnsAuthorization name. */ + public name: string; + + /** DnsAuthorization createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DnsAuthorization updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DnsAuthorization labels. */ + public labels: { [k: string]: string }; + + /** DnsAuthorization description. */ + public description: string; + + /** DnsAuthorization domain. */ + public domain: string; + + /** DnsAuthorization dnsResourceRecord. */ + public dnsResourceRecord?: (google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord|null); + + /** + * Creates a new DnsAuthorization instance using the specified properties. + * @param [properties] Properties to set + * @returns DnsAuthorization instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.IDnsAuthorization): google.cloud.certificatemanager.v1.DnsAuthorization; + + /** + * Encodes the specified DnsAuthorization message. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.verify|verify} messages. + * @param message DnsAuthorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.IDnsAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DnsAuthorization message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.verify|verify} messages. + * @param message DnsAuthorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.IDnsAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DnsAuthorization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DnsAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DnsAuthorization; + + /** + * Decodes a DnsAuthorization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DnsAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DnsAuthorization; + + /** + * Verifies a DnsAuthorization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DnsAuthorization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DnsAuthorization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DnsAuthorization; + + /** + * Creates a plain object from a DnsAuthorization message. Also converts values to other types if specified. + * @param message DnsAuthorization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DnsAuthorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DnsAuthorization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DnsAuthorization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DnsAuthorization { + + /** Properties of a DnsResourceRecord. */ + interface IDnsResourceRecord { + + /** DnsResourceRecord name */ + name?: (string|null); + + /** DnsResourceRecord type */ + type?: (string|null); + + /** DnsResourceRecord data */ + data?: (string|null); + } + + /** Represents a DnsResourceRecord. */ + class DnsResourceRecord implements IDnsResourceRecord { + + /** + * Constructs a new DnsResourceRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord); + + /** DnsResourceRecord name. */ + public name: string; + + /** DnsResourceRecord type. */ + public type: string; + + /** DnsResourceRecord data. */ + public data: string; + + /** + * Creates a new DnsResourceRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns DnsResourceRecord instance + */ + public static create(properties?: google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord): google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord; + + /** + * Encodes the specified DnsResourceRecord message. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.verify|verify} messages. + * @param message DnsResourceRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DnsResourceRecord message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.verify|verify} messages. + * @param message DnsResourceRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DnsResourceRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DnsResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord; + + /** + * Decodes a DnsResourceRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DnsResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord; + + /** + * Verifies a DnsResourceRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DnsResourceRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DnsResourceRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord; + + /** + * Creates a plain object from a DnsResourceRecord message. Also converts values to other types if specified. + * @param message DnsResourceRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DnsResourceRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DnsResourceRecord + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ServingState enum. */ + enum ServingState { + SERVING_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PENDING = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** 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; + } + + /** 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @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; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-certificatemanager/protos/protos.js b/packages/google-cloud-certificatemanager/protos/protos.js new file mode 100644 index 000000000000..77626e44bf8b --- /dev/null +++ b/packages/google-cloud-certificatemanager/protos/protos.js @@ -0,0 +1,27860 @@ +// Copyright 2022 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_certificate_manager_protos || ($protobuf.roots._google_cloud_certificate_manager_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.certificatemanager = (function() { + + /** + * Namespace certificatemanager. + * @memberof google.cloud + * @namespace + */ + var certificatemanager = {}; + + certificatemanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.certificatemanager + * @namespace + */ + var v1 = {}; + + v1.ListCertificateIssuanceConfigsRequest = (function() { + + /** + * Properties of a ListCertificateIssuanceConfigsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateIssuanceConfigsRequest + * @property {string|null} [parent] ListCertificateIssuanceConfigsRequest parent + * @property {number|null} [pageSize] ListCertificateIssuanceConfigsRequest pageSize + * @property {string|null} [pageToken] ListCertificateIssuanceConfigsRequest pageToken + * @property {string|null} [filter] ListCertificateIssuanceConfigsRequest filter + * @property {string|null} [orderBy] ListCertificateIssuanceConfigsRequest orderBy + */ + + /** + * Constructs a new ListCertificateIssuanceConfigsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateIssuanceConfigsRequest. + * @implements IListCertificateIssuanceConfigsRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest=} [properties] Properties to set + */ + function ListCertificateIssuanceConfigsRequest(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]]; + } + + /** + * ListCertificateIssuanceConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + */ + ListCertificateIssuanceConfigsRequest.prototype.parent = ""; + + /** + * ListCertificateIssuanceConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + */ + ListCertificateIssuanceConfigsRequest.prototype.pageSize = 0; + + /** + * ListCertificateIssuanceConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + */ + ListCertificateIssuanceConfigsRequest.prototype.pageToken = ""; + + /** + * ListCertificateIssuanceConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + */ + ListCertificateIssuanceConfigsRequest.prototype.filter = ""; + + /** + * ListCertificateIssuanceConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + */ + ListCertificateIssuanceConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateIssuanceConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest} ListCertificateIssuanceConfigsRequest instance + */ + ListCertificateIssuanceConfigsRequest.create = function create(properties) { + return new ListCertificateIssuanceConfigsRequest(properties); + }; + + /** + * Encodes the specified ListCertificateIssuanceConfigsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest} message ListCertificateIssuanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateIssuanceConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateIssuanceConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest} message ListCertificateIssuanceConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateIssuanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateIssuanceConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest} ListCertificateIssuanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateIssuanceConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateIssuanceConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest} ListCertificateIssuanceConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateIssuanceConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateIssuanceConfigsRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateIssuanceConfigsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListCertificateIssuanceConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest} ListCertificateIssuanceConfigsRequest + */ + ListCertificateIssuanceConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateIssuanceConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest} message ListCertificateIssuanceConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateIssuanceConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateIssuanceConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateIssuanceConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateIssuanceConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateIssuanceConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest"; + }; + + return ListCertificateIssuanceConfigsRequest; + })(); + + v1.ListCertificateIssuanceConfigsResponse = (function() { + + /** + * Properties of a ListCertificateIssuanceConfigsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateIssuanceConfigsResponse + * @property {Array.|null} [certificateIssuanceConfigs] ListCertificateIssuanceConfigsResponse certificateIssuanceConfigs + * @property {string|null} [nextPageToken] ListCertificateIssuanceConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateIssuanceConfigsResponse unreachable + */ + + /** + * Constructs a new ListCertificateIssuanceConfigsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateIssuanceConfigsResponse. + * @implements IListCertificateIssuanceConfigsResponse + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse=} [properties] Properties to set + */ + function ListCertificateIssuanceConfigsResponse(properties) { + this.certificateIssuanceConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateIssuanceConfigsResponse certificateIssuanceConfigs. + * @member {Array.} certificateIssuanceConfigs + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @instance + */ + ListCertificateIssuanceConfigsResponse.prototype.certificateIssuanceConfigs = $util.emptyArray; + + /** + * ListCertificateIssuanceConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @instance + */ + ListCertificateIssuanceConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateIssuanceConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @instance + */ + ListCertificateIssuanceConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateIssuanceConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} ListCertificateIssuanceConfigsResponse instance + */ + ListCertificateIssuanceConfigsResponse.create = function create(properties) { + return new ListCertificateIssuanceConfigsResponse(properties); + }; + + /** + * Encodes the specified ListCertificateIssuanceConfigsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse} message ListCertificateIssuanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateIssuanceConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateIssuanceConfigs != null && message.certificateIssuanceConfigs.length) + for (var i = 0; i < message.certificateIssuanceConfigs.length; ++i) + $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.encode(message.certificateIssuanceConfigs[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateIssuanceConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse} message ListCertificateIssuanceConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateIssuanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateIssuanceConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} ListCertificateIssuanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateIssuanceConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.certificateIssuanceConfigs && message.certificateIssuanceConfigs.length)) + message.certificateIssuanceConfigs = []; + message.certificateIssuanceConfigs.push($root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateIssuanceConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} ListCertificateIssuanceConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateIssuanceConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateIssuanceConfigsResponse message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateIssuanceConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateIssuanceConfigs != null && message.hasOwnProperty("certificateIssuanceConfigs")) { + if (!Array.isArray(message.certificateIssuanceConfigs)) + return "certificateIssuanceConfigs: array expected"; + for (var i = 0; i < message.certificateIssuanceConfigs.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify(message.certificateIssuanceConfigs[i]); + if (error) + return "certificateIssuanceConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateIssuanceConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} ListCertificateIssuanceConfigsResponse + */ + ListCertificateIssuanceConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse(); + if (object.certificateIssuanceConfigs) { + if (!Array.isArray(object.certificateIssuanceConfigs)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.certificateIssuanceConfigs: array expected"); + message.certificateIssuanceConfigs = []; + for (var i = 0; i < object.certificateIssuanceConfigs.length; ++i) { + if (typeof object.certificateIssuanceConfigs[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.certificateIssuanceConfigs: object expected"); + message.certificateIssuanceConfigs[i] = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.fromObject(object.certificateIssuanceConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateIssuanceConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} message ListCertificateIssuanceConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateIssuanceConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateIssuanceConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateIssuanceConfigs && message.certificateIssuanceConfigs.length) { + object.certificateIssuanceConfigs = []; + for (var j = 0; j < message.certificateIssuanceConfigs.length; ++j) + object.certificateIssuanceConfigs[j] = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.toObject(message.certificateIssuanceConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateIssuanceConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateIssuanceConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateIssuanceConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateIssuanceConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse"; + }; + + return ListCertificateIssuanceConfigsResponse; + })(); + + v1.GetCertificateIssuanceConfigRequest = (function() { + + /** + * Properties of a GetCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IGetCertificateIssuanceConfigRequest + * @property {string|null} [name] GetCertificateIssuanceConfigRequest name + */ + + /** + * Constructs a new GetCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a GetCertificateIssuanceConfigRequest. + * @implements IGetCertificateIssuanceConfigRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest=} [properties] Properties to set + */ + function GetCertificateIssuanceConfigRequest(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]]; + } + + /** + * GetCertificateIssuanceConfigRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @instance + */ + GetCertificateIssuanceConfigRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateIssuanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest} GetCertificateIssuanceConfigRequest instance + */ + GetCertificateIssuanceConfigRequest.create = function create(properties) { + return new GetCertificateIssuanceConfigRequest(properties); + }; + + /** + * Encodes the specified GetCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest} message GetCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateIssuanceConfigRequest.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 GetCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest} message GetCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateIssuanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest} GetCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateIssuanceConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest(); + 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 GetCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest} GetCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateIssuanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateIssuanceConfigRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateIssuanceConfigRequest.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 GetCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest} GetCertificateIssuanceConfigRequest + */ + GetCertificateIssuanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest} message GetCertificateIssuanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateIssuanceConfigRequest.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 GetCertificateIssuanceConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateIssuanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateIssuanceConfigRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateIssuanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest"; + }; + + return GetCertificateIssuanceConfigRequest; + })(); + + v1.CreateCertificateIssuanceConfigRequest = (function() { + + /** + * Properties of a CreateCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICreateCertificateIssuanceConfigRequest + * @property {string|null} [parent] CreateCertificateIssuanceConfigRequest parent + * @property {string|null} [certificateIssuanceConfigId] CreateCertificateIssuanceConfigRequest certificateIssuanceConfigId + * @property {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig|null} [certificateIssuanceConfig] CreateCertificateIssuanceConfigRequest certificateIssuanceConfig + */ + + /** + * Constructs a new CreateCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CreateCertificateIssuanceConfigRequest. + * @implements ICreateCertificateIssuanceConfigRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest=} [properties] Properties to set + */ + function CreateCertificateIssuanceConfigRequest(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]]; + } + + /** + * CreateCertificateIssuanceConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @instance + */ + CreateCertificateIssuanceConfigRequest.prototype.parent = ""; + + /** + * CreateCertificateIssuanceConfigRequest certificateIssuanceConfigId. + * @member {string} certificateIssuanceConfigId + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @instance + */ + CreateCertificateIssuanceConfigRequest.prototype.certificateIssuanceConfigId = ""; + + /** + * CreateCertificateIssuanceConfigRequest certificateIssuanceConfig. + * @member {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig|null|undefined} certificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @instance + */ + CreateCertificateIssuanceConfigRequest.prototype.certificateIssuanceConfig = null; + + /** + * Creates a new CreateCertificateIssuanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest} CreateCertificateIssuanceConfigRequest instance + */ + CreateCertificateIssuanceConfigRequest.create = function create(properties) { + return new CreateCertificateIssuanceConfigRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest} message CreateCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateIssuanceConfigRequest.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.certificateIssuanceConfigId != null && Object.hasOwnProperty.call(message, "certificateIssuanceConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateIssuanceConfigId); + if (message.certificateIssuanceConfig != null && Object.hasOwnProperty.call(message, "certificateIssuanceConfig")) + $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.encode(message.certificateIssuanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest} message CreateCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateIssuanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest} CreateCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateIssuanceConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateIssuanceConfigId = reader.string(); + break; + } + case 3: { + message.certificateIssuanceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest} CreateCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateIssuanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateIssuanceConfigRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateIssuanceConfigRequest.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.certificateIssuanceConfigId != null && message.hasOwnProperty("certificateIssuanceConfigId")) + if (!$util.isString(message.certificateIssuanceConfigId)) + return "certificateIssuanceConfigId: string expected"; + if (message.certificateIssuanceConfig != null && message.hasOwnProperty("certificateIssuanceConfig")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify(message.certificateIssuanceConfig); + if (error) + return "certificateIssuanceConfig." + error; + } + return null; + }; + + /** + * Creates a CreateCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest} CreateCertificateIssuanceConfigRequest + */ + CreateCertificateIssuanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateIssuanceConfigId != null) + message.certificateIssuanceConfigId = String(object.certificateIssuanceConfigId); + if (object.certificateIssuanceConfig != null) { + if (typeof object.certificateIssuanceConfig !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest.certificateIssuanceConfig: object expected"); + message.certificateIssuanceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.fromObject(object.certificateIssuanceConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest} message CreateCertificateIssuanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateIssuanceConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateIssuanceConfigId = ""; + object.certificateIssuanceConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateIssuanceConfigId != null && message.hasOwnProperty("certificateIssuanceConfigId")) + object.certificateIssuanceConfigId = message.certificateIssuanceConfigId; + if (message.certificateIssuanceConfig != null && message.hasOwnProperty("certificateIssuanceConfig")) + object.certificateIssuanceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.toObject(message.certificateIssuanceConfig, options); + return object; + }; + + /** + * Converts this CreateCertificateIssuanceConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateIssuanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateIssuanceConfigRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateIssuanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest"; + }; + + return CreateCertificateIssuanceConfigRequest; + })(); + + v1.DeleteCertificateIssuanceConfigRequest = (function() { + + /** + * Properties of a DeleteCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDeleteCertificateIssuanceConfigRequest + * @property {string|null} [name] DeleteCertificateIssuanceConfigRequest name + */ + + /** + * Constructs a new DeleteCertificateIssuanceConfigRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DeleteCertificateIssuanceConfigRequest. + * @implements IDeleteCertificateIssuanceConfigRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest=} [properties] Properties to set + */ + function DeleteCertificateIssuanceConfigRequest(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]]; + } + + /** + * DeleteCertificateIssuanceConfigRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @instance + */ + DeleteCertificateIssuanceConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteCertificateIssuanceConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest} DeleteCertificateIssuanceConfigRequest instance + */ + DeleteCertificateIssuanceConfigRequest.create = function create(properties) { + return new DeleteCertificateIssuanceConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateIssuanceConfigRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest} message DeleteCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateIssuanceConfigRequest.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 DeleteCertificateIssuanceConfigRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest} message DeleteCertificateIssuanceConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateIssuanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateIssuanceConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest} DeleteCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateIssuanceConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest(); + 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 DeleteCertificateIssuanceConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest} DeleteCertificateIssuanceConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateIssuanceConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateIssuanceConfigRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateIssuanceConfigRequest.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 DeleteCertificateIssuanceConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest} DeleteCertificateIssuanceConfigRequest + */ + DeleteCertificateIssuanceConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateIssuanceConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest} message DeleteCertificateIssuanceConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateIssuanceConfigRequest.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 DeleteCertificateIssuanceConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateIssuanceConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateIssuanceConfigRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateIssuanceConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest"; + }; + + return DeleteCertificateIssuanceConfigRequest; + })(); + + v1.CertificateIssuanceConfig = (function() { + + /** + * Properties of a CertificateIssuanceConfig. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICertificateIssuanceConfig + * @property {string|null} [name] CertificateIssuanceConfig name + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateIssuanceConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateIssuanceConfig updateTime + * @property {Object.|null} [labels] CertificateIssuanceConfig labels + * @property {string|null} [description] CertificateIssuanceConfig description + * @property {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig|null} [certificateAuthorityConfig] CertificateIssuanceConfig certificateAuthorityConfig + * @property {google.protobuf.IDuration|null} [lifetime] CertificateIssuanceConfig lifetime + * @property {number|null} [rotationWindowPercentage] CertificateIssuanceConfig rotationWindowPercentage + * @property {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm|null} [keyAlgorithm] CertificateIssuanceConfig keyAlgorithm + */ + + /** + * Constructs a new CertificateIssuanceConfig. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CertificateIssuanceConfig. + * @implements ICertificateIssuanceConfig + * @constructor + * @param {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig=} [properties] Properties to set + */ + function CertificateIssuanceConfig(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]]; + } + + /** + * CertificateIssuanceConfig name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.name = ""; + + /** + * CertificateIssuanceConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.createTime = null; + + /** + * CertificateIssuanceConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.updateTime = null; + + /** + * CertificateIssuanceConfig labels. + * @member {Object.} labels + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.labels = $util.emptyObject; + + /** + * CertificateIssuanceConfig description. + * @member {string} description + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.description = ""; + + /** + * CertificateIssuanceConfig certificateAuthorityConfig. + * @member {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig|null|undefined} certificateAuthorityConfig + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.certificateAuthorityConfig = null; + + /** + * CertificateIssuanceConfig lifetime. + * @member {google.protobuf.IDuration|null|undefined} lifetime + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.lifetime = null; + + /** + * CertificateIssuanceConfig rotationWindowPercentage. + * @member {number} rotationWindowPercentage + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.rotationWindowPercentage = 0; + + /** + * CertificateIssuanceConfig keyAlgorithm. + * @member {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm} keyAlgorithm + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + */ + CertificateIssuanceConfig.prototype.keyAlgorithm = 0; + + /** + * Creates a new CertificateIssuanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} CertificateIssuanceConfig instance + */ + CertificateIssuanceConfig.create = function create(properties) { + return new CertificateIssuanceConfig(properties); + }; + + /** + * Encodes the specified CertificateIssuanceConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig} message CertificateIssuanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateIssuanceConfig.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.certificateAuthorityConfig != null && Object.hasOwnProperty.call(message, "certificateAuthorityConfig")) + $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.encode(message.certificateAuthorityConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime")) + $root.google.protobuf.Duration.encode(message.lifetime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.rotationWindowPercentage != null && Object.hasOwnProperty.call(message, "rotationWindowPercentage")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.rotationWindowPercentage); + if (message.keyAlgorithm != null && Object.hasOwnProperty.call(message, "keyAlgorithm")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.keyAlgorithm); + return writer; + }; + + /** + * Encodes the specified CertificateIssuanceConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateIssuanceConfig} message CertificateIssuanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateIssuanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateIssuanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} CertificateIssuanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateIssuanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $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; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.certificateAuthorityConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.lifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.rotationWindowPercentage = reader.int32(); + break; + } + case 9: { + message.keyAlgorithm = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateIssuanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} CertificateIssuanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateIssuanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateIssuanceConfig message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateIssuanceConfig.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.certificateAuthorityConfig != null && message.hasOwnProperty("certificateAuthorityConfig")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.verify(message.certificateAuthorityConfig); + if (error) + return "certificateAuthorityConfig." + error; + } + if (message.lifetime != null && message.hasOwnProperty("lifetime")) { + var error = $root.google.protobuf.Duration.verify(message.lifetime); + if (error) + return "lifetime." + error; + } + if (message.rotationWindowPercentage != null && message.hasOwnProperty("rotationWindowPercentage")) + if (!$util.isInteger(message.rotationWindowPercentage)) + return "rotationWindowPercentage: integer expected"; + if (message.keyAlgorithm != null && message.hasOwnProperty("keyAlgorithm")) + switch (message.keyAlgorithm) { + default: + return "keyAlgorithm: enum value expected"; + case 0: + case 1: + case 4: + break; + } + return null; + }; + + /** + * Creates a CertificateIssuanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} CertificateIssuanceConfig + */ + CertificateIssuanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.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.description != null) + message.description = String(object.description); + if (object.certificateAuthorityConfig != null) { + if (typeof object.certificateAuthorityConfig !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.certificateAuthorityConfig: object expected"); + message.certificateAuthorityConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.fromObject(object.certificateAuthorityConfig); + } + if (object.lifetime != null) { + if (typeof object.lifetime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.lifetime: object expected"); + message.lifetime = $root.google.protobuf.Duration.fromObject(object.lifetime); + } + if (object.rotationWindowPercentage != null) + message.rotationWindowPercentage = object.rotationWindowPercentage | 0; + switch (object.keyAlgorithm) { + case "KEY_ALGORITHM_UNSPECIFIED": + case 0: + message.keyAlgorithm = 0; + break; + case "RSA_2048": + case 1: + message.keyAlgorithm = 1; + break; + case "ECDSA_P256": + case 4: + message.keyAlgorithm = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a CertificateIssuanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} message CertificateIssuanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateIssuanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.certificateAuthorityConfig = null; + object.lifetime = null; + object.rotationWindowPercentage = 0; + object.keyAlgorithm = options.enums === String ? "KEY_ALGORITHM_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.certificateAuthorityConfig != null && message.hasOwnProperty("certificateAuthorityConfig")) + object.certificateAuthorityConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.toObject(message.certificateAuthorityConfig, options); + if (message.lifetime != null && message.hasOwnProperty("lifetime")) + object.lifetime = $root.google.protobuf.Duration.toObject(message.lifetime, options); + if (message.rotationWindowPercentage != null && message.hasOwnProperty("rotationWindowPercentage")) + object.rotationWindowPercentage = message.rotationWindowPercentage; + if (message.keyAlgorithm != null && message.hasOwnProperty("keyAlgorithm")) + object.keyAlgorithm = options.enums === String ? $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm[message.keyAlgorithm] : message.keyAlgorithm; + return object; + }; + + /** + * Converts this CertificateIssuanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @instance + * @returns {Object.} JSON object + */ + CertificateIssuanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateIssuanceConfig + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateIssuanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateIssuanceConfig"; + }; + + CertificateIssuanceConfig.CertificateAuthorityConfig = (function() { + + /** + * Properties of a CertificateAuthorityConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @interface ICertificateAuthorityConfig + * @property {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig|null} [certificateAuthorityServiceConfig] CertificateAuthorityConfig certificateAuthorityServiceConfig + */ + + /** + * Constructs a new CertificateAuthorityConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig + * @classdesc Represents a CertificateAuthorityConfig. + * @implements ICertificateAuthorityConfig + * @constructor + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig=} [properties] Properties to set + */ + function CertificateAuthorityConfig(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]]; + } + + /** + * CertificateAuthorityConfig certificateAuthorityServiceConfig. + * @member {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig|null|undefined} certificateAuthorityServiceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @instance + */ + CertificateAuthorityConfig.prototype.certificateAuthorityServiceConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CertificateAuthorityConfig kind. + * @member {"certificateAuthorityServiceConfig"|undefined} kind + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @instance + */ + Object.defineProperty(CertificateAuthorityConfig.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["certificateAuthorityServiceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CertificateAuthorityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig} CertificateAuthorityConfig instance + */ + CertificateAuthorityConfig.create = function create(properties) { + return new CertificateAuthorityConfig(properties); + }; + + /** + * Encodes the specified CertificateAuthorityConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig} message CertificateAuthorityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateAuthorityServiceConfig != null && Object.hasOwnProperty.call(message, "certificateAuthorityServiceConfig")) + $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.encode(message.certificateAuthorityServiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateAuthorityConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.ICertificateAuthorityConfig} message CertificateAuthorityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateAuthorityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig} CertificateAuthorityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.certificateAuthorityServiceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateAuthorityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig} CertificateAuthorityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateAuthorityConfig message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateAuthorityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.certificateAuthorityServiceConfig != null && message.hasOwnProperty("certificateAuthorityServiceConfig")) { + properties.kind = 1; + { + var error = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.verify(message.certificateAuthorityServiceConfig); + if (error) + return "certificateAuthorityServiceConfig." + error; + } + } + return null; + }; + + /** + * Creates a CertificateAuthorityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig} CertificateAuthorityConfig + */ + CertificateAuthorityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig(); + if (object.certificateAuthorityServiceConfig != null) { + if (typeof object.certificateAuthorityServiceConfig !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.certificateAuthorityServiceConfig: object expected"); + message.certificateAuthorityServiceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.fromObject(object.certificateAuthorityServiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a CertificateAuthorityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig} message CertificateAuthorityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateAuthorityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.certificateAuthorityServiceConfig != null && message.hasOwnProperty("certificateAuthorityServiceConfig")) { + object.certificateAuthorityServiceConfig = $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.toObject(message.certificateAuthorityServiceConfig, options); + if (options.oneofs) + object.kind = "certificateAuthorityServiceConfig"; + } + return object; + }; + + /** + * Converts this CertificateAuthorityConfig to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @instance + * @returns {Object.} JSON object + */ + CertificateAuthorityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateAuthorityConfig + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateAuthorityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig"; + }; + + CertificateAuthorityConfig.CertificateAuthorityServiceConfig = (function() { + + /** + * Properties of a CertificateAuthorityServiceConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @interface ICertificateAuthorityServiceConfig + * @property {string|null} [caPool] CertificateAuthorityServiceConfig caPool + */ + + /** + * Constructs a new CertificateAuthorityServiceConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig + * @classdesc Represents a CertificateAuthorityServiceConfig. + * @implements ICertificateAuthorityServiceConfig + * @constructor + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig=} [properties] Properties to set + */ + function CertificateAuthorityServiceConfig(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]]; + } + + /** + * CertificateAuthorityServiceConfig caPool. + * @member {string} caPool + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @instance + */ + CertificateAuthorityServiceConfig.prototype.caPool = ""; + + /** + * Creates a new CertificateAuthorityServiceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig} CertificateAuthorityServiceConfig instance + */ + CertificateAuthorityServiceConfig.create = function create(properties) { + return new CertificateAuthorityServiceConfig(properties); + }; + + /** + * Encodes the specified CertificateAuthorityServiceConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig} message CertificateAuthorityServiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityServiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caPool); + return writer; + }; + + /** + * Encodes the specified CertificateAuthorityServiceConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.ICertificateAuthorityServiceConfig} message CertificateAuthorityServiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateAuthorityServiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateAuthorityServiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig} CertificateAuthorityServiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityServiceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.caPool = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateAuthorityServiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig} CertificateAuthorityServiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateAuthorityServiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateAuthorityServiceConfig message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateAuthorityServiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caPool != null && message.hasOwnProperty("caPool")) + if (!$util.isString(message.caPool)) + return "caPool: string expected"; + return null; + }; + + /** + * Creates a CertificateAuthorityServiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig} CertificateAuthorityServiceConfig + */ + CertificateAuthorityServiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig(); + if (object.caPool != null) + message.caPool = String(object.caPool); + return message; + }; + + /** + * Creates a plain object from a CertificateAuthorityServiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig} message CertificateAuthorityServiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateAuthorityServiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.caPool = ""; + if (message.caPool != null && message.hasOwnProperty("caPool")) + object.caPool = message.caPool; + return object; + }; + + /** + * Converts this CertificateAuthorityServiceConfig to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @instance + * @returns {Object.} JSON object + */ + CertificateAuthorityServiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateAuthorityServiceConfig + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateAuthorityServiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateIssuanceConfig.CertificateAuthorityConfig.CertificateAuthorityServiceConfig"; + }; + + return CertificateAuthorityServiceConfig; + })(); + + return CertificateAuthorityConfig; + })(); + + /** + * KeyAlgorithm enum. + * @name google.cloud.certificatemanager.v1.CertificateIssuanceConfig.KeyAlgorithm + * @enum {number} + * @property {number} KEY_ALGORITHM_UNSPECIFIED=0 KEY_ALGORITHM_UNSPECIFIED value + * @property {number} RSA_2048=1 RSA_2048 value + * @property {number} ECDSA_P256=4 ECDSA_P256 value + */ + CertificateIssuanceConfig.KeyAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_ALGORITHM_UNSPECIFIED"] = 0; + values[valuesById[1] = "RSA_2048"] = 1; + values[valuesById[4] = "ECDSA_P256"] = 4; + return values; + })(); + + return CertificateIssuanceConfig; + })(); + + v1.CertificateManager = (function() { + + /** + * Constructs a new CertificateManager service. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CertificateManager + * @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 CertificateManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CertificateManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CertificateManager; + + /** + * Creates new CertificateManager service using the specified rpc implementation. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @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 {CertificateManager} RPC service. Useful where requests and/or responses are streamed. + */ + CertificateManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificates}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef ListCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.ListCertificatesResponse} [response] ListCertificatesResponse + */ + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.ListCertificatesCallback} callback Node-style callback called with the error, if any, and ListCertificatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.listCertificates = function listCertificates(request, callback) { + return this.rpcCall(listCertificates, $root.google.cloud.certificatemanager.v1.ListCertificatesRequest, $root.google.cloud.certificatemanager.v1.ListCertificatesResponse, request, callback); + }, "name", { value: "ListCertificates" }); + + /** + * Calls ListCertificates. + * @function listCertificates + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest} request ListCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificate}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef GetCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.Certificate} [response] Certificate + */ + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.GetCertificateCallback} callback Node-style callback called with the error, if any, and Certificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.getCertificate = function getCertificate(request, callback) { + return this.rpcCall(getCertificate, $root.google.cloud.certificatemanager.v1.GetCertificateRequest, $root.google.cloud.certificatemanager.v1.Certificate, request, callback); + }, "name", { value: "GetCertificate" }); + + /** + * Calls GetCertificate. + * @function getCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest} request GetCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificate}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef CreateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.createCertificate = function createCertificate(request, callback) { + return this.rpcCall(createCertificate, $root.google.cloud.certificatemanager.v1.CreateCertificateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificate" }); + + /** + * Calls CreateCertificate. + * @function createCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest} request CreateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificate}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef UpdateCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.updateCertificate = function updateCertificate(request, callback) { + return this.rpcCall(updateCertificate, $root.google.cloud.certificatemanager.v1.UpdateCertificateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificate" }); + + /** + * Calls UpdateCertificate. + * @function updateCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest} request UpdateCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificate}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef DeleteCertificateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificate. + * @function deleteCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest} request DeleteCertificateRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.deleteCertificate = function deleteCertificate(request, callback) { + return this.rpcCall(deleteCertificate, $root.google.cloud.certificatemanager.v1.DeleteCertificateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificate" }); + + /** + * Calls DeleteCertificate. + * @function deleteCertificate + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest} request DeleteCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateMaps}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef ListCertificateMapsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} [response] ListCertificateMapsResponse + */ + + /** + * Calls ListCertificateMaps. + * @function listCertificateMaps + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest} request ListCertificateMapsRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapsCallback} callback Node-style callback called with the error, if any, and ListCertificateMapsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.listCertificateMaps = function listCertificateMaps(request, callback) { + return this.rpcCall(listCertificateMaps, $root.google.cloud.certificatemanager.v1.ListCertificateMapsRequest, $root.google.cloud.certificatemanager.v1.ListCertificateMapsResponse, request, callback); + }, "name", { value: "ListCertificateMaps" }); + + /** + * Calls ListCertificateMaps. + * @function listCertificateMaps + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest} request ListCertificateMapsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateMap}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef GetCertificateMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.CertificateMap} [response] CertificateMap + */ + + /** + * Calls GetCertificateMap. + * @function getCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest} request GetCertificateMapRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapCallback} callback Node-style callback called with the error, if any, and CertificateMap + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.getCertificateMap = function getCertificateMap(request, callback) { + return this.rpcCall(getCertificateMap, $root.google.cloud.certificatemanager.v1.GetCertificateMapRequest, $root.google.cloud.certificatemanager.v1.CertificateMap, request, callback); + }, "name", { value: "GetCertificateMap" }); + + /** + * Calls GetCertificateMap. + * @function getCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest} request GetCertificateMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateMap}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef CreateCertificateMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateMap. + * @function createCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest} request CreateCertificateMapRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.createCertificateMap = function createCertificateMap(request, callback) { + return this.rpcCall(createCertificateMap, $root.google.cloud.certificatemanager.v1.CreateCertificateMapRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateMap" }); + + /** + * Calls CreateCertificateMap. + * @function createCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest} request CreateCertificateMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificateMap}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef UpdateCertificateMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateMap. + * @function updateCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest} request UpdateCertificateMapRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.updateCertificateMap = function updateCertificateMap(request, callback) { + return this.rpcCall(updateCertificateMap, $root.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateMap" }); + + /** + * Calls UpdateCertificateMap. + * @function updateCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest} request UpdateCertificateMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateMap}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef DeleteCertificateMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificateMap. + * @function deleteCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest} request DeleteCertificateMapRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.deleteCertificateMap = function deleteCertificateMap(request, callback) { + return this.rpcCall(deleteCertificateMap, $root.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificateMap" }); + + /** + * Calls DeleteCertificateMap. + * @function deleteCertificateMap + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest} request DeleteCertificateMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateMapEntries}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef ListCertificateMapEntriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} [response] ListCertificateMapEntriesResponse + */ + + /** + * Calls ListCertificateMapEntries. + * @function listCertificateMapEntries + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest} request ListCertificateMapEntriesRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapEntriesCallback} callback Node-style callback called with the error, if any, and ListCertificateMapEntriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.listCertificateMapEntries = function listCertificateMapEntries(request, callback) { + return this.rpcCall(listCertificateMapEntries, $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest, $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse, request, callback); + }, "name", { value: "ListCertificateMapEntries" }); + + /** + * Calls ListCertificateMapEntries. + * @function listCertificateMapEntries + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest} request ListCertificateMapEntriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateMapEntry}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef GetCertificateMapEntryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.CertificateMapEntry} [response] CertificateMapEntry + */ + + /** + * Calls GetCertificateMapEntry. + * @function getCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest} request GetCertificateMapEntryRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapEntryCallback} callback Node-style callback called with the error, if any, and CertificateMapEntry + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.getCertificateMapEntry = function getCertificateMapEntry(request, callback) { + return this.rpcCall(getCertificateMapEntry, $root.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest, $root.google.cloud.certificatemanager.v1.CertificateMapEntry, request, callback); + }, "name", { value: "GetCertificateMapEntry" }); + + /** + * Calls GetCertificateMapEntry. + * @function getCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest} request GetCertificateMapEntryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateMapEntry}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef CreateCertificateMapEntryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateMapEntry. + * @function createCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest} request CreateCertificateMapEntryRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapEntryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.createCertificateMapEntry = function createCertificateMapEntry(request, callback) { + return this.rpcCall(createCertificateMapEntry, $root.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateMapEntry" }); + + /** + * Calls CreateCertificateMapEntry. + * @function createCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest} request CreateCertificateMapEntryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateCertificateMapEntry}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef UpdateCertificateMapEntryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCertificateMapEntry. + * @function updateCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest} request UpdateCertificateMapEntryRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapEntryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.updateCertificateMapEntry = function updateCertificateMapEntry(request, callback) { + return this.rpcCall(updateCertificateMapEntry, $root.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCertificateMapEntry" }); + + /** + * Calls UpdateCertificateMapEntry. + * @function updateCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest} request UpdateCertificateMapEntryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateMapEntry}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef DeleteCertificateMapEntryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificateMapEntry. + * @function deleteCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest} request DeleteCertificateMapEntryRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapEntryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.deleteCertificateMapEntry = function deleteCertificateMapEntry(request, callback) { + return this.rpcCall(deleteCertificateMapEntry, $root.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificateMapEntry" }); + + /** + * Calls DeleteCertificateMapEntry. + * @function deleteCertificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest} request DeleteCertificateMapEntryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listDnsAuthorizations}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef ListDnsAuthorizationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} [response] ListDnsAuthorizationsResponse + */ + + /** + * Calls ListDnsAuthorizations. + * @function listDnsAuthorizations + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest} request ListDnsAuthorizationsRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.ListDnsAuthorizationsCallback} callback Node-style callback called with the error, if any, and ListDnsAuthorizationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.listDnsAuthorizations = function listDnsAuthorizations(request, callback) { + return this.rpcCall(listDnsAuthorizations, $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest, $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse, request, callback); + }, "name", { value: "ListDnsAuthorizations" }); + + /** + * Calls ListDnsAuthorizations. + * @function listDnsAuthorizations + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest} request ListDnsAuthorizationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getDnsAuthorization}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef GetDnsAuthorizationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.DnsAuthorization} [response] DnsAuthorization + */ + + /** + * Calls GetDnsAuthorization. + * @function getDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest} request GetDnsAuthorizationRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.GetDnsAuthorizationCallback} callback Node-style callback called with the error, if any, and DnsAuthorization + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.getDnsAuthorization = function getDnsAuthorization(request, callback) { + return this.rpcCall(getDnsAuthorization, $root.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest, $root.google.cloud.certificatemanager.v1.DnsAuthorization, request, callback); + }, "name", { value: "GetDnsAuthorization" }); + + /** + * Calls GetDnsAuthorization. + * @function getDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest} request GetDnsAuthorizationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createDnsAuthorization}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef CreateDnsAuthorizationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDnsAuthorization. + * @function createDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest} request CreateDnsAuthorizationRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.CreateDnsAuthorizationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.createDnsAuthorization = function createDnsAuthorization(request, callback) { + return this.rpcCall(createDnsAuthorization, $root.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDnsAuthorization" }); + + /** + * Calls CreateDnsAuthorization. + * @function createDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest} request CreateDnsAuthorizationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|updateDnsAuthorization}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef UpdateDnsAuthorizationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDnsAuthorization. + * @function updateDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest} request UpdateDnsAuthorizationRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.UpdateDnsAuthorizationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.updateDnsAuthorization = function updateDnsAuthorization(request, callback) { + return this.rpcCall(updateDnsAuthorization, $root.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDnsAuthorization" }); + + /** + * Calls UpdateDnsAuthorization. + * @function updateDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest} request UpdateDnsAuthorizationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteDnsAuthorization}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef DeleteDnsAuthorizationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDnsAuthorization. + * @function deleteDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest} request DeleteDnsAuthorizationRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.DeleteDnsAuthorizationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.deleteDnsAuthorization = function deleteDnsAuthorization(request, callback) { + return this.rpcCall(deleteDnsAuthorization, $root.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDnsAuthorization" }); + + /** + * Calls DeleteDnsAuthorization. + * @function deleteDnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest} request DeleteDnsAuthorizationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|listCertificateIssuanceConfigs}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef ListCertificateIssuanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse} [response] ListCertificateIssuanceConfigsResponse + */ + + /** + * Calls ListCertificateIssuanceConfigs. + * @function listCertificateIssuanceConfigs + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest} request ListCertificateIssuanceConfigsRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.ListCertificateIssuanceConfigsCallback} callback Node-style callback called with the error, if any, and ListCertificateIssuanceConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.listCertificateIssuanceConfigs = function listCertificateIssuanceConfigs(request, callback) { + return this.rpcCall(listCertificateIssuanceConfigs, $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest, $root.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse, request, callback); + }, "name", { value: "ListCertificateIssuanceConfigs" }); + + /** + * Calls ListCertificateIssuanceConfigs. + * @function listCertificateIssuanceConfigs + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest} request ListCertificateIssuanceConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|getCertificateIssuanceConfig}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef GetCertificateIssuanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} [response] CertificateIssuanceConfig + */ + + /** + * Calls GetCertificateIssuanceConfig. + * @function getCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest} request GetCertificateIssuanceConfigRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.GetCertificateIssuanceConfigCallback} callback Node-style callback called with the error, if any, and CertificateIssuanceConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.getCertificateIssuanceConfig = function getCertificateIssuanceConfig(request, callback) { + return this.rpcCall(getCertificateIssuanceConfig, $root.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest, $root.google.cloud.certificatemanager.v1.CertificateIssuanceConfig, request, callback); + }, "name", { value: "GetCertificateIssuanceConfig" }); + + /** + * Calls GetCertificateIssuanceConfig. + * @function getCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest} request GetCertificateIssuanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|createCertificateIssuanceConfig}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef CreateCertificateIssuanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCertificateIssuanceConfig. + * @function createCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest} request CreateCertificateIssuanceConfigRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateIssuanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.createCertificateIssuanceConfig = function createCertificateIssuanceConfig(request, callback) { + return this.rpcCall(createCertificateIssuanceConfig, $root.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCertificateIssuanceConfig" }); + + /** + * Calls CreateCertificateIssuanceConfig. + * @function createCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest} request CreateCertificateIssuanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.certificatemanager.v1.CertificateManager|deleteCertificateIssuanceConfig}. + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @typedef DeleteCertificateIssuanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCertificateIssuanceConfig. + * @function deleteCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest} request DeleteCertificateIssuanceConfigRequest message or plain object + * @param {google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateIssuanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CertificateManager.prototype.deleteCertificateIssuanceConfig = function deleteCertificateIssuanceConfig(request, callback) { + return this.rpcCall(deleteCertificateIssuanceConfig, $root.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCertificateIssuanceConfig" }); + + /** + * Calls DeleteCertificateIssuanceConfig. + * @function deleteCertificateIssuanceConfig + * @memberof google.cloud.certificatemanager.v1.CertificateManager + * @instance + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest} request DeleteCertificateIssuanceConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CertificateManager; + })(); + + v1.ListCertificatesRequest = (function() { + + /** + * Properties of a ListCertificatesRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificatesRequest + * @property {string|null} [parent] ListCertificatesRequest parent + * @property {number|null} [pageSize] ListCertificatesRequest pageSize + * @property {string|null} [pageToken] ListCertificatesRequest pageToken + * @property {string|null} [filter] ListCertificatesRequest filter + * @property {string|null} [orderBy] ListCertificatesRequest orderBy + */ + + /** + * Constructs a new ListCertificatesRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificatesRequest. + * @implements IListCertificatesRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest=} [properties] Properties to set + */ + function ListCertificatesRequest(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]]; + } + + /** + * ListCertificatesRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.parent = ""; + + /** + * ListCertificatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageSize = 0; + + /** + * ListCertificatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.pageToken = ""; + + /** + * ListCertificatesRequest filter. + * @member {string} filter + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.filter = ""; + + /** + * ListCertificatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + */ + ListCertificatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificatesRequest} ListCertificatesRequest instance + */ + ListCertificatesRequest.create = function create(properties) { + return new ListCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListCertificatesRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesRequest} message ListCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificatesRequest} ListCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificatesRequest} ListCertificatesRequest + */ + ListCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificatesRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificatesRequest} message ListCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificatesRequest"; + }; + + return ListCertificatesRequest; + })(); + + v1.ListCertificatesResponse = (function() { + + /** + * Properties of a ListCertificatesResponse. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificatesResponse + * @property {Array.|null} [certificates] ListCertificatesResponse certificates + * @property {string|null} [nextPageToken] ListCertificatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificatesResponse unreachable + */ + + /** + * Constructs a new ListCertificatesResponse. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificatesResponse. + * @implements IListCertificatesResponse + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificatesResponse=} [properties] Properties to set + */ + function ListCertificatesResponse(properties) { + this.certificates = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificatesResponse certificates. + * @member {Array.} certificates + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.certificates = $util.emptyArray; + + /** + * ListCertificatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @instance + */ + ListCertificatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesResponse=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificatesResponse} ListCertificatesResponse instance + */ + ListCertificatesResponse.create = function create(properties) { + return new ListCertificatesResponse(properties); + }; + + /** + * Encodes the specified ListCertificatesResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + $root.google.cloud.certificatemanager.v1.Certificate.encode(message.certificates[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificatesResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificatesResponse} message ListCertificatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push($root.google.cloud.certificatemanager.v1.Certificate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificatesResponse} ListCertificatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificatesResponse message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.Certificate.verify(message.certificates[i]); + if (error) + return "certificates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificatesResponse} ListCertificatesResponse + */ + ListCertificatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificatesResponse) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificatesResponse(); + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificatesResponse.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) { + if (typeof object.certificates[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificatesResponse.certificates: object expected"); + message.certificates[i] = $root.google.cloud.certificatemanager.v1.Certificate.fromObject(object.certificates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificatesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificatesResponse} message ListCertificatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = $root.google.cloud.certificatemanager.v1.Certificate.toObject(message.certificates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificatesResponse + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificatesResponse"; + }; + + return ListCertificatesResponse; + })(); + + v1.GetCertificateRequest = (function() { + + /** + * Properties of a GetCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IGetCertificateRequest + * @property {string|null} [name] GetCertificateRequest name + */ + + /** + * Constructs a new GetCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a GetCertificateRequest. + * @implements IGetCertificateRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest=} [properties] Properties to set + */ + function GetCertificateRequest(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]]; + } + + /** + * GetCertificateRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @instance + */ + GetCertificateRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.GetCertificateRequest} GetCertificateRequest instance + */ + GetCertificateRequest.create = function create(properties) { + return new GetCertificateRequest(properties); + }; + + /** + * Encodes the specified GetCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.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 GetCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateRequest} message GetCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.GetCertificateRequest(); + 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 GetCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.GetCertificateRequest} GetCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateRequest.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 GetCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.GetCertificateRequest} GetCertificateRequest + */ + GetCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.GetCertificateRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.GetCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.GetCertificateRequest} message GetCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateRequest.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 GetCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.GetCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.GetCertificateRequest"; + }; + + return GetCertificateRequest; + })(); + + v1.CreateCertificateRequest = (function() { + + /** + * Properties of a CreateCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICreateCertificateRequest + * @property {string|null} [parent] CreateCertificateRequest parent + * @property {string|null} [certificateId] CreateCertificateRequest certificateId + * @property {google.cloud.certificatemanager.v1.ICertificate|null} [certificate] CreateCertificateRequest certificate + */ + + /** + * Constructs a new CreateCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CreateCertificateRequest. + * @implements ICreateCertificateRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest=} [properties] Properties to set + */ + function CreateCertificateRequest(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]]; + } + + /** + * CreateCertificateRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.parent = ""; + + /** + * CreateCertificateRequest certificateId. + * @member {string} certificateId + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificateId = ""; + + /** + * CreateCertificateRequest certificate. + * @member {google.cloud.certificatemanager.v1.ICertificate|null|undefined} certificate + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @instance + */ + CreateCertificateRequest.prototype.certificate = null; + + /** + * Creates a new CreateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CreateCertificateRequest} CreateCertificateRequest instance + */ + CreateCertificateRequest.create = function create(properties) { + return new CreateCertificateRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.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.certificateId != null && Object.hasOwnProperty.call(message, "certificateId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateId); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.certificatemanager.v1.Certificate.encode(message.certificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateRequest} message CreateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CreateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateId = reader.string(); + break; + } + case 3: { + message.certificate = $root.google.cloud.certificatemanager.v1.Certificate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CreateCertificateRequest} CreateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateRequest.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.certificateId != null && message.hasOwnProperty("certificateId")) + if (!$util.isString(message.certificateId)) + return "certificateId: string expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.certificatemanager.v1.Certificate.verify(message.certificate); + if (error) + return "certificate." + error; + } + return null; + }; + + /** + * Creates a CreateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CreateCertificateRequest} CreateCertificateRequest + */ + CreateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CreateCertificateRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CreateCertificateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateId != null) + message.certificateId = String(object.certificateId); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CreateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.certificatemanager.v1.Certificate.fromObject(object.certificate); + } + return message; + }; + + /** + * Creates a plain object from a CreateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.CreateCertificateRequest} message CreateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateId = ""; + object.certificate = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateId != null && message.hasOwnProperty("certificateId")) + object.certificateId = message.certificateId; + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.certificatemanager.v1.Certificate.toObject(message.certificate, options); + return object; + }; + + /** + * Converts this CreateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CreateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CreateCertificateRequest"; + }; + + return CreateCertificateRequest; + })(); + + v1.UpdateCertificateRequest = (function() { + + /** + * Properties of an UpdateCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IUpdateCertificateRequest + * @property {google.cloud.certificatemanager.v1.ICertificate|null} [certificate] UpdateCertificateRequest certificate + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateRequest updateMask + */ + + /** + * Constructs a new UpdateCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents an UpdateCertificateRequest. + * @implements IUpdateCertificateRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest=} [properties] Properties to set + */ + function UpdateCertificateRequest(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]]; + } + + /** + * UpdateCertificateRequest certificate. + * @member {google.cloud.certificatemanager.v1.ICertificate|null|undefined} certificate + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.certificate = null; + + /** + * UpdateCertificateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @instance + */ + UpdateCertificateRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateRequest} UpdateCertificateRequest instance + */ + UpdateCertificateRequest.create = function create(properties) { + return new UpdateCertificateRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + $root.google.cloud.certificatemanager.v1.Certificate.encode(message.certificate, 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 UpdateCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateRequest} message UpdateCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.certificate = $root.google.cloud.certificatemanager.v1.Certificate.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 UpdateCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateRequest} UpdateCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + var error = $root.google.cloud.certificatemanager.v1.Certificate.verify(message.certificate); + if (error) + return "certificate." + 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 UpdateCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateRequest} UpdateCertificateRequest + */ + UpdateCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.UpdateCertificateRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateRequest(); + if (object.certificate != null) { + if (typeof object.certificate !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateRequest.certificate: object expected"); + message.certificate = $root.google.cloud.certificatemanager.v1.Certificate.fromObject(object.certificate); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.UpdateCertificateRequest} message UpdateCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificate = null; + object.updateMask = null; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) + object.certificate = $root.google.cloud.certificatemanager.v1.Certificate.toObject(message.certificate, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.UpdateCertificateRequest"; + }; + + return UpdateCertificateRequest; + })(); + + v1.DeleteCertificateRequest = (function() { + + /** + * Properties of a DeleteCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDeleteCertificateRequest + * @property {string|null} [name] DeleteCertificateRequest name + */ + + /** + * Constructs a new DeleteCertificateRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DeleteCertificateRequest. + * @implements IDeleteCertificateRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest=} [properties] Properties to set + */ + function DeleteCertificateRequest(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]]; + } + + /** + * DeleteCertificateRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @instance + */ + DeleteCertificateRequest.prototype.name = ""; + + /** + * Creates a new DeleteCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateRequest} DeleteCertificateRequest instance + */ + DeleteCertificateRequest.create = function create(properties) { + return new DeleteCertificateRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest} message DeleteCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateRequest.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 DeleteCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateRequest} message DeleteCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateRequest} DeleteCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateRequest(); + 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 DeleteCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateRequest} DeleteCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateRequest.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 DeleteCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateRequest} DeleteCertificateRequest + */ + DeleteCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DeleteCertificateRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {google.cloud.certificatemanager.v1.DeleteCertificateRequest} message DeleteCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateRequest.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 DeleteCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DeleteCertificateRequest"; + }; + + return DeleteCertificateRequest; + })(); + + v1.ListCertificateMapsRequest = (function() { + + /** + * Properties of a ListCertificateMapsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateMapsRequest + * @property {string|null} [parent] ListCertificateMapsRequest parent + * @property {number|null} [pageSize] ListCertificateMapsRequest pageSize + * @property {string|null} [pageToken] ListCertificateMapsRequest pageToken + * @property {string|null} [filter] ListCertificateMapsRequest filter + * @property {string|null} [orderBy] ListCertificateMapsRequest orderBy + */ + + /** + * Constructs a new ListCertificateMapsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateMapsRequest. + * @implements IListCertificateMapsRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest=} [properties] Properties to set + */ + function ListCertificateMapsRequest(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]]; + } + + /** + * ListCertificateMapsRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + */ + ListCertificateMapsRequest.prototype.parent = ""; + + /** + * ListCertificateMapsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + */ + ListCertificateMapsRequest.prototype.pageSize = 0; + + /** + * ListCertificateMapsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + */ + ListCertificateMapsRequest.prototype.pageToken = ""; + + /** + * ListCertificateMapsRequest filter. + * @member {string} filter + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + */ + ListCertificateMapsRequest.prototype.filter = ""; + + /** + * ListCertificateMapsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + */ + ListCertificateMapsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateMapsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsRequest} ListCertificateMapsRequest instance + */ + ListCertificateMapsRequest.create = function create(properties) { + return new ListCertificateMapsRequest(properties); + }; + + /** + * Encodes the specified ListCertificateMapsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest} message ListCertificateMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateMapsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsRequest} message ListCertificateMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateMapsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsRequest} ListCertificateMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateMapsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsRequest} ListCertificateMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateMapsRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateMapsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListCertificateMapsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsRequest} ListCertificateMapsRequest + */ + ListCertificateMapsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateMapsRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateMapsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateMapsRequest} message ListCertificateMapsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateMapsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateMapsRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateMapsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateMapsRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateMapsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateMapsRequest"; + }; + + return ListCertificateMapsRequest; + })(); + + v1.ListCertificateMapsResponse = (function() { + + /** + * Properties of a ListCertificateMapsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateMapsResponse + * @property {Array.|null} [certificateMaps] ListCertificateMapsResponse certificateMaps + * @property {string|null} [nextPageToken] ListCertificateMapsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateMapsResponse unreachable + */ + + /** + * Constructs a new ListCertificateMapsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateMapsResponse. + * @implements IListCertificateMapsResponse + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsResponse=} [properties] Properties to set + */ + function ListCertificateMapsResponse(properties) { + this.certificateMaps = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateMapsResponse certificateMaps. + * @member {Array.} certificateMaps + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @instance + */ + ListCertificateMapsResponse.prototype.certificateMaps = $util.emptyArray; + + /** + * ListCertificateMapsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @instance + */ + ListCertificateMapsResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateMapsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @instance + */ + ListCertificateMapsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateMapsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsResponse=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} ListCertificateMapsResponse instance + */ + ListCertificateMapsResponse.create = function create(properties) { + return new ListCertificateMapsResponse(properties); + }; + + /** + * Encodes the specified ListCertificateMapsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsResponse} message ListCertificateMapsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateMaps != null && message.certificateMaps.length) + for (var i = 0; i < message.certificateMaps.length; ++i) + $root.google.cloud.certificatemanager.v1.CertificateMap.encode(message.certificateMaps[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateMapsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapsResponse} message ListCertificateMapsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateMapsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} ListCertificateMapsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.certificateMaps && message.certificateMaps.length)) + message.certificateMaps = []; + message.certificateMaps.push($root.google.cloud.certificatemanager.v1.CertificateMap.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateMapsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} ListCertificateMapsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateMapsResponse message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateMapsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateMaps != null && message.hasOwnProperty("certificateMaps")) { + if (!Array.isArray(message.certificateMaps)) + return "certificateMaps: array expected"; + for (var i = 0; i < message.certificateMaps.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMap.verify(message.certificateMaps[i]); + if (error) + return "certificateMaps." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateMapsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} ListCertificateMapsResponse + */ + ListCertificateMapsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateMapsResponse) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapsResponse(); + if (object.certificateMaps) { + if (!Array.isArray(object.certificateMaps)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapsResponse.certificateMaps: array expected"); + message.certificateMaps = []; + for (var i = 0; i < object.certificateMaps.length; ++i) { + if (typeof object.certificateMaps[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapsResponse.certificateMaps: object expected"); + message.certificateMaps[i] = $root.google.cloud.certificatemanager.v1.CertificateMap.fromObject(object.certificateMaps[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateMapsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateMapsResponse} message ListCertificateMapsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateMapsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateMaps = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateMaps && message.certificateMaps.length) { + object.certificateMaps = []; + for (var j = 0; j < message.certificateMaps.length; ++j) + object.certificateMaps[j] = $root.google.cloud.certificatemanager.v1.CertificateMap.toObject(message.certificateMaps[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateMapsResponse to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateMapsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateMapsResponse + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateMapsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateMapsResponse"; + }; + + return ListCertificateMapsResponse; + })(); + + v1.GetCertificateMapRequest = (function() { + + /** + * Properties of a GetCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IGetCertificateMapRequest + * @property {string|null} [name] GetCertificateMapRequest name + */ + + /** + * Constructs a new GetCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a GetCertificateMapRequest. + * @implements IGetCertificateMapRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest=} [properties] Properties to set + */ + function GetCertificateMapRequest(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]]; + } + + /** + * GetCertificateMapRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @instance + */ + GetCertificateMapRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapRequest} GetCertificateMapRequest instance + */ + GetCertificateMapRequest.create = function create(properties) { + return new GetCertificateMapRequest(properties); + }; + + /** + * Encodes the specified GetCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest} message GetCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateMapRequest.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 GetCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapRequest} message GetCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapRequest} GetCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.GetCertificateMapRequest(); + 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 GetCertificateMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapRequest} GetCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateMapRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateMapRequest.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 GetCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapRequest} GetCertificateMapRequest + */ + GetCertificateMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.GetCertificateMapRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.GetCertificateMapRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.GetCertificateMapRequest} message GetCertificateMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateMapRequest.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 GetCertificateMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateMapRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateMapRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.GetCertificateMapRequest"; + }; + + return GetCertificateMapRequest; + })(); + + v1.CreateCertificateMapRequest = (function() { + + /** + * Properties of a CreateCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICreateCertificateMapRequest + * @property {string|null} [parent] CreateCertificateMapRequest parent + * @property {string|null} [certificateMapId] CreateCertificateMapRequest certificateMapId + * @property {google.cloud.certificatemanager.v1.ICertificateMap|null} [certificateMap] CreateCertificateMapRequest certificateMap + */ + + /** + * Constructs a new CreateCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CreateCertificateMapRequest. + * @implements ICreateCertificateMapRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest=} [properties] Properties to set + */ + function CreateCertificateMapRequest(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]]; + } + + /** + * CreateCertificateMapRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @instance + */ + CreateCertificateMapRequest.prototype.parent = ""; + + /** + * CreateCertificateMapRequest certificateMapId. + * @member {string} certificateMapId + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @instance + */ + CreateCertificateMapRequest.prototype.certificateMapId = ""; + + /** + * CreateCertificateMapRequest certificateMap. + * @member {google.cloud.certificatemanager.v1.ICertificateMap|null|undefined} certificateMap + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @instance + */ + CreateCertificateMapRequest.prototype.certificateMap = null; + + /** + * Creates a new CreateCertificateMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapRequest} CreateCertificateMapRequest instance + */ + CreateCertificateMapRequest.create = function create(properties) { + return new CreateCertificateMapRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest} message CreateCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateMapRequest.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.certificateMapId != null && Object.hasOwnProperty.call(message, "certificateMapId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateMapId); + if (message.certificateMap != null && Object.hasOwnProperty.call(message, "certificateMap")) + $root.google.cloud.certificatemanager.v1.CertificateMap.encode(message.certificateMap, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapRequest} message CreateCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapRequest} CreateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CreateCertificateMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateMapId = reader.string(); + break; + } + case 3: { + message.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapRequest} CreateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateMapRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateMapRequest.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.certificateMapId != null && message.hasOwnProperty("certificateMapId")) + if (!$util.isString(message.certificateMapId)) + return "certificateMapId: string expected"; + if (message.certificateMap != null && message.hasOwnProperty("certificateMap")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMap.verify(message.certificateMap); + if (error) + return "certificateMap." + error; + } + return null; + }; + + /** + * Creates a CreateCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapRequest} CreateCertificateMapRequest + */ + CreateCertificateMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CreateCertificateMapRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CreateCertificateMapRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateMapId != null) + message.certificateMapId = String(object.certificateMapId); + if (object.certificateMap != null) { + if (typeof object.certificateMap !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CreateCertificateMapRequest.certificateMap: object expected"); + message.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.fromObject(object.certificateMap); + } + return message; + }; + + /** + * Creates a plain object from a CreateCertificateMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.CreateCertificateMapRequest} message CreateCertificateMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateMapId = ""; + object.certificateMap = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateMapId != null && message.hasOwnProperty("certificateMapId")) + object.certificateMapId = message.certificateMapId; + if (message.certificateMap != null && message.hasOwnProperty("certificateMap")) + object.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.toObject(message.certificateMap, options); + return object; + }; + + /** + * Converts this CreateCertificateMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateMapRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateMapRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CreateCertificateMapRequest"; + }; + + return CreateCertificateMapRequest; + })(); + + v1.UpdateCertificateMapRequest = (function() { + + /** + * Properties of an UpdateCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IUpdateCertificateMapRequest + * @property {google.cloud.certificatemanager.v1.ICertificateMap|null} [certificateMap] UpdateCertificateMapRequest certificateMap + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateMapRequest updateMask + */ + + /** + * Constructs a new UpdateCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents an UpdateCertificateMapRequest. + * @implements IUpdateCertificateMapRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest=} [properties] Properties to set + */ + function UpdateCertificateMapRequest(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]]; + } + + /** + * UpdateCertificateMapRequest certificateMap. + * @member {google.cloud.certificatemanager.v1.ICertificateMap|null|undefined} certificateMap + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @instance + */ + UpdateCertificateMapRequest.prototype.certificateMap = null; + + /** + * UpdateCertificateMapRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @instance + */ + UpdateCertificateMapRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCertificateMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapRequest} UpdateCertificateMapRequest instance + */ + UpdateCertificateMapRequest.create = function create(properties) { + return new UpdateCertificateMapRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest} message UpdateCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateMap != null && Object.hasOwnProperty.call(message, "certificateMap")) + $root.google.cloud.certificatemanager.v1.CertificateMap.encode(message.certificateMap, 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 UpdateCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest} message UpdateCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapRequest} UpdateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.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 UpdateCertificateMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapRequest} UpdateCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateMapRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateMap != null && message.hasOwnProperty("certificateMap")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMap.verify(message.certificateMap); + if (error) + return "certificateMap." + 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 UpdateCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapRequest} UpdateCertificateMapRequest + */ + UpdateCertificateMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest(); + if (object.certificateMap != null) { + if (typeof object.certificateMap !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.certificateMap: object expected"); + message.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.fromObject(object.certificateMap); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateMapRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.UpdateCertificateMapRequest} message UpdateCertificateMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateMap = null; + object.updateMask = null; + } + if (message.certificateMap != null && message.hasOwnProperty("certificateMap")) + object.certificateMap = $root.google.cloud.certificatemanager.v1.CertificateMap.toObject(message.certificateMap, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCertificateMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateMapRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateMapRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.UpdateCertificateMapRequest"; + }; + + return UpdateCertificateMapRequest; + })(); + + v1.DeleteCertificateMapRequest = (function() { + + /** + * Properties of a DeleteCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDeleteCertificateMapRequest + * @property {string|null} [name] DeleteCertificateMapRequest name + */ + + /** + * Constructs a new DeleteCertificateMapRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DeleteCertificateMapRequest. + * @implements IDeleteCertificateMapRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest=} [properties] Properties to set + */ + function DeleteCertificateMapRequest(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]]; + } + + /** + * DeleteCertificateMapRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @instance + */ + DeleteCertificateMapRequest.prototype.name = ""; + + /** + * Creates a new DeleteCertificateMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapRequest} DeleteCertificateMapRequest instance + */ + DeleteCertificateMapRequest.create = function create(properties) { + return new DeleteCertificateMapRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateMapRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest} message DeleteCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateMapRequest.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 DeleteCertificateMapRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest} message DeleteCertificateMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapRequest} DeleteCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest(); + 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 DeleteCertificateMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapRequest} DeleteCertificateMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateMapRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateMapRequest.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 DeleteCertificateMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapRequest} DeleteCertificateMapRequest + */ + DeleteCertificateMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {google.cloud.certificatemanager.v1.DeleteCertificateMapRequest} message DeleteCertificateMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateMapRequest.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 DeleteCertificateMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateMapRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateMapRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DeleteCertificateMapRequest"; + }; + + return DeleteCertificateMapRequest; + })(); + + v1.ListCertificateMapEntriesRequest = (function() { + + /** + * Properties of a ListCertificateMapEntriesRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateMapEntriesRequest + * @property {string|null} [parent] ListCertificateMapEntriesRequest parent + * @property {number|null} [pageSize] ListCertificateMapEntriesRequest pageSize + * @property {string|null} [pageToken] ListCertificateMapEntriesRequest pageToken + * @property {string|null} [filter] ListCertificateMapEntriesRequest filter + * @property {string|null} [orderBy] ListCertificateMapEntriesRequest orderBy + */ + + /** + * Constructs a new ListCertificateMapEntriesRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateMapEntriesRequest. + * @implements IListCertificateMapEntriesRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest=} [properties] Properties to set + */ + function ListCertificateMapEntriesRequest(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]]; + } + + /** + * ListCertificateMapEntriesRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + */ + ListCertificateMapEntriesRequest.prototype.parent = ""; + + /** + * ListCertificateMapEntriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + */ + ListCertificateMapEntriesRequest.prototype.pageSize = 0; + + /** + * ListCertificateMapEntriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + */ + ListCertificateMapEntriesRequest.prototype.pageToken = ""; + + /** + * ListCertificateMapEntriesRequest filter. + * @member {string} filter + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + */ + ListCertificateMapEntriesRequest.prototype.filter = ""; + + /** + * ListCertificateMapEntriesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + */ + ListCertificateMapEntriesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCertificateMapEntriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest} ListCertificateMapEntriesRequest instance + */ + ListCertificateMapEntriesRequest.create = function create(properties) { + return new ListCertificateMapEntriesRequest(properties); + }; + + /** + * Encodes the specified ListCertificateMapEntriesRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest} message ListCertificateMapEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapEntriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListCertificateMapEntriesRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest} message ListCertificateMapEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateMapEntriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest} ListCertificateMapEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapEntriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateMapEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest} ListCertificateMapEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateMapEntriesRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateMapEntriesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListCertificateMapEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest} ListCertificateMapEntriesRequest + */ + ListCertificateMapEntriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListCertificateMapEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest} message ListCertificateMapEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateMapEntriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListCertificateMapEntriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListCertificateMapEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateMapEntriesRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateMapEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest"; + }; + + return ListCertificateMapEntriesRequest; + })(); + + v1.ListCertificateMapEntriesResponse = (function() { + + /** + * Properties of a ListCertificateMapEntriesResponse. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListCertificateMapEntriesResponse + * @property {Array.|null} [certificateMapEntries] ListCertificateMapEntriesResponse certificateMapEntries + * @property {string|null} [nextPageToken] ListCertificateMapEntriesResponse nextPageToken + * @property {Array.|null} [unreachable] ListCertificateMapEntriesResponse unreachable + */ + + /** + * Constructs a new ListCertificateMapEntriesResponse. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListCertificateMapEntriesResponse. + * @implements IListCertificateMapEntriesResponse + * @constructor + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse=} [properties] Properties to set + */ + function ListCertificateMapEntriesResponse(properties) { + this.certificateMapEntries = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCertificateMapEntriesResponse certificateMapEntries. + * @member {Array.} certificateMapEntries + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @instance + */ + ListCertificateMapEntriesResponse.prototype.certificateMapEntries = $util.emptyArray; + + /** + * ListCertificateMapEntriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @instance + */ + ListCertificateMapEntriesResponse.prototype.nextPageToken = ""; + + /** + * ListCertificateMapEntriesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @instance + */ + ListCertificateMapEntriesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCertificateMapEntriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} ListCertificateMapEntriesResponse instance + */ + ListCertificateMapEntriesResponse.create = function create(properties) { + return new ListCertificateMapEntriesResponse(properties); + }; + + /** + * Encodes the specified ListCertificateMapEntriesResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse} message ListCertificateMapEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapEntriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateMapEntries != null && message.certificateMapEntries.length) + for (var i = 0; i < message.certificateMapEntries.length; ++i) + $root.google.cloud.certificatemanager.v1.CertificateMapEntry.encode(message.certificateMapEntries[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListCertificateMapEntriesResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse} message ListCertificateMapEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCertificateMapEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCertificateMapEntriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} ListCertificateMapEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapEntriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.certificateMapEntries && message.certificateMapEntries.length)) + message.certificateMapEntries = []; + message.certificateMapEntries.push($root.google.cloud.certificatemanager.v1.CertificateMapEntry.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCertificateMapEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} ListCertificateMapEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCertificateMapEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCertificateMapEntriesResponse message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCertificateMapEntriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateMapEntries != null && message.hasOwnProperty("certificateMapEntries")) { + if (!Array.isArray(message.certificateMapEntries)) + return "certificateMapEntries: array expected"; + for (var i = 0; i < message.certificateMapEntries.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.verify(message.certificateMapEntries[i]); + if (error) + return "certificateMapEntries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListCertificateMapEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} ListCertificateMapEntriesResponse + */ + ListCertificateMapEntriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse(); + if (object.certificateMapEntries) { + if (!Array.isArray(object.certificateMapEntries)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.certificateMapEntries: array expected"); + message.certificateMapEntries = []; + for (var i = 0; i < object.certificateMapEntries.length; ++i) { + if (typeof object.certificateMapEntries[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.certificateMapEntries: object expected"); + message.certificateMapEntries[i] = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.fromObject(object.certificateMapEntries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListCertificateMapEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse} message ListCertificateMapEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCertificateMapEntriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.certificateMapEntries = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.certificateMapEntries && message.certificateMapEntries.length) { + object.certificateMapEntries = []; + for (var j = 0; j < message.certificateMapEntries.length; ++j) + object.certificateMapEntries[j] = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.toObject(message.certificateMapEntries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListCertificateMapEntriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListCertificateMapEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCertificateMapEntriesResponse + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCertificateMapEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse"; + }; + + return ListCertificateMapEntriesResponse; + })(); + + v1.GetCertificateMapEntryRequest = (function() { + + /** + * Properties of a GetCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IGetCertificateMapEntryRequest + * @property {string|null} [name] GetCertificateMapEntryRequest name + */ + + /** + * Constructs a new GetCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a GetCertificateMapEntryRequest. + * @implements IGetCertificateMapEntryRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest=} [properties] Properties to set + */ + function GetCertificateMapEntryRequest(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]]; + } + + /** + * GetCertificateMapEntryRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @instance + */ + GetCertificateMapEntryRequest.prototype.name = ""; + + /** + * Creates a new GetCertificateMapEntryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest} GetCertificateMapEntryRequest instance + */ + GetCertificateMapEntryRequest.create = function create(properties) { + return new GetCertificateMapEntryRequest(properties); + }; + + /** + * Encodes the specified GetCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest} message GetCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateMapEntryRequest.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 GetCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest} message GetCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCertificateMapEntryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCertificateMapEntryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest} GetCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateMapEntryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest(); + 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 GetCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest} GetCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCertificateMapEntryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCertificateMapEntryRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCertificateMapEntryRequest.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 GetCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest} GetCertificateMapEntryRequest + */ + GetCertificateMapEntryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCertificateMapEntryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest} message GetCertificateMapEntryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCertificateMapEntryRequest.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 GetCertificateMapEntryRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @instance + * @returns {Object.} JSON object + */ + GetCertificateMapEntryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCertificateMapEntryRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCertificateMapEntryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest"; + }; + + return GetCertificateMapEntryRequest; + })(); + + v1.CreateCertificateMapEntryRequest = (function() { + + /** + * Properties of a CreateCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICreateCertificateMapEntryRequest + * @property {string|null} [parent] CreateCertificateMapEntryRequest parent + * @property {string|null} [certificateMapEntryId] CreateCertificateMapEntryRequest certificateMapEntryId + * @property {google.cloud.certificatemanager.v1.ICertificateMapEntry|null} [certificateMapEntry] CreateCertificateMapEntryRequest certificateMapEntry + */ + + /** + * Constructs a new CreateCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CreateCertificateMapEntryRequest. + * @implements ICreateCertificateMapEntryRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest=} [properties] Properties to set + */ + function CreateCertificateMapEntryRequest(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]]; + } + + /** + * CreateCertificateMapEntryRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @instance + */ + CreateCertificateMapEntryRequest.prototype.parent = ""; + + /** + * CreateCertificateMapEntryRequest certificateMapEntryId. + * @member {string} certificateMapEntryId + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @instance + */ + CreateCertificateMapEntryRequest.prototype.certificateMapEntryId = ""; + + /** + * CreateCertificateMapEntryRequest certificateMapEntry. + * @member {google.cloud.certificatemanager.v1.ICertificateMapEntry|null|undefined} certificateMapEntry + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @instance + */ + CreateCertificateMapEntryRequest.prototype.certificateMapEntry = null; + + /** + * Creates a new CreateCertificateMapEntryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest} CreateCertificateMapEntryRequest instance + */ + CreateCertificateMapEntryRequest.create = function create(properties) { + return new CreateCertificateMapEntryRequest(properties); + }; + + /** + * Encodes the specified CreateCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest} message CreateCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateMapEntryRequest.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.certificateMapEntryId != null && Object.hasOwnProperty.call(message, "certificateMapEntryId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.certificateMapEntryId); + if (message.certificateMapEntry != null && Object.hasOwnProperty.call(message, "certificateMapEntry")) + $root.google.cloud.certificatemanager.v1.CertificateMapEntry.encode(message.certificateMapEntry, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest} message CreateCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCertificateMapEntryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCertificateMapEntryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest} CreateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateMapEntryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.certificateMapEntryId = reader.string(); + break; + } + case 3: { + message.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest} CreateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCertificateMapEntryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCertificateMapEntryRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCertificateMapEntryRequest.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.certificateMapEntryId != null && message.hasOwnProperty("certificateMapEntryId")) + if (!$util.isString(message.certificateMapEntryId)) + return "certificateMapEntryId: string expected"; + if (message.certificateMapEntry != null && message.hasOwnProperty("certificateMapEntry")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.verify(message.certificateMapEntry); + if (error) + return "certificateMapEntry." + error; + } + return null; + }; + + /** + * Creates a CreateCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest} CreateCertificateMapEntryRequest + */ + CreateCertificateMapEntryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.certificateMapEntryId != null) + message.certificateMapEntryId = String(object.certificateMapEntryId); + if (object.certificateMapEntry != null) { + if (typeof object.certificateMapEntry !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest.certificateMapEntry: object expected"); + message.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.fromObject(object.certificateMapEntry); + } + return message; + }; + + /** + * Creates a plain object from a CreateCertificateMapEntryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest} message CreateCertificateMapEntryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCertificateMapEntryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.certificateMapEntryId = ""; + object.certificateMapEntry = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.certificateMapEntryId != null && message.hasOwnProperty("certificateMapEntryId")) + object.certificateMapEntryId = message.certificateMapEntryId; + if (message.certificateMapEntry != null && message.hasOwnProperty("certificateMapEntry")) + object.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.toObject(message.certificateMapEntry, options); + return object; + }; + + /** + * Converts this CreateCertificateMapEntryRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCertificateMapEntryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCertificateMapEntryRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCertificateMapEntryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest"; + }; + + return CreateCertificateMapEntryRequest; + })(); + + v1.UpdateCertificateMapEntryRequest = (function() { + + /** + * Properties of an UpdateCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IUpdateCertificateMapEntryRequest + * @property {google.cloud.certificatemanager.v1.ICertificateMapEntry|null} [certificateMapEntry] UpdateCertificateMapEntryRequest certificateMapEntry + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCertificateMapEntryRequest updateMask + */ + + /** + * Constructs a new UpdateCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents an UpdateCertificateMapEntryRequest. + * @implements IUpdateCertificateMapEntryRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest=} [properties] Properties to set + */ + function UpdateCertificateMapEntryRequest(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]]; + } + + /** + * UpdateCertificateMapEntryRequest certificateMapEntry. + * @member {google.cloud.certificatemanager.v1.ICertificateMapEntry|null|undefined} certificateMapEntry + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @instance + */ + UpdateCertificateMapEntryRequest.prototype.certificateMapEntry = null; + + /** + * UpdateCertificateMapEntryRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @instance + */ + UpdateCertificateMapEntryRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCertificateMapEntryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest} UpdateCertificateMapEntryRequest instance + */ + UpdateCertificateMapEntryRequest.create = function create(properties) { + return new UpdateCertificateMapEntryRequest(properties); + }; + + /** + * Encodes the specified UpdateCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest} message UpdateCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateMapEntryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificateMapEntry != null && Object.hasOwnProperty.call(message, "certificateMapEntry")) + $root.google.cloud.certificatemanager.v1.CertificateMapEntry.encode(message.certificateMapEntry, 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 UpdateCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest} message UpdateCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCertificateMapEntryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCertificateMapEntryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest} UpdateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateMapEntryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.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 UpdateCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest} UpdateCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCertificateMapEntryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCertificateMapEntryRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCertificateMapEntryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.certificateMapEntry != null && message.hasOwnProperty("certificateMapEntry")) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.verify(message.certificateMapEntry); + if (error) + return "certificateMapEntry." + 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 UpdateCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest} UpdateCertificateMapEntryRequest + */ + UpdateCertificateMapEntryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest(); + if (object.certificateMapEntry != null) { + if (typeof object.certificateMapEntry !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.certificateMapEntry: object expected"); + message.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.fromObject(object.certificateMapEntry); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCertificateMapEntryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest} message UpdateCertificateMapEntryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCertificateMapEntryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.certificateMapEntry = null; + object.updateMask = null; + } + if (message.certificateMapEntry != null && message.hasOwnProperty("certificateMapEntry")) + object.certificateMapEntry = $root.google.cloud.certificatemanager.v1.CertificateMapEntry.toObject(message.certificateMapEntry, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCertificateMapEntryRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCertificateMapEntryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCertificateMapEntryRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCertificateMapEntryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest"; + }; + + return UpdateCertificateMapEntryRequest; + })(); + + v1.DeleteCertificateMapEntryRequest = (function() { + + /** + * Properties of a DeleteCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDeleteCertificateMapEntryRequest + * @property {string|null} [name] DeleteCertificateMapEntryRequest name + */ + + /** + * Constructs a new DeleteCertificateMapEntryRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DeleteCertificateMapEntryRequest. + * @implements IDeleteCertificateMapEntryRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest=} [properties] Properties to set + */ + function DeleteCertificateMapEntryRequest(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]]; + } + + /** + * DeleteCertificateMapEntryRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @instance + */ + DeleteCertificateMapEntryRequest.prototype.name = ""; + + /** + * Creates a new DeleteCertificateMapEntryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest} DeleteCertificateMapEntryRequest instance + */ + DeleteCertificateMapEntryRequest.create = function create(properties) { + return new DeleteCertificateMapEntryRequest(properties); + }; + + /** + * Encodes the specified DeleteCertificateMapEntryRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest} message DeleteCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateMapEntryRequest.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 DeleteCertificateMapEntryRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest} message DeleteCertificateMapEntryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCertificateMapEntryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCertificateMapEntryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest} DeleteCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateMapEntryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest(); + 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 DeleteCertificateMapEntryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest} DeleteCertificateMapEntryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCertificateMapEntryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCertificateMapEntryRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCertificateMapEntryRequest.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 DeleteCertificateMapEntryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest} DeleteCertificateMapEntryRequest + */ + DeleteCertificateMapEntryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCertificateMapEntryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest} message DeleteCertificateMapEntryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCertificateMapEntryRequest.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 DeleteCertificateMapEntryRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCertificateMapEntryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCertificateMapEntryRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCertificateMapEntryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest"; + }; + + return DeleteCertificateMapEntryRequest; + })(); + + v1.ListDnsAuthorizationsRequest = (function() { + + /** + * Properties of a ListDnsAuthorizationsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListDnsAuthorizationsRequest + * @property {string|null} [parent] ListDnsAuthorizationsRequest parent + * @property {number|null} [pageSize] ListDnsAuthorizationsRequest pageSize + * @property {string|null} [pageToken] ListDnsAuthorizationsRequest pageToken + * @property {string|null} [filter] ListDnsAuthorizationsRequest filter + * @property {string|null} [orderBy] ListDnsAuthorizationsRequest orderBy + */ + + /** + * Constructs a new ListDnsAuthorizationsRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListDnsAuthorizationsRequest. + * @implements IListDnsAuthorizationsRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest=} [properties] Properties to set + */ + function ListDnsAuthorizationsRequest(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]]; + } + + /** + * ListDnsAuthorizationsRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + */ + ListDnsAuthorizationsRequest.prototype.parent = ""; + + /** + * ListDnsAuthorizationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + */ + ListDnsAuthorizationsRequest.prototype.pageSize = 0; + + /** + * ListDnsAuthorizationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + */ + ListDnsAuthorizationsRequest.prototype.pageToken = ""; + + /** + * ListDnsAuthorizationsRequest filter. + * @member {string} filter + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + */ + ListDnsAuthorizationsRequest.prototype.filter = ""; + + /** + * ListDnsAuthorizationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + */ + ListDnsAuthorizationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDnsAuthorizationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest} ListDnsAuthorizationsRequest instance + */ + ListDnsAuthorizationsRequest.create = function create(properties) { + return new ListDnsAuthorizationsRequest(properties); + }; + + /** + * Encodes the specified ListDnsAuthorizationsRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest} message ListDnsAuthorizationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsAuthorizationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDnsAuthorizationsRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest} message ListDnsAuthorizationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsAuthorizationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsAuthorizationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest} ListDnsAuthorizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsAuthorizationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDnsAuthorizationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest} ListDnsAuthorizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsAuthorizationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsAuthorizationsRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsAuthorizationsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDnsAuthorizationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest} ListDnsAuthorizationsRequest + */ + ListDnsAuthorizationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDnsAuthorizationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest} message ListDnsAuthorizationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsAuthorizationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDnsAuthorizationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDnsAuthorizationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDnsAuthorizationsRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsAuthorizationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest"; + }; + + return ListDnsAuthorizationsRequest; + })(); + + v1.ListDnsAuthorizationsResponse = (function() { + + /** + * Properties of a ListDnsAuthorizationsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @interface IListDnsAuthorizationsResponse + * @property {Array.|null} [dnsAuthorizations] ListDnsAuthorizationsResponse dnsAuthorizations + * @property {string|null} [nextPageToken] ListDnsAuthorizationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListDnsAuthorizationsResponse unreachable + */ + + /** + * Constructs a new ListDnsAuthorizationsResponse. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a ListDnsAuthorizationsResponse. + * @implements IListDnsAuthorizationsResponse + * @constructor + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse=} [properties] Properties to set + */ + function ListDnsAuthorizationsResponse(properties) { + this.dnsAuthorizations = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDnsAuthorizationsResponse dnsAuthorizations. + * @member {Array.} dnsAuthorizations + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @instance + */ + ListDnsAuthorizationsResponse.prototype.dnsAuthorizations = $util.emptyArray; + + /** + * ListDnsAuthorizationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @instance + */ + ListDnsAuthorizationsResponse.prototype.nextPageToken = ""; + + /** + * ListDnsAuthorizationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @instance + */ + ListDnsAuthorizationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDnsAuthorizationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} ListDnsAuthorizationsResponse instance + */ + ListDnsAuthorizationsResponse.create = function create(properties) { + return new ListDnsAuthorizationsResponse(properties); + }; + + /** + * Encodes the specified ListDnsAuthorizationsResponse message. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse} message ListDnsAuthorizationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsAuthorizationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsAuthorizations != null && message.dnsAuthorizations.length) + for (var i = 0; i < message.dnsAuthorizations.length; ++i) + $root.google.cloud.certificatemanager.v1.DnsAuthorization.encode(message.dnsAuthorizations[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDnsAuthorizationsResponse message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse} message ListDnsAuthorizationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsAuthorizationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsAuthorizationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} ListDnsAuthorizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsAuthorizationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dnsAuthorizations && message.dnsAuthorizations.length)) + message.dnsAuthorizations = []; + message.dnsAuthorizations.push($root.google.cloud.certificatemanager.v1.DnsAuthorization.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDnsAuthorizationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} ListDnsAuthorizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsAuthorizationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsAuthorizationsResponse message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsAuthorizationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsAuthorizations != null && message.hasOwnProperty("dnsAuthorizations")) { + if (!Array.isArray(message.dnsAuthorizations)) + return "dnsAuthorizations: array expected"; + for (var i = 0; i < message.dnsAuthorizations.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.DnsAuthorization.verify(message.dnsAuthorizations[i]); + if (error) + return "dnsAuthorizations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDnsAuthorizationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} ListDnsAuthorizationsResponse + */ + ListDnsAuthorizationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse) + return object; + var message = new $root.google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse(); + if (object.dnsAuthorizations) { + if (!Array.isArray(object.dnsAuthorizations)) + throw TypeError(".google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.dnsAuthorizations: array expected"); + message.dnsAuthorizations = []; + for (var i = 0; i < object.dnsAuthorizations.length; ++i) { + if (typeof object.dnsAuthorizations[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.dnsAuthorizations: object expected"); + message.dnsAuthorizations[i] = $root.google.cloud.certificatemanager.v1.DnsAuthorization.fromObject(object.dnsAuthorizations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListDnsAuthorizationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse} message ListDnsAuthorizationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsAuthorizationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dnsAuthorizations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dnsAuthorizations && message.dnsAuthorizations.length) { + object.dnsAuthorizations = []; + for (var j = 0; j < message.dnsAuthorizations.length; ++j) + object.dnsAuthorizations[j] = $root.google.cloud.certificatemanager.v1.DnsAuthorization.toObject(message.dnsAuthorizations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListDnsAuthorizationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDnsAuthorizationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDnsAuthorizationsResponse + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsAuthorizationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse"; + }; + + return ListDnsAuthorizationsResponse; + })(); + + v1.GetDnsAuthorizationRequest = (function() { + + /** + * Properties of a GetDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IGetDnsAuthorizationRequest + * @property {string|null} [name] GetDnsAuthorizationRequest name + */ + + /** + * Constructs a new GetDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a GetDnsAuthorizationRequest. + * @implements IGetDnsAuthorizationRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest=} [properties] Properties to set + */ + function GetDnsAuthorizationRequest(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]]; + } + + /** + * GetDnsAuthorizationRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @instance + */ + GetDnsAuthorizationRequest.prototype.name = ""; + + /** + * Creates a new GetDnsAuthorizationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest} GetDnsAuthorizationRequest instance + */ + GetDnsAuthorizationRequest.create = function create(properties) { + return new GetDnsAuthorizationRequest(properties); + }; + + /** + * Encodes the specified GetDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest} message GetDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDnsAuthorizationRequest.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 GetDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest} message GetDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDnsAuthorizationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDnsAuthorizationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest} GetDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDnsAuthorizationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest(); + 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 GetDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest} GetDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDnsAuthorizationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDnsAuthorizationRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDnsAuthorizationRequest.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 GetDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest} GetDnsAuthorizationRequest + */ + GetDnsAuthorizationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDnsAuthorizationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest} message GetDnsAuthorizationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDnsAuthorizationRequest.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 GetDnsAuthorizationRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @instance + * @returns {Object.} JSON object + */ + GetDnsAuthorizationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDnsAuthorizationRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDnsAuthorizationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest"; + }; + + return GetDnsAuthorizationRequest; + })(); + + v1.CreateDnsAuthorizationRequest = (function() { + + /** + * Properties of a CreateDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICreateDnsAuthorizationRequest + * @property {string|null} [parent] CreateDnsAuthorizationRequest parent + * @property {string|null} [dnsAuthorizationId] CreateDnsAuthorizationRequest dnsAuthorizationId + * @property {google.cloud.certificatemanager.v1.IDnsAuthorization|null} [dnsAuthorization] CreateDnsAuthorizationRequest dnsAuthorization + */ + + /** + * Constructs a new CreateDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CreateDnsAuthorizationRequest. + * @implements ICreateDnsAuthorizationRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest=} [properties] Properties to set + */ + function CreateDnsAuthorizationRequest(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]]; + } + + /** + * CreateDnsAuthorizationRequest parent. + * @member {string} parent + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @instance + */ + CreateDnsAuthorizationRequest.prototype.parent = ""; + + /** + * CreateDnsAuthorizationRequest dnsAuthorizationId. + * @member {string} dnsAuthorizationId + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @instance + */ + CreateDnsAuthorizationRequest.prototype.dnsAuthorizationId = ""; + + /** + * CreateDnsAuthorizationRequest dnsAuthorization. + * @member {google.cloud.certificatemanager.v1.IDnsAuthorization|null|undefined} dnsAuthorization + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @instance + */ + CreateDnsAuthorizationRequest.prototype.dnsAuthorization = null; + + /** + * Creates a new CreateDnsAuthorizationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest} CreateDnsAuthorizationRequest instance + */ + CreateDnsAuthorizationRequest.create = function create(properties) { + return new CreateDnsAuthorizationRequest(properties); + }; + + /** + * Encodes the specified CreateDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest} message CreateDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDnsAuthorizationRequest.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.dnsAuthorizationId != null && Object.hasOwnProperty.call(message, "dnsAuthorizationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dnsAuthorizationId); + if (message.dnsAuthorization != null && Object.hasOwnProperty.call(message, "dnsAuthorization")) + $root.google.cloud.certificatemanager.v1.DnsAuthorization.encode(message.dnsAuthorization, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest} message CreateDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDnsAuthorizationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDnsAuthorizationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest} CreateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDnsAuthorizationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dnsAuthorizationId = reader.string(); + break; + } + case 3: { + message.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest} CreateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDnsAuthorizationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDnsAuthorizationRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDnsAuthorizationRequest.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.dnsAuthorizationId != null && message.hasOwnProperty("dnsAuthorizationId")) + if (!$util.isString(message.dnsAuthorizationId)) + return "dnsAuthorizationId: string expected"; + if (message.dnsAuthorization != null && message.hasOwnProperty("dnsAuthorization")) { + var error = $root.google.cloud.certificatemanager.v1.DnsAuthorization.verify(message.dnsAuthorization); + if (error) + return "dnsAuthorization." + error; + } + return null; + }; + + /** + * Creates a CreateDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest} CreateDnsAuthorizationRequest + */ + CreateDnsAuthorizationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dnsAuthorizationId != null) + message.dnsAuthorizationId = String(object.dnsAuthorizationId); + if (object.dnsAuthorization != null) { + if (typeof object.dnsAuthorization !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest.dnsAuthorization: object expected"); + message.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.fromObject(object.dnsAuthorization); + } + return message; + }; + + /** + * Creates a plain object from a CreateDnsAuthorizationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest} message CreateDnsAuthorizationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDnsAuthorizationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dnsAuthorizationId = ""; + object.dnsAuthorization = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dnsAuthorizationId != null && message.hasOwnProperty("dnsAuthorizationId")) + object.dnsAuthorizationId = message.dnsAuthorizationId; + if (message.dnsAuthorization != null && message.hasOwnProperty("dnsAuthorization")) + object.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.toObject(message.dnsAuthorization, options); + return object; + }; + + /** + * Converts this CreateDnsAuthorizationRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDnsAuthorizationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDnsAuthorizationRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDnsAuthorizationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest"; + }; + + return CreateDnsAuthorizationRequest; + })(); + + v1.UpdateDnsAuthorizationRequest = (function() { + + /** + * Properties of an UpdateDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IUpdateDnsAuthorizationRequest + * @property {google.cloud.certificatemanager.v1.IDnsAuthorization|null} [dnsAuthorization] UpdateDnsAuthorizationRequest dnsAuthorization + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDnsAuthorizationRequest updateMask + */ + + /** + * Constructs a new UpdateDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents an UpdateDnsAuthorizationRequest. + * @implements IUpdateDnsAuthorizationRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest=} [properties] Properties to set + */ + function UpdateDnsAuthorizationRequest(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]]; + } + + /** + * UpdateDnsAuthorizationRequest dnsAuthorization. + * @member {google.cloud.certificatemanager.v1.IDnsAuthorization|null|undefined} dnsAuthorization + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @instance + */ + UpdateDnsAuthorizationRequest.prototype.dnsAuthorization = null; + + /** + * UpdateDnsAuthorizationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @instance + */ + UpdateDnsAuthorizationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDnsAuthorizationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest} UpdateDnsAuthorizationRequest instance + */ + UpdateDnsAuthorizationRequest.create = function create(properties) { + return new UpdateDnsAuthorizationRequest(properties); + }; + + /** + * Encodes the specified UpdateDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest} message UpdateDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDnsAuthorizationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsAuthorization != null && Object.hasOwnProperty.call(message, "dnsAuthorization")) + $root.google.cloud.certificatemanager.v1.DnsAuthorization.encode(message.dnsAuthorization, 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 UpdateDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest} message UpdateDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDnsAuthorizationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDnsAuthorizationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest} UpdateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDnsAuthorizationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.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 UpdateDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest} UpdateDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDnsAuthorizationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDnsAuthorizationRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDnsAuthorizationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsAuthorization != null && message.hasOwnProperty("dnsAuthorization")) { + var error = $root.google.cloud.certificatemanager.v1.DnsAuthorization.verify(message.dnsAuthorization); + if (error) + return "dnsAuthorization." + 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 UpdateDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest} UpdateDnsAuthorizationRequest + */ + UpdateDnsAuthorizationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest(); + if (object.dnsAuthorization != null) { + if (typeof object.dnsAuthorization !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.dnsAuthorization: object expected"); + message.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.fromObject(object.dnsAuthorization); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDnsAuthorizationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest} message UpdateDnsAuthorizationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDnsAuthorizationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dnsAuthorization = null; + object.updateMask = null; + } + if (message.dnsAuthorization != null && message.hasOwnProperty("dnsAuthorization")) + object.dnsAuthorization = $root.google.cloud.certificatemanager.v1.DnsAuthorization.toObject(message.dnsAuthorization, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDnsAuthorizationRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDnsAuthorizationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDnsAuthorizationRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDnsAuthorizationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest"; + }; + + return UpdateDnsAuthorizationRequest; + })(); + + v1.DeleteDnsAuthorizationRequest = (function() { + + /** + * Properties of a DeleteDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDeleteDnsAuthorizationRequest + * @property {string|null} [name] DeleteDnsAuthorizationRequest name + */ + + /** + * Constructs a new DeleteDnsAuthorizationRequest. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DeleteDnsAuthorizationRequest. + * @implements IDeleteDnsAuthorizationRequest + * @constructor + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest=} [properties] Properties to set + */ + function DeleteDnsAuthorizationRequest(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]]; + } + + /** + * DeleteDnsAuthorizationRequest name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @instance + */ + DeleteDnsAuthorizationRequest.prototype.name = ""; + + /** + * Creates a new DeleteDnsAuthorizationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest} DeleteDnsAuthorizationRequest instance + */ + DeleteDnsAuthorizationRequest.create = function create(properties) { + return new DeleteDnsAuthorizationRequest(properties); + }; + + /** + * Encodes the specified DeleteDnsAuthorizationRequest message. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest} message DeleteDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDnsAuthorizationRequest.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 DeleteDnsAuthorizationRequest message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest} message DeleteDnsAuthorizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDnsAuthorizationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDnsAuthorizationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest} DeleteDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDnsAuthorizationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest(); + 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 DeleteDnsAuthorizationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest} DeleteDnsAuthorizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDnsAuthorizationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDnsAuthorizationRequest message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDnsAuthorizationRequest.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 DeleteDnsAuthorizationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest} DeleteDnsAuthorizationRequest + */ + DeleteDnsAuthorizationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDnsAuthorizationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest} message DeleteDnsAuthorizationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDnsAuthorizationRequest.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 DeleteDnsAuthorizationRequest to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDnsAuthorizationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDnsAuthorizationRequest + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDnsAuthorizationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest"; + }; + + return DeleteDnsAuthorizationRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.certificatemanager.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.certificatemanager.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {google.cloud.certificatemanager.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.certificatemanager.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {google.cloud.certificatemanager.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {google.cloud.certificatemanager.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.certificatemanager.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {google.cloud.certificatemanager.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.Certificate = (function() { + + /** + * Properties of a Certificate. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICertificate + * @property {string|null} [name] Certificate name + * @property {string|null} [description] Certificate description + * @property {google.protobuf.ITimestamp|null} [createTime] Certificate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Certificate updateTime + * @property {Object.|null} [labels] Certificate labels + * @property {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate|null} [selfManaged] Certificate selfManaged + * @property {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate|null} [managed] Certificate managed + * @property {Array.|null} [sanDnsnames] Certificate sanDnsnames + * @property {string|null} [pemCertificate] Certificate pemCertificate + * @property {google.protobuf.ITimestamp|null} [expireTime] Certificate expireTime + * @property {google.cloud.certificatemanager.v1.Certificate.Scope|null} [scope] Certificate scope + */ + + /** + * Constructs a new Certificate. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a Certificate. + * @implements ICertificate + * @constructor + * @param {google.cloud.certificatemanager.v1.ICertificate=} [properties] Properties to set + */ + function Certificate(properties) { + this.labels = {}; + this.sanDnsnames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Certificate name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.name = ""; + + /** + * Certificate description. + * @member {string} description + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.description = ""; + + /** + * Certificate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.createTime = null; + + /** + * Certificate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.updateTime = null; + + /** + * Certificate labels. + * @member {Object.} labels + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.labels = $util.emptyObject; + + /** + * Certificate selfManaged. + * @member {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate|null|undefined} selfManaged + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.selfManaged = null; + + /** + * Certificate managed. + * @member {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate|null|undefined} managed + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.managed = null; + + /** + * Certificate sanDnsnames. + * @member {Array.} sanDnsnames + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.sanDnsnames = $util.emptyArray; + + /** + * Certificate pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.pemCertificate = ""; + + /** + * Certificate expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.expireTime = null; + + /** + * Certificate scope. + * @member {google.cloud.certificatemanager.v1.Certificate.Scope} scope + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Certificate.prototype.scope = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Certificate type. + * @member {"selfManaged"|"managed"|undefined} type + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + */ + Object.defineProperty(Certificate.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["selfManaged", "managed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Certificate instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {google.cloud.certificatemanager.v1.ICertificate=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.Certificate} Certificate instance + */ + Certificate.create = function create(properties) { + return new Certificate(properties); + }; + + /** + * Encodes the specified Certificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {google.cloud.certificatemanager.v1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); + if (message.selfManaged != null && Object.hasOwnProperty.call(message, "selfManaged")) + $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.encode(message.selfManaged, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sanDnsnames != null && message.sanDnsnames.length) + for (var i = 0; i < message.sanDnsnames.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sanDnsnames[i]); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.pemCertificate); + if (message.managed != null && Object.hasOwnProperty.call(message, "managed")) + $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.encode(message.managed, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.scope); + return writer; + }; + + /** + * Encodes the specified Certificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {google.cloud.certificatemanager.v1.ICertificate} message Certificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Certificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Certificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.Certificate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $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; + } + case 5: { + message.selfManaged = $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.decode(reader, reader.uint32()); + break; + } + case 11: { + message.managed = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.sanDnsnames && message.sanDnsnames.length)) + message.sanDnsnames = []; + message.sanDnsnames.push(reader.string()); + break; + } + case 9: { + message.pemCertificate = reader.string(); + break; + } + case 7: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.scope = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Certificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.Certificate} Certificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Certificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Certificate message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Certificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.selfManaged != null && message.hasOwnProperty("selfManaged")) { + properties.type = 1; + { + var error = $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.verify(message.selfManaged); + if (error) + return "selfManaged." + error; + } + } + if (message.managed != null && message.hasOwnProperty("managed")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.verify(message.managed); + if (error) + return "managed." + error; + } + } + if (message.sanDnsnames != null && message.hasOwnProperty("sanDnsnames")) { + if (!Array.isArray(message.sanDnsnames)) + return "sanDnsnames: array expected"; + for (var i = 0; i < message.sanDnsnames.length; ++i) + if (!$util.isString(message.sanDnsnames[i])) + return "sanDnsnames: string[] expected"; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: 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.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Certificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.Certificate} Certificate + */ + Certificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.Certificate) + return object; + var message = new $root.google.cloud.certificatemanager.v1.Certificate(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.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.selfManaged != null) { + if (typeof object.selfManaged !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.selfManaged: object expected"); + message.selfManaged = $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.fromObject(object.selfManaged); + } + if (object.managed != null) { + if (typeof object.managed !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.managed: object expected"); + message.managed = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.fromObject(object.managed); + } + if (object.sanDnsnames) { + if (!Array.isArray(object.sanDnsnames)) + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.sanDnsnames: array expected"); + message.sanDnsnames = []; + for (var i = 0; i < object.sanDnsnames.length; ++i) + message.sanDnsnames[i] = String(object.sanDnsnames[i]); + } + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + switch (object.scope) { + case "DEFAULT": + case 0: + message.scope = 0; + break; + case "EDGE_CACHE": + case 1: + message.scope = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Certificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate} message Certificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Certificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sanDnsnames = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.expireTime = null; + object.description = ""; + object.pemCertificate = ""; + object.scope = options.enums === String ? "DEFAULT" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.selfManaged != null && message.hasOwnProperty("selfManaged")) { + object.selfManaged = $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.toObject(message.selfManaged, options); + if (options.oneofs) + object.type = "selfManaged"; + } + if (message.sanDnsnames && message.sanDnsnames.length) { + object.sanDnsnames = []; + for (var j = 0; j < message.sanDnsnames.length; ++j) + object.sanDnsnames[j] = message.sanDnsnames[j]; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.managed != null && message.hasOwnProperty("managed")) { + object.managed = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.toObject(message.managed, options); + if (options.oneofs) + object.type = "managed"; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.certificatemanager.v1.Certificate.Scope[message.scope] : message.scope; + return object; + }; + + /** + * Converts this Certificate to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.Certificate + * @instance + * @returns {Object.} JSON object + */ + Certificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Certificate + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.Certificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Certificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.Certificate"; + }; + + Certificate.SelfManagedCertificate = (function() { + + /** + * Properties of a SelfManagedCertificate. + * @memberof google.cloud.certificatemanager.v1.Certificate + * @interface ISelfManagedCertificate + * @property {string|null} [pemCertificate] SelfManagedCertificate pemCertificate + * @property {string|null} [pemPrivateKey] SelfManagedCertificate pemPrivateKey + */ + + /** + * Constructs a new SelfManagedCertificate. + * @memberof google.cloud.certificatemanager.v1.Certificate + * @classdesc Represents a SelfManagedCertificate. + * @implements ISelfManagedCertificate + * @constructor + * @param {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate=} [properties] Properties to set + */ + function SelfManagedCertificate(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]]; + } + + /** + * SelfManagedCertificate pemCertificate. + * @member {string} pemCertificate + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @instance + */ + SelfManagedCertificate.prototype.pemCertificate = ""; + + /** + * SelfManagedCertificate pemPrivateKey. + * @member {string} pemPrivateKey + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @instance + */ + SelfManagedCertificate.prototype.pemPrivateKey = ""; + + /** + * Creates a new SelfManagedCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate} SelfManagedCertificate instance + */ + SelfManagedCertificate.create = function create(properties) { + return new SelfManagedCertificate(properties); + }; + + /** + * Encodes the specified SelfManagedCertificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate} message SelfManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelfManagedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pemCertificate != null && Object.hasOwnProperty.call(message, "pemCertificate")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pemCertificate); + if (message.pemPrivateKey != null && Object.hasOwnProperty.call(message, "pemPrivateKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pemPrivateKey); + return writer; + }; + + /** + * Encodes the specified SelfManagedCertificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ISelfManagedCertificate} message SelfManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelfManagedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelfManagedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate} SelfManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelfManagedCertificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pemCertificate = reader.string(); + break; + } + case 2: { + message.pemPrivateKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelfManagedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate} SelfManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelfManagedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelfManagedCertificate message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelfManagedCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + if (!$util.isString(message.pemCertificate)) + return "pemCertificate: string expected"; + if (message.pemPrivateKey != null && message.hasOwnProperty("pemPrivateKey")) + if (!$util.isString(message.pemPrivateKey)) + return "pemPrivateKey: string expected"; + return null; + }; + + /** + * Creates a SelfManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate} SelfManagedCertificate + */ + SelfManagedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate) + return object; + var message = new $root.google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate(); + if (object.pemCertificate != null) + message.pemCertificate = String(object.pemCertificate); + if (object.pemPrivateKey != null) + message.pemPrivateKey = String(object.pemPrivateKey); + return message; + }; + + /** + * Creates a plain object from a SelfManagedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate} message SelfManagedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelfManagedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pemCertificate = ""; + object.pemPrivateKey = ""; + } + if (message.pemCertificate != null && message.hasOwnProperty("pemCertificate")) + object.pemCertificate = message.pemCertificate; + if (message.pemPrivateKey != null && message.hasOwnProperty("pemPrivateKey")) + object.pemPrivateKey = message.pemPrivateKey; + return object; + }; + + /** + * Converts this SelfManagedCertificate to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @instance + * @returns {Object.} JSON object + */ + SelfManagedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelfManagedCertificate + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelfManagedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.Certificate.SelfManagedCertificate"; + }; + + return SelfManagedCertificate; + })(); + + Certificate.ManagedCertificate = (function() { + + /** + * Properties of a ManagedCertificate. + * @memberof google.cloud.certificatemanager.v1.Certificate + * @interface IManagedCertificate + * @property {Array.|null} [domains] ManagedCertificate domains + * @property {Array.|null} [dnsAuthorizations] ManagedCertificate dnsAuthorizations + * @property {string|null} [issuanceConfig] ManagedCertificate issuanceConfig + * @property {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State|null} [state] ManagedCertificate state + * @property {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue|null} [provisioningIssue] ManagedCertificate provisioningIssue + * @property {Array.|null} [authorizationAttemptInfo] ManagedCertificate authorizationAttemptInfo + */ + + /** + * Constructs a new ManagedCertificate. + * @memberof google.cloud.certificatemanager.v1.Certificate + * @classdesc Represents a ManagedCertificate. + * @implements IManagedCertificate + * @constructor + * @param {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate=} [properties] Properties to set + */ + function ManagedCertificate(properties) { + this.domains = []; + this.dnsAuthorizations = []; + this.authorizationAttemptInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedCertificate domains. + * @member {Array.} domains + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.domains = $util.emptyArray; + + /** + * ManagedCertificate dnsAuthorizations. + * @member {Array.} dnsAuthorizations + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.dnsAuthorizations = $util.emptyArray; + + /** + * ManagedCertificate issuanceConfig. + * @member {string} issuanceConfig + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.issuanceConfig = ""; + + /** + * ManagedCertificate state. + * @member {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State} state + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.state = 0; + + /** + * ManagedCertificate provisioningIssue. + * @member {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue|null|undefined} provisioningIssue + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.provisioningIssue = null; + + /** + * ManagedCertificate authorizationAttemptInfo. + * @member {Array.} authorizationAttemptInfo + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + */ + ManagedCertificate.prototype.authorizationAttemptInfo = $util.emptyArray; + + /** + * Creates a new ManagedCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate} ManagedCertificate instance + */ + ManagedCertificate.create = function create(properties) { + return new ManagedCertificate(properties); + }; + + /** + * Encodes the specified ManagedCertificate message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate} message ManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.domains[i]); + if (message.dnsAuthorizations != null && message.dnsAuthorizations.length) + for (var i = 0; i < message.dnsAuthorizations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dnsAuthorizations[i]); + if (message.provisioningIssue != null && Object.hasOwnProperty.call(message, "provisioningIssue")) + $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.encode(message.provisioningIssue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.authorizationAttemptInfo != null && message.authorizationAttemptInfo.length) + for (var i = 0; i < message.authorizationAttemptInfo.length; ++i) + $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.encode(message.authorizationAttemptInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.issuanceConfig != null && Object.hasOwnProperty.call(message, "issuanceConfig")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.issuanceConfig); + return writer; + }; + + /** + * Encodes the specified ManagedCertificate message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.IManagedCertificate} message ManagedCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate} ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCertificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + } + case 2: { + if (!(message.dnsAuthorizations && message.dnsAuthorizations.length)) + message.dnsAuthorizations = []; + message.dnsAuthorizations.push(reader.string()); + break; + } + case 6: { + message.issuanceConfig = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 3: { + message.provisioningIssue = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.authorizationAttemptInfo && message.authorizationAttemptInfo.length)) + message.authorizationAttemptInfo = []; + message.authorizationAttemptInfo.push($root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate} ManagedCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedCertificate message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domains != null && message.hasOwnProperty("domains")) { + if (!Array.isArray(message.domains)) + return "domains: array expected"; + for (var i = 0; i < message.domains.length; ++i) + if (!$util.isString(message.domains[i])) + return "domains: string[] expected"; + } + if (message.dnsAuthorizations != null && message.hasOwnProperty("dnsAuthorizations")) { + if (!Array.isArray(message.dnsAuthorizations)) + return "dnsAuthorizations: array expected"; + for (var i = 0; i < message.dnsAuthorizations.length; ++i) + if (!$util.isString(message.dnsAuthorizations[i])) + return "dnsAuthorizations: string[] expected"; + } + if (message.issuanceConfig != null && message.hasOwnProperty("issuanceConfig")) + if (!$util.isString(message.issuanceConfig)) + return "issuanceConfig: string 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: + break; + } + if (message.provisioningIssue != null && message.hasOwnProperty("provisioningIssue")) { + var error = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.verify(message.provisioningIssue); + if (error) + return "provisioningIssue." + error; + } + if (message.authorizationAttemptInfo != null && message.hasOwnProperty("authorizationAttemptInfo")) { + if (!Array.isArray(message.authorizationAttemptInfo)) + return "authorizationAttemptInfo: array expected"; + for (var i = 0; i < message.authorizationAttemptInfo.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.verify(message.authorizationAttemptInfo[i]); + if (error) + return "authorizationAttemptInfo." + error; + } + } + return null; + }; + + /** + * Creates a ManagedCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate} ManagedCertificate + */ + ManagedCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate) + return object; + var message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate(); + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + if (object.dnsAuthorizations) { + if (!Array.isArray(object.dnsAuthorizations)) + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.dnsAuthorizations: array expected"); + message.dnsAuthorizations = []; + for (var i = 0; i < object.dnsAuthorizations.length; ++i) + message.dnsAuthorizations[i] = String(object.dnsAuthorizations[i]); + } + if (object.issuanceConfig != null) + message.issuanceConfig = String(object.issuanceConfig); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PROVISIONING": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + } + if (object.provisioningIssue != null) { + if (typeof object.provisioningIssue !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.provisioningIssue: object expected"); + message.provisioningIssue = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.fromObject(object.provisioningIssue); + } + if (object.authorizationAttemptInfo) { + if (!Array.isArray(object.authorizationAttemptInfo)) + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.authorizationAttemptInfo: array expected"); + message.authorizationAttemptInfo = []; + for (var i = 0; i < object.authorizationAttemptInfo.length; ++i) { + if (typeof object.authorizationAttemptInfo[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.authorizationAttemptInfo: object expected"); + message.authorizationAttemptInfo[i] = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.fromObject(object.authorizationAttemptInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ManagedCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate} message ManagedCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.domains = []; + object.dnsAuthorizations = []; + object.authorizationAttemptInfo = []; + } + if (options.defaults) { + object.provisioningIssue = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.issuanceConfig = ""; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + if (message.dnsAuthorizations && message.dnsAuthorizations.length) { + object.dnsAuthorizations = []; + for (var j = 0; j < message.dnsAuthorizations.length; ++j) + object.dnsAuthorizations[j] = message.dnsAuthorizations[j]; + } + if (message.provisioningIssue != null && message.hasOwnProperty("provisioningIssue")) + object.provisioningIssue = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.toObject(message.provisioningIssue, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State[message.state] : message.state; + if (message.authorizationAttemptInfo && message.authorizationAttemptInfo.length) { + object.authorizationAttemptInfo = []; + for (var j = 0; j < message.authorizationAttemptInfo.length; ++j) + object.authorizationAttemptInfo[j] = $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.toObject(message.authorizationAttemptInfo[j], options); + } + if (message.issuanceConfig != null && message.hasOwnProperty("issuanceConfig")) + object.issuanceConfig = message.issuanceConfig; + return object; + }; + + /** + * Converts this ManagedCertificate to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @instance + * @returns {Object.} JSON object + */ + ManagedCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedCertificate + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedCertificate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.Certificate.ManagedCertificate"; + }; + + /** + * State enum. + * @name google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROVISIONING=1 PROVISIONING value + * @property {number} FAILED=2 FAILED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ManagedCertificate.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROVISIONING"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + ManagedCertificate.ProvisioningIssue = (function() { + + /** + * Properties of a ProvisioningIssue. + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @interface IProvisioningIssue + * @property {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason|null} [reason] ProvisioningIssue reason + * @property {string|null} [details] ProvisioningIssue details + */ + + /** + * Constructs a new ProvisioningIssue. + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @classdesc Represents a ProvisioningIssue. + * @implements IProvisioningIssue + * @constructor + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue=} [properties] Properties to set + */ + function ProvisioningIssue(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]]; + } + + /** + * ProvisioningIssue reason. + * @member {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason} reason + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @instance + */ + ProvisioningIssue.prototype.reason = 0; + + /** + * ProvisioningIssue details. + * @member {string} details + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @instance + */ + ProvisioningIssue.prototype.details = ""; + + /** + * Creates a new ProvisioningIssue instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue} ProvisioningIssue instance + */ + ProvisioningIssue.create = function create(properties) { + return new ProvisioningIssue(properties); + }; + + /** + * Encodes the specified ProvisioningIssue message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue} message ProvisioningIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisioningIssue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.details); + return writer; + }; + + /** + * Encodes the specified ProvisioningIssue message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IProvisioningIssue} message ProvisioningIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisioningIssue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProvisioningIssue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue} ProvisioningIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisioningIssue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reason = reader.int32(); + break; + } + case 2: { + message.details = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProvisioningIssue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue} ProvisioningIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisioningIssue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProvisioningIssue message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProvisioningIssue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a ProvisioningIssue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue} ProvisioningIssue + */ + ProvisioningIssue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue) + return object; + var message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue(); + switch (object.reason) { + case "REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "AUTHORIZATION_ISSUE": + case 1: + message.reason = 1; + break; + case "RATE_LIMITED": + case 2: + message.reason = 2; + break; + } + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a ProvisioningIssue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue} message ProvisioningIssue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProvisioningIssue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + object.details = ""; + } + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason[message.reason] : message.reason; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this ProvisioningIssue to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @instance + * @returns {Object.} JSON object + */ + ProvisioningIssue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProvisioningIssue + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProvisioningIssue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue"; + }; + + /** + * Reason enum. + * @name google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.ProvisioningIssue.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} AUTHORIZATION_ISSUE=1 AUTHORIZATION_ISSUE value + * @property {number} RATE_LIMITED=2 RATE_LIMITED value + */ + ProvisioningIssue.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTHORIZATION_ISSUE"] = 1; + values[valuesById[2] = "RATE_LIMITED"] = 2; + return values; + })(); + + return ProvisioningIssue; + })(); + + ManagedCertificate.AuthorizationAttemptInfo = (function() { + + /** + * Properties of an AuthorizationAttemptInfo. + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @interface IAuthorizationAttemptInfo + * @property {string|null} [domain] AuthorizationAttemptInfo domain + * @property {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State|null} [state] AuthorizationAttemptInfo state + * @property {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason|null} [failureReason] AuthorizationAttemptInfo failureReason + * @property {string|null} [details] AuthorizationAttemptInfo details + */ + + /** + * Constructs a new AuthorizationAttemptInfo. + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate + * @classdesc Represents an AuthorizationAttemptInfo. + * @implements IAuthorizationAttemptInfo + * @constructor + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo=} [properties] Properties to set + */ + function AuthorizationAttemptInfo(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]]; + } + + /** + * AuthorizationAttemptInfo domain. + * @member {string} domain + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @instance + */ + AuthorizationAttemptInfo.prototype.domain = ""; + + /** + * AuthorizationAttemptInfo state. + * @member {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State} state + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @instance + */ + AuthorizationAttemptInfo.prototype.state = 0; + + /** + * AuthorizationAttemptInfo failureReason. + * @member {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason} failureReason + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @instance + */ + AuthorizationAttemptInfo.prototype.failureReason = 0; + + /** + * AuthorizationAttemptInfo details. + * @member {string} details + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @instance + */ + AuthorizationAttemptInfo.prototype.details = ""; + + /** + * Creates a new AuthorizationAttemptInfo instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo} AuthorizationAttemptInfo instance + */ + AuthorizationAttemptInfo.create = function create(properties) { + return new AuthorizationAttemptInfo(properties); + }; + + /** + * Encodes the specified AuthorizationAttemptInfo message. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo} message AuthorizationAttemptInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationAttemptInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.failureReason != null && Object.hasOwnProperty.call(message, "failureReason")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failureReason); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.details); + return writer; + }; + + /** + * Encodes the specified AuthorizationAttemptInfo message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.IAuthorizationAttemptInfo} message AuthorizationAttemptInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationAttemptInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizationAttemptInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo} AuthorizationAttemptInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationAttemptInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.domain = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.failureReason = reader.int32(); + break; + } + case 4: { + message.details = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizationAttemptInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo} AuthorizationAttemptInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationAttemptInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizationAttemptInfo message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizationAttemptInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 6: + case 7: + break; + } + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + switch (message.failureReason) { + default: + return "failureReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates an AuthorizationAttemptInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo} AuthorizationAttemptInfo + */ + AuthorizationAttemptInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo) + return object; + var message = new $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo(); + if (object.domain != null) + message.domain = String(object.domain); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "AUTHORIZING": + case 1: + message.state = 1; + break; + case "AUTHORIZED": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + } + switch (object.failureReason) { + case "FAILURE_REASON_UNSPECIFIED": + case 0: + message.failureReason = 0; + break; + case "CONFIG": + case 1: + message.failureReason = 1; + break; + case "CAA": + case 2: + message.failureReason = 2; + break; + case "RATE_LIMITED": + case 3: + message.failureReason = 3; + break; + } + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from an AuthorizationAttemptInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo} message AuthorizationAttemptInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizationAttemptInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.domain = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.failureReason = options.enums === String ? "FAILURE_REASON_UNSPECIFIED" : 0; + object.details = ""; + } + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State[message.state] : message.state; + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + object.failureReason = options.enums === String ? $root.google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason[message.failureReason] : message.failureReason; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this AuthorizationAttemptInfo to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @instance + * @returns {Object.} JSON object + */ + AuthorizationAttemptInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizationAttemptInfo + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizationAttemptInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo"; + }; + + /** + * State enum. + * @name google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} AUTHORIZING=1 AUTHORIZING value + * @property {number} AUTHORIZED=6 AUTHORIZED value + * @property {number} FAILED=7 FAILED value + */ + AuthorizationAttemptInfo.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTHORIZING"] = 1; + values[valuesById[6] = "AUTHORIZED"] = 6; + values[valuesById[7] = "FAILED"] = 7; + return values; + })(); + + /** + * FailureReason enum. + * @name google.cloud.certificatemanager.v1.Certificate.ManagedCertificate.AuthorizationAttemptInfo.FailureReason + * @enum {number} + * @property {number} FAILURE_REASON_UNSPECIFIED=0 FAILURE_REASON_UNSPECIFIED value + * @property {number} CONFIG=1 CONFIG value + * @property {number} CAA=2 CAA value + * @property {number} RATE_LIMITED=3 RATE_LIMITED value + */ + AuthorizationAttemptInfo.FailureReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFIG"] = 1; + values[valuesById[2] = "CAA"] = 2; + values[valuesById[3] = "RATE_LIMITED"] = 3; + return values; + })(); + + return AuthorizationAttemptInfo; + })(); + + return ManagedCertificate; + })(); + + /** + * Scope enum. + * @name google.cloud.certificatemanager.v1.Certificate.Scope + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} EDGE_CACHE=1 EDGE_CACHE value + */ + Certificate.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "EDGE_CACHE"] = 1; + return values; + })(); + + return Certificate; + })(); + + v1.CertificateMap = (function() { + + /** + * Properties of a CertificateMap. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICertificateMap + * @property {string|null} [name] CertificateMap name + * @property {string|null} [description] CertificateMap description + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateMap createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateMap updateTime + * @property {Object.|null} [labels] CertificateMap labels + * @property {Array.|null} [gclbTargets] CertificateMap gclbTargets + */ + + /** + * Constructs a new CertificateMap. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CertificateMap. + * @implements ICertificateMap + * @constructor + * @param {google.cloud.certificatemanager.v1.ICertificateMap=} [properties] Properties to set + */ + function CertificateMap(properties) { + this.labels = {}; + this.gclbTargets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CertificateMap name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.name = ""; + + /** + * CertificateMap description. + * @member {string} description + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.description = ""; + + /** + * CertificateMap createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.createTime = null; + + /** + * CertificateMap updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.updateTime = null; + + /** + * CertificateMap labels. + * @member {Object.} labels + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.labels = $util.emptyObject; + + /** + * CertificateMap gclbTargets. + * @member {Array.} gclbTargets + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + */ + CertificateMap.prototype.gclbTargets = $util.emptyArray; + + /** + * Creates a new CertificateMap instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMap=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateMap} CertificateMap instance + */ + CertificateMap.create = function create(properties) { + return new CertificateMap(properties); + }; + + /** + * Encodes the specified CertificateMap message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMap} message CertificateMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateMap.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.gclbTargets != null && message.gclbTargets.length) + for (var i = 0; i < message.gclbTargets.length; ++i) + $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.encode(message.gclbTargets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateMap message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMap} message CertificateMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateMap} CertificateMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateMap(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + if (!(message.gclbTargets && message.gclbTargets.length)) + message.gclbTargets = []; + message.gclbTargets.push($root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateMap} CertificateMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateMap message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateMap.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.gclbTargets != null && message.hasOwnProperty("gclbTargets")) { + if (!Array.isArray(message.gclbTargets)) + return "gclbTargets: array expected"; + for (var i = 0; i < message.gclbTargets.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.verify(message.gclbTargets[i]); + if (error) + return "gclbTargets." + error; + } + } + return null; + }; + + /** + * Creates a CertificateMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateMap} CertificateMap + */ + CertificateMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateMap) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateMap(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.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.gclbTargets) { + if (!Array.isArray(object.gclbTargets)) + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.gclbTargets: array expected"); + message.gclbTargets = []; + for (var i = 0; i < object.gclbTargets.length; ++i) { + if (typeof object.gclbTargets[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.gclbTargets: object expected"); + message.gclbTargets[i] = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.fromObject(object.gclbTargets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CertificateMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap} message CertificateMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gclbTargets = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.description = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, 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.gclbTargets && message.gclbTargets.length) { + object.gclbTargets = []; + for (var j = 0; j < message.gclbTargets.length; ++j) + object.gclbTargets[j] = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.toObject(message.gclbTargets[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this CertificateMap to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @instance + * @returns {Object.} JSON object + */ + CertificateMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateMap + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateMap"; + }; + + CertificateMap.GclbTarget = (function() { + + /** + * Properties of a GclbTarget. + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @interface IGclbTarget + * @property {string|null} [targetHttpsProxy] GclbTarget targetHttpsProxy + * @property {string|null} [targetSslProxy] GclbTarget targetSslProxy + * @property {Array.|null} [ipConfigs] GclbTarget ipConfigs + */ + + /** + * Constructs a new GclbTarget. + * @memberof google.cloud.certificatemanager.v1.CertificateMap + * @classdesc Represents a GclbTarget. + * @implements IGclbTarget + * @constructor + * @param {google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget=} [properties] Properties to set + */ + function GclbTarget(properties) { + this.ipConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GclbTarget targetHttpsProxy. + * @member {string|null|undefined} targetHttpsProxy + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @instance + */ + GclbTarget.prototype.targetHttpsProxy = null; + + /** + * GclbTarget targetSslProxy. + * @member {string|null|undefined} targetSslProxy + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @instance + */ + GclbTarget.prototype.targetSslProxy = null; + + /** + * GclbTarget ipConfigs. + * @member {Array.} ipConfigs + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @instance + */ + GclbTarget.prototype.ipConfigs = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GclbTarget targetProxy. + * @member {"targetHttpsProxy"|"targetSslProxy"|undefined} targetProxy + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @instance + */ + Object.defineProperty(GclbTarget.prototype, "targetProxy", { + get: $util.oneOfGetter($oneOfFields = ["targetHttpsProxy", "targetSslProxy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GclbTarget instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget} GclbTarget instance + */ + GclbTarget.create = function create(properties) { + return new GclbTarget(properties); + }; + + /** + * Encodes the specified GclbTarget message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget} message GclbTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GclbTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetHttpsProxy); + if (message.ipConfigs != null && message.ipConfigs.length) + for (var i = 0; i < message.ipConfigs.length; ++i) + $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.encode(message.ipConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified GclbTarget message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.IGclbTarget} message GclbTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GclbTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GclbTarget message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget} GclbTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GclbTarget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetHttpsProxy = reader.string(); + break; + } + case 3: { + message.targetSslProxy = reader.string(); + break; + } + case 2: { + if (!(message.ipConfigs && message.ipConfigs.length)) + message.ipConfigs = []; + message.ipConfigs.push($root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GclbTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget} GclbTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GclbTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GclbTarget message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GclbTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) { + properties.targetProxy = 1; + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) { + if (properties.targetProxy === 1) + return "targetProxy: multiple values"; + properties.targetProxy = 1; + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + } + if (message.ipConfigs != null && message.hasOwnProperty("ipConfigs")) { + if (!Array.isArray(message.ipConfigs)) + return "ipConfigs: array expected"; + for (var i = 0; i < message.ipConfigs.length; ++i) { + var error = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.verify(message.ipConfigs[i]); + if (error) + return "ipConfigs." + error; + } + } + return null; + }; + + /** + * Creates a GclbTarget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget} GclbTarget + */ + GclbTarget.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget(); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + if (object.ipConfigs) { + if (!Array.isArray(object.ipConfigs)) + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.ipConfigs: array expected"); + message.ipConfigs = []; + for (var i = 0; i < object.ipConfigs.length; ++i) { + if (typeof object.ipConfigs[i] !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.ipConfigs: object expected"); + message.ipConfigs[i] = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.fromObject(object.ipConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GclbTarget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget} message GclbTarget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GclbTarget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipConfigs = []; + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) { + object.targetHttpsProxy = message.targetHttpsProxy; + if (options.oneofs) + object.targetProxy = "targetHttpsProxy"; + } + if (message.ipConfigs && message.ipConfigs.length) { + object.ipConfigs = []; + for (var j = 0; j < message.ipConfigs.length; ++j) + object.ipConfigs[j] = $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.toObject(message.ipConfigs[j], options); + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) { + object.targetSslProxy = message.targetSslProxy; + if (options.oneofs) + object.targetProxy = "targetSslProxy"; + } + return object; + }; + + /** + * Converts this GclbTarget to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @instance + * @returns {Object.} JSON object + */ + GclbTarget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GclbTarget + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GclbTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateMap.GclbTarget"; + }; + + GclbTarget.IpConfig = (function() { + + /** + * Properties of an IpConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @interface IIpConfig + * @property {string|null} [ipAddress] IpConfig ipAddress + * @property {Array.|null} [ports] IpConfig ports + */ + + /** + * Constructs a new IpConfig. + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget + * @classdesc Represents an IpConfig. + * @implements IIpConfig + * @constructor + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig=} [properties] Properties to set + */ + function IpConfig(properties) { + this.ports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpConfig ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @instance + */ + IpConfig.prototype.ipAddress = ""; + + /** + * IpConfig ports. + * @member {Array.} ports + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @instance + */ + IpConfig.prototype.ports = $util.emptyArray; + + /** + * Creates a new IpConfig instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig} IpConfig instance + */ + IpConfig.create = function create(properties) { + return new IpConfig(properties); + }; + + /** + * Encodes the specified IpConfig message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig} message IpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipAddress); + if (message.ports != null && message.ports.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(message.ports[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IpConfig message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IIpConfig} message IpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig} IpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ipAddress = reader.string(); + break; + } + case 3: { + if (!(message.ports && message.ports.length)) + message.ports = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ports.push(reader.uint32()); + } else + message.ports.push(reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig} IpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpConfig message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + if (message.ports != null && message.hasOwnProperty("ports")) { + if (!Array.isArray(message.ports)) + return "ports: array expected"; + for (var i = 0; i < message.ports.length; ++i) + if (!$util.isInteger(message.ports[i])) + return "ports: integer[] expected"; + } + return null; + }; + + /** + * Creates an IpConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig} IpConfig + */ + IpConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig(); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = object.ports[i] >>> 0; + } + return message; + }; + + /** + * Creates a plain object from an IpConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig} message IpConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (options.defaults) + object.ipAddress = ""; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + return object; + }; + + /** + * Converts this IpConfig to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @instance + * @returns {Object.} JSON object + */ + IpConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpConfig + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateMap.GclbTarget.IpConfig"; + }; + + return IpConfig; + })(); + + return GclbTarget; + })(); + + return CertificateMap; + })(); + + v1.CertificateMapEntry = (function() { + + /** + * Properties of a CertificateMapEntry. + * @memberof google.cloud.certificatemanager.v1 + * @interface ICertificateMapEntry + * @property {string|null} [name] CertificateMapEntry name + * @property {string|null} [description] CertificateMapEntry description + * @property {google.protobuf.ITimestamp|null} [createTime] CertificateMapEntry createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CertificateMapEntry updateTime + * @property {Object.|null} [labels] CertificateMapEntry labels + * @property {string|null} [hostname] CertificateMapEntry hostname + * @property {google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|null} [matcher] CertificateMapEntry matcher + * @property {Array.|null} [certificates] CertificateMapEntry certificates + * @property {google.cloud.certificatemanager.v1.ServingState|null} [state] CertificateMapEntry state + */ + + /** + * Constructs a new CertificateMapEntry. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a CertificateMapEntry. + * @implements ICertificateMapEntry + * @constructor + * @param {google.cloud.certificatemanager.v1.ICertificateMapEntry=} [properties] Properties to set + */ + function CertificateMapEntry(properties) { + this.labels = {}; + this.certificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CertificateMapEntry name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.name = ""; + + /** + * CertificateMapEntry description. + * @member {string} description + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.description = ""; + + /** + * CertificateMapEntry createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.createTime = null; + + /** + * CertificateMapEntry updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.updateTime = null; + + /** + * CertificateMapEntry labels. + * @member {Object.} labels + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.labels = $util.emptyObject; + + /** + * CertificateMapEntry hostname. + * @member {string|null|undefined} hostname + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.hostname = null; + + /** + * CertificateMapEntry matcher. + * @member {google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher|null|undefined} matcher + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.matcher = null; + + /** + * CertificateMapEntry certificates. + * @member {Array.} certificates + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.certificates = $util.emptyArray; + + /** + * CertificateMapEntry state. + * @member {google.cloud.certificatemanager.v1.ServingState} state + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + CertificateMapEntry.prototype.state = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CertificateMapEntry match. + * @member {"hostname"|"matcher"|undefined} match + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + */ + Object.defineProperty(CertificateMapEntry.prototype, "match", { + get: $util.oneOfGetter($oneOfFields = ["hostname", "matcher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CertificateMapEntry instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMapEntry=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.CertificateMapEntry} CertificateMapEntry instance + */ + CertificateMapEntry.create = function create(properties) { + return new CertificateMapEntry(properties); + }; + + /** + * Encodes the specified CertificateMapEntry message. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMapEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMapEntry} message CertificateMapEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateMapEntry.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostname); + if (message.certificates != null && message.certificates.length) + for (var i = 0; i < message.certificates.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.certificates[i]); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.matcher != null && Object.hasOwnProperty.call(message, "matcher")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.matcher); + return writer; + }; + + /** + * Encodes the specified CertificateMapEntry message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.CertificateMapEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {google.cloud.certificatemanager.v1.ICertificateMapEntry} message CertificateMapEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateMapEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateMapEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.CertificateMapEntry} CertificateMapEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateMapEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.CertificateMapEntry(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $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; + } + case 5: { + message.hostname = reader.string(); + break; + } + case 10: { + message.matcher = reader.int32(); + break; + } + case 7: { + if (!(message.certificates && message.certificates.length)) + message.certificates = []; + message.certificates.push(reader.string()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateMapEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.CertificateMapEntry} CertificateMapEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateMapEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateMapEntry message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateMapEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.hostname != null && message.hasOwnProperty("hostname")) { + properties.match = 1; + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + } + if (message.matcher != null && message.hasOwnProperty("matcher")) { + if (properties.match === 1) + return "match: multiple values"; + properties.match = 1; + switch (message.matcher) { + default: + return "matcher: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.certificates != null && message.hasOwnProperty("certificates")) { + if (!Array.isArray(message.certificates)) + return "certificates: array expected"; + for (var i = 0; i < message.certificates.length; ++i) + if (!$util.isString(message.certificates[i])) + return "certificates: string[] expected"; + } + 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 CertificateMapEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.CertificateMapEntry} CertificateMapEntry + */ + CertificateMapEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.CertificateMapEntry) + return object; + var message = new $root.google.cloud.certificatemanager.v1.CertificateMapEntry(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMapEntry.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMapEntry.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMapEntry.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.hostname != null) + message.hostname = String(object.hostname); + switch (object.matcher) { + case "MATCHER_UNSPECIFIED": + case 0: + message.matcher = 0; + break; + case "PRIMARY": + case 1: + message.matcher = 1; + break; + } + if (object.certificates) { + if (!Array.isArray(object.certificates)) + throw TypeError(".google.cloud.certificatemanager.v1.CertificateMapEntry.certificates: array expected"); + message.certificates = []; + for (var i = 0; i < object.certificates.length; ++i) + message.certificates[i] = String(object.certificates[i]); + } + switch (object.state) { + case "SERVING_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PENDING": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CertificateMapEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {google.cloud.certificatemanager.v1.CertificateMapEntry} message CertificateMapEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateMapEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.certificates = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "SERVING_STATE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.hostname != null && message.hasOwnProperty("hostname")) { + object.hostname = message.hostname; + if (options.oneofs) + object.match = "hostname"; + } + if (message.certificates && message.certificates.length) { + object.certificates = []; + for (var j = 0; j < message.certificates.length; ++j) + object.certificates[j] = message.certificates[j]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.certificatemanager.v1.ServingState[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.matcher != null && message.hasOwnProperty("matcher")) { + object.matcher = options.enums === String ? $root.google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher[message.matcher] : message.matcher; + if (options.oneofs) + object.match = "matcher"; + } + return object; + }; + + /** + * Converts this CertificateMapEntry to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @instance + * @returns {Object.} JSON object + */ + CertificateMapEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateMapEntry + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.CertificateMapEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateMapEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.CertificateMapEntry"; + }; + + /** + * Matcher enum. + * @name google.cloud.certificatemanager.v1.CertificateMapEntry.Matcher + * @enum {number} + * @property {number} MATCHER_UNSPECIFIED=0 MATCHER_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + */ + CertificateMapEntry.Matcher = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCHER_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + return values; + })(); + + return CertificateMapEntry; + })(); + + v1.DnsAuthorization = (function() { + + /** + * Properties of a DnsAuthorization. + * @memberof google.cloud.certificatemanager.v1 + * @interface IDnsAuthorization + * @property {string|null} [name] DnsAuthorization name + * @property {google.protobuf.ITimestamp|null} [createTime] DnsAuthorization createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DnsAuthorization updateTime + * @property {Object.|null} [labels] DnsAuthorization labels + * @property {string|null} [description] DnsAuthorization description + * @property {string|null} [domain] DnsAuthorization domain + * @property {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord|null} [dnsResourceRecord] DnsAuthorization dnsResourceRecord + */ + + /** + * Constructs a new DnsAuthorization. + * @memberof google.cloud.certificatemanager.v1 + * @classdesc Represents a DnsAuthorization. + * @implements IDnsAuthorization + * @constructor + * @param {google.cloud.certificatemanager.v1.IDnsAuthorization=} [properties] Properties to set + */ + function DnsAuthorization(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]]; + } + + /** + * DnsAuthorization name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.name = ""; + + /** + * DnsAuthorization createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.createTime = null; + + /** + * DnsAuthorization updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.updateTime = null; + + /** + * DnsAuthorization labels. + * @member {Object.} labels + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.labels = $util.emptyObject; + + /** + * DnsAuthorization description. + * @member {string} description + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.description = ""; + + /** + * DnsAuthorization domain. + * @member {string} domain + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.domain = ""; + + /** + * DnsAuthorization dnsResourceRecord. + * @member {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord|null|undefined} dnsResourceRecord + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + */ + DnsAuthorization.prototype.dnsResourceRecord = null; + + /** + * Creates a new DnsAuthorization instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {google.cloud.certificatemanager.v1.IDnsAuthorization=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization} DnsAuthorization instance + */ + DnsAuthorization.create = function create(properties) { + return new DnsAuthorization(properties); + }; + + /** + * Encodes the specified DnsAuthorization message. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {google.cloud.certificatemanager.v1.IDnsAuthorization} message DnsAuthorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsAuthorization.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domain); + if (message.dnsResourceRecord != null && Object.hasOwnProperty.call(message, "dnsResourceRecord")) + $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.encode(message.dnsResourceRecord, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DnsAuthorization message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {google.cloud.certificatemanager.v1.IDnsAuthorization} message DnsAuthorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsAuthorization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DnsAuthorization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization} DnsAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsAuthorization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DnsAuthorization(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $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; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.domain = reader.string(); + break; + } + case 10: { + message.dnsResourceRecord = $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DnsAuthorization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization} DnsAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsAuthorization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DnsAuthorization message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DnsAuthorization.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.dnsResourceRecord != null && message.hasOwnProperty("dnsResourceRecord")) { + var error = $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.verify(message.dnsResourceRecord); + if (error) + return "dnsResourceRecord." + error; + } + return null; + }; + + /** + * Creates a DnsAuthorization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization} DnsAuthorization + */ + DnsAuthorization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DnsAuthorization) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DnsAuthorization(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.DnsAuthorization.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.DnsAuthorization.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.DnsAuthorization.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.description != null) + message.description = String(object.description); + if (object.domain != null) + message.domain = String(object.domain); + if (object.dnsResourceRecord != null) { + if (typeof object.dnsResourceRecord !== "object") + throw TypeError(".google.cloud.certificatemanager.v1.DnsAuthorization.dnsResourceRecord: object expected"); + message.dnsResourceRecord = $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.fromObject(object.dnsResourceRecord); + } + return message; + }; + + /** + * Creates a plain object from a DnsAuthorization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {google.cloud.certificatemanager.v1.DnsAuthorization} message DnsAuthorization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DnsAuthorization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.domain = ""; + object.dnsResourceRecord = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.dnsResourceRecord != null && message.hasOwnProperty("dnsResourceRecord")) + object.dnsResourceRecord = $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.toObject(message.dnsResourceRecord, options); + return object; + }; + + /** + * Converts this DnsAuthorization to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @instance + * @returns {Object.} JSON object + */ + DnsAuthorization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DnsAuthorization + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DnsAuthorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DnsAuthorization"; + }; + + DnsAuthorization.DnsResourceRecord = (function() { + + /** + * Properties of a DnsResourceRecord. + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @interface IDnsResourceRecord + * @property {string|null} [name] DnsResourceRecord name + * @property {string|null} [type] DnsResourceRecord type + * @property {string|null} [data] DnsResourceRecord data + */ + + /** + * Constructs a new DnsResourceRecord. + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization + * @classdesc Represents a DnsResourceRecord. + * @implements IDnsResourceRecord + * @constructor + * @param {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord=} [properties] Properties to set + */ + function DnsResourceRecord(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]]; + } + + /** + * DnsResourceRecord name. + * @member {string} name + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @instance + */ + DnsResourceRecord.prototype.name = ""; + + /** + * DnsResourceRecord type. + * @member {string} type + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @instance + */ + DnsResourceRecord.prototype.type = ""; + + /** + * DnsResourceRecord data. + * @member {string} data + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @instance + */ + DnsResourceRecord.prototype.data = ""; + + /** + * Creates a new DnsResourceRecord instance using the specified properties. + * @function create + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord=} [properties] Properties to set + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord} DnsResourceRecord instance + */ + DnsResourceRecord.create = function create(properties) { + return new DnsResourceRecord(properties); + }; + + /** + * Encodes the specified DnsResourceRecord message. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord} message DnsResourceRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsResourceRecord.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 2 =*/18).string(message.type); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.data); + return writer; + }; + + /** + * Encodes the specified DnsResourceRecord message, length delimited. Does not implicitly {@link google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {google.cloud.certificatemanager.v1.DnsAuthorization.IDnsResourceRecord} message DnsResourceRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsResourceRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DnsResourceRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord} DnsResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsResourceRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.data = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DnsResourceRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord} DnsResourceRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsResourceRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DnsResourceRecord message. + * @function verify + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DnsResourceRecord.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")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!$util.isString(message.data)) + return "data: string expected"; + return null; + }; + + /** + * Creates a DnsResourceRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord} DnsResourceRecord + */ + DnsResourceRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord) + return object; + var message = new $root.google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.data != null) + message.data = String(object.data); + return message; + }; + + /** + * Creates a plain object from a DnsResourceRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord} message DnsResourceRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DnsResourceRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.data = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.data != null && message.hasOwnProperty("data")) + object.data = message.data; + return object; + }; + + /** + * Converts this DnsResourceRecord to JSON. + * @function toJSON + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @instance + * @returns {Object.} JSON object + */ + DnsResourceRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DnsResourceRecord + * @function getTypeUrl + * @memberof google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DnsResourceRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.certificatemanager.v1.DnsAuthorization.DnsResourceRecord"; + }; + + return DnsResourceRecord; + })(); + + return DnsAuthorization; + })(); + + /** + * ServingState enum. + * @name google.cloud.certificatemanager.v1.ServingState + * @enum {number} + * @property {number} SERVING_STATE_UNSPECIFIED=0 SERVING_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PENDING=2 PENDING value + */ + v1.ServingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PENDING"] = 2; + return values; + })(); + + return v1; + })(); + + return certificatemanager; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.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; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-certificatemanager/protos/protos.json b/packages/google-cloud-certificatemanager/protos/protos.json new file mode 100644 index 000000000000..596732babc5f --- /dev/null +++ b/packages/google-cloud-certificatemanager/protos/protos.json @@ -0,0 +1,3220 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "certificatemanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.CertificateManager.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/certificatemanager/v1;certificatemanager", + "java_multiple_files": true, + "java_outer_classname": "CertificateManagerProto", + "java_package": "com.google.cloud.certificatemanager.v1", + "php_namespace": "Google\\Cloud\\CertificateManager\\V1", + "ruby_package": "Google::Cloud::CertificateManager::V1", + "(google.api.resource_definition).type": "privateca.googleapis.com/CaPool", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}" + }, + "nested": { + "ListCertificateIssuanceConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListCertificateIssuanceConfigsResponse": { + "fields": { + "certificateIssuanceConfigs": { + "rule": "repeated", + "type": "CertificateIssuanceConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCertificateIssuanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + } + } + }, + "CreateCertificateIssuanceConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "certificateIssuanceConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateIssuanceConfig": { + "type": "CertificateIssuanceConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCertificateIssuanceConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + } + } + }, + "CertificateIssuanceConfig": { + "options": { + "(google.api.resource).type": "certificatemanager.googleapis.com/CertificateIssuanceConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateIssuanceConfigs/{certificate_issuance_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "certificateAuthorityConfig": { + "type": "CertificateAuthorityConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lifetime": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rotationWindowPercentage": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keyAlgorithm": { + "type": "KeyAlgorithm", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "CertificateAuthorityConfig": { + "oneofs": { + "kind": { + "oneof": [ + "certificateAuthorityServiceConfig" + ] + } + }, + "fields": { + "certificateAuthorityServiceConfig": { + "type": "CertificateAuthorityServiceConfig", + "id": 1 + } + }, + "nested": { + "CertificateAuthorityServiceConfig": { + "fields": { + "caPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + } + } + } + } + }, + "KeyAlgorithm": { + "values": { + "KEY_ALGORITHM_UNSPECIFIED": 0, + "RSA_2048": 1, + "ECDSA_P256": 4 + } + } + } + }, + "CertificateManager": { + "options": { + "(google.api.default_host)": "certificatemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListCertificates": { + "requestType": "ListCertificatesRequest", + "responseType": "ListCertificatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/certificates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/certificates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCertificate": { + "requestType": "GetCertificateRequest", + "responseType": "Certificate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/certificates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCertificate": { + "requestType": "CreateCertificateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/certificates", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "parent,certificate,certificate_id", + "(google.longrunning.operation_info).response_type": "Certificate", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/certificates", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "parent,certificate,certificate_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Certificate", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCertificate": { + "requestType": "UpdateCertificateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate.name=projects/*/locations/*/certificates/*}", + "(google.api.http).body": "certificate", + "(google.api.method_signature)": "certificate,update_mask", + "(google.longrunning.operation_info).response_type": "Certificate", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate.name=projects/*/locations/*/certificates/*}", + "body": "certificate" + } + }, + { + "(google.api.method_signature)": "certificate,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Certificate", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificate": { + "requestType": "DeleteCertificateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificates/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/certificates/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCertificateMaps": { + "requestType": "ListCertificateMapsRequest", + "responseType": "ListCertificateMapsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/certificateMaps", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/certificateMaps" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCertificateMap": { + "requestType": "GetCertificateMapRequest", + "responseType": "CertificateMap", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificateMaps/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/certificateMaps/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCertificateMap": { + "requestType": "CreateCertificateMapRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/certificateMaps", + "(google.api.http).body": "certificate_map", + "(google.api.method_signature)": "parent,certificate_map,certificate_map_id", + "(google.longrunning.operation_info).response_type": "CertificateMap", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/certificateMaps", + "body": "certificate_map" + } + }, + { + "(google.api.method_signature)": "parent,certificate_map,certificate_map_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateMap", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCertificateMap": { + "requestType": "UpdateCertificateMapRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate_map.name=projects/*/locations/*/certificateMaps/*}", + "(google.api.http).body": "certificate_map", + "(google.api.method_signature)": "certificate_map,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateMap", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate_map.name=projects/*/locations/*/certificateMaps/*}", + "body": "certificate_map" + } + }, + { + "(google.api.method_signature)": "certificate_map,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateMap", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificateMap": { + "requestType": "DeleteCertificateMapRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificateMaps/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/certificateMaps/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCertificateMapEntries": { + "requestType": "ListCertificateMapEntriesRequest", + "responseType": "ListCertificateMapEntriesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCertificateMapEntry": { + "requestType": "GetCertificateMapEntryRequest", + "responseType": "CertificateMapEntry", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCertificateMapEntry": { + "requestType": "CreateCertificateMapEntryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries", + "(google.api.http).body": "certificate_map_entry", + "(google.api.method_signature)": "parent,certificate_map_entry,certificate_map_entry_id", + "(google.longrunning.operation_info).response_type": "CertificateMapEntry", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/certificateMaps/*}/certificateMapEntries", + "body": "certificate_map_entry" + } + }, + { + "(google.api.method_signature)": "parent,certificate_map_entry,certificate_map_entry_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateMapEntry", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCertificateMapEntry": { + "requestType": "UpdateCertificateMapEntryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{certificate_map_entry.name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}", + "(google.api.http).body": "certificate_map_entry", + "(google.api.method_signature)": "certificate_map_entry,update_mask", + "(google.longrunning.operation_info).response_type": "CertificateMapEntry", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{certificate_map_entry.name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}", + "body": "certificate_map_entry" + } + }, + { + "(google.api.method_signature)": "certificate_map_entry,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateMapEntry", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificateMapEntry": { + "requestType": "DeleteCertificateMapEntryRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/certificateMaps/*/certificateMapEntries/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDnsAuthorizations": { + "requestType": "ListDnsAuthorizationsRequest", + "responseType": "ListDnsAuthorizationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dnsAuthorizations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dnsAuthorizations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDnsAuthorization": { + "requestType": "GetDnsAuthorizationRequest", + "responseType": "DnsAuthorization", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDnsAuthorization": { + "requestType": "CreateDnsAuthorizationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/dnsAuthorizations", + "(google.api.http).body": "dns_authorization", + "(google.api.method_signature)": "parent,dns_authorization,dns_authorization_id", + "(google.longrunning.operation_info).response_type": "DnsAuthorization", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/dnsAuthorizations", + "body": "dns_authorization" + } + }, + { + "(google.api.method_signature)": "parent,dns_authorization,dns_authorization_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DnsAuthorization", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateDnsAuthorization": { + "requestType": "UpdateDnsAuthorizationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{dns_authorization.name=projects/*/locations/*/dnsAuthorizations/*}", + "(google.api.http).body": "dns_authorization", + "(google.api.method_signature)": "dns_authorization,update_mask", + "(google.longrunning.operation_info).response_type": "DnsAuthorization", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dns_authorization.name=projects/*/locations/*/dnsAuthorizations/*}", + "body": "dns_authorization" + } + }, + { + "(google.api.method_signature)": "dns_authorization,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DnsAuthorization", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDnsAuthorization": { + "requestType": "DeleteDnsAuthorizationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dnsAuthorizations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCertificateIssuanceConfigs": { + "requestType": "ListCertificateIssuanceConfigsRequest", + "responseType": "ListCertificateIssuanceConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCertificateIssuanceConfig": { + "requestType": "GetCertificateIssuanceConfigRequest", + "responseType": "CertificateIssuanceConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCertificateIssuanceConfig": { + "requestType": "CreateCertificateIssuanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs", + "(google.api.http).body": "certificate_issuance_config", + "(google.api.method_signature)": "parent,certificate_issuance_config,certificate_issuance_config_id", + "(google.longrunning.operation_info).response_type": "CertificateIssuanceConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/certificateIssuanceConfigs", + "body": "certificate_issuance_config" + } + }, + { + "(google.api.method_signature)": "parent,certificate_issuance_config,certificate_issuance_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CertificateIssuanceConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCertificateIssuanceConfig": { + "requestType": "DeleteCertificateIssuanceConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/certificateIssuanceConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListCertificatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListCertificatesResponse": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "Certificate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/Certificate" + } + } + } + }, + "CreateCertificateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "certificateId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificate": { + "type": "Certificate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCertificateRequest": { + "fields": { + "certificate": { + "type": "Certificate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCertificateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/Certificate" + } + } + } + }, + "ListCertificateMapsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListCertificateMapsResponse": { + "fields": { + "certificateMaps": { + "rule": "repeated", + "type": "CertificateMap", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCertificateMapRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMap" + } + } + } + }, + "CreateCertificateMapRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "certificateMapId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateMap": { + "type": "CertificateMap", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCertificateMapRequest": { + "fields": { + "certificateMap": { + "type": "CertificateMap", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCertificateMapRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMap" + } + } + } + }, + "ListCertificateMapEntriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMap" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListCertificateMapEntriesResponse": { + "fields": { + "certificateMapEntries": { + "rule": "repeated", + "type": "CertificateMapEntry", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetCertificateMapEntryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMapEntry" + } + } + } + }, + "CreateCertificateMapEntryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMap" + } + }, + "certificateMapEntryId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "certificateMapEntry": { + "type": "CertificateMapEntry", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCertificateMapEntryRequest": { + "fields": { + "certificateMapEntry": { + "type": "CertificateMapEntry", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCertificateMapEntryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateMapEntry" + } + } + } + }, + "ListDnsAuthorizationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListDnsAuthorizationsResponse": { + "fields": { + "dnsAuthorizations": { + "rule": "repeated", + "type": "DnsAuthorization", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDnsAuthorizationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/DnsAuthorization" + } + } + } + }, + "CreateDnsAuthorizationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "dnsAuthorizationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dnsAuthorization": { + "type": "DnsAuthorization", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDnsAuthorizationRequest": { + "fields": { + "dnsAuthorization": { + "type": "DnsAuthorization", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDnsAuthorizationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/DnsAuthorization" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusMessage": { + "type": "string", + "id": 5 + }, + "requestedCancellation": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "Certificate": { + "options": { + "(google.api.resource).type": "certificatemanager.googleapis.com/Certificate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificates/{certificate}" + }, + "oneofs": { + "type": { + "oneof": [ + "selfManaged", + "managed" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "selfManaged": { + "type": "SelfManagedCertificate", + "id": 5 + }, + "managed": { + "type": "ManagedCertificate", + "id": 11 + }, + "sanDnsnames": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pemCertificate": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scope": { + "type": "Scope", + "id": 12, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "SelfManagedCertificate": { + "fields": { + "pemCertificate": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "pemPrivateKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "ManagedCertificate": { + "fields": { + "domains": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "dnsAuthorizations": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/DnsAuthorization" + } + }, + "issuanceConfig": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/CertificateIssuanceConfig" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "provisioningIssue": { + "type": "ProvisioningIssue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "authorizationAttemptInfo": { + "rule": "repeated", + "type": "AuthorizationAttemptInfo", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROVISIONING": 1, + "FAILED": 2, + "ACTIVE": 3 + } + }, + "ProvisioningIssue": { + "fields": { + "reason": { + "type": "Reason", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "details": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "AUTHORIZATION_ISSUE": 1, + "RATE_LIMITED": 2 + } + } + } + }, + "AuthorizationAttemptInfo": { + "fields": { + "domain": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureReason": { + "type": "FailureReason", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "details": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "AUTHORIZING": 1, + "AUTHORIZED": 6, + "FAILED": 7 + } + }, + "FailureReason": { + "values": { + "FAILURE_REASON_UNSPECIFIED": 0, + "CONFIG": 1, + "CAA": 2, + "RATE_LIMITED": 3 + } + } + } + } + } + }, + "Scope": { + "values": { + "DEFAULT": 0, + "EDGE_CACHE": 1 + } + } + } + }, + "CertificateMap": { + "options": { + "(google.api.resource).type": "certificatemanager.googleapis.com/CertificateMap", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateMaps/{certificate_map}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "gclbTargets": { + "rule": "repeated", + "type": "GclbTarget", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GclbTarget": { + "oneofs": { + "targetProxy": { + "oneof": [ + "targetHttpsProxy", + "targetSslProxy" + ] + } + }, + "fields": { + "targetHttpsProxy": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetSslProxy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ipConfigs": { + "rule": "repeated", + "type": "IpConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "IpConfig": { + "fields": { + "ipAddress": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ports": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + }, + "CertificateMapEntry": { + "options": { + "(google.api.resource).type": "certificatemanager.googleapis.com/CertificateMapEntry", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/certificateMaps/{certificate_map}/certificateMapEntries/{certificate_map_entry}" + }, + "oneofs": { + "match": { + "oneof": [ + "hostname", + "matcher" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "hostname": { + "type": "string", + "id": 5 + }, + "matcher": { + "type": "Matcher", + "id": 10 + }, + "certificates": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/Certificate" + } + }, + "state": { + "type": "ServingState", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Matcher": { + "values": { + "MATCHER_UNSPECIFIED": 0, + "PRIMARY": 1 + } + } + } + }, + "DnsAuthorization": { + "options": { + "(google.api.resource).type": "certificatemanager.googleapis.com/DnsAuthorization", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dnsAuthorizations/{dns_authorization}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "domain": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "dnsResourceRecord": { + "type": "DnsResourceRecord", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DnsResourceRecord": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "data": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "ServingState": { + "values": { + "SERVING_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PENDING": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-certificatemanager/samples/README.md b/packages/google-cloud-certificatemanager/samples/README.md new file mode 100644 index 000000000000..a5c5f565e03d --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/README.md @@ -0,0 +1,500 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Certificate Manager: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Certificate_manager.create_certificate](#certificate_manager.create_certificate) + * [Certificate_manager.create_certificate_issuance_config](#certificate_manager.create_certificate_issuance_config) + * [Certificate_manager.create_certificate_map](#certificate_manager.create_certificate_map) + * [Certificate_manager.create_certificate_map_entry](#certificate_manager.create_certificate_map_entry) + * [Certificate_manager.create_dns_authorization](#certificate_manager.create_dns_authorization) + * [Certificate_manager.delete_certificate](#certificate_manager.delete_certificate) + * [Certificate_manager.delete_certificate_issuance_config](#certificate_manager.delete_certificate_issuance_config) + * [Certificate_manager.delete_certificate_map](#certificate_manager.delete_certificate_map) + * [Certificate_manager.delete_certificate_map_entry](#certificate_manager.delete_certificate_map_entry) + * [Certificate_manager.delete_dns_authorization](#certificate_manager.delete_dns_authorization) + * [Certificate_manager.get_certificate](#certificate_manager.get_certificate) + * [Certificate_manager.get_certificate_issuance_config](#certificate_manager.get_certificate_issuance_config) + * [Certificate_manager.get_certificate_map](#certificate_manager.get_certificate_map) + * [Certificate_manager.get_certificate_map_entry](#certificate_manager.get_certificate_map_entry) + * [Certificate_manager.get_dns_authorization](#certificate_manager.get_dns_authorization) + * [Certificate_manager.list_certificate_issuance_configs](#certificate_manager.list_certificate_issuance_configs) + * [Certificate_manager.list_certificate_map_entries](#certificate_manager.list_certificate_map_entries) + * [Certificate_manager.list_certificate_maps](#certificate_manager.list_certificate_maps) + * [Certificate_manager.list_certificates](#certificate_manager.list_certificates) + * [Certificate_manager.list_dns_authorizations](#certificate_manager.list_dns_authorizations) + * [Certificate_manager.update_certificate](#certificate_manager.update_certificate) + * [Certificate_manager.update_certificate_map](#certificate_manager.update_certificate_map) + * [Certificate_manager.update_certificate_map_entry](#certificate_manager.update_certificate_map_entry) + * [Certificate_manager.update_dns_authorization](#certificate_manager.update_dns_authorization) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Certificate_manager.create_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js` + + +----- + + + + +### Certificate_manager.create_certificate_issuance_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js` + + +----- + + + + +### Certificate_manager.create_certificate_map + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js` + + +----- + + + + +### Certificate_manager.create_certificate_map_entry + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js` + + +----- + + + + +### Certificate_manager.create_dns_authorization + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js` + + +----- + + + + +### Certificate_manager.delete_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js` + + +----- + + + + +### Certificate_manager.delete_certificate_issuance_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js` + + +----- + + + + +### Certificate_manager.delete_certificate_map + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js` + + +----- + + + + +### Certificate_manager.delete_certificate_map_entry + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js` + + +----- + + + + +### Certificate_manager.delete_dns_authorization + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js` + + +----- + + + + +### Certificate_manager.get_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js` + + +----- + + + + +### Certificate_manager.get_certificate_issuance_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js` + + +----- + + + + +### Certificate_manager.get_certificate_map + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js` + + +----- + + + + +### Certificate_manager.get_certificate_map_entry + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js` + + +----- + + + + +### Certificate_manager.get_dns_authorization + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js` + + +----- + + + + +### Certificate_manager.list_certificate_issuance_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js` + + +----- + + + + +### Certificate_manager.list_certificate_map_entries + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js` + + +----- + + + + +### Certificate_manager.list_certificate_maps + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js` + + +----- + + + + +### Certificate_manager.list_certificates + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js` + + +----- + + + + +### Certificate_manager.list_dns_authorizations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js` + + +----- + + + + +### Certificate_manager.update_certificate + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js` + + +----- + + + + +### Certificate_manager.update_certificate_map + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js` + + +----- + + + + +### Certificate_manager.update_certificate_map_entry + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js` + + +----- + + + + +### Certificate_manager.update_dns_authorization + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-certificatemanager/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-certificatemanager/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-certificatemanager/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/certificate-manager/ diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js new file mode 100644 index 000000000000..4aff01e684e3 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, certificateId, certificate) { + // [START certificatemanager_v1_generated_CertificateManager_CreateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the certificate. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. A user-provided name of the certificate. + */ + // const certificateId = 'abc123' + /** + * Required. A definition of the certificate to create. + */ + // const certificate = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callCreateCertificate() { + // Construct request + const request = { + parent, + certificateId, + certificate, + }; + + // Run request + const [operation] = await certificatemanagerClient.createCertificate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificate(); + // [END certificatemanager_v1_generated_CertificateManager_CreateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js new file mode 100644 index 000000000000..6f613c802c2c --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, certificateIssuanceConfigId, certificateIssuanceConfig) { + // [START certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the certificate issuance config. Must be + * in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. A user-provided name of the certificate config. + */ + // const certificateIssuanceConfigId = 'abc123' + /** + * Required. A definition of the certificate issuance config to create. + */ + // const certificateIssuanceConfig = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callCreateCertificateIssuanceConfig() { + // Construct request + const request = { + parent, + certificateIssuanceConfigId, + certificateIssuanceConfig, + }; + + // Run request + const [operation] = await certificatemanagerClient.createCertificateIssuanceConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateIssuanceConfig(); + // [END certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js new file mode 100644 index 000000000000..5c6f8e31da52 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, certificateMapId, certificateMap) { + // [START certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the certificate map. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. A user-provided name of the certificate map. + */ + // const certificateMapId = 'abc123' + /** + * Required. A definition of the certificate map to create. + */ + // const certificateMap = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callCreateCertificateMap() { + // Construct request + const request = { + parent, + certificateMapId, + certificateMap, + }; + + // Run request + const [operation] = await certificatemanagerClient.createCertificateMap(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateMap(); + // [END certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js new file mode 100644 index 000000000000..0dd845b9f961 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, certificateMapEntryId, certificateMapEntry) { + // [START certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the certificate map entry. Must be in the + * format `projects/* /locations/* /certificateMaps/*`. + */ + // const parent = 'abc123' + /** + * Required. A user-provided name of the certificate map entry. + */ + // const certificateMapEntryId = 'abc123' + /** + * Required. A definition of the certificate map entry to create. + */ + // const certificateMapEntry = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callCreateCertificateMapEntry() { + // Construct request + const request = { + parent, + certificateMapEntryId, + certificateMapEntry, + }; + + // Run request + const [operation] = await certificatemanagerClient.createCertificateMapEntry(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCertificateMapEntry(); + // [END certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js new file mode 100644 index 000000000000..e2d80dd0be99 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, dnsAuthorizationId, dnsAuthorization) { + // [START certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the dns authorization. Must be in the + * format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. A user-provided name of the dns authorization. + */ + // const dnsAuthorizationId = 'abc123' + /** + * Required. A definition of the dns authorization to create. + */ + // const dnsAuthorization = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callCreateDnsAuthorization() { + // Construct request + const request = { + parent, + dnsAuthorizationId, + dnsAuthorization, + }; + + // Run request + const [operation] = await certificatemanagerClient.createDnsAuthorization(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDnsAuthorization(); + // [END certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js new file mode 100644 index 000000000000..3bb0c8cb1c37 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_DeleteCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate to delete. Must be in the format + * `projects/* /locations/* /certificates/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callDeleteCertificate() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await certificatemanagerClient.deleteCertificate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificate(); + // [END certificatemanager_v1_generated_CertificateManager_DeleteCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js new file mode 100644 index 000000000000..46fc6c5587dc --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate issuance config to delete. Must be in + * the format `projects/* /locations/* /certificateIssuanceConfigs/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callDeleteCertificateIssuanceConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await certificatemanagerClient.deleteCertificateIssuanceConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificateIssuanceConfig(); + // [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js new file mode 100644 index 000000000000..452fe4011ef9 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate map to delete. Must be in the format + * `projects/* /locations/* /certificateMaps/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callDeleteCertificateMap() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await certificatemanagerClient.deleteCertificateMap(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificateMap(); + // [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js new file mode 100644 index 000000000000..f59482a1dabd --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate map entry to delete. Must be in the + * format `projects/* /locations/* /certificateMaps/* /certificateMapEntries/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callDeleteCertificateMapEntry() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await certificatemanagerClient.deleteCertificateMapEntry(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCertificateMapEntry(); + // [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js new file mode 100644 index 000000000000..5b7094b309b0 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the dns authorization to delete. Must be in the format + * `projects/* /locations/* /dnsAuthorizations/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callDeleteDnsAuthorization() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await certificatemanagerClient.deleteDnsAuthorization(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDnsAuthorization(); + // [END certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js new file mode 100644 index 000000000000..3d49f89482ff --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_GetCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate to describe. Must be in the format + * `projects/* /locations/* /certificates/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callGetCertificate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await certificatemanagerClient.getCertificate(request); + console.log(response); + } + + callGetCertificate(); + // [END certificatemanager_v1_generated_CertificateManager_GetCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js new file mode 100644 index 000000000000..271306890f64 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate issuance config to describe. Must be in + * the format `projects/* /locations/* /certificateIssuanceConfigs/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callGetCertificateIssuanceConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await certificatemanagerClient.getCertificateIssuanceConfig(request); + console.log(response); + } + + callGetCertificateIssuanceConfig(); + // [END certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js new file mode 100644 index 000000000000..c23ee73a3b33 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_GetCertificateMap_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate map to describe. Must be in the format + * `projects/* /locations/* /certificateMaps/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callGetCertificateMap() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await certificatemanagerClient.getCertificateMap(request); + console.log(response); + } + + callGetCertificateMap(); + // [END certificatemanager_v1_generated_CertificateManager_GetCertificateMap_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js new file mode 100644 index 000000000000..6589f1e9d9c6 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the certificate map entry to describe. Must be in the + * format `projects/* /locations/* /certificateMaps/* /certificateMapEntries/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callGetCertificateMapEntry() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await certificatemanagerClient.getCertificateMapEntry(request); + console.log(response); + } + + callGetCertificateMapEntry(); + // [END certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js new file mode 100644 index 000000000000..9410db15769a --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the dns authorization to describe. Must be in the + * format `projects/* /locations/* /dnsAuthorizations/*`. + */ + // const name = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callGetDnsAuthorization() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await certificatemanagerClient.getDnsAuthorization(request); + console.log(response); + } + + callGetDnsAuthorization(); + // [END certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js new file mode 100644 index 000000000000..985378ec4e90 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of certificate configs to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListCertificateIssuanceConfigsResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateIssuanceConfigs` call, and that the system should return + * the next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the Certificates Configs returned. + */ + // const filter = 'abc123' + /** + * A list of Certificate Config field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListCertificateIssuanceConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificateIssuanceConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateIssuanceConfigs(); + // [END certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js new file mode 100644 index 000000000000..c4c764b3ca11 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js @@ -0,0 +1,89 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project, location and certificate map from which the + * certificate map entries should be listed, specified in the format + * `projects/* /locations/* /certificateMaps/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of certificate map entries to return. The service may return + * fewer than this value. + * If unspecified, at most 50 certificate map entries will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListCertificateMapEntriesResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateMapEntries` call, and that the system should return the + * next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the returned Certificate Map Entries. + */ + // const filter = 'abc123' + /** + * A list of Certificate Map Entry field names used to specify + * the order of the returned results. The default sorting order is ascending. + * To specify descending order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListCertificateMapEntries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificateMapEntriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateMapEntries(); + // [END certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js new file mode 100644 index 000000000000..38fc8c2d42cc --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js @@ -0,0 +1,84 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the certificate maps should + * be listed, specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of certificate maps to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListCertificateMapsResponse`. Indicates + * that this is a continuation of a prior `ListCertificateMaps` call, and that + * the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the Certificates Maps returned. + */ + // const filter = 'abc123' + /** + * A list of Certificate Map field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListCertificateMaps() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificateMapsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificateMaps(); + // [END certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js new file mode 100644 index 000000000000..45c63e697683 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js @@ -0,0 +1,84 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_v1_generated_CertificateManager_ListCertificates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of certificates to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the Certificates returned. + */ + // const filter = 'abc123' + /** + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListCertificates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificates(); + // [END certificatemanager_v1_generated_CertificateManager_ListCertificates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js new file mode 100644 index 000000000000..4577ba6a9a74 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js @@ -0,0 +1,84 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the dns authorizations should + * be listed, specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of dns authorizations to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListDnsAuthorizationsResponse`. Indicates + * that this is a continuation of a prior `ListDnsAuthorizations` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the Dns Authorizations returned. + */ + // const filter = 'abc123' + /** + * A list of Dns Authorization field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListDnsAuthorizations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listDnsAuthorizationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDnsAuthorizations(); + // [END certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js new file mode 100644 index 000000000000..a123d039e7fd --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(certificate, updateMask) { + // [START certificatemanager_v1_generated_CertificateManager_UpdateCertificate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A definition of the certificate to update. + */ + // const certificate = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + */ + // const updateMask = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callUpdateCertificate() { + // Construct request + const request = { + certificate, + updateMask, + }; + + // Run request + const [operation] = await certificatemanagerClient.updateCertificate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificate(); + // [END certificatemanager_v1_generated_CertificateManager_UpdateCertificate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js new file mode 100644 index 000000000000..e600726975d8 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(certificateMap, updateMask) { + // [START certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A definition of the certificate map to update. + */ + // const certificateMap = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + */ + // const updateMask = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callUpdateCertificateMap() { + // Construct request + const request = { + certificateMap, + updateMask, + }; + + // Run request + const [operation] = await certificatemanagerClient.updateCertificateMap(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateMap(); + // [END certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js new file mode 100644 index 000000000000..9270cc0d663c --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(certificateMapEntry, updateMask) { + // [START certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A definition of the certificate map entry to create map entry. + */ + // const certificateMapEntry = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + */ + // const updateMask = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callUpdateCertificateMapEntry() { + // Construct request + const request = { + certificateMapEntry, + updateMask, + }; + + // Run request + const [operation] = await certificatemanagerClient.updateCertificateMapEntry(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCertificateMapEntry(); + // [END certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js new file mode 100644 index 000000000000..0b988a1e3cb1 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(dnsAuthorization, updateMask) { + // [START certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A definition of the dns authorization to update. + */ + // const dnsAuthorization = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + */ + // const updateMask = {} + + // Imports the Certificatemanager library + const {CertificateManagerClient} = require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callUpdateDnsAuthorization() { + // Construct request + const request = { + dnsAuthorization, + updateMask, + }; + + // Run request + const [operation] = await certificatemanagerClient.updateDnsAuthorization(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDnsAuthorization(); + // [END certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/snippet_metadata.google.cloud.certificatemanager.v1.json b/packages/google-cloud-certificatemanager/samples/generated/v1/snippet_metadata.google.cloud.certificatemanager.v1.json new file mode 100644 index 000000000000..b3309f07c2b5 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/snippet_metadata.google.cloud.certificatemanager.v1.json @@ -0,0 +1,1111 @@ +{ + "clientLibrary": { + "name": "nodejs-certificatemanager", + "version": "0.6.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.certificatemanager.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_ListCertificates_async", + "title": "CertificateManager listCertificates Sample", + "origin": "API_DEFINITION", + "description": " Lists Certificates in a given project and location.", + "canonical": true, + "file": "certificate_manager.list_certificates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificates", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.ListCertificatesResponse", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "ListCertificates", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificates", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_GetCertificate_async", + "title": "CertificateManager getCertificate Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Certificate.", + "canonical": true, + "file": "certificate_manager.get_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.Certificate", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "GetCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificate", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_CreateCertificate_async", + "title": "CertificateManager createCertificate Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Certificate in a given project and location.", + "canonical": true, + "file": "certificate_manager.create_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate", + "type": ".google.cloud.certificatemanager.v1.Certificate" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "CreateCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificate", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_UpdateCertificate_async", + "title": "CertificateManager updateCertificate Sample", + "origin": "API_DEFINITION", + "description": " Updates a Certificate.", + "canonical": true, + "file": "certificate_manager.update_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificate", + "async": true, + "parameters": [ + { + "name": "certificate", + "type": ".google.cloud.certificatemanager.v1.Certificate" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "UpdateCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificate", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_DeleteCertificate_async", + "title": "CertificateManager deleteCertificate Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Certificate.", + "canonical": true, + "file": "certificate_manager.delete_certificate.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "DeleteCertificate", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificate", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_async", + "title": "CertificateManager listCertificateMaps Sample", + "origin": "API_DEFINITION", + "description": " Lists CertificateMaps in a given project and location.", + "canonical": true, + "file": "certificate_manager.list_certificate_maps.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateMaps", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMaps", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.ListCertificateMapsResponse", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "ListCertificateMaps", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMaps", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_GetCertificateMap_async", + "title": "CertificateManager getCertificateMap Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single CertificateMap.", + "canonical": true, + "file": "certificate_manager.get_certificate_map.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMap", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.CertificateMap", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "GetCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMap", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_async", + "title": "CertificateManager createCertificateMap Sample", + "origin": "API_DEFINITION", + "description": " Creates a new CertificateMap in a given project and location.", + "canonical": true, + "file": "certificate_manager.create_certificate_map.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMap", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_map_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_map", + "type": ".google.cloud.certificatemanager.v1.CertificateMap" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "CreateCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMap", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_async", + "title": "CertificateManager updateCertificateMap Sample", + "origin": "API_DEFINITION", + "description": " Updates a CertificateMap.", + "canonical": true, + "file": "certificate_manager.update_certificate_map.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMap", + "async": true, + "parameters": [ + { + "name": "certificate_map", + "type": ".google.cloud.certificatemanager.v1.CertificateMap" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "UpdateCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMap", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_async", + "title": "CertificateManager deleteCertificateMap Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single CertificateMap. A Certificate Map can't be deleted if it contains Certificate Map Entries. Remove all the entries from the map before calling this method.", + "canonical": true, + "file": "certificate_manager.delete_certificate_map.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMap", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "DeleteCertificateMap", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMap", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_async", + "title": "CertificateManager listCertificateMapEntries Sample", + "origin": "API_DEFINITION", + "description": " Lists CertificateMapEntries in a given project and location.", + "canonical": true, + "file": "certificate_manager.list_certificate_map_entries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateMapEntries", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapEntries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.ListCertificateMapEntriesResponse", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "ListCertificateMapEntries", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateMapEntries", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_async", + "title": "CertificateManager getCertificateMapEntry Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single CertificateMapEntry.", + "canonical": true, + "file": "certificate_manager.get_certificate_map_entry.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapEntry", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.CertificateMapEntry", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "GetCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateMapEntry", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_async", + "title": "CertificateManager createCertificateMapEntry Sample", + "origin": "API_DEFINITION", + "description": " Creates a new CertificateMapEntry in a given project and location.", + "canonical": true, + "file": "certificate_manager.create_certificate_map_entry.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapEntry", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_map_entry_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_map_entry", + "type": ".google.cloud.certificatemanager.v1.CertificateMapEntry" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "CreateCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateMapEntry", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_async", + "title": "CertificateManager updateCertificateMapEntry Sample", + "origin": "API_DEFINITION", + "description": " Updates a CertificateMapEntry.", + "canonical": true, + "file": "certificate_manager.update_certificate_map_entry.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapEntry", + "async": true, + "parameters": [ + { + "name": "certificate_map_entry", + "type": ".google.cloud.certificatemanager.v1.CertificateMapEntry" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "UpdateCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateCertificateMapEntry", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_async", + "title": "CertificateManager deleteCertificateMapEntry Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single CertificateMapEntry.", + "canonical": true, + "file": "certificate_manager.delete_certificate_map_entry.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapEntry", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "DeleteCertificateMapEntry", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateMapEntry", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_async", + "title": "CertificateManager listDnsAuthorizations Sample", + "origin": "API_DEFINITION", + "description": " Lists DnsAuthorizations in a given project and location.", + "canonical": true, + "file": "certificate_manager.list_dns_authorizations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDnsAuthorizations", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListDnsAuthorizations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.ListDnsAuthorizationsResponse", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "ListDnsAuthorizations", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListDnsAuthorizations", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_async", + "title": "CertificateManager getDnsAuthorization Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DnsAuthorization.", + "canonical": true, + "file": "certificate_manager.get_dns_authorization.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetDnsAuthorization", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.DnsAuthorization", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "GetDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetDnsAuthorization", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_async", + "title": "CertificateManager createDnsAuthorization Sample", + "origin": "API_DEFINITION", + "description": " Creates a new DnsAuthorization in a given project and location.", + "canonical": true, + "file": "certificate_manager.create_dns_authorization.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateDnsAuthorization", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dns_authorization_id", + "type": "TYPE_STRING" + }, + { + "name": "dns_authorization", + "type": ".google.cloud.certificatemanager.v1.DnsAuthorization" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "CreateDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateDnsAuthorization", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_async", + "title": "CertificateManager updateDnsAuthorization Sample", + "origin": "API_DEFINITION", + "description": " Updates a DnsAuthorization.", + "canonical": true, + "file": "certificate_manager.update_dns_authorization.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateDnsAuthorization", + "async": true, + "parameters": [ + { + "name": "dns_authorization", + "type": ".google.cloud.certificatemanager.v1.DnsAuthorization" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "UpdateDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.UpdateDnsAuthorization", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_async", + "title": "CertificateManager deleteDnsAuthorization Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single DnsAuthorization.", + "canonical": true, + "file": "certificate_manager.delete_dns_authorization.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteDnsAuthorization", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "DeleteDnsAuthorization", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteDnsAuthorization", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_async", + "title": "CertificateManager listCertificateIssuanceConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists CertificateIssuanceConfigs in a given project and location.", + "canonical": true, + "file": "certificate_manager.list_certificate_issuance_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCertificateIssuanceConfigs", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateIssuanceConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "ListCertificateIssuanceConfigs", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.ListCertificateIssuanceConfigs", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_async", + "title": "CertificateManager getCertificateIssuanceConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single CertificateIssuanceConfig.", + "canonical": true, + "file": "certificate_manager.get_certificate_issuance_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateIssuanceConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.certificatemanager.v1.CertificateIssuanceConfig", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "GetCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.GetCertificateIssuanceConfig", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_async", + "title": "CertificateManager createCertificateIssuanceConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new CertificateIssuanceConfig in a given project and location.", + "canonical": true, + "file": "certificate_manager.create_certificate_issuance_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateIssuanceConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "certificate_issuance_config_id", + "type": "TYPE_STRING" + }, + { + "name": "certificate_issuance_config", + "type": ".google.cloud.certificatemanager.v1.CertificateIssuanceConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "CreateCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.CreateCertificateIssuanceConfig", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + }, + { + "regionTag": "certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_async", + "title": "CertificateManager deleteCertificateIssuanceConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single CertificateIssuanceConfig.", + "canonical": true, + "file": "certificate_manager.delete_certificate_issuance_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateIssuanceConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CertificateManagerClient", + "fullName": "google.cloud.certificatemanager.v1.CertificateManagerClient" + }, + "method": { + "shortName": "DeleteCertificateIssuanceConfig", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager.DeleteCertificateIssuanceConfig", + "service": { + "shortName": "CertificateManager", + "fullName": "google.cloud.certificatemanager.v1.CertificateManager" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-certificatemanager/samples/package.json b/packages/google-cloud-certificatemanager/samples/package.json new file mode 100644 index 000000000000..d7e649a50a2d --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-certificate-manager-samples", + "private": true, + "license": "Apache-2.0", + "files": [ + "*.js" + ], + "author": "Google LLC", + "repository": "googleapis/nodejs-secret-manager", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "c8 mocha --recursive test/ --timeout=800000" + }, + "dependencies": { + "@google-cloud/certificate-manager": "^0.6.0" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^9.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-certificatemanager/samples/quickstart.js b/packages/google-cloud-certificatemanager/samples/quickstart.js new file mode 100644 index 000000000000..84d9c417431b --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/quickstart.js @@ -0,0 +1,82 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START certificatemanager_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the certificate should be listed, + * specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of certificates to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * Filter expression to restrict the Certificates returned. + */ + // const filter = 'abc123' + /** + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + */ + // const orderBy = 'abc123' + + // Imports the Certificatemanager library + const {CertificateManagerClient} = + require('@google-cloud/certificate-manager').v1; + + // Instantiates a client + const certificatemanagerClient = new CertificateManagerClient(); + + async function callListCertificates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await certificatemanagerClient.listCertificatesAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + callListCertificates(); + // [END certificatemanager_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-certificatemanager/samples/test/quickstart.js b/packages/google-cloud-certificatemanager/samples/test/quickstart.js new file mode 100644 index 000000000000..68622618ce05 --- /dev/null +++ b/packages/google-cloud-certificatemanager/samples/test/quickstart.js @@ -0,0 +1,45 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const {CertificateManagerClient} = + require('@google-cloud/certificate-manager').v1; + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new CertificateManagerClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + // Should have 0 exit code, and therefore not throw: + execSync(`node ./quickstart.js projects/${projectId}/locations/global`, { + cwd, + }); + }); +}); diff --git a/packages/google-cloud-certificatemanager/src/index.ts b/packages/google-cloud-certificatemanager/src/index.ts new file mode 100644 index 000000000000..616c4df1492d --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const CertificateManagerClient = v1.CertificateManagerClient; +type CertificateManagerClient = v1.CertificateManagerClient; + +export {v1, CertificateManagerClient}; +export default {v1, CertificateManagerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts new file mode 100644 index 000000000000..eb7556ddfbc1 --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts @@ -0,0 +1,4905 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} 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/certificate_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './certificate_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * API Overview + * + * Certificates Manager API allows customers to see and manage all their TLS + * certificates. + * + * Certificates Manager API service provides methods to manage certificates, + * group them into collections, and create serving configuration that can be + * easily applied to other Cloud resources e.g. Target Proxies. + * + * Data Model + * + * The Certificates Manager service exposes the following resources: + * + * * `Certificate` which describes a single TLS certificate. + * * `CertificateMap` which describes a collection of certificates that can be + * attached to a target resource. + * * `CertificateMapEntry` which describes a single configuration entry that + * consists of a SNI and a group of certificates. It's a subresource of + * CertificateMap. + * + * Certificate, CertificateMap and CertificateMapEntry IDs + * have to match "^[a-z0-9-]{1,63}$" regexp, which means that + * - only lower case letters, digits, and hyphen are allowed + * - length of the resource ID has to be in [1,63] range. + * + * Provides methods to manage Cloud Certificate Manager entities. + * @class + * @memberof v1 + */ +export class CertificateManagerClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + certificateManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CertificateManagerClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 CertificateManagerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CertificateManagerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + certificatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificates/{certificate}' + ), + certificateIssuanceConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateIssuanceConfigs/{certificate_issuance_config}' + ), + certificateMapPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateMaps/{certificate_map}' + ), + certificateMapEntryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/certificateMaps/{certificate_map}/certificateMapEntries/{certificate_map_entry}' + ), + dnsAuthorizationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsAuthorizations/{dns_authorization}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listCertificates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificates' + ), + listCertificateMaps: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateMaps' + ), + listCertificateMapEntries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateMapEntries' + ), + listDnsAuthorizations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dnsAuthorizations' + ), + listCertificateIssuanceConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'certificateIssuanceConfigs' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createCertificateResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.Certificate' + ) as gax.protobuf.Type; + const createCertificateMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateCertificateResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.Certificate' + ) as gax.protobuf.Type; + const updateCertificateMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCertificateResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteCertificateMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createCertificateMapResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.CertificateMap' + ) as gax.protobuf.Type; + const createCertificateMapMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateCertificateMapResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.CertificateMap' + ) as gax.protobuf.Type; + const updateCertificateMapMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCertificateMapResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteCertificateMapMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createCertificateMapEntryResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.CertificateMapEntry' + ) as gax.protobuf.Type; + const createCertificateMapEntryMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateCertificateMapEntryResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.CertificateMapEntry' + ) as gax.protobuf.Type; + const updateCertificateMapEntryMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCertificateMapEntryResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteCertificateMapEntryMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createDnsAuthorizationResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.DnsAuthorization' + ) as gax.protobuf.Type; + const createDnsAuthorizationMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDnsAuthorizationResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.DnsAuthorization' + ) as gax.protobuf.Type; + const updateDnsAuthorizationMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDnsAuthorizationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDnsAuthorizationMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createCertificateIssuanceConfigResponse = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.CertificateIssuanceConfig' + ) as gax.protobuf.Type; + const createCertificateIssuanceConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteCertificateIssuanceConfigResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteCertificateIssuanceConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.certificatemanager.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCertificate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateResponse.decode.bind(createCertificateResponse), + createCertificateMetadata.decode.bind(createCertificateMetadata) + ), + updateCertificate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateResponse.decode.bind(updateCertificateResponse), + updateCertificateMetadata.decode.bind(updateCertificateMetadata) + ), + deleteCertificate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateResponse.decode.bind(deleteCertificateResponse), + deleteCertificateMetadata.decode.bind(deleteCertificateMetadata) + ), + createCertificateMap: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateMapResponse.decode.bind(createCertificateMapResponse), + createCertificateMapMetadata.decode.bind(createCertificateMapMetadata) + ), + updateCertificateMap: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateMapResponse.decode.bind(updateCertificateMapResponse), + updateCertificateMapMetadata.decode.bind(updateCertificateMapMetadata) + ), + deleteCertificateMap: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateMapResponse.decode.bind(deleteCertificateMapResponse), + deleteCertificateMapMetadata.decode.bind(deleteCertificateMapMetadata) + ), + createCertificateMapEntry: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateMapEntryResponse.decode.bind( + createCertificateMapEntryResponse + ), + createCertificateMapEntryMetadata.decode.bind( + createCertificateMapEntryMetadata + ) + ), + updateCertificateMapEntry: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateCertificateMapEntryResponse.decode.bind( + updateCertificateMapEntryResponse + ), + updateCertificateMapEntryMetadata.decode.bind( + updateCertificateMapEntryMetadata + ) + ), + deleteCertificateMapEntry: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateMapEntryResponse.decode.bind( + deleteCertificateMapEntryResponse + ), + deleteCertificateMapEntryMetadata.decode.bind( + deleteCertificateMapEntryMetadata + ) + ), + createDnsAuthorization: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDnsAuthorizationResponse.decode.bind( + createDnsAuthorizationResponse + ), + createDnsAuthorizationMetadata.decode.bind( + createDnsAuthorizationMetadata + ) + ), + updateDnsAuthorization: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDnsAuthorizationResponse.decode.bind( + updateDnsAuthorizationResponse + ), + updateDnsAuthorizationMetadata.decode.bind( + updateDnsAuthorizationMetadata + ) + ), + deleteDnsAuthorization: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDnsAuthorizationResponse.decode.bind( + deleteDnsAuthorizationResponse + ), + deleteDnsAuthorizationMetadata.decode.bind( + deleteDnsAuthorizationMetadata + ) + ), + createCertificateIssuanceConfig: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCertificateIssuanceConfigResponse.decode.bind( + createCertificateIssuanceConfigResponse + ), + createCertificateIssuanceConfigMetadata.decode.bind( + createCertificateIssuanceConfigMetadata + ) + ), + deleteCertificateIssuanceConfig: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteCertificateIssuanceConfigResponse.decode.bind( + deleteCertificateIssuanceConfigResponse + ), + deleteCertificateIssuanceConfigMetadata.decode.bind( + deleteCertificateIssuanceConfigMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.certificatemanager.v1.CertificateManager', + 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.certificateManagerStub) { + return this.certificateManagerStub; + } + + // Put together the "service stub" for + // google.cloud.certificatemanager.v1.CertificateManager. + this.certificateManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.certificatemanager.v1.CertificateManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.certificatemanager.v1 + .CertificateManager, + 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 certificateManagerStubMethods = [ + 'listCertificates', + 'getCertificate', + 'createCertificate', + 'updateCertificate', + 'deleteCertificate', + 'listCertificateMaps', + 'getCertificateMap', + 'createCertificateMap', + 'updateCertificateMap', + 'deleteCertificateMap', + 'listCertificateMapEntries', + 'getCertificateMapEntry', + 'createCertificateMapEntry', + 'updateCertificateMapEntry', + 'deleteCertificateMapEntry', + 'listDnsAuthorizations', + 'getDnsAuthorization', + 'createDnsAuthorization', + 'updateDnsAuthorization', + 'deleteDnsAuthorization', + 'listCertificateIssuanceConfigs', + 'getCertificateIssuanceConfig', + 'createCertificateIssuanceConfig', + 'deleteCertificateIssuanceConfig', + ]; + for (const methodName of certificateManagerStubMethods) { + const callPromise = this.certificateManagerStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.certificateManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'certificatemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'certificatemanager.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Gets details of a single Certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate to describe. Must be in the format + * `projects/* /locations/* /certificates/*`. + * @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 [Certificate]{@link google.cloud.certificatemanager.v1.Certificate}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.get_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_GetCertificate_async + */ + getCertificate( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificate, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | undefined + ), + {} | undefined + ] + >; + getCertificate( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificate, + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificate( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateRequest, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificate, + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificate( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificate, + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.certificatemanager.v1.ICertificate, + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificate, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | 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.getCertificate(request, options, callback); + } + /** + * Gets details of a single CertificateMap. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate map to describe. Must be in the format + * `projects/* /locations/* /certificateMaps/*`. + * @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 [CertificateMap]{@link google.cloud.certificatemanager.v1.CertificateMap}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.get_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_GetCertificateMap_async + */ + getCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMap, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | undefined + ), + {} | undefined + ] + >; + getCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMap, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | 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.getCertificateMap(request, options, callback); + } + /** + * Gets details of a single CertificateMapEntry. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate map entry to describe. Must be in the + * format `projects/* /locations/* /certificateMaps/* /certificateMapEntries/*`. + * @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 [CertificateMapEntry]{@link google.cloud.certificatemanager.v1.CertificateMapEntry}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.get_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_async + */ + getCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | undefined + ), + {} | undefined + ] + >; + getCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | 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.getCertificateMapEntry( + request, + options, + callback + ); + } + /** + * Gets details of a single DnsAuthorization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the dns authorization to describe. Must be in the + * format `projects/* /locations/* /dnsAuthorizations/*`. + * @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 [DnsAuthorization]{@link google.cloud.certificatemanager.v1.DnsAuthorization}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.get_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_async + */ + getDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + ( + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | undefined + ), + {} | undefined + ] + >; + getDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, + callback: Callback< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + ( + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | 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.getDnsAuthorization(request, options, callback); + } + /** + * Gets details of a single CertificateIssuanceConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate issuance config to describe. Must be in + * the format `projects/* /locations/* /certificateIssuanceConfigs/*`. + * @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 [CertificateIssuanceConfig]{@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.get_certificate_issuance_config.js + * region_tag:certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_async + */ + getCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | undefined + ), + {} | undefined + ] + >; + getCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, + callback: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | 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.getCertificateIssuanceConfig( + request, + options, + callback + ); + } + + /** + * Creates a new Certificate in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the certificate. Must be in the format + * `projects/* /locations/*`. + * @param {string} request.certificateId + * Required. A user-provided name of the certificate. + * @param {google.cloud.certificatemanager.v1.Certificate} request.certificate + * Required. A definition of the certificate to create. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificate_async + */ + createCertificate( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCertificate( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificate( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificate( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createCertificate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCertificate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificate_async + */ + async checkCreateCertificateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.Certificate, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.Certificate, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Updates a Certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.certificatemanager.v1.Certificate} request.certificate + * Required. A definition of the certificate to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificate_async + */ + updateCertificate( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCertificate( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificate( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificate( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'certificate.name': request.certificate!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCertificate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCertificate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificate_async + */ + async checkUpdateCertificateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.Certificate, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.Certificate, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Deletes a single Certificate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate to delete. Must be in the format + * `projects/* /locations/* /certificates/*`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificate_async + */ + deleteCertificate( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCertificate( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificate( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificate( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteCertificate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCertificate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificate_async + */ + async checkDeleteCertificateProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Creates a new CertificateMap in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the certificate map. Must be in the format + * `projects/* /locations/*`. + * @param {string} request.certificateMapId + * Required. A user-provided name of the certificate map. + * @param {google.cloud.certificatemanager.v1.CertificateMap} request.certificateMap + * Required. A definition of the certificate map to create. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_async + */ + createCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCertificateMap( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateMap( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createCertificateMap(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCertificateMap()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_async + */ + async checkCreateCertificateMapProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMap, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateMap, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMap, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Updates a CertificateMap. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.certificatemanager.v1.CertificateMap} request.certificateMap + * Required. A definition of the certificate map to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_async + */ + updateCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'certificate_map.name': request.certificateMap!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCertificateMap(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCertificateMap()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_async + */ + async checkUpdateCertificateMapProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMap, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateMap, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMap, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Deletes a single CertificateMap. A Certificate Map can't be deleted + * if it contains Certificate Map Entries. Remove all the entries from + * the map before calling this method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate map to delete. Must be in the format + * `projects/* /locations/* /certificateMaps/*`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_async + */ + deleteCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateMap( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateMap( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteCertificateMap(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCertificateMap()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_map.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_async + */ + async checkDeleteCertificateMapProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificateMap, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Creates a new CertificateMapEntry in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the certificate map entry. Must be in the + * format `projects/* /locations/* /certificateMaps/*`. + * @param {string} request.certificateMapEntryId + * Required. A user-provided name of the certificate map entry. + * @param {google.cloud.certificatemanager.v1.CertificateMapEntry} request.certificateMapEntry + * Required. A definition of the certificate map entry to create. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_async + */ + createCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateMapEntryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createCertificateMapEntry( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createCertificateMapEntry()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_async + */ + async checkCreateCertificateMapEntryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMapEntry, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateMapEntry, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMapEntry, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Updates a CertificateMapEntry. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.certificatemanager.v1.CertificateMapEntry} request.certificateMapEntry + * Required. A definition of the certificate map entry to create map entry. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_async + */ + updateCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IUpdateCertificateMapEntryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'certificate_map_entry.name': request.certificateMapEntry!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCertificateMapEntry( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateCertificateMapEntry()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_async + */ + async checkUpdateCertificateMapEntryProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMapEntry, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateCertificateMapEntry, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.CertificateMapEntry, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Deletes a single CertificateMapEntry. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate map entry to delete. Must be in the + * format `projects/* /locations/* /certificateMaps/* /certificateMapEntries/*`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_async + */ + deleteCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateMapEntry( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateMapEntry( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateMapEntryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteCertificateMapEntry( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteCertificateMapEntry()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_map_entry.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_async + */ + async checkDeleteCertificateMapEntryProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificateMapEntry, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Creates a new DnsAuthorization in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the dns authorization. Must be in the + * format `projects/* /locations/*`. + * @param {string} request.dnsAuthorizationId + * Required. A user-provided name of the dns authorization. + * @param {google.cloud.certificatemanager.v1.DnsAuthorization} request.dnsAuthorization + * Required. A definition of the dns authorization to create. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_async + */ + createDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.ICreateDnsAuthorizationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createDnsAuthorization( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createDnsAuthorization()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_async + */ + async checkCreateDnsAuthorizationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.DnsAuthorization, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createDnsAuthorization, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.DnsAuthorization, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Updates a DnsAuthorization. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.certificatemanager.v1.DnsAuthorization} request.dnsAuthorization + * Required. A definition of the dns authorization to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_async + */ + updateDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IUpdateDnsAuthorizationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'dns_authorization.name': request.dnsAuthorization!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDnsAuthorization( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateDnsAuthorization()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.update_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_async + */ + async checkUpdateDnsAuthorizationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.DnsAuthorization, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDnsAuthorization, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.DnsAuthorization, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Deletes a single DnsAuthorization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the dns authorization to delete. Must be in the format + * `projects/* /locations/* /dnsAuthorizations/*`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_async + */ + deleteDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDnsAuthorization( + request: protos.google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDnsAuthorization( + request?: protos.google.cloud.certificatemanager.v1.IDeleteDnsAuthorizationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteDnsAuthorization( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteDnsAuthorization()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_dns_authorization.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_async + */ + async checkDeleteDnsAuthorizationProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteDnsAuthorization, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Creates a new CertificateIssuanceConfig in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the certificate issuance config. Must be + * in the format `projects/* /locations/*`. + * @param {string} request.certificateIssuanceConfigId + * Required. A user-provided name of the certificate config. + * @param {google.cloud.certificatemanager.v1.CertificateIssuanceConfig} request.certificateIssuanceConfig + * Required. A definition of the certificate issuance config to create. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_issuance_config.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_async + */ + createCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.ICreateCertificateIssuanceConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createCertificateIssuanceConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createCertificateIssuanceConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.create_certificate_issuance_config.js + * region_tag:certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_async + */ + async checkCreateCertificateIssuanceConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createCertificateIssuanceConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Deletes a single CertificateIssuanceConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the certificate issuance config to delete. Must be in + * the format `projects/* /locations/* /certificateIssuanceConfigs/*`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_async + */ + deleteCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateIssuanceConfig( + request: protos.google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCertificateIssuanceConfig( + request?: protos.google.cloud.certificatemanager.v1.IDeleteCertificateIssuanceConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteCertificateIssuanceConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteCertificateIssuanceConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js + * region_tag:certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_async + */ + async checkDeleteCertificateIssuanceConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteCertificateIssuanceConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.certificatemanager.v1.OperationMetadata + >; + } + /** + * Lists Certificates in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificates to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates returned. + * @param {string} request.orderBy + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + * @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 [Certificate]{@link google.cloud.certificatemanager.v1.Certificate}. + * 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 `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificates( + request?: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificate[], + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + ] + >; + listCertificates( + request: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificate + > + ): void; + listCertificates( + request: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificate + > + ): void; + listCertificates( + request?: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificate + >, + callback?: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificate + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificate[], + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + ] + > | 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.listCertificates(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 project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificates to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates returned. + * @param {string} request.orderBy + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + * @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 [Certificate]{@link google.cloud.certificatemanager.v1.Certificate} 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 `listCertificatesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificatesStream( + request?: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + 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['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificates.createStream( + this.innerApiCalls.listCertificates as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCertificates`, 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 project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificates to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificatesResponse`. Indicates that + * this is a continuation of a prior `ListCertificates` call, and that the + * system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates returned. + * @param {string} request.orderBy + * A list of Certificate field names used to specify the order of the returned + * results. The default sorting order is ascending. To specify descending + * order for a field, add a suffix " desc". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Certificate]{@link google.cloud.certificatemanager.v1.Certificate}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.list_certificates.js + * region_tag:certificatemanager_v1_generated_CertificateManager_ListCertificates_async + */ + listCertificatesAsync( + request?: protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + 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['listCertificates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificates.asyncIterate( + this.innerApiCalls['listCertificates'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CertificateMaps in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the certificate maps should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate maps to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapsResponse`. Indicates + * that this is a continuation of a prior `ListCertificateMaps` call, and that + * the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Maps returned. + * @param {string} request.orderBy + * A list of Certificate Map field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [CertificateMap]{@link google.cloud.certificatemanager.v1.CertificateMap}. + * 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 `listCertificateMapsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateMaps( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMap[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + ] + >; + listCertificateMaps( + request: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMap + > + ): void; + listCertificateMaps( + request: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMap + > + ): void; + listCertificateMaps( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMap + >, + callback?: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMap + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMap[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + ] + > | 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.listCertificateMaps(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 project and location from which the certificate maps should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate maps to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapsResponse`. Indicates + * that this is a continuation of a prior `ListCertificateMaps` call, and that + * the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Maps returned. + * @param {string} request.orderBy + * A list of Certificate Map field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [CertificateMap]{@link google.cloud.certificatemanager.v1.CertificateMap} 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 `listCertificateMapsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateMapsStream( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + 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['listCertificateMaps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateMaps.createStream( + this.innerApiCalls.listCertificateMaps as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCertificateMaps`, 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 project and location from which the certificate maps should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate maps to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapsResponse`. Indicates + * that this is a continuation of a prior `ListCertificateMaps` call, and that + * the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Maps returned. + * @param {string} request.orderBy + * A list of Certificate Map field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CertificateMap]{@link google.cloud.certificatemanager.v1.CertificateMap}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.list_certificate_maps.js + * region_tag:certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_async + */ + listCertificateMapsAsync( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + 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['listCertificateMaps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateMaps.asyncIterate( + this.innerApiCalls['listCertificateMaps'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CertificateMapEntries in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project, location and certificate map from which the + * certificate map entries should be listed, specified in the format + * `projects/* /locations/* /certificateMaps/*`. + * @param {number} request.pageSize + * Maximum number of certificate map entries to return. The service may return + * fewer than this value. + * If unspecified, at most 50 certificate map entries will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapEntriesResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateMapEntries` call, and that the system should return the + * next page of data. + * @param {string} request.filter + * Filter expression to restrict the returned Certificate Map Entries. + * @param {string} request.orderBy + * A list of Certificate Map Entry field names used to specify + * the order of the returned results. The default sorting order is ascending. + * To specify descending order for a field, add a suffix " desc". + * @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 [CertificateMapEntry]{@link google.cloud.certificatemanager.v1.CertificateMapEntry}. + * 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 `listCertificateMapEntriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateMapEntries( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + ] + >; + listCertificateMapEntries( + request: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry + > + ): void; + listCertificateMapEntries( + request: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry + > + ): void; + listCertificateMapEntries( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry + >, + callback?: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + ] + > | 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.listCertificateMapEntries( + 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 project, location and certificate map from which the + * certificate map entries should be listed, specified in the format + * `projects/* /locations/* /certificateMaps/*`. + * @param {number} request.pageSize + * Maximum number of certificate map entries to return. The service may return + * fewer than this value. + * If unspecified, at most 50 certificate map entries will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapEntriesResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateMapEntries` call, and that the system should return the + * next page of data. + * @param {string} request.filter + * Filter expression to restrict the returned Certificate Map Entries. + * @param {string} request.orderBy + * A list of Certificate Map Entry field names used to specify + * the order of the returned results. The default sorting order is ascending. + * To specify descending order for a field, add a suffix " desc". + * @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 [CertificateMapEntry]{@link google.cloud.certificatemanager.v1.CertificateMapEntry} 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 `listCertificateMapEntriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateMapEntriesStream( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + 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['listCertificateMapEntries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateMapEntries.createStream( + this.innerApiCalls.listCertificateMapEntries as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCertificateMapEntries`, 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 project, location and certificate map from which the + * certificate map entries should be listed, specified in the format + * `projects/* /locations/* /certificateMaps/*`. + * @param {number} request.pageSize + * Maximum number of certificate map entries to return. The service may return + * fewer than this value. + * If unspecified, at most 50 certificate map entries will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateMapEntriesResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateMapEntries` call, and that the system should return the + * next page of data. + * @param {string} request.filter + * Filter expression to restrict the returned Certificate Map Entries. + * @param {string} request.orderBy + * A list of Certificate Map Entry field names used to specify + * the order of the returned results. The default sorting order is ascending. + * To specify descending order for a field, add a suffix " desc". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CertificateMapEntry]{@link google.cloud.certificatemanager.v1.CertificateMapEntry}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.list_certificate_map_entries.js + * region_tag:certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_async + */ + listCertificateMapEntriesAsync( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + 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['listCertificateMapEntries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateMapEntries.asyncIterate( + this.innerApiCalls['listCertificateMapEntries'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DnsAuthorizations in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the dns authorizations should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of dns authorizations to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListDnsAuthorizationsResponse`. Indicates + * that this is a continuation of a prior `ListDnsAuthorizations` call, and + * that the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Dns Authorizations returned. + * @param {string} request.orderBy + * A list of Dns Authorization field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [DnsAuthorization]{@link google.cloud.certificatemanager.v1.DnsAuthorization}. + * 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 `listDnsAuthorizationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDnsAuthorizations( + request?: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization[], + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest | null, + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + ] + >; + listDnsAuthorizations( + request: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + | protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.IDnsAuthorization + > + ): void; + listDnsAuthorizations( + request: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + | protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.IDnsAuthorization + > + ): void; + listDnsAuthorizations( + request?: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + | protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.IDnsAuthorization + >, + callback?: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + | protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.IDnsAuthorization + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization[], + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest | null, + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + ] + > | 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.listDnsAuthorizations(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 project and location from which the dns authorizations should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of dns authorizations to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListDnsAuthorizationsResponse`. Indicates + * that this is a continuation of a prior `ListDnsAuthorizations` call, and + * that the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Dns Authorizations returned. + * @param {string} request.orderBy + * A list of Dns Authorization field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [DnsAuthorization]{@link google.cloud.certificatemanager.v1.DnsAuthorization} 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 `listDnsAuthorizationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDnsAuthorizationsStream( + request?: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + 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['listDnsAuthorizations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsAuthorizations.createStream( + this.innerApiCalls.listDnsAuthorizations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDnsAuthorizations`, 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 project and location from which the dns authorizations should + * be listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of dns authorizations to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListDnsAuthorizationsResponse`. Indicates + * that this is a continuation of a prior `ListDnsAuthorizations` call, and + * that the system should return the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Dns Authorizations returned. + * @param {string} request.orderBy + * A list of Dns Authorization field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DnsAuthorization]{@link google.cloud.certificatemanager.v1.DnsAuthorization}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.list_dns_authorizations.js + * region_tag:certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_async + */ + listDnsAuthorizationsAsync( + request?: protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + 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['listDnsAuthorizations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsAuthorizations.asyncIterate( + this.innerApiCalls['listDnsAuthorizations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CertificateIssuanceConfigs in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate configs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateIssuanceConfigsResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateIssuanceConfigs` call, and that the system should return + * the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Configs returned. + * @param {string} request.orderBy + * A list of Certificate Config field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [CertificateIssuanceConfig]{@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig}. + * 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 `listCertificateIssuanceConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateIssuanceConfigs( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[], + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + ] + >; + listCertificateIssuanceConfigs( + request: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig + > + ): void; + listCertificateIssuanceConfigs( + request: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig + > + ): void; + listCertificateIssuanceConfigs( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig + >, + callback?: PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig + > + ): Promise< + [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[], + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + ] + > | 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.listCertificateIssuanceConfigs( + 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 project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate configs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateIssuanceConfigsResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateIssuanceConfigs` call, and that the system should return + * the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Configs returned. + * @param {string} request.orderBy + * A list of Certificate Config field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [CertificateIssuanceConfig]{@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig} 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 `listCertificateIssuanceConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCertificateIssuanceConfigsStream( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + 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['listCertificateIssuanceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateIssuanceConfigs.createStream( + this.innerApiCalls.listCertificateIssuanceConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCertificateIssuanceConfigs`, 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 project and location from which the certificate should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of certificate configs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListCertificateIssuanceConfigsResponse`. + * Indicates that this is a continuation of a prior + * `ListCertificateIssuanceConfigs` call, and that the system should return + * the next page of data. + * @param {string} request.filter + * Filter expression to restrict the Certificates Configs returned. + * @param {string} request.orderBy + * A list of Certificate Config field names used to specify the order of the + * returned results. The default sorting order is ascending. To specify + * descending order for a field, add a suffix " desc". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CertificateIssuanceConfig]{@link google.cloud.certificatemanager.v1.CertificateIssuanceConfig}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js + * region_tag:certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_async + */ + listCertificateIssuanceConfigsAsync( + request?: protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + 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['listCertificateIssuanceConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCertificateIssuanceConfigs.asyncIterate( + this.innerApiCalls['listCertificateIssuanceConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified certificate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate + * @returns {string} Resource name string. + */ + certificatePath(project: string, location: string, certificate: string) { + return this.pathTemplates.certificatePathTemplate.render({ + project: project, + location: location, + certificate: certificate, + }); + } + + /** + * Parse the project from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .project; + } + + /** + * Parse the location from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .location; + } + + /** + * Parse the certificate from Certificate resource. + * + * @param {string} certificateName + * A fully-qualified path representing Certificate resource. + * @returns {string} A string representing the certificate. + */ + matchCertificateFromCertificateName(certificateName: string) { + return this.pathTemplates.certificatePathTemplate.match(certificateName) + .certificate; + } + + /** + * Return a fully-qualified certificateIssuanceConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_issuance_config + * @returns {string} Resource name string. + */ + certificateIssuanceConfigPath( + project: string, + location: string, + certificateIssuanceConfig: string + ) { + return this.pathTemplates.certificateIssuanceConfigPathTemplate.render({ + project: project, + location: location, + certificate_issuance_config: certificateIssuanceConfig, + }); + } + + /** + * Parse the project from CertificateIssuanceConfig resource. + * + * @param {string} certificateIssuanceConfigName + * A fully-qualified path representing CertificateIssuanceConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateIssuanceConfigName( + certificateIssuanceConfigName: string + ) { + return this.pathTemplates.certificateIssuanceConfigPathTemplate.match( + certificateIssuanceConfigName + ).project; + } + + /** + * Parse the location from CertificateIssuanceConfig resource. + * + * @param {string} certificateIssuanceConfigName + * A fully-qualified path representing CertificateIssuanceConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateIssuanceConfigName( + certificateIssuanceConfigName: string + ) { + return this.pathTemplates.certificateIssuanceConfigPathTemplate.match( + certificateIssuanceConfigName + ).location; + } + + /** + * Parse the certificate_issuance_config from CertificateIssuanceConfig resource. + * + * @param {string} certificateIssuanceConfigName + * A fully-qualified path representing CertificateIssuanceConfig resource. + * @returns {string} A string representing the certificate_issuance_config. + */ + matchCertificateIssuanceConfigFromCertificateIssuanceConfigName( + certificateIssuanceConfigName: string + ) { + return this.pathTemplates.certificateIssuanceConfigPathTemplate.match( + certificateIssuanceConfigName + ).certificate_issuance_config; + } + + /** + * Return a fully-qualified certificateMap resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_map + * @returns {string} Resource name string. + */ + certificateMapPath( + project: string, + location: string, + certificateMap: string + ) { + return this.pathTemplates.certificateMapPathTemplate.render({ + project: project, + location: location, + certificate_map: certificateMap, + }); + } + + /** + * Parse the project from CertificateMap resource. + * + * @param {string} certificateMapName + * A fully-qualified path representing CertificateMap resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateMapName(certificateMapName: string) { + return this.pathTemplates.certificateMapPathTemplate.match( + certificateMapName + ).project; + } + + /** + * Parse the location from CertificateMap resource. + * + * @param {string} certificateMapName + * A fully-qualified path representing CertificateMap resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateMapName(certificateMapName: string) { + return this.pathTemplates.certificateMapPathTemplate.match( + certificateMapName + ).location; + } + + /** + * Parse the certificate_map from CertificateMap resource. + * + * @param {string} certificateMapName + * A fully-qualified path representing CertificateMap resource. + * @returns {string} A string representing the certificate_map. + */ + matchCertificateMapFromCertificateMapName(certificateMapName: string) { + return this.pathTemplates.certificateMapPathTemplate.match( + certificateMapName + ).certificate_map; + } + + /** + * Return a fully-qualified certificateMapEntry resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} certificate_map + * @param {string} certificate_map_entry + * @returns {string} Resource name string. + */ + certificateMapEntryPath( + project: string, + location: string, + certificateMap: string, + certificateMapEntry: string + ) { + return this.pathTemplates.certificateMapEntryPathTemplate.render({ + project: project, + location: location, + certificate_map: certificateMap, + certificate_map_entry: certificateMapEntry, + }); + } + + /** + * Parse the project from CertificateMapEntry resource. + * + * @param {string} certificateMapEntryName + * A fully-qualified path representing CertificateMapEntry resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCertificateMapEntryName(certificateMapEntryName: string) { + return this.pathTemplates.certificateMapEntryPathTemplate.match( + certificateMapEntryName + ).project; + } + + /** + * Parse the location from CertificateMapEntry resource. + * + * @param {string} certificateMapEntryName + * A fully-qualified path representing CertificateMapEntry resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCertificateMapEntryName(certificateMapEntryName: string) { + return this.pathTemplates.certificateMapEntryPathTemplate.match( + certificateMapEntryName + ).location; + } + + /** + * Parse the certificate_map from CertificateMapEntry resource. + * + * @param {string} certificateMapEntryName + * A fully-qualified path representing CertificateMapEntry resource. + * @returns {string} A string representing the certificate_map. + */ + matchCertificateMapFromCertificateMapEntryName( + certificateMapEntryName: string + ) { + return this.pathTemplates.certificateMapEntryPathTemplate.match( + certificateMapEntryName + ).certificate_map; + } + + /** + * Parse the certificate_map_entry from CertificateMapEntry resource. + * + * @param {string} certificateMapEntryName + * A fully-qualified path representing CertificateMapEntry resource. + * @returns {string} A string representing the certificate_map_entry. + */ + matchCertificateMapEntryFromCertificateMapEntryName( + certificateMapEntryName: string + ) { + return this.pathTemplates.certificateMapEntryPathTemplate.match( + certificateMapEntryName + ).certificate_map_entry; + } + + /** + * Return a fully-qualified dnsAuthorization resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_authorization + * @returns {string} Resource name string. + */ + dnsAuthorizationPath( + project: string, + location: string, + dnsAuthorization: string + ) { + return this.pathTemplates.dnsAuthorizationPathTemplate.render({ + project: project, + location: location, + dns_authorization: dnsAuthorization, + }); + } + + /** + * Parse the project from DnsAuthorization resource. + * + * @param {string} dnsAuthorizationName + * A fully-qualified path representing DnsAuthorization resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsAuthorizationName(dnsAuthorizationName: string) { + return this.pathTemplates.dnsAuthorizationPathTemplate.match( + dnsAuthorizationName + ).project; + } + + /** + * Parse the location from DnsAuthorization resource. + * + * @param {string} dnsAuthorizationName + * A fully-qualified path representing DnsAuthorization resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsAuthorizationName(dnsAuthorizationName: string) { + return this.pathTemplates.dnsAuthorizationPathTemplate.match( + dnsAuthorizationName + ).location; + } + + /** + * Parse the dns_authorization from DnsAuthorization resource. + * + * @param {string} dnsAuthorizationName + * A fully-qualified path representing DnsAuthorization resource. + * @returns {string} A string representing the dns_authorization. + */ + matchDnsAuthorizationFromDnsAuthorizationName(dnsAuthorizationName: string) { + return this.pathTemplates.dnsAuthorizationPathTemplate.match( + dnsAuthorizationName + ).dns_authorization; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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.certificateManagerStub && !this._terminated) { + return this.certificateManagerStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client_config.json b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client_config.json new file mode 100644 index 000000000000..7601cd455ce4 --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client_config.json @@ -0,0 +1,158 @@ +{ + "interfaces": { + "google.cloud.certificatemanager.v1.CertificateManager": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListCertificates": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCertificate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCertificateMaps": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCertificateMap": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCertificateMap": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCertificateMap": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCertificateMap": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCertificateMapEntries": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCertificateMapEntry": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCertificateMapEntry": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCertificateMapEntry": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCertificateMapEntry": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDnsAuthorizations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDnsAuthorization": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateDnsAuthorization": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDnsAuthorization": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDnsAuthorization": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCertificateIssuanceConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCertificateIssuanceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCertificateIssuanceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCertificateIssuanceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_proto_list.json b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_proto_list.json new file mode 100644 index 000000000000..daa9fd4d4b18 --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto", + "../../protos/google/cloud/certificatemanager/v1/certificate_manager.proto" +] diff --git a/packages/google-cloud-certificatemanager/src/v1/gapic_metadata.json b/packages/google-cloud-certificatemanager/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..3713e3ad2c62 --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/v1/gapic_metadata.json @@ -0,0 +1,283 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.certificatemanager.v1", + "libraryPackage": "@google-cloud/certificate-manager", + "services": { + "CertificateManager": { + "clients": { + "grpc": { + "libraryClient": "CertificateManagerClient", + "rpcs": { + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "GetCertificateMap": { + "methods": [ + "getCertificateMap" + ] + }, + "GetCertificateMapEntry": { + "methods": [ + "getCertificateMapEntry" + ] + }, + "GetDnsAuthorization": { + "methods": [ + "getDnsAuthorization" + ] + }, + "GetCertificateIssuanceConfig": { + "methods": [ + "getCertificateIssuanceConfig" + ] + }, + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "DeleteCertificate": { + "methods": [ + "deleteCertificate" + ] + }, + "CreateCertificateMap": { + "methods": [ + "createCertificateMap" + ] + }, + "UpdateCertificateMap": { + "methods": [ + "updateCertificateMap" + ] + }, + "DeleteCertificateMap": { + "methods": [ + "deleteCertificateMap" + ] + }, + "CreateCertificateMapEntry": { + "methods": [ + "createCertificateMapEntry" + ] + }, + "UpdateCertificateMapEntry": { + "methods": [ + "updateCertificateMapEntry" + ] + }, + "DeleteCertificateMapEntry": { + "methods": [ + "deleteCertificateMapEntry" + ] + }, + "CreateDnsAuthorization": { + "methods": [ + "createDnsAuthorization" + ] + }, + "UpdateDnsAuthorization": { + "methods": [ + "updateDnsAuthorization" + ] + }, + "DeleteDnsAuthorization": { + "methods": [ + "deleteDnsAuthorization" + ] + }, + "CreateCertificateIssuanceConfig": { + "methods": [ + "createCertificateIssuanceConfig" + ] + }, + "DeleteCertificateIssuanceConfig": { + "methods": [ + "deleteCertificateIssuanceConfig" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateMaps": { + "methods": [ + "listCertificateMaps", + "listCertificateMapsStream", + "listCertificateMapsAsync" + ] + }, + "ListCertificateMapEntries": { + "methods": [ + "listCertificateMapEntries", + "listCertificateMapEntriesStream", + "listCertificateMapEntriesAsync" + ] + }, + "ListDnsAuthorizations": { + "methods": [ + "listDnsAuthorizations", + "listDnsAuthorizationsStream", + "listDnsAuthorizationsAsync" + ] + }, + "ListCertificateIssuanceConfigs": { + "methods": [ + "listCertificateIssuanceConfigs", + "listCertificateIssuanceConfigsStream", + "listCertificateIssuanceConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CertificateManagerClient", + "rpcs": { + "GetCertificate": { + "methods": [ + "getCertificate" + ] + }, + "GetCertificateMap": { + "methods": [ + "getCertificateMap" + ] + }, + "GetCertificateMapEntry": { + "methods": [ + "getCertificateMapEntry" + ] + }, + "GetDnsAuthorization": { + "methods": [ + "getDnsAuthorization" + ] + }, + "GetCertificateIssuanceConfig": { + "methods": [ + "getCertificateIssuanceConfig" + ] + }, + "CreateCertificate": { + "methods": [ + "createCertificate" + ] + }, + "UpdateCertificate": { + "methods": [ + "updateCertificate" + ] + }, + "DeleteCertificate": { + "methods": [ + "deleteCertificate" + ] + }, + "CreateCertificateMap": { + "methods": [ + "createCertificateMap" + ] + }, + "UpdateCertificateMap": { + "methods": [ + "updateCertificateMap" + ] + }, + "DeleteCertificateMap": { + "methods": [ + "deleteCertificateMap" + ] + }, + "CreateCertificateMapEntry": { + "methods": [ + "createCertificateMapEntry" + ] + }, + "UpdateCertificateMapEntry": { + "methods": [ + "updateCertificateMapEntry" + ] + }, + "DeleteCertificateMapEntry": { + "methods": [ + "deleteCertificateMapEntry" + ] + }, + "CreateDnsAuthorization": { + "methods": [ + "createDnsAuthorization" + ] + }, + "UpdateDnsAuthorization": { + "methods": [ + "updateDnsAuthorization" + ] + }, + "DeleteDnsAuthorization": { + "methods": [ + "deleteDnsAuthorization" + ] + }, + "CreateCertificateIssuanceConfig": { + "methods": [ + "createCertificateIssuanceConfig" + ] + }, + "DeleteCertificateIssuanceConfig": { + "methods": [ + "deleteCertificateIssuanceConfig" + ] + }, + "ListCertificates": { + "methods": [ + "listCertificates", + "listCertificatesStream", + "listCertificatesAsync" + ] + }, + "ListCertificateMaps": { + "methods": [ + "listCertificateMaps", + "listCertificateMapsStream", + "listCertificateMapsAsync" + ] + }, + "ListCertificateMapEntries": { + "methods": [ + "listCertificateMapEntries", + "listCertificateMapEntriesStream", + "listCertificateMapEntriesAsync" + ] + }, + "ListDnsAuthorizations": { + "methods": [ + "listDnsAuthorizations", + "listDnsAuthorizationsStream", + "listDnsAuthorizationsAsync" + ] + }, + "ListCertificateIssuanceConfigs": { + "methods": [ + "listCertificateIssuanceConfigs", + "listCertificateIssuanceConfigsStream", + "listCertificateIssuanceConfigsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-certificatemanager/src/v1/index.ts b/packages/google-cloud-certificatemanager/src/v1/index.ts new file mode 100644 index 000000000000..41cec7e226bb --- /dev/null +++ b/packages/google-cloud-certificatemanager/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {CertificateManagerClient} from './certificate_manager_client'; diff --git a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..de6779b498a8 --- /dev/null +++ b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const certificatemanager = require('@google-cloud/certificate-manager'); + +function main() { + const certificateManagerClient = + new certificatemanager.CertificateManagerClient(); +} + +main(); diff --git a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..922c5fb43ba8 --- /dev/null +++ b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {CertificateManagerClient} from '@google-cloud/certificate-manager'; + +// check that the client class type name can be used +function doStuffWithCertificateManagerClient(client: CertificateManagerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const certificateManagerClient = new CertificateManagerClient(); + doStuffWithCertificateManagerClient(certificateManagerClient); +} + +main(); diff --git a/packages/google-cloud-certificatemanager/system-test/install.ts b/packages/google-cloud-certificatemanager/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-certificatemanager/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts b/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts new file mode 100644 index 000000000000..11bf9ed62043 --- /dev/null +++ b/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts @@ -0,0 +1,6358 @@ +// Copyright 2022 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 certificatemanagerModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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.CertificateManagerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + certificatemanagerModule.v1.CertificateManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + certificatemanagerModule.v1.CertificateManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = certificatemanagerModule.v1.CertificateManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.certificateManagerStub, undefined); + await client.initialize(); + assert(client.certificateManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.certificateManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.certificateManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + 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 certificatemanagerModule.v1.CertificateManagerClient({ + 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('getCertificate', () => { + it('invokes getCertificate without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ); + client.innerApiCalls.getCertificate = stubSimpleCall(expectedResponse); + const [response] = await client.getCertificate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ); + client.innerApiCalls.getCertificate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.certificatemanager.v1.ICertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificate with closed client', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCertificate(request), expectedError); + }); + }); + + describe('getCertificateMap', () => { + it('invokes getCertificateMap without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ); + client.innerApiCalls.getCertificateMap = stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateMap(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMap without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ); + client.innerApiCalls.getCertificateMap = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateMap( + request, + ( + err?: Error | null, + result?: protos.google.cloud.certificatemanager.v1.ICertificateMap | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMap with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateMap = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCertificateMap(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMap with closed client', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCertificateMap(request), expectedError); + }); + }); + + describe('getCertificateMapEntry', () => { + it('invokes getCertificateMapEntry without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ); + client.innerApiCalls.getCertificateMapEntry = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateMapEntry(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMapEntry without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ); + client.innerApiCalls.getCertificateMapEntry = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateMapEntry( + request, + ( + err?: Error | null, + result?: protos.google.cloud.certificatemanager.v1.ICertificateMapEntry | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMapEntry with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateMapEntry = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getCertificateMapEntry(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateMapEntry with closed client', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getCertificateMapEntry(request), + expectedError + ); + }); + }); + + describe('getDnsAuthorization', () => { + it('invokes getDnsAuthorization without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ); + client.innerApiCalls.getDnsAuthorization = + stubSimpleCall(expectedResponse); + const [response] = await client.getDnsAuthorization(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsAuthorization without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ); + client.innerApiCalls.getDnsAuthorization = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDnsAuthorization( + request, + ( + err?: Error | null, + result?: protos.google.cloud.certificatemanager.v1.IDnsAuthorization | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsAuthorization with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDnsAuthorization = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDnsAuthorization(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsAuthorization with closed client', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDnsAuthorization(request), expectedError); + }); + }); + + describe('getCertificateIssuanceConfig', () => { + it('invokes getCertificateIssuanceConfig without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ); + client.innerApiCalls.getCertificateIssuanceConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getCertificateIssuanceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateIssuanceConfig without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ); + client.innerApiCalls.getCertificateIssuanceConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCertificateIssuanceConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateIssuanceConfig with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCertificateIssuanceConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getCertificateIssuanceConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCertificateIssuanceConfig with closed client', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.GetCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getCertificateIssuanceConfig(request), + expectedError + ); + }); + }); + + describe('createCertificate', () => { + it('invokes createCertificate without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificate with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCertificate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCertificateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateCertificateProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificate', () => { + it('invokes updateCertificate without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateRequest() + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateRequest', + ['certificate', 'name'] + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateRequest() + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateRequest', + ['certificate', 'name'] + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateRequest() + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateRequest', + ['certificate', 'name'] + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificate with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateRequest() + ); + request.certificate ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateRequest', + ['certificate', 'name'] + ); + request.certificate.name = defaultValue1; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCertificate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateCertificateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateCertificateProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificate', () => { + it('invokes deleteCertificate without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificate without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificate with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCertificate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificate with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCertificate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCertificateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteCertificateProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateMap', () => { + it('invokes createCertificateMap without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateMap = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateMap(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMap without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateMap = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateMap( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMap with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateMap = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCertificateMap(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMap with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateMap = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCertificateMap(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateMapProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateCertificateMapProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateMapProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateCertificateMapProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateMap', () => { + it('invokes updateCertificateMap without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest() + ); + request.certificateMap ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest', + ['certificateMap', 'name'] + ); + request.certificateMap.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificateMap = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateMap(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMap without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest() + ); + request.certificateMap ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest', + ['certificateMap', 'name'] + ); + request.certificateMap.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificateMap = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateMap( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMap with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest() + ); + request.certificateMap ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest', + ['certificateMap', 'name'] + ); + request.certificateMap.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateMap = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCertificateMap(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMap with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest() + ); + request.certificateMap ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapRequest', + ['certificateMap', 'name'] + ); + request.certificateMap.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateMap = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCertificateMap(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateMapProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateCertificateMapProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateMapProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateCertificateMapProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificateMap', () => { + it('invokes deleteCertificateMap without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateMap = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificateMap(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMap without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateMap = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificateMap( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMap with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateMap = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCertificateMap(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMap with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateMap = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCertificateMap(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMap as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateMapProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteCertificateMapProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateMapProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteCertificateMapProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateMapEntry', () => { + it('invokes createCertificateMapEntry without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateMapEntry = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateMapEntry(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMapEntry without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateMapEntry = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateMapEntry( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMapEntry with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateMapEntry = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createCertificateMapEntry(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateMapEntry with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateMapEntryRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateMapEntry = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCertificateMapEntry(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateMapEntryProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateCertificateMapEntryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateMapEntryProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateCertificateMapEntryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCertificateMapEntry', () => { + it('invokes updateCertificateMapEntry without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest() + ); + request.certificateMapEntry ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest', + ['certificateMapEntry', 'name'] + ); + request.certificateMapEntry.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificateMapEntry = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCertificateMapEntry(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMapEntry without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest() + ); + request.certificateMapEntry ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest', + ['certificateMapEntry', 'name'] + ); + request.certificateMapEntry.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCertificateMapEntry = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCertificateMapEntry( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMapEntry with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest() + ); + request.certificateMapEntry ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest', + ['certificateMapEntry', 'name'] + ); + request.certificateMapEntry.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateMapEntry = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateCertificateMapEntry(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCertificateMapEntry with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest() + ); + request.certificateMapEntry ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateCertificateMapEntryRequest', + ['certificateMapEntry', 'name'] + ); + request.certificateMapEntry.name = defaultValue1; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCertificateMapEntry = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCertificateMapEntry(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateCertificateMapEntryProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateCertificateMapEntryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateCertificateMapEntryProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateCertificateMapEntryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificateMapEntry', () => { + it('invokes deleteCertificateMapEntry without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateMapEntry = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificateMapEntry(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMapEntry without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateMapEntry = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificateMapEntry( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMapEntry with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateMapEntry = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteCertificateMapEntry(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateMapEntry with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateMapEntryRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateMapEntry = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCertificateMapEntry(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateMapEntry as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateMapEntryProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteCertificateMapEntryProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateMapEntryProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteCertificateMapEntryProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createDnsAuthorization', () => { + it('invokes createDnsAuthorization without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDnsAuthorization = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDnsAuthorization(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsAuthorization without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDnsAuthorization = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDnsAuthorization( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsAuthorization with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDnsAuthorization = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createDnsAuthorization(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsAuthorization with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateDnsAuthorizationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDnsAuthorization = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDnsAuthorization(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDnsAuthorizationProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDnsAuthorizationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDnsAuthorizationProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateDnsAuthorizationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDnsAuthorization', () => { + it('invokes updateDnsAuthorization without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest() + ); + request.dnsAuthorization ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest', + ['dnsAuthorization', 'name'] + ); + request.dnsAuthorization.name = defaultValue1; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDnsAuthorization = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDnsAuthorization(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsAuthorization without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest() + ); + request.dnsAuthorization ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest', + ['dnsAuthorization', 'name'] + ); + request.dnsAuthorization.name = defaultValue1; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDnsAuthorization = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDnsAuthorization( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsAuthorization with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest() + ); + request.dnsAuthorization ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest', + ['dnsAuthorization', 'name'] + ); + request.dnsAuthorization.name = defaultValue1; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDnsAuthorization = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDnsAuthorization(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsAuthorization with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest() + ); + request.dnsAuthorization ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.UpdateDnsAuthorizationRequest', + ['dnsAuthorization', 'name'] + ); + request.dnsAuthorization.name = defaultValue1; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDnsAuthorization = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDnsAuthorization(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDnsAuthorizationProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDnsAuthorizationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDnsAuthorizationProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDnsAuthorizationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDnsAuthorization', () => { + it('invokes deleteDnsAuthorization without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDnsAuthorization = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDnsAuthorization(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsAuthorization without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDnsAuthorization = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDnsAuthorization( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsAuthorization with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDnsAuthorization = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteDnsAuthorization(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsAuthorization with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteDnsAuthorizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDnsAuthorization = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDnsAuthorization(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDnsAuthorization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDnsAuthorizationProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDnsAuthorizationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDnsAuthorizationProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteDnsAuthorizationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCertificateIssuanceConfig', () => { + it('invokes createCertificateIssuanceConfig without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateIssuanceConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCertificateIssuanceConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateIssuanceConfig without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCertificateIssuanceConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCertificateIssuanceConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateIssuanceConfig with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateIssuanceConfig = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.createCertificateIssuanceConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCertificateIssuanceConfig with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.CreateCertificateIssuanceConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCertificateIssuanceConfig = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCertificateIssuanceConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCertificateIssuanceConfigProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateCertificateIssuanceConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCertificateIssuanceConfigProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateCertificateIssuanceConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCertificateIssuanceConfig', () => { + it('invokes deleteCertificateIssuanceConfig without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateIssuanceConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCertificateIssuanceConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateIssuanceConfig without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCertificateIssuanceConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCertificateIssuanceConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateIssuanceConfig with call error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateIssuanceConfig = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.deleteCertificateIssuanceConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCertificateIssuanceConfig with LRO error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.DeleteCertificateIssuanceConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCertificateIssuanceConfig = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCertificateIssuanceConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCertificateIssuanceConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteCertificateIssuanceConfigProgress without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteCertificateIssuanceConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteCertificateIssuanceConfigProgress with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteCertificateIssuanceConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCertificates', () => { + it('invokes listCertificates without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + ]; + client.innerApiCalls.listCertificates = stubSimpleCall(expectedResponse); + const [response] = await client.listCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + ]; + client.innerApiCalls.listCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificates( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.certificatemanager.v1.ICertificate[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificates with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCertificates(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificatesStream without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + ]; + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.Certificate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.certificatemanager.v1.Certificate) => { + 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.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request) + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCertificatesStream with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.Certificate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.certificatemanager.v1.Certificate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificates, request) + ); + assert( + (client.descriptors.page.listCertificates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificates without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.Certificate() + ), + ]; + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.certificatemanager.v1.ICertificate[] = + []; + const iterable = client.listCertificatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificates with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.certificatemanager.v1.ICertificate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificates.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCertificates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCertificateMaps', () => { + it('invokes listCertificateMaps without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + ]; + client.innerApiCalls.listCertificateMaps = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateMaps(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMaps without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + ]; + client.innerApiCalls.listCertificateMaps = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateMaps( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.certificatemanager.v1.ICertificateMap[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMaps with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateMaps = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCertificateMaps(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMaps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMapsStream without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + ]; + client.descriptors.page.listCertificateMaps.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateMapsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateMap[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateMap + ) => { + 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.listCertificateMaps.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateMaps, request) + ); + assert( + (client.descriptors.page.listCertificateMaps.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCertificateMapsStream with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateMaps.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateMapsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateMap[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateMap + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCertificateMaps.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateMaps, request) + ); + assert( + (client.descriptors.page.listCertificateMaps.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateMaps without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMap() + ), + ]; + client.descriptors.page.listCertificateMaps.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.certificatemanager.v1.ICertificateMap[] = + []; + const iterable = client.listCertificateMapsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateMaps.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCertificateMaps.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateMaps with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateMaps.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateMapsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.certificatemanager.v1.ICertificateMap[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateMaps.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCertificateMaps.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCertificateMapEntries', () => { + it('invokes listCertificateMapEntries without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + ]; + client.innerApiCalls.listCertificateMapEntries = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateMapEntries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMapEntries without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + ]; + client.innerApiCalls.listCertificateMapEntries = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateMapEntries( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMapEntries with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateMapEntries = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listCertificateMapEntries(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateMapEntries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateMapEntriesStream without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + ]; + client.descriptors.page.listCertificateMapEntries.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateMapEntriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateMapEntry[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateMapEntry + ) => { + 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.listCertificateMapEntries + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateMapEntries, request) + ); + assert( + ( + client.descriptors.page.listCertificateMapEntries + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCertificateMapEntriesStream with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateMapEntries.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateMapEntriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateMapEntry[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateMapEntry + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateMapEntries + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listCertificateMapEntries, request) + ); + assert( + ( + client.descriptors.page.listCertificateMapEntries + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateMapEntries without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() + ), + ]; + client.descriptors.page.listCertificateMapEntries.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[] = + []; + const iterable = client.listCertificateMapEntriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateMapEntries + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCertificateMapEntries + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateMapEntries with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateMapEntriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateMapEntries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateMapEntriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateMapEntries + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCertificateMapEntries + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDnsAuthorizations', () => { + it('invokes listDnsAuthorizations without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + ]; + client.innerApiCalls.listDnsAuthorizations = + stubSimpleCall(expectedResponse); + const [response] = await client.listDnsAuthorizations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsAuthorizations without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + ]; + client.innerApiCalls.listDnsAuthorizations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDnsAuthorizations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.certificatemanager.v1.IDnsAuthorization[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsAuthorizations with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDnsAuthorizations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listDnsAuthorizations(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsAuthorizations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsAuthorizationsStream without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + ]; + client.descriptors.page.listDnsAuthorizations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDnsAuthorizationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.DnsAuthorization[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.DnsAuthorization + ) => { + 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.listDnsAuthorizations + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDnsAuthorizations, request) + ); + assert( + ( + client.descriptors.page.listDnsAuthorizations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDnsAuthorizationsStream with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsAuthorizations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDnsAuthorizationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.DnsAuthorization[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.DnsAuthorization + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listDnsAuthorizations + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDnsAuthorizations, request) + ); + assert( + ( + client.descriptors.page.listDnsAuthorizations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDnsAuthorizations without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.DnsAuthorization() + ), + ]; + client.descriptors.page.listDnsAuthorizations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.certificatemanager.v1.IDnsAuthorization[] = + []; + const iterable = client.listDnsAuthorizationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDnsAuthorizations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDnsAuthorizations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDnsAuthorizations with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListDnsAuthorizationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsAuthorizations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDnsAuthorizationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.certificatemanager.v1.IDnsAuthorization[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDnsAuthorizations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDnsAuthorizations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCertificateIssuanceConfigs', () => { + it('invokes listCertificateIssuanceConfigs without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + ]; + client.innerApiCalls.listCertificateIssuanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listCertificateIssuanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateIssuanceConfigs without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + ]; + client.innerApiCalls.listCertificateIssuanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCertificateIssuanceConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateIssuanceConfigs with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCertificateIssuanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listCertificateIssuanceConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCertificateIssuanceConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCertificateIssuanceConfigsStream without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + ]; + client.descriptors.page.listCertificateIssuanceConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCertificateIssuanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig + ) => { + 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.listCertificateIssuanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateIssuanceConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCertificateIssuanceConfigsStream with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateIssuanceConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCertificateIssuanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCertificateIssuanceConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateIssuanceConfigs without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() + ), + ]; + client.descriptors.page.listCertificateIssuanceConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[] = + []; + const iterable = client.listCertificateIssuanceConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCertificateIssuanceConfigs with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCertificateIssuanceConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCertificateIssuanceConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCertificateIssuanceConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('certificate', () => { + const fakePath = '/rendered/path/certificate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate: 'certificateValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.certificatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificatePath', () => { + const result = client.certificatePath( + 'projectValue', + 'locationValue', + 'certificateValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.certificatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCertificateName', () => { + const result = client.matchProjectFromCertificateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCertificateName', () => { + const result = client.matchLocationFromCertificateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCertificateFromCertificateName', () => { + const result = client.matchCertificateFromCertificateName(fakePath); + assert.strictEqual(result, 'certificateValue'); + assert( + (client.pathTemplates.certificatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('certificateIssuanceConfig', () => { + const fakePath = '/rendered/path/certificateIssuanceConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_issuance_config: 'certificateIssuanceConfigValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.certificateIssuanceConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateIssuanceConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateIssuanceConfigPath', () => { + const result = client.certificateIssuanceConfigPath( + 'projectValue', + 'locationValue', + 'certificateIssuanceConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateIssuanceConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCertificateIssuanceConfigName', () => { + const result = + client.matchProjectFromCertificateIssuanceConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateIssuanceConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCertificateIssuanceConfigName', () => { + const result = + client.matchLocationFromCertificateIssuanceConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateIssuanceConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCertificateIssuanceConfigFromCertificateIssuanceConfigName', () => { + const result = + client.matchCertificateIssuanceConfigFromCertificateIssuanceConfigName( + fakePath + ); + assert.strictEqual(result, 'certificateIssuanceConfigValue'); + assert( + ( + client.pathTemplates.certificateIssuanceConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('certificateMap', () => { + const fakePath = '/rendered/path/certificateMap'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_map: 'certificateMapValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.certificateMapPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateMapPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateMapPath', () => { + const result = client.certificateMapPath( + 'projectValue', + 'locationValue', + 'certificateMapValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.certificateMapPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCertificateMapName', () => { + const result = client.matchProjectFromCertificateMapName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.certificateMapPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCertificateMapName', () => { + const result = client.matchLocationFromCertificateMapName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.certificateMapPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCertificateMapFromCertificateMapName', () => { + const result = + client.matchCertificateMapFromCertificateMapName(fakePath); + assert.strictEqual(result, 'certificateMapValue'); + assert( + (client.pathTemplates.certificateMapPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('certificateMapEntry', () => { + const fakePath = '/rendered/path/certificateMapEntry'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + certificate_map: 'certificateMapValue', + certificate_map_entry: 'certificateMapEntryValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.certificateMapEntryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.certificateMapEntryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('certificateMapEntryPath', () => { + const result = client.certificateMapEntryPath( + 'projectValue', + 'locationValue', + 'certificateMapValue', + 'certificateMapEntryValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.certificateMapEntryPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCertificateMapEntryName', () => { + const result = client.matchProjectFromCertificateMapEntryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.certificateMapEntryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCertificateMapEntryName', () => { + const result = + client.matchLocationFromCertificateMapEntryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.certificateMapEntryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCertificateMapFromCertificateMapEntryName', () => { + const result = + client.matchCertificateMapFromCertificateMapEntryName(fakePath); + assert.strictEqual(result, 'certificateMapValue'); + assert( + ( + client.pathTemplates.certificateMapEntryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCertificateMapEntryFromCertificateMapEntryName', () => { + const result = + client.matchCertificateMapEntryFromCertificateMapEntryName(fakePath); + assert.strictEqual(result, 'certificateMapEntryValue'); + assert( + ( + client.pathTemplates.certificateMapEntryPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dnsAuthorization', () => { + const fakePath = '/rendered/path/dnsAuthorization'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dns_authorization: 'dnsAuthorizationValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dnsAuthorizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dnsAuthorizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dnsAuthorizationPath', () => { + const result = client.dnsAuthorizationPath( + 'projectValue', + 'locationValue', + 'dnsAuthorizationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.dnsAuthorizationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDnsAuthorizationName', () => { + const result = client.matchProjectFromDnsAuthorizationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dnsAuthorizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDnsAuthorizationName', () => { + const result = client.matchLocationFromDnsAuthorizationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dnsAuthorizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDnsAuthorizationFromDnsAuthorizationName', () => { + const result = + client.matchDnsAuthorizationFromDnsAuthorizationName(fakePath); + assert.strictEqual(result, 'dnsAuthorizationValue'); + assert( + (client.pathTemplates.dnsAuthorizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new certificatemanagerModule.v1.CertificateManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-certificatemanager/tsconfig.json b/packages/google-cloud-certificatemanager/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-certificatemanager/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/packages/google-cloud-certificatemanager/webpack.config.js b/packages/google-cloud-certificatemanager/webpack.config.js new file mode 100644 index 000000000000..9add3d7a2fa0 --- /dev/null +++ b/packages/google-cloud-certificatemanager/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: 'CertificateManager', + filename: './certificate-manager.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/packages/google-cloud-dataplex/.OwlBot.yaml b/packages/google-cloud-dataplex/.OwlBot.yaml new file mode 100644 index 000000000000..7356a0314e22 --- /dev/null +++ b/packages/google-cloud-dataplex/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/dataplex/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-dataplex/$1 diff --git a/packages/google-cloud-dataplex/.eslintignore b/packages/google-cloud-dataplex/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-dataplex/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-dataplex/.eslintrc.json b/packages/google-cloud-dataplex/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-dataplex/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-dataplex/.gitattributes b/packages/google-cloud-dataplex/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-dataplex/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-dataplex/.gitignore b/packages/google-cloud-dataplex/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-dataplex/.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/packages/google-cloud-dataplex/.jsdoc.js b/packages/google-cloud-dataplex/.jsdoc.js new file mode 100644 index 000000000000..ee5e526879dc --- /dev/null +++ b/packages/google-cloud-dataplex/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dataplex', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-dataplex/.mocharc.js b/packages/google-cloud-dataplex/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-dataplex/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-dataplex/.nycrc b/packages/google-cloud-dataplex/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-dataplex/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-dataplex/.prettierignore b/packages/google-cloud-dataplex/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-dataplex/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-dataplex/.prettierrc.js b/packages/google-cloud-dataplex/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-dataplex/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-dataplex/.repo-metadata.json b/packages/google-cloud-dataplex/.repo-metadata.json new file mode 100644 index 000000000000..b2ed29676d8a --- /dev/null +++ b/packages/google-cloud-dataplex/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "dataplex", + "name_pretty": "Cloud Dataplex", + "product_documentation": "https://cloud.google.com/dataplex/", + "client_documentation": "https://cloud.google.com/dataplex", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/dataplex", + "api_id": "dataplex.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "dataplex" +} diff --git a/packages/google-cloud-dataplex/CHANGELOG.md b/packages/google-cloud-dataplex/CHANGELOG.md new file mode 100644 index 000000000000..3d934ffb43fa --- /dev/null +++ b/packages/google-cloud-dataplex/CHANGELOG.md @@ -0,0 +1,58 @@ +# Changelog + +## [2.2.0](https://github.com/googleapis/nodejs-dataplex/compare/v2.1.1...v2.2.0) (2022-09-21) + + +### Features + +* Custom container, encryption key, cross project for Task, and more ([#51](https://github.com/googleapis/nodejs-dataplex/issues/51)) ([c6ab09d](https://github.com/googleapis/nodejs-dataplex/commit/c6ab09d06acd14bc182de9afda2d2da683a7a041)) + +## [2.1.1](https://github.com/googleapis/nodejs-dataplex/compare/v2.1.0...v2.1.1) (2022-08-27) + + +### Bug Fixes + +* change import long to require ([#45](https://github.com/googleapis/nodejs-dataplex/issues/45)) ([7f3455c](https://github.com/googleapis/nodejs-dataplex/commit/7f3455c33f91a950b28d71e4af317eb31549a035)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dataplex/issues/1553)) ([#48](https://github.com/googleapis/nodejs-dataplex/issues/48)) ([8ced1a1](https://github.com/googleapis/nodejs-dataplex/commit/8ced1a11ec7a280d8fe10b5180dd7b7252377441)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-dataplex/issues/1546)) ([#47](https://github.com/googleapis/nodejs-dataplex/issues/47)) ([76d8469](https://github.com/googleapis/nodejs-dataplex/commit/76d84695d49aec32df66626ea7cfa6f9d4eb2516)) +* use google-gax v3.3.0 ([8ced1a1](https://github.com/googleapis/nodejs-dataplex/commit/8ced1a11ec7a280d8fe10b5180dd7b7252377441)) + +## [2.1.0](https://github.com/googleapis/nodejs-dataplex/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#40](https://github.com/googleapis/nodejs-dataplex/issues/40)) ([b41c45d](https://github.com/googleapis/nodejs-dataplex/commit/b41c45db754f2bbead96bd6a1ee327d7db7d05ae)) + +## [2.0.0](https://github.com/googleapis/nodejs-dataplex/compare/v1.2.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#35) + +### Build System + +* update library to use Node 12 ([#35](https://github.com/googleapis/nodejs-dataplex/issues/35)) ([5eacc44](https://github.com/googleapis/nodejs-dataplex/commit/5eacc440fb9d16a200d7a4c79edd1a52fbc17848)) + +## [1.2.0](https://github.com/googleapis/nodejs-dataplex/compare/v1.1.0...v1.2.0) (2022-03-24) + + +### Features + +* promote to stable ([#18](https://github.com/googleapis/nodejs-dataplex/issues/18)) ([a66995c](https://github.com/googleapis/nodejs-dataplex/commit/a66995c55005f941e1d43ca2befca1b497c6d9d4)), closes [#6](https://github.com/googleapis/nodejs-dataplex/issues/6) + +## [1.1.0](https://github.com/googleapis/nodejs-dataplex/compare/v1.0.0...v1.1.0) (2022-02-16) + + +### Features + +* add Content APIs ([#11](https://github.com/googleapis/nodejs-dataplex/issues/11)) ([09ea109](https://github.com/googleapis/nodejs-dataplex/commit/09ea109f0e9a6edc5e6eefa345833689422785eb)) +* add Create|Update|Delete Metadata APIs (e.g. Entity and/or Partition). ([09ea109](https://github.com/googleapis/nodejs-dataplex/commit/09ea109f0e9a6edc5e6eefa345833689422785eb)) + +## 1.0.0 (2022-02-07) + + +### Features + +* initial generation ([0315f09](https://github.com/googleapis/nodejs-dataplex/commit/0315f09e8c2768b8acb46793694cf7ba64432f2f)) diff --git a/packages/google-cloud-dataplex/CODE_OF_CONDUCT.md b/packages/google-cloud-dataplex/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-dataplex/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-dataplex/CONTRIBUTING.md b/packages/google-cloud-dataplex/CONTRIBUTING.md new file mode 100644 index 000000000000..7786ca4f303d --- /dev/null +++ b/packages/google-cloud-dataplex/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Dataplex API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=dataplex.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-dataplex/LICENSE b/packages/google-cloud-dataplex/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-dataplex/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-dataplex/README.md b/packages/google-cloud-dataplex/README.md new file mode 100644 index 000000000000..90002399119c --- /dev/null +++ b/packages/google-cloud-dataplex/README.md @@ -0,0 +1,211 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Dataplex: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/dataplex.svg)](https://www.npmjs.org/package/@google-cloud/dataplex) + + + + +dataplex client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Cloud Dataplex Node.js Client API Reference][client-docs] +* [Cloud Dataplex Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Dataplex API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/dataplex +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +// eslint-disable-next-line node/no-missing-require +const {DataplexServiceClient} = require('@google-cloud/dataplex'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' +// const location = 'my-location' + +// Creates a client1046198160504 +// eslint-disable-next-line no-unused-vars +const client = new DataplexServiceClient(); + +async function listLakes() { + const [lakes] = await client.listLakes({ + parent: `projects/${projectId}/locations/${location}`, + }); + console.info(lakes); +} +listLakes(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Content_service.create_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js,samples/README.md) | +| Content_service.delete_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js,samples/README.md) | +| Content_service.get_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js,samples/README.md) | +| Content_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js,samples/README.md) | +| Content_service.list_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js,samples/README.md) | +| Content_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js,samples/README.md) | +| Content_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js,samples/README.md) | +| Content_service.update_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js,samples/README.md) | +| Dataplex_service.cancel_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js,samples/README.md) | +| Dataplex_service.create_asset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js,samples/README.md) | +| Dataplex_service.create_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js,samples/README.md) | +| Dataplex_service.create_lake | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js,samples/README.md) | +| Dataplex_service.create_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js,samples/README.md) | +| Dataplex_service.create_zone | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js,samples/README.md) | +| Dataplex_service.delete_asset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js,samples/README.md) | +| Dataplex_service.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js,samples/README.md) | +| Dataplex_service.delete_lake | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js,samples/README.md) | +| Dataplex_service.delete_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js,samples/README.md) | +| Dataplex_service.delete_zone | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js,samples/README.md) | +| Dataplex_service.get_asset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js,samples/README.md) | +| Dataplex_service.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js,samples/README.md) | +| Dataplex_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js,samples/README.md) | +| Dataplex_service.get_lake | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js,samples/README.md) | +| Dataplex_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js,samples/README.md) | +| Dataplex_service.get_zone | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js,samples/README.md) | +| Dataplex_service.list_asset_actions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js,samples/README.md) | +| Dataplex_service.list_assets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js,samples/README.md) | +| Dataplex_service.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js,samples/README.md) | +| Dataplex_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js,samples/README.md) | +| Dataplex_service.list_lake_actions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js,samples/README.md) | +| Dataplex_service.list_lakes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js,samples/README.md) | +| Dataplex_service.list_sessions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js,samples/README.md) | +| Dataplex_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js,samples/README.md) | +| Dataplex_service.list_zone_actions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js,samples/README.md) | +| Dataplex_service.list_zones | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js,samples/README.md) | +| Dataplex_service.update_asset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js,samples/README.md) | +| Dataplex_service.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js,samples/README.md) | +| Dataplex_service.update_lake | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js,samples/README.md) | +| Dataplex_service.update_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js,samples/README.md) | +| Dataplex_service.update_zone | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js,samples/README.md) | +| Metadata_service.create_entity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js,samples/README.md) | +| Metadata_service.create_partition | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js,samples/README.md) | +| Metadata_service.delete_entity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js,samples/README.md) | +| Metadata_service.delete_partition | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js,samples/README.md) | +| Metadata_service.get_entity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js,samples/README.md) | +| Metadata_service.get_partition | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js,samples/README.md) | +| Metadata_service.list_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js,samples/README.md) | +| Metadata_service.list_partitions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js,samples/README.md) | +| Metadata_service.update_entity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/test/quickstart.js,samples/README.md) | + + + +The [Cloud Dataplex Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/dataplex@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/dataplex +[product-docs]: https://cloud.google.com/dataplex/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=dataplex.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-dataplex/linkinator.config.json b/packages/google-cloud-dataplex/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-dataplex/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-dataplex/package.json b/packages/google-cloud-dataplex/package.json new file mode 100644 index 000000000000..fea3e5359c07 --- /dev/null +++ b/packages/google-cloud-dataplex/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/dataplex", + "version": "2.2.0", + "description": "dataplex client for Node.js", + "repository": "googleapis/nodejs-dataplex", + "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 dataplex", + "dataplex", + "dataplex service" + ], + "scripts": { + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "chai": "^4.3.6", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/analyze.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/analyze.proto new file mode 100644 index 000000000000..6f987fafad0d --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/analyze.proto @@ -0,0 +1,264 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataplex/v1/resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "AnalyzeProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// Environment represents a user-visible compute infrastructure for analytics +// within a lake. +message Environment { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}" + }; + + // Configuration for the underlying infrastructure used to run workloads. + message InfrastructureSpec { + // Compute resources associated with the analyze interactive workloads. + message ComputeResources { + // Optional. Size in GB of the disk. Default is 100 GB. + int32 disk_size_gb = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Total number of nodes in the sessions created for this environment. + int32 node_count = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Max configurable nodes. + // If max_node_count > node_count, then auto-scaling is enabled. + int32 max_node_count = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Software Runtime Configuration to run Analyze. + message OsImageRuntime { + // Required. Dataplex Image version. + string image_version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of Java jars to be included in the runtime environment. + // Valid input includes Cloud Storage URIs to Jar binaries. + // For example, gs://bucket-name/my/path/to/file.jar + repeated string java_libraries = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of python packages to be installed. + // Valid formats include Cloud Storage URI to a PIP installable library. + // For example, gs://bucket-name/my/path/to/lib.tar.gz + repeated string python_packages = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Spark properties to provide configuration for use in sessions created + // for this environment. The properties to set on daemon config files. + // Property keys are specified in `prefix:property` format. + // The prefix must be "spark". + map properties = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Hardware config + oneof resources { + // Optional. Compute resources needed for analyze interactive workloads. + ComputeResources compute = 50 [(google.api.field_behavior) = OPTIONAL]; + } + + // Software config + oneof runtime { + // Required. Software Runtime Configuration for analyze interactive workloads. + OsImageRuntime os_image = 100 [(google.api.field_behavior) = REQUIRED]; + } + } + + message SessionSpec { + // Optional. The idle time configuration of the session. The session will be + // auto-terminated at the end of this period. + google.protobuf.Duration max_idle_duration = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If True, this causes sessions to be pre-created and available for faster + // startup to enable interactive exploration use-cases. This defaults to + // False to avoid additional billed charges. + // These can only be set to True for the environment with name set to + // "default", and with default configuration. + bool enable_fast_startup = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + message SessionStatus { + // Output only. Queries over sessions to mark whether the environment is currently + // active or not + bool active = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + message Endpoints { + // Output only. URI to serve notebook APIs + string notebooks = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI to serve SQL APIs + string sql = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The relative resource name of the environment, of the form: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Environment" + } + ]; + + // Optional. User friendly display name. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. System generated globally unique ID for the environment. This ID will be + // different if the environment is deleted and re-created with the same name. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Environment creation time. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the environment was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User defined labels for the environment. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the environment. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the environment. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Infrastructure specification for the Environment. + InfrastructureSpec infrastructure_spec = 100 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Configuration for sessions created for this environment. + SessionSpec session_spec = 101 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Status of sessions created for this environment. + SessionStatus session_status = 102 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI Endpoints to access sessions associated with the Environment. + Endpoints endpoints = 200 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Content represents a user-visible notebook or a sql script +message Content { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Content" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/content/{content}" + }; + + // Configuration for the Sql Script content. + message SqlScript { + // Query Engine Type of the SQL Script. + enum QueryEngine { + // Value was unspecified. + QUERY_ENGINE_UNSPECIFIED = 0; + + // Spark SQL Query. + SPARK = 2; + } + + // Required. Query Engine to be used for the Sql Query. + QueryEngine engine = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for Notebook content. + message Notebook { + // Kernel Type of the Jupyter notebook. + enum KernelType { + // Kernel Type unspecified. + KERNEL_TYPE_UNSPECIFIED = 0; + + // Python 3 Kernel. + PYTHON3 = 1; + } + + // Required. Kernel Type of the notebook. + KernelType kernel_type = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The relative resource name of the content, of the form: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Content" + } + ]; + + // Output only. System generated globally unique ID for the content. This ID will be + // different if the content is deleted and re-created with the same name. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The path for the Content file, represented as directory structure. + // Unique within a lake. + // Limited to alphanumerics, hyphens, underscores, dots and slashes. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Content creation time. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the content was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User defined labels for the content. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the content. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Only returned in `GetContent` requests and not in `ListContent` request. + oneof data { + // Required. Content data in string format. + string data_text = 9 [(google.api.field_behavior) = REQUIRED]; + } + + oneof content { + // Sql Script related configurations. + SqlScript sql_script = 100; + + // Notebook related configurations. + Notebook notebook = 101; + } +} + +// Represents an active analyze session running for a user. +message Session { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}" + }; + + // Output only. The relative resource name of the content, of the form: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}/sessions/{session_id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Session" + } + ]; + + // Output only. Email of user running the session. + string user_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Session start time. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/content.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/content.proto new file mode 100644 index 000000000000..cd335a58cfd0 --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/content.proto @@ -0,0 +1,268 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataplex/v1/analyze.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "ContentProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// ContentService manages Notebook and SQL Scripts for Dataplex. +service ContentService { + option (google.api.default_host) = "dataplex.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a content. + rpc CreateContent(CreateContentRequest) returns (Content) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems" + body: "content" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/content" + body: "content" + } + }; + option (google.api.method_signature) = "parent,content"; + } + + // Update a content. Only supports full resource update. + rpc UpdateContent(UpdateContentRequest) returns (Content) { + option (google.api.http) = { + patch: "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}" + body: "content" + additional_bindings { + patch: "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}" + body: "content" + } + }; + option (google.api.method_signature) = "content,update_mask"; + } + + // Delete a content. + rpc DeleteContent(DeleteContentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Get a content resource. + rpc GetContent(GetContentRequest) returns (Content) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets the access control policy for a contentitem resource. A `NOT_FOUND` + // error is returned if the resource does not exist. An empty policy is + // returned if the resource exists but does not have a policy set on it. + // + // Caller must have Google IAM `dataplex.content.getIamPolicy` permission + // on the resource. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy" + additional_bindings { + get: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy" + } + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on the specified contentitem resource. + // Replaces any existing policy. + // + // Caller must have Google IAM `dataplex.content.setIamPolicy` permission + // on the resource. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy" + body: "*" + } + }; + } + + // Returns the caller's permissions on a resource. + // If the resource does not exist, an empty set of + // permissions is returned (a `NOT_FOUND` error is not returned). + // + // A caller is not required to have Google IAM permission to make this + // request. + // + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions" + body: "*" + } + }; + } + + // List content. + rpc ListContent(ListContentRequest) returns (ListContentResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/content" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// Create content request. +message CreateContentRequest { + // Required. The resource name of the parent lake: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Required. Content resource. + Content content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update content request. +message UpdateContentRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Content content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete content request. +message DeleteContentRequest { + // Required. The resource name of the content: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Content" + } + ]; +} + +// List content request. Returns the BASIC Content view. +message ListContentRequest { + // Required. The resource name of the parent lake: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. Maximum number of content to return. The service may return fewer than + // this value. If unspecified, at most 10 content will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListContent` call. Provide this + // to retrieve the subsequent page. When paginating, all other parameters + // provided to `ListContent` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. Filters are case-sensitive. + // The following formats are supported: + // + // labels.key1 = "value1" + // labels:key1 + // type = "NOTEBOOK" + // type = "SQL_SCRIPT" + // + // These restrictions can be coinjoined with AND, OR and NOT conjunctions. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// List content response. +message ListContentResponse { + // Content under the given parent lake. + repeated Content content = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Get content request. +message GetContentRequest { + // Specifies whether the request should return the full or the partial + // representation. + enum ContentView { + // Content view not specified. Defaults to BASIC. + // The API will default to the BASIC view. + CONTENT_VIEW_UNSPECIFIED = 0; + + // Will not return the `data_text` field. + BASIC = 1; + + // Returns the complete proto. + FULL = 2; + } + + // Required. The resource name of the content: + // projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Content" + } + ]; + + // Optional. Specify content view to make a partial request. + ContentView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto new file mode 100644 index 000000000000..0cec184809be --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto @@ -0,0 +1,300 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "LogsProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// The payload associated with Discovery data processing. +message DiscoveryEvent { + // The type of the event. + enum EventType { + // An unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // An event representing discovery configuration in effect. + CONFIG = 1; + + // An event representing a metadata entity being created. + ENTITY_CREATED = 2; + + // An event representing a metadata entity being updated. + ENTITY_UPDATED = 3; + + // An event representing a metadata entity being deleted. + ENTITY_DELETED = 4; + + // An event representing a partition being created. + PARTITION_CREATED = 5; + + // An event representing a partition being updated. + PARTITION_UPDATED = 6; + + // An event representing a partition being deleted. + PARTITION_DELETED = 7; + } + + // The type of the entity. + enum EntityType { + // An unspecified event type. + ENTITY_TYPE_UNSPECIFIED = 0; + + // Entities representing structured data. + TABLE = 1; + + // Entities representing unstructured data. + FILESET = 2; + } + + // Details about configuration events. + message ConfigDetails { + // A list of discovery configuration parameters in effect. + // The keys are the field paths within DiscoverySpec. + // Eg. includePatterns, excludePatterns, csvOptions.disableTypeInference, + // etc. + map parameters = 1; + } + + // Details about the entity. + message EntityDetails { + // The name of the entity resource. + // The name is the fully-qualified resource name. + string entity = 1; + + // The type of the entity resource. + EntityType type = 2; + } + + // Details about the partition. + message PartitionDetails { + // The name to the partition resource. + // The name is the fully-qualified resource name. + string partition = 1; + + // The name to the containing entity resource. + // The name is the fully-qualified resource name. + string entity = 2; + + // The type of the containing entity resource. + EntityType type = 3; + + // The locations of the data items (e.g., a Cloud Storage objects) sampled + // for metadata inference. + repeated string sampled_data_locations = 4; + } + + // Details about the action. + message ActionDetails { + // The type of action. + // Eg. IncompatibleDataSchema, InvalidDataFormat + string type = 1; + } + + // The log message. + string message = 1; + + // The id of the associated lake. + string lake_id = 2; + + // The id of the associated zone. + string zone_id = 3; + + // The id of the associated asset. + string asset_id = 4; + + // The data location associated with the event. + string data_location = 5; + + // The type of the event being logged. + EventType type = 10; + + // Additional details about the event. + oneof details { + // Details about discovery configuration in effect. + ConfigDetails config = 20; + + // Details about the entity associated with the event. + EntityDetails entity = 21; + + // Details about the partition associated with the event. + PartitionDetails partition = 22; + + // Details about the action associated with the event. + ActionDetails action = 23; + } +} + +// The payload associated with Job logs that contains events describing jobs +// that have run within a Lake. +message JobEvent { + // The type of the job. + enum Type { + // Unspecified job type. + TYPE_UNSPECIFIED = 0; + + // Spark jobs. + SPARK = 1; + + // Notebook jobs. + NOTEBOOK = 2; + } + + // The completion status of the job. + enum State { + // Unspecified job state. + STATE_UNSPECIFIED = 0; + + // Job successfully completed. + SUCCEEDED = 1; + + // Job was unsuccessful. + FAILED = 2; + + // Job was cancelled by the user. + CANCELLED = 3; + + // Job was cancelled or aborted via the service executing the job. + ABORTED = 4; + } + + // The service used to execute the job. + enum Service { + // Unspecified service. + SERVICE_UNSPECIFIED = 0; + + // Cloud Dataproc. + DATAPROC = 1; + } + + // The log message. + string message = 1; + + // The unique id identifying the job. + string job_id = 2; + + // The time when the job started running. + google.protobuf.Timestamp start_time = 3; + + // The time when the job ended running. + google.protobuf.Timestamp end_time = 4; + + // The job state on completion. + State state = 5; + + // The number of retries. + int32 retries = 6; + + // The type of the job. + Type type = 7; + + // The service used to execute the job. + Service service = 8; + + // The reference to the job within the service. + string service_job = 9; +} + +// These messages contain information about sessions within an environment. +// The monitored resource is 'Environment'. +message SessionEvent { + // The type of the event. + enum EventType { + // An unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // Event when the session is assigned to a user. + START = 1; + + // Event for stop of a session. + STOP = 2; + + // Query events in the session. + QUERY = 3; + + // Event for creation of a cluster. It is not yet assigned to a user. + // This comes before START in the sequence + CREATE = 4; + } + + // Execution details of the query. + message QueryDetail { + // Query Execution engine. + enum Engine { + // An unspecified Engine type. + ENGINE_UNSPECIFIED = 0; + + // Spark-sql engine is specified in Query. + SPARK_SQL = 1; + + // BigQuery engine is specified in Query. + BIGQUERY = 2; + } + + // The unique Query id identifying the query. + string query_id = 1; + + // The query text executed. + string query_text = 2; + + // Query Execution engine. + Engine engine = 3; + + // Time taken for execution of the query. + google.protobuf.Duration duration = 4; + + // The size of results the query produced. + int64 result_size_bytes = 5; + + // The data processed by the query. + int64 data_processed_bytes = 6; + } + + // The log message. + string message = 1; + + // The information about the user that created the session. It will be the + // email address of the user. + string user_id = 2; + + // Unique identifier for the session. + string session_id = 3; + + // The type of the event. + EventType type = 4; + + // Additional information about the Query metadata. + oneof detail { + // The execution details of the query. + QueryDetail query = 5; + } + + // The status of the event. + bool event_succeeded = 6; + + // If the session is associated with an Environment with fast startup enabled, + // and was pre-created before being assigned to a user. + bool fast_startup_enabled = 7; + + // The idle duration of a warm pooled session before it is assigned to user. + google.protobuf.Duration unassigned_duration = 8; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/metadata.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/metadata.proto new file mode 100644 index 000000000000..290d9406628d --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/metadata.proto @@ -0,0 +1,793 @@ +// Copyright 2022 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.cloud.dataplex.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 go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "MetadataProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// Metadata service manages metadata resources such as tables, filesets and +// partitions. +service MetadataService { + option (google.api.default_host) = "dataplex.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a metadata entity. + rpc CreateEntity(CreateEntityRequest) returns (Entity) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities" + body: "entity" + }; + option (google.api.method_signature) = "parent,entity"; + } + + // Update a metadata entity. Only supports full resource update. + rpc UpdateEntity(UpdateEntityRequest) returns (Entity) { + option (google.api.http) = { + put: "/v1/{entity.name=projects/*/locations/*/lakes/*/zones/*/entities/*}" + body: "entity" + }; + } + + // Delete a metadata entity. + rpc DeleteEntity(DeleteEntityRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a metadata entity. + rpc GetEntity(GetEntityRequest) returns (Entity) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List metadata entities in a zone. + rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a metadata partition. + rpc CreatePartition(CreatePartitionRequest) returns (Partition) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions" + body: "partition" + }; + option (google.api.method_signature) = "parent,partition"; + } + + // Delete a metadata partition. + rpc DeletePartition(DeletePartitionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a metadata partition of an entity. + rpc GetPartition(GetPartitionRequest) returns (Partition) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}" + }; + option (google.api.method_signature) = "name"; + } + + // List metadata partitions of an entity. + rpc ListPartitions(ListPartitionsRequest) returns (ListPartitionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Create a metadata entity request. +message CreateEntityRequest { + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Required. Entity resource. + Entity entity = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update a metadata entity request. +// The exiting entity will be fully replaced by the entity in the request. +// The entity ID is mutable. To modify the ID, use the current entity ID in the +// request URL and specify the new ID in the request body. +message UpdateEntityRequest { + // Required. Update description. + Entity entity = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete a metadata entity request. +message DeleteEntityRequest { + // Required. The resource name of the entity: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + } + ]; + + // Required. The etag associated with the entity, which can be retrieved with a + // [GetEntity][] request. + string etag = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// List metadata entities request. +message ListEntitiesRequest { + // Entity views. + enum EntityView { + // The default unset value. Return both table and fileset entities + // if unspecified. + ENTITY_VIEW_UNSPECIFIED = 0; + + // Only list table entities. + TABLES = 1; + + // Only list fileset entities. + FILESETS = 2; + } + + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Required. Specify the entity view to make a partial list request. + EntityView view = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of entities to return. The service may return fewer than + // this value. If unspecified, 100 entities will be returned by default. The + // maximum value is 500; larger values will will be truncated to 500. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListEntities` call. Provide + // this to retrieve the subsequent page. When paginating, all other parameters + // provided to `ListEntities` must match the call that provided the + // page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The following filter parameters can be added to the URL to limit the + // entities returned by the API: + // + // - Entity ID: ?filter="id=entityID" + // - Asset ID: ?filter="asset=assetID" + // - Data path ?filter="data_path=gs://my-bucket" + // - Is HIVE compatible: ?filter="hive_compatible=true" + // - Is BigQuery compatible: ?filter="bigquery_compatible=true" + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List metadata entities response. +message ListEntitiesResponse { + // Entities in the specified parent zone. + repeated Entity entities = 1; + + // Token to retrieve the next page of results, or empty if there are no + // remaining results in the list. + string next_page_token = 2; +} + +// Get metadata entity request. +message GetEntityRequest { + // Entity views for get entity partial result. + enum EntityView { + // The API will default to the `BASIC` view. + ENTITY_VIEW_UNSPECIFIED = 0; + + // Minimal view that does not include the schema. + BASIC = 1; + + // Include basic information and schema. + SCHEMA = 2; + + // Include everything. Currently, this is the same as the SCHEMA view. + FULL = 4; + } + + // Required. The resource name of the entity: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + } + ]; + + // Optional. Used to select the subset of entity information to return. + // Defaults to `BASIC`. + EntityView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// List metadata partitions request. +message ListPartitionsRequest { + // Required. The resource name of the parent entity: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + } + ]; + + // Optional. Maximum number of partitions to return. The service may return fewer than + // this value. If unspecified, 100 partitions will be returned by default. The + // maximum page size is 500; larger values will will be truncated to 500. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListPartitions` call. Provide + // this to retrieve the subsequent page. When paginating, all other parameters + // provided to `ListPartitions` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter the partitions returned to the caller using a key value pair + // expression. Supported operators and syntax: + // + // - logic operators: AND, OR + // - comparison operators: <, >, >=, <= ,=, != + // - LIKE operators: + // - The right hand of a LIKE operator supports "." and + // "*" for wildcard searches, for example "value1 LIKE ".*oo.*" + // - parenthetical grouping: ( ) + // + // Sample filter expression: `?filter="key1 < value1 OR key2 > value2" + // + // **Notes:** + // + // - Keys to the left of operators are case insensitive. + // - Partition results are sorted first by creation time, then by + // lexicographic order. + // - Up to 20 key value filter pairs are allowed, but due to performance + // considerations, only the first 10 will be used as a filter. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Create metadata partition request. +message CreatePartitionRequest { + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + } + ]; + + // Required. Partition resource. + Partition partition = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete metadata partition request. +message DeletePartitionRequest { + // Required. The resource name of the partition. + // format: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + // The {partition_value_path} segment consists of an ordered sequence of + // partition values separated by "/". All values must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Partition" + } + ]; + + // Optional. The etag associated with the partition. + string etag = 2 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// List metadata partitions response. +message ListPartitionsResponse { + // Partitions under the specified parent entity. + repeated Partition partitions = 1; + + // Token to retrieve the next page of results, or empty if there are no + // remaining results in the list. + string next_page_token = 2; +} + +// Get metadata partition request. +message GetPartitionRequest { + // Required. The resource name of the partition: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + // The {partition_value_path} segment consists of an ordered sequence of + // partition values separated by "/". All values must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Partition" + } + ]; +} + +// Represents tables and fileset metadata contained within a zone. +message Entity { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Entity" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}" + }; + + // The type of entity. + enum Type { + // Type unspecified. + TYPE_UNSPECIFIED = 0; + + // Structured and semi-structured data. + TABLE = 1; + + // Unstructured data. + FILESET = 2; + } + + // Provides compatibility information for various metadata stores. + message CompatibilityStatus { + // Provides compatibility information for a specific metadata store. + message Compatibility { + // Output only. Whether the entity is compatible and can be represented in the metadata + // store. + bool compatible = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides additional detail if the entity is incompatible with the + // metadata store. + string reason = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Whether this entity is compatible with Hive Metastore. + Compatibility hive_metastore = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether this entity is compatible with BigQuery. + Compatibility bigquery = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The resource name of the entity, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + } + ]; + + // Optional. Display name must be shorter than or equal to 256 characters. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User friendly longer description text. Must be shorter than or equal to + // 1024 characters. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the entity was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the entity was last updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. A user-provided entity ID. It is mutable, and will be used as the + // published table name. Specifying a new ID in an update entity + // request will override the existing value. + // The ID must contain only letters (a-z, A-Z), numbers (0-9), and + // underscores. Must begin with a letter and consist of 256 or fewer + // characters. + string id = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag associated with the entity, which can be retrieved with a + // [GetEntity][] request. Required for update and delete requests. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The type of entity. + Type type = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The ID of the asset associated with the storage location containing the + // entity data. The entity must be with in the same zone with the asset. + string asset = 11 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The storage path of the entity data. + // For Cloud Storage data, this is the fully-qualified path to the entity, + // such as `gs://bucket/path/to/data`. For BigQuery data, this is the name of + // the table resource, such as + // `projects/project_id/datasets/dataset_id/tables/table_id`. + string data_path = 12 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The set of items within the data path constituting the data in the entity, + // represented as a glob path. + // Example: `gs://bucket/path/to/data/**/*.csv`. + string data_path_pattern = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The name of the associated Data Catalog entry. + string catalog_entry = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Identifies the storage system of the entity data. + StorageSystem system = 15 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Identifies the storage format of the entity data. + // It does not apply to entities with data stored in BigQuery. + StorageFormat format = 16 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Metadata stores that the entity is compatible with. + CompatibilityStatus compatibility = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The description of the data structure and layout. + // The schema is not included in list responses. It is only included in + // `SCHEMA` and `FULL` entity views of a `GetEntity` response. + Schema schema = 50 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents partition metadata contained within entity instances. +message Partition { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Partition" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}" + }; + + // Output only. Partition values used in the HTTP URL must be + // double encoded. For example, `url_encode(url_encode(value))` can be used + // to encode "US:CA/CA#Sunnyvale so that the request URL ends + // with "/partitions/US%253ACA/CA%2523Sunnyvale". + // The name field in the response retains the encoded format. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Partition" + } + ]; + + // Required. Immutable. The set of values representing the partition, which correspond to the + // partition schema defined in the parent entity. + repeated string values = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The location of the entity data within the partition, for example, + // `gs://bucket/path/to/entity/key1=value1/key2=value2`. + // Or `projects//datasets//tables/` + string location = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The etag for this partition. + string etag = 4 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Schema information describing the structure and layout of the data. +message Schema { + // Type information for fields in schemas and partition schemas. + enum Type { + // SchemaType unspecified. + TYPE_UNSPECIFIED = 0; + + // Boolean field. + BOOLEAN = 1; + + // Single byte numeric field. + BYTE = 2; + + // 16-bit numeric field. + INT16 = 3; + + // 32-bit numeric field. + INT32 = 4; + + // 64-bit numeric field. + INT64 = 5; + + // Floating point numeric field. + FLOAT = 6; + + // Double precision numeric field. + DOUBLE = 7; + + // Real value numeric field. + DECIMAL = 8; + + // Sequence of characters field. + STRING = 9; + + // Sequence of bytes field. + BINARY = 10; + + // Date and time field. + TIMESTAMP = 11; + + // Date field. + DATE = 12; + + // Time field. + TIME = 13; + + // Structured field. Nested fields that define the structure of the map. + // If all nested fields are nullable, this field represents a union. + RECORD = 14; + + // Null field that does not have values. + NULL = 100; + } + + // Additional qualifiers to define field semantics. + enum Mode { + // Mode unspecified. + MODE_UNSPECIFIED = 0; + + // The field has required semantics. + REQUIRED = 1; + + // The field has optional semantics, and may be null. + NULLABLE = 2; + + // The field has repeated (0 or more) semantics, and is a list of values. + REPEATED = 3; + } + + // Represents a column field within a table schema. + message SchemaField { + // Required. The name of the field. Must contain only letters, numbers and + // underscores, with a maximum length of 767 characters, + // and must begin with a letter or underscore. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User friendly field description. Must be less than or equal to 1024 + // characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of field. + Type type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Additional field semantics. + Mode mode = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Any nested field for complex types. + repeated SchemaField fields = 10 [(google.api.field_behavior) = OPTIONAL]; + } + + // Represents a key field within the entity's partition structure. You could + // have up to 20 partition fields, but only the first 10 partitions have the + // filtering ability due to performance consideration. **Note:** + // Partition fields are immutable. + message PartitionField { + // Required. Partition field name must consist of letters, numbers, and underscores + // only, with a maximum of length of 256 characters, + // and must begin with a letter or underscore.. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The type of field. + Type type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // The structure of paths within the entity, which represent partitions. + enum PartitionStyle { + // PartitionStyle unspecified + PARTITION_STYLE_UNSPECIFIED = 0; + + // Partitions are hive-compatible. + // Examples: `gs://bucket/path/to/table/dt=2019-10-31/lang=en`, + // `gs://bucket/path/to/table/dt=2019-10-31/lang=en/late`. + HIVE_COMPATIBLE = 1; + } + + // Required. Set to `true` if user-managed or `false` if managed by Dataplex. The + // default is `false` (managed by Dataplex). + // + // - Set to `false`to enable Dataplex discovery to update the schema. + // including new data discovery, schema inference, and schema evolution. + // Users retain the ability to input and edit the schema. Dataplex + // treats schema input by the user as though produced + // by a previous Dataplex discovery operation, and it will + // evolve the schema and take action based on that treatment. + // + // - Set to `true` to fully manage the entity + // schema. This setting guarantees that Dataplex will not + // change schema fields. + bool user_managed = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The sequence of fields describing data in table entities. + // **Note:** BigQuery SchemaFields are immutable. + repeated SchemaField fields = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sequence of fields describing the partition structure in entities. + // If this field is empty, there are no partitions within the data. + repeated PartitionField partition_fields = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The structure of paths containing partition data within the entity. + PartitionStyle partition_style = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Describes the format of the data within its storage location. +message StorageFormat { + // Describes CSV and similar semi-structured data formats. + message CsvOptions { + // Optional. The character encoding of the data. Accepts "US-ASCII", "UTF-8", and + // "ISO-8859-1". Defaults to UTF-8 if unspecified. + string encoding = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of rows to interpret as header rows that should be skipped + // when reading data rows. Defaults to 0. + int32 header_rows = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The delimiter used to separate values. Defaults to ','. + string delimiter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The character used to quote column values. Accepts '"' + // (double quotation mark) or ''' (single quotation mark). Defaults to + // '"' (double quotation mark) if unspecified. + string quote = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes JSON data format. + message JsonOptions { + // Optional. The character encoding of the data. Accepts "US-ASCII", "UTF-8" and + // "ISO-8859-1". Defaults to UTF-8 if not specified. + string encoding = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // The specific file format of the data. + enum Format { + // Format unspecified. + FORMAT_UNSPECIFIED = 0; + + // Parquet-formatted structured data. + PARQUET = 1; + + // Avro-formatted structured data. + AVRO = 2; + + // Orc-formatted structured data. + ORC = 3; + + // Csv-formatted semi-structured data. + CSV = 100; + + // Json-formatted semi-structured data. + JSON = 101; + + // Image data formats (such as jpg and png). + IMAGE = 200; + + // Audio data formats (such as mp3, and wav). + AUDIO = 201; + + // Video data formats (such as mp4 and mpg). + VIDEO = 202; + + // Textual data formats (such as txt and xml). + TEXT = 203; + + // TensorFlow record format. + TFRECORD = 204; + + // Data that doesn't match a specific format. + OTHER = 1000; + + // Data of an unknown format. + UNKNOWN = 1001; + } + + // The specific compressed file format of the data. + enum CompressionFormat { + // CompressionFormat unspecified. Implies uncompressed data. + COMPRESSION_FORMAT_UNSPECIFIED = 0; + + // GZip compressed set of files. + GZIP = 2; + + // BZip2 compressed set of files. + BZIP2 = 3; + } + + // Output only. The data format associated with the stored data, which represents + // content type values. The value is inferred from mime type. + Format format = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The compression type associated with the stored data. + // If unspecified, the data is uncompressed. + CompressionFormat compression_format = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The mime type descriptor for the data. Must match the pattern + // {type}/{subtype}. Supported values: + // + // - application/x-parquet + // - application/x-avro + // - application/x-orc + // - application/x-tfrecord + // - application/json + // - application/{subtypes} + // - text/csv + // - text/ + // - image/{image subtype} + // - video/{video subtype} + // - audio/{audio subtype} + string mime_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Additional format-specific options. + oneof options { + // Optional. Additional information about CSV formatted data. + CsvOptions csv = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information about CSV formatted data. + JsonOptions json = 11 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Identifies the cloud system that manages the data storage. +enum StorageSystem { + // Storage system unspecified. + STORAGE_SYSTEM_UNSPECIFIED = 0; + + // The entity data is contained within a Cloud Storage bucket. + CLOUD_STORAGE = 1; + + // The entity data is contained within a BigQuery dataset. + BIGQUERY = 2; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/resources.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/resources.proto new file mode 100644 index 000000000000..e07caac233af --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/resources.proto @@ -0,0 +1,790 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// A lake is a centralized repository for managing enterprise data across the +// organization distributed across many cloud projects, and stored in a variety +// of storage services such as Google Cloud Storage and BigQuery. The resources +// attached to a lake are referred to as managed resources. Data within these +// managed resources can be structured or unstructured. A lake provides data +// admins with tools to organize, secure and manage their data at scale, and +// provides data scientists and data engineers an integrated experience to +// easily search, discover, analyze and transform data and associated metadata. +message Lake { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Lake" + pattern: "projects/{project}/locations/{location}/lakes/{lake}" + }; + + // Settings to manage association of Dataproc Metastore with a lake. + message Metastore { + // Optional. A relative reference to the Dataproc Metastore + // (https://cloud.google.com/dataproc-metastore/docs) service associated + // with the lake: + // `projects/{project_id}/locations/{location_id}/services/{service_id}` + string service = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Status of Lake and Dataproc Metastore service instance association. + message MetastoreStatus { + // Current state of association. + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // A Metastore service instance is not associated with the lake. + NONE = 1; + + // A Metastore service instance is attached to the lake. + READY = 2; + + // Attach/detach is in progress. + UPDATING = 3; + + // Attach/detach could not be done due to errors. + ERROR = 4; + } + + // Current state of association. + State state = 1; + + // Additional information about the current status. + string message = 2; + + // Last update time of the metastore status of the lake. + google.protobuf.Timestamp update_time = 3; + + // The URI of the endpoint used to access the Metastore service. + string endpoint = 4; + } + + // Output only. The relative resource name of the lake, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. User friendly display name. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. System generated globally unique ID for the lake. This ID will be + // different if the lake is deleted and re-created with the same name. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the lake was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the lake was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-defined labels for the lake. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the lake. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the lake. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service account associated with this lake. This service account must be + // authorized to access or operate on resources managed by the lake. + string service_account = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Settings to manage lake and Dataproc Metastore service instance + // association. + Metastore metastore = 102 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Aggregated status of the underlying assets of the lake. + AssetStatus asset_status = 103 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metastore status of the lake. + MetastoreStatus metastore_status = 104 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Aggregated status of the underlying assets of a lake or zone. +message AssetStatus { + // Last update time of the status. + google.protobuf.Timestamp update_time = 1; + + // Number of active assets. + int32 active_assets = 2; + + // Number of assets that are in process of updating the security policy on + // attached resources. + int32 security_policy_applying_assets = 3; +} + +// A zone represents a logical group of related assets within a lake. A zone can +// be used to map to organizational structure or represent stages of data +// readiness from raw to curated. It provides managing behavior that is shared +// or inherited by all contained assets. +message Zone { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Zone" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}" + }; + + // Type of zone. + enum Type { + // Zone type not specified. + TYPE_UNSPECIFIED = 0; + + // A zone that contains data that needs further processing before it is + // considered generally ready for consumption and analytics workloads. + RAW = 1; + + // A zone that contains data that is considered to be ready for broader + // consumption and analytics workloads. Curated structured data stored in + // Cloud Storage must conform to certain file formats (parquet, avro and + // orc) and organized in a hive-compatible directory layout. + CURATED = 2; + } + + // Settings for resources attached as assets within a zone. + message ResourceSpec { + // Location type of the resources attached to a zone. + enum LocationType { + // Unspecified location type. + LOCATION_TYPE_UNSPECIFIED = 0; + + // Resources that are associated with a single region. + SINGLE_REGION = 1; + + // Resources that are associated with a multi-region location. + MULTI_REGION = 2; + } + + // Required. Immutable. The location type of the resources that are allowed to be attached to the + // assets within this zone. + LocationType location_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings to manage the metadata discovery and publishing in a zone. + message DiscoverySpec { + // Describe CSV and similar semi-structured data formats. + message CsvOptions { + // Optional. The number of rows to interpret as header rows that should be skipped + // when reading data rows. + int32 header_rows = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The delimiter being used to separate values. This defaults to ','. + string delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The character encoding of the data. The default is UTF-8. + string encoding = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable the inference of data type for CSV data. + // If true, all columns will be registered as strings. + bool disable_type_inference = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describe JSON data format. + message JsonOptions { + // Optional. The character encoding of the data. The default is UTF-8. + string encoding = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable the inference of data type for Json data. + // If true, all columns will be registered as their primitive types + // (strings, number or boolean). + bool disable_type_inference = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Whether discovery is enabled. + bool enabled = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of patterns to apply for selecting data to include during + // discovery if only a subset of the data should considered. For Cloud + // Storage bucket assets, these are interpreted as glob patterns used to + // match object names. For BigQuery dataset assets, these are + // interpreted as patterns to match table names. + repeated string include_patterns = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of patterns to apply for selecting data to exclude during + // discovery. For Cloud Storage bucket assets, these are interpreted as + // glob patterns used to match object names. For BigQuery dataset assets, + // these are interpreted as patterns to match table names. + repeated string exclude_patterns = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for CSV data. + CsvOptions csv_options = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for Json data. + JsonOptions json_options = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Determines when discovery is triggered. + oneof trigger { + // Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running + // discovery periodically. Successive discovery runs must be scheduled at + // least 60 minutes apart. + // The default value is to run discovery every 60 minutes. + // To explicitly set a timezone to the cron tab, apply a prefix in the + // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or TZ=${IANA_TIME_ZONE}". + // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone + // database. For example, "CRON_TZ=America/New_York 1 * * * *", or + // "TZ=America/New_York 1 * * * *". + string schedule = 10 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Output only. The relative resource name of the zone, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Optional. User friendly display name. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. System generated globally unique ID for the zone. This ID will be + // different if the zone is deleted and re-created with the same name. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the zone was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the zone was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User defined labels for the zone. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the zone. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the zone. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The type of the zone. + Type type = 9 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Specification of the discovery feature applied to data in this zone. + DiscoverySpec discovery_spec = 103 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Specification of the resources that are referenced by the assets within + // this zone. + ResourceSpec resource_spec = 104 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Aggregated status of the underlying assets of the zone. + AssetStatus asset_status = 105 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Action represents an issue requiring administrator action for resolution. +message Action { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Action" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/actions/{action}" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}" + }; + + // The category of issues. + enum Category { + // Unspecified category. + CATEGORY_UNSPECIFIED = 0; + + // Resource management related issues. + RESOURCE_MANAGEMENT = 1; + + // Security policy related issues. + SECURITY_POLICY = 2; + + // Data and discovery related issues. + DATA_DISCOVERY = 3; + } + + // Action details for resource references in assets that cannot be located. + message MissingResource { + + } + + // Action details for unauthorized resource issues raised to indicate that the + // service account associated with the lake instance is not authorized to + // access or manage the resource associated with an asset. + message UnauthorizedResource { + + } + + // Failed to apply security policy to the managed resource(s) under a + // lake, zone or an asset. For a lake or zone resource, one or more underlying + // assets has a failure applying security policy to the associated managed + // resource. + message FailedSecurityPolicyApply { + // Resource name of one of the assets with failing security policy + // application. Populated for a lake or zone resource only. + string asset = 1; + } + + // Action details for invalid or unsupported data files detected by discovery. + message InvalidDataFormat { + // The list of data locations sampled and used for format/schema + // inference. + repeated string sampled_data_locations = 1; + + // The expected data format of the entity. + string expected_format = 2; + + // The new unexpected data format within the entity. + string new_format = 3; + } + + // Action details for incompatible schemas detected by discovery. + message IncompatibleDataSchema { + // Whether the action relates to a schema that is incompatible or modified. + enum SchemaChange { + // Schema change unspecified. + SCHEMA_CHANGE_UNSPECIFIED = 0; + + // Newly discovered schema is incompatible with existing schema. + INCOMPATIBLE = 1; + + // Newly discovered schema has changed from existing schema for data in a + // curated zone. + MODIFIED = 2; + } + + // The name of the table containing invalid data. + string table = 1; + + // The existing and expected schema of the table. The schema is provided as + // a JSON formatted structure listing columns and data types. + string existing_schema = 2; + + // The new and incompatible schema within the table. The schema is provided + // as a JSON formatted structured listing columns and data types. + string new_schema = 3; + + // The list of data locations sampled and used for format/schema + // inference. + repeated string sampled_data_locations = 4; + + // Whether the action relates to a schema that is incompatible or modified. + SchemaChange schema_change = 5; + } + + // Action details for invalid or unsupported partitions detected by discovery. + message InvalidDataPartition { + // The expected partition structure. + enum PartitionStructure { + // PartitionStructure unspecified. + PARTITION_STRUCTURE_UNSPECIFIED = 0; + + // Consistent hive-style partition definition (both raw and curated zone). + CONSISTENT_KEYS = 1; + + // Hive style partition definition (curated zone only). + HIVE_STYLE_KEYS = 2; + } + + // The issue type of InvalidDataPartition. + PartitionStructure expected_structure = 1; + } + + // Action details for absence of data detected by discovery. + message MissingData { + + } + + // Action details for invalid data arrangement. + message InvalidDataOrganization { + + } + + // The category of issue associated with the action. + Category category = 1; + + // Detailed description of the issue requiring action. + string issue = 2; + + // The time that the issue was detected. + google.protobuf.Timestamp detect_time = 4; + + // Output only. The relative resource name of the action, of the form: + // `projects/{project}/locations/{location}/lakes/{lake}/actions/{action}` + // `projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}` + // `projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}`. + string name = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Action" + } + ]; + + // Output only. The relative resource name of the lake, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string lake = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Output only. The relative resource name of the zone, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string zone = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Output only. The relative resource name of the asset, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + string asset = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Asset" + } + ]; + + // The list of data locations associated with this action. Cloud Storage + // locations are represented as URI paths(E.g. + // `gs://bucket/table1/year=2020/month=Jan/`). BigQuery locations refer to + // resource names(E.g. + // `bigquery.googleapis.com/projects/project-id/datasets/dataset-id`). + repeated string data_locations = 9; + + // Additional details about the action based on the action category. + oneof details { + // Details for issues related to invalid or unsupported data formats. + InvalidDataFormat invalid_data_format = 10; + + // Details for issues related to incompatible schemas detected within data. + IncompatibleDataSchema incompatible_data_schema = 11; + + // Details for issues related to invalid or unsupported data partition + // structure. + InvalidDataPartition invalid_data_partition = 12; + + // Details for issues related to absence of data within managed resources. + MissingData missing_data = 13; + + // Details for issues related to absence of a managed resource. + MissingResource missing_resource = 14; + + // Details for issues related to lack of permissions to access data + // resources. + UnauthorizedResource unauthorized_resource = 15; + + // Details for issues related to applying security policy. + FailedSecurityPolicyApply failed_security_policy_apply = 21; + + // Details for issues related to invalid data arrangement. + InvalidDataOrganization invalid_data_organization = 22; + } +} + +// An asset represents a cloud resource that is being managed within a lake as a +// member of a zone. +message Asset { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Asset" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}" + }; + + // Security policy status of the asset. Data security policy, i.e., readers, + // writers & owners, should be specified in the lake/zone/asset IAM policy. + message SecurityStatus { + // The state of the security policy. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // Security policy has been successfully applied to the attached resource. + READY = 1; + + // Security policy is in the process of being applied to the attached + // resource. + APPLYING = 2; + + // Security policy could not be applied to the attached resource due to + // errors. + ERROR = 3; + } + + // The current state of the security policy applied to the attached + // resource. + State state = 1; + + // Additional information about the current state. + string message = 2; + + // Last update time of the status. + google.protobuf.Timestamp update_time = 3; + } + + // Settings to manage the metadata discovery and publishing for an asset. + message DiscoverySpec { + // Describe CSV and similar semi-structured data formats. + message CsvOptions { + // Optional. The number of rows to interpret as header rows that should be skipped + // when reading data rows. + int32 header_rows = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The delimiter being used to separate values. This defaults to ','. + string delimiter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The character encoding of the data. The default is UTF-8. + string encoding = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable the inference of data type for CSV data. + // If true, all columns will be registered as strings. + bool disable_type_inference = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describe JSON data format. + message JsonOptions { + // Optional. The character encoding of the data. The default is UTF-8. + string encoding = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to disable the inference of data type for Json data. + // If true, all columns will be registered as their primitive types + // (strings, number or boolean). + bool disable_type_inference = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Whether discovery is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of patterns to apply for selecting data to include during + // discovery if only a subset of the data should considered. For Cloud + // Storage bucket assets, these are interpreted as glob patterns used to + // match object names. For BigQuery dataset assets, these are interpreted as + // patterns to match table names. + repeated string include_patterns = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of patterns to apply for selecting data to exclude during + // discovery. For Cloud Storage bucket assets, these are interpreted as + // glob patterns used to match object names. For BigQuery dataset assets, + // these are interpreted as patterns to match table names. + repeated string exclude_patterns = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for CSV data. + CsvOptions csv_options = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for Json data. + JsonOptions json_options = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Determines when discovery is triggered. + oneof trigger { + // Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running + // discovery periodically. Successive discovery runs must be scheduled at + // least 60 minutes apart. + // The default value is to run discovery every 60 minutes. + // To explicitly set a timezone to the cron tab, apply a prefix in the + // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or TZ=${IANA_TIME_ZONE}". + // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone + // database. For example, "CRON_TZ=America/New_York 1 * * * *", or + // "TZ=America/New_York 1 * * * *". + string schedule = 10 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Identifies the cloud resource that is referenced by this asset. + message ResourceSpec { + // Type of resource. + enum Type { + // Type not specified. + TYPE_UNSPECIFIED = 0; + + // Cloud Storage bucket. + STORAGE_BUCKET = 1; + + // BigQuery dataset. + BIGQUERY_DATASET = 2; + } + + // Immutable. Relative name of the cloud resource that contains the data that is + // being managed within a lake. For example: + // `projects/{project_number}/buckets/{bucket_id}` + // `projects/{project_number}/datasets/{dataset_id}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Type of resource. + Type type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Status of the resource referenced by an asset. + message ResourceStatus { + // The state of a resource. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // Resource does not have any errors. + READY = 1; + + // Resource has errors. + ERROR = 2; + } + + // The current state of the managed resource. + State state = 1; + + // Additional information about the current state. + string message = 2; + + // Last update time of the status. + google.protobuf.Timestamp update_time = 3; + } + + // Status of discovery for an asset. + message DiscoveryStatus { + // Current state of discovery. + enum State { + // State is unspecified. + STATE_UNSPECIFIED = 0; + + // Discovery for the asset is scheduled. + SCHEDULED = 1; + + // Discovery for the asset is running. + IN_PROGRESS = 2; + + // Discovery for the asset is currently paused (e.g. due to a lack + // of available resources). It will be automatically resumed. + PAUSED = 3; + + // Discovery for the asset is disabled. + DISABLED = 5; + } + + // The aggregated data statistics for the asset reported by discovery. + message Stats { + // The count of data items within the referenced resource. + int64 data_items = 1; + + // The number of stored data bytes within the referenced resource. + int64 data_size = 2; + + // The count of table entities within the referenced resource. + int64 tables = 3; + + // The count of fileset entities within the referenced resource. + int64 filesets = 4; + } + + // The current status of the discovery feature. + State state = 1; + + // Additional information about the current state. + string message = 2; + + // Last update time of the status. + google.protobuf.Timestamp update_time = 3; + + // The start time of the last discovery run. + google.protobuf.Timestamp last_run_time = 4; + + // Data Stats of the asset reported by discovery. + Stats stats = 6; + + // The duration of the last discovery run. + google.protobuf.Duration last_run_duration = 7; + } + + // Output only. The relative resource name of the asset, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Asset" + } + ]; + + // Optional. User friendly display name. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. System generated globally unique ID for the asset. This ID will be + // different if the asset is deleted and re-created with the same name. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the asset was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the asset was last updated. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User defined labels for the asset. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the asset. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the asset. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Specification of the resource that is referenced by this asset. + ResourceSpec resource_spec = 100 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Status of the resource referenced by this asset. + ResourceStatus resource_status = 101 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status of the security policy applied to resource referenced by this asset. + SecurityStatus security_status = 103 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Specification of the discovery feature applied to data referenced by this + // asset. + // When this spec is left unset, the asset will use the spec set on the parent + // zone. + DiscoverySpec discovery_spec = 106 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Status of the discovery feature applied to data referenced by this asset. + DiscoveryStatus discovery_status = 107 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// State of a resource. +enum State { + // State is not specified. + STATE_UNSPECIFIED = 0; + + // Resource is active, i.e., ready to use. + ACTIVE = 1; + + // Resource is under creation. + CREATING = 2; + + // Resource is under deletion. + DELETING = 3; + + // Resource is active but has unresolved actions. + ACTION_REQUIRED = 4; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/service.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/service.proto new file mode 100644 index 000000000000..f7995c07b75f --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/service.proto @@ -0,0 +1,1109 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataplex/v1/analyze.proto"; +import "google/cloud/dataplex/v1/resources.proto"; +import "google/cloud/dataplex/v1/tasks.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// Dataplex service provides data lakes as a service. The primary resources +// offered by this service are Lakes, Zones and Assets which collectively allow +// a data administrator to organize, manage, secure and catalog data across +// their organization located across cloud projects in a variety of storage +// systems including Cloud Storage and BigQuery. +service DataplexService { + option (google.api.default_host) = "dataplex.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a lake resource. + rpc CreateLake(CreateLakeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/lakes" + body: "lake" + }; + option (google.api.method_signature) = "parent,lake,lake_id"; + option (google.longrunning.operation_info) = { + response_type: "Lake" + metadata_type: "OperationMetadata" + }; + } + + // Updates a lake resource. + rpc UpdateLake(UpdateLakeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{lake.name=projects/*/locations/*/lakes/*}" + body: "lake" + }; + option (google.api.method_signature) = "lake,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Lake" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a lake resource. All zones within the lake must be deleted before + // the lake can be deleted. + rpc DeleteLake(DeleteLakeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists lake resources in a project and location. + rpc ListLakes(ListLakesRequest) returns (ListLakesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/lakes" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a lake resource. + rpc GetLake(GetLakeRequest) returns (Lake) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists action resources in a lake. + rpc ListLakeActions(ListLakeActionsRequest) returns (ListActionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/actions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a zone resource within a lake. + rpc CreateZone(CreateZoneRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/zones" + body: "zone" + }; + option (google.api.method_signature) = "parent,zone,zone_id"; + option (google.longrunning.operation_info) = { + response_type: "Zone" + metadata_type: "OperationMetadata" + }; + } + + // Updates a zone resource. + rpc UpdateZone(UpdateZoneRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{zone.name=projects/*/locations/*/lakes/*/zones/*}" + body: "zone" + }; + option (google.api.method_signature) = "zone,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Zone" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a zone resource. All assets within a zone must be deleted before + // the zone can be deleted. + rpc DeleteZone(DeleteZoneRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/zones/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists zone resources in a lake. + rpc ListZones(ListZonesRequest) returns (ListZonesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/zones" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a zone resource. + rpc GetZone(GetZoneRequest) returns (Zone) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/zones/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists action resources in a zone. + rpc ListZoneActions(ListZoneActionsRequest) returns (ListActionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/actions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates an asset resource. + rpc CreateAsset(CreateAssetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets" + body: "asset" + }; + option (google.api.method_signature) = "parent,asset,asset_id"; + option (google.longrunning.operation_info) = { + response_type: "Asset" + metadata_type: "OperationMetadata" + }; + } + + // Updates an asset resource. + rpc UpdateAsset(UpdateAssetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{asset.name=projects/*/locations/*/lakes/*/zones/*/assets/*}" + body: "asset" + }; + option (google.api.method_signature) = "asset,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Asset" + metadata_type: "OperationMetadata" + }; + } + + // Deletes an asset resource. The referenced storage resource is detached + // (default) or deleted based on the associated Lifecycle policy. + rpc DeleteAsset(DeleteAssetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists asset resources in a zone. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves an asset resource. + rpc GetAsset(GetAssetRequest) returns (Asset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists action resources in an asset. + rpc ListAssetActions(ListAssetActionsRequest) returns (ListActionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/assets/*}/actions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a task resource within a lake. + rpc CreateTask(CreateTaskRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/tasks" + body: "task" + }; + option (google.api.method_signature) = "parent,task,task_id"; + option (google.longrunning.operation_info) = { + response_type: "Task" + metadata_type: "OperationMetadata" + }; + } + + // Update the task resource. + rpc UpdateTask(UpdateTaskRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{task.name=projects/*/locations/*/lakes/*/tasks/*}" + body: "task" + }; + option (google.api.method_signature) = "task,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Task" + metadata_type: "OperationMetadata" + }; + } + + // Delete the task resource. + rpc DeleteTask(DeleteTaskRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists tasks under the given lake. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } + + // Get task resource. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Jobs under the given task. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/tasks/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get job resource. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel jobs running for the task resource. + rpc CancelJob(CancelJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Create an environment resource. + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/lakes/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment,environment_id"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "OperationMetadata" + }; + } + + // Update the environment resource. + rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{environment.name=projects/*/locations/*/lakes/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "OperationMetadata" + }; + } + + // Delete the environment resource. All the child resources must have been + // deleted before environment deletion can be initiated. + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/lakes/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists environments under the given lake. + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Get environment resource. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/lakes/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists session resources in an environment. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/lakes/*/environments/*}/sessions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Create lake request. +message CreateLakeRequest { + // Required. The resource name of the lake location, of the form: + // projects/{project_number}/locations/{location_id} + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Lake identifier. + // This ID will be used to generate names such as database and dataset names + // when publishing metadata to Hive Metastore and BigQuery. + // * Must contain only lowercase letters, numbers and hyphens. + // * Must start with a letter. + // * Must end with a number or a letter. + // * Must be between 1-63 characters. + // * Must be unique within the customer project / location. + string lake_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Lake resource + Lake lake = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update lake request. +message UpdateLakeRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Lake lake = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete lake request. +message DeleteLakeRequest { + // Required. The resource name of the lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; +} + +// List lakes request. +message ListLakesRequest { + // Required. The resource name of the lake location, of the form: + // `projects/{project_number}/locations/{location_id}` + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Maximum number of Lakes to return. The service may return fewer than this + // value. If unspecified, at most 10 lakes will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListLakes` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListLakes` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List lakes response. +message ListLakesResponse { + // Lakes under the given parent location. + repeated Lake lakes = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable_locations = 3; +} + +// List lake actions request. +message ListLakeActionsRequest { + // Required. The resource name of the parent lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. Maximum number of actions to return. The service may return fewer than this + // value. If unspecified, at most 10 actions will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListLakeActions` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListLakeActions` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// List actions response. +message ListActionsResponse { + // Actions under the given parent lake/zone/asset. + repeated Action actions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Get lake request. +message GetLakeRequest { + // Required. The resource name of the lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; +} + +// Create zone request. +message CreateZoneRequest { + // Required. The resource name of the parent lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Required. Zone identifier. + // This ID will be used to generate names such as database and dataset names + // when publishing metadata to Hive Metastore and BigQuery. + // * Must contain only lowercase letters, numbers and hyphens. + // * Must start with a letter. + // * Must end with a number or a letter. + // * Must be between 1-63 characters. + // * Must be unique across all lakes from all locations in a project. + // * Must not be one of the reserved IDs (i.e. "default", "global-temp") + string zone_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Zone resource. + Zone zone = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update zone request. +message UpdateZoneRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Zone zone = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete zone request. +message DeleteZoneRequest { + // Required. The resource name of the zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; +} + +// List zones request. +message ListZonesRequest { + // Required. The resource name of the parent lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. Maximum number of zones to return. The service may return fewer than this + // value. If unspecified, at most 10 zones will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListZones` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListZones` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List zones response. +message ListZonesResponse { + // Zones under the given parent lake. + repeated Zone zones = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// List zone actions request. +message ListZoneActionsRequest { + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Optional. Maximum number of actions to return. The service may return fewer than this + // value. If unspecified, at most 10 actions will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListZoneActions` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListZoneActions` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Get zone request. +message GetZoneRequest { + // Required. The resource name of the zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; +} + +// Create asset request. +message CreateAssetRequest { + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Required. Asset identifier. + // This ID will be used to generate names such as table names when publishing + // metadata to Hive Metastore and BigQuery. + // * Must contain only lowercase letters, numbers and hyphens. + // * Must start with a letter. + // * Must end with a number or a letter. + // * Must be between 1-63 characters. + // * Must be unique within the zone. + string asset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Asset resource. + Asset asset = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update asset request. +message UpdateAssetRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Asset asset = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete asset request. +message DeleteAssetRequest { + // Required. The resource name of the asset: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Asset" + } + ]; +} + +// List assets request. +message ListAssetsRequest { + // Required. The resource name of the parent zone: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Zone" + } + ]; + + // Optional. Maximum number of asset to return. The service may return fewer than + // this value. If unspecified, at most 10 assets will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListAssets` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListAssets` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List assets response. +message ListAssetsResponse { + // Asset under the given parent zone. + repeated Asset assets = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// List asset actions request. +message ListAssetActionsRequest { + // Required. The resource name of the parent asset: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Asset" + } + ]; + + // Optional. Maximum number of actions to return. The service may return fewer than this + // value. If unspecified, at most 10 actions will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListAssetActions` call. Provide this + // to retrieve the subsequent page. When paginating, all other parameters + // provided to `ListAssetActions` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Get asset request. +message GetAssetRequest { + // Required. The resource name of the asset: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Asset" + } + ]; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Create task request. +message CreateTaskRequest { + // Required. The resource name of the parent lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Required. Task identifier. + string task_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Task resource. + Task task = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update task request. +message UpdateTaskRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Task task = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete task request. +message DeleteTaskRequest { + // Required. The resource name of the task: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Task" + } + ]; +} + +// List tasks request. +message ListTasksRequest { + // Required. The resource name of the parent lake: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. Maximum number of tasks to return. The service may return fewer than this + // value. If unspecified, at most 10 tasks will be returned. The maximum + // value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListZones` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListZones` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List tasks response. +message ListTasksResponse { + // Tasks under the given parent lake. + repeated Task tasks = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable_locations = 3; +} + +// Get task request. +message GetTaskRequest { + // Required. The resource name of the task: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Task" + } + ]; +} + +// Get job request. +message GetJobRequest { + // Required. The resource name of the job: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Job" + } + ]; +} + +// List jobs request. +message ListJobsRequest { + // Required. The resource name of the parent environment: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Task" + } + ]; + + // Optional. Maximum number of jobs to return. The service may return fewer than + // this value. If unspecified, at most 10 jobs will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListJobs` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListJobs` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// List jobs response. +message ListJobsResponse { + // Jobs under a given task. + repeated Job jobs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Cancel task jobs. +message CancelJobRequest { + // Required. The resource name of the job: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Job" + } + ]; +} + +// Create environment request. +message CreateEnvironmentRequest { + // Required. The resource name of the parent lake: + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Required. Environment identifier. + // * Must contain only lowercase letters, numbers and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the lake. + string environment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Environment resource. + Environment environment = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update environment request. +message UpdateEnvironmentRequest { + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in `update_mask` are updated. + Environment environment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is false. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete environment request. +message DeleteEnvironmentRequest { + // Required. The resource name of the environment: + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Environment" + } + ]; +} + +// List environments request. +message ListEnvironmentsRequest { + // Required. The resource name of the parent lake: + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Lake" + } + ]; + + // Optional. Maximum number of environments to return. The service may return fewer than + // this value. If unspecified, at most 10 environments will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListEnvironments` call. Provide this + // to retrieve the subsequent page. When paginating, all other parameters + // provided to `ListEnvironments` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// List environments response. +message ListEnvironmentsResponse { + // Environments under the given parent lake. + repeated Environment environments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Get environment request. +message GetEnvironmentRequest { + // Required. The resource name of the environment: + // `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Environment" + } + ]; +} + +// List sessions request. +message ListSessionsRequest { + // Required. The resource name of the parent environment: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Environment" + } + ]; + + // Optional. Maximum number of sessions to return. The service may return fewer than + // this value. If unspecified, at most 10 sessions will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token received from a previous `ListSessions` call. Provide this to + // retrieve the subsequent page. When paginating, all other parameters + // provided to `ListSessions` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter request. The following `mode` filter is supported to return only the + // sessions belonging to the requester when the mode is USER and return + // sessions of all the users when the mode is ADMIN. When no filter is sent + // default to USER mode. + // NOTE: When the mode is ADMIN, the requester should have + // `dataplex.environments.listAllSessions` permission to list all sessions, + // in absence of the permission, the request fails. + // + // mode = ADMIN | USER + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// List sessions response. +message ListSessionsResponse { + // Sessions under a given environment. + repeated Session sessions = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/tasks.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/tasks.proto new file mode 100644 index 000000000000..214be25582e7 --- /dev/null +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/tasks.proto @@ -0,0 +1,393 @@ +// Copyright 2022 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.cloud.dataplex.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataplex/v1/resources.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex"; +option java_multiple_files = true; +option java_outer_classname = "TasksProto"; +option java_package = "com.google.cloud.dataplex.v1"; + +// A task represents a user-visible job. +message Task { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}" + }; + + // Configuration for the underlying infrastructure used to run workloads. + message InfrastructureSpec { + // Batch compute resources associated with the task. + message BatchComputeResources { + // Optional. Total number of job executors. + // Executor Count should be between 2 and 100. [Default=2] + int32 executors_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Max configurable executors. + // If max_executors_count > executors_count, then auto-scaling is enabled. + // Max Executor Count should be between 2 and 1000. [Default=1000] + int32 max_executors_count = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Container Image Runtime Configuration used with Batch execution. + message ContainerImageRuntime { + // Optional. Container image to use. + string image = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of Java JARS to add to the classpath. + // Valid input includes Cloud Storage URIs to Jar binaries. + // For example, gs://bucket-name/my/path/to/file.jar + repeated string java_jars = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of python packages to be installed. + // Valid formats include Cloud Storage URI to a PIP installable library. + // For example, gs://bucket-name/my/path/to/lib.tar.gz + repeated string python_packages = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Override to common configuration of open source components installed on + // the Dataproc cluster. + // The properties to set on daemon config files. + // Property keys are specified in `prefix:property` format, for example + // `core:hadoop.tmp.dir`. + // For more information, see [Cluster + // properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). + map properties = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Cloud VPC Network used to run the infrastructure. + message VpcNetwork { + // The Cloud VPC network identifier. + oneof network_name { + // Optional. The Cloud VPC network in which the job is run. By default, the Cloud + // VPC network named Default within the project is used. + string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud VPC sub-network in which the job is run. + string sub_network = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. List of network tags to apply to the job. + repeated string network_tags = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Hardware config. + oneof resources { + // Compute resources needed for a Task when using Dataproc Serverless. + BatchComputeResources batch = 52; + } + + // Software config. + oneof runtime { + // Container Image Runtime Configuration. + ContainerImageRuntime container_image = 101; + } + + // Networking config. + oneof network { + // Vpc network. + VpcNetwork vpc_network = 150; + } + } + + // Task scheduling and trigger settings. + message TriggerSpec { + // Determines how often and when the job will run. + enum Type { + // Unspecified trigger type. + TYPE_UNSPECIFIED = 0; + + // The task runs one-time shortly after Task Creation. + ON_DEMAND = 1; + + // The task is scheduled to run periodically. + RECURRING = 2; + } + + // Required. Immutable. Trigger type of the user-specified Task. + Type type = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The first run of the task will be after this time. + // If not specified, the task will run shortly after being submitted if + // ON_DEMAND and based on the schedule if RECURRING. + google.protobuf.Timestamp start_time = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Prevent the task from executing. + // This does not cancel already running tasks. It is intended to temporarily + // disable RECURRING tasks. + bool disabled = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of retry attempts before aborting. + // Set to zero to never attempt to retry a failed task. + int32 max_retries = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Trigger only applies for RECURRING tasks. + oneof trigger { + // Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running + // tasks periodically. + // To explicitly set a timezone to the cron tab, apply a prefix in the + // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". + // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone + // database. For example, "CRON_TZ=America/New_York 1 * * * *", or + // "TZ=America/New_York 1 * * * *". + // This field is required for RECURRING tasks. + string schedule = 100 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Execution related settings, like retry and service_account. + message ExecutionSpec { + // Optional. The arguments to pass to the task. + // The args can use placeholders of the format ${placeholder} as + // part of key/value string. These will be interpolated before passing the + // args to the driver. Currently supported placeholders: + // - ${task_id} + // - ${job_time} + // To pass positional args, set the key as TASK_ARGS. The value should be a + // comma-separated string of all the positional arguments. To use a + // delimiter other than comma, refer to + // https://cloud.google.com/sdk/gcloud/reference/topic/escaping. In case of + // other keys being present in the args, then TASK_ARGS will be passed as + // the last argument. + map args = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Service account to use to execute a task. + // If not provided, the default Compute service account for the project is + // used. + string service_account = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The project in which jobs are run. By default, the project containing the + // Lake is used. If a project is provided, the + // [ExecutionSpec.service_account][google.cloud.dataplex.v1.Task.ExecutionSpec.service_account] must belong to this project. + string project = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum duration after which the job execution is expired. + google.protobuf.Duration max_job_execution_lifetime = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud KMS key to use for encryption, of the form: + // `projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}`. + string kms_key = 9 [(google.api.field_behavior) = OPTIONAL]; + } + + // User-specified config for running a Spark task. + message SparkTaskConfig { + // Required. The specification of the main method to call to drive the + // job. Specify either the jar file that contains the main class or the + // main class name. + oneof driver { + // The Cloud Storage URI of the jar file that contains the main class. + // The execution args are passed in as a sequence of named process + // arguments (`--key=value`). + string main_jar_file_uri = 100; + + // The name of the driver's main class. The jar file that contains the + // class must be in the default CLASSPATH or specified in + // `jar_file_uris`. + // The execution args are passed in as a sequence of named process + // arguments (`--key=value`). + string main_class = 101; + + // The Gcloud Storage URI of the main Python file to use as the driver. + // Must be a .py file. The execution args are passed in as a sequence of + // named process arguments (`--key=value`). + string python_script_file = 102; + + // A reference to a query file. This can be the Cloud Storage URI of the + // query file or it can the path to a SqlScript Content. The execution + // args are used to declare a set of script variables + // (`set key="value";`). + string sql_script_file = 104; + + // The query text. + // The execution args are used to declare a set of script variables + // (`set key="value";`). + string sql_script = 105; + } + + // Optional. Cloud Storage URIs of files to be placed in the working directory of each + // executor. + repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage URIs of archives to be extracted into the working directory + // of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and + // .zip. + repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Infrastructure specification for the execution. + InfrastructureSpec infrastructure_spec = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for running scheduled notebooks. + message NotebookTaskConfig { + // Required. Path to input notebook. This can be the Cloud Storage URI of the notebook + // file or the path to a Notebook Content. The execution args are accessible + // as environment variables + // (`TASK_key=value`). + string notebook = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Infrastructure specification for the execution. + InfrastructureSpec infrastructure_spec = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage URIs of files to be placed in the working directory of each + // executor. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage URIs of archives to be extracted into the working directory + // of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and + // .zip. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Status of the task execution (e.g. Jobs). + message ExecutionStatus { + // Output only. Last update time of the status. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. latest job execution + Job latest_job = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The relative resource name of the task, of the form: + // projects/{project_number}/locations/{location_id}/lakes/{lake_id}/ + // tasks/{task_id}. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Task" + } + ]; + + // Output only. System generated globally unique ID for the task. This ID will be + // different if the task is deleted and re-created with the same name. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the task was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the task was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Description of the task. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User friendly display name. + string display_name = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the task. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-defined labels for the task. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Spec related to how often and when a task should be triggered. + TriggerSpec trigger_spec = 100 [(google.api.field_behavior) = REQUIRED]; + + // Required. Spec related to how a task is executed. + ExecutionSpec execution_spec = 101 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Status of the latest task executions. + ExecutionStatus execution_status = 201 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Task template specific user-specified config. + oneof config { + // Config related to running custom Spark tasks. + SparkTaskConfig spark = 300; + + // Config related to running scheduled Notebooks. + NotebookTaskConfig notebook = 302; + } +} + +// A job represents an instance of a task. +message Job { + option (google.api.resource) = { + type: "dataplex.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}" + }; + + enum Service { + // Service used to run the job is unspecified. + SERVICE_UNSPECIFIED = 0; + + // Dataproc service is used to run this job. + DATAPROC = 1; + } + + enum State { + // The job state is unknown. + STATE_UNSPECIFIED = 0; + + // The job is running. + RUNNING = 1; + + // The job is cancelling. + CANCELLING = 2; + + // The job cancellation was successful. + CANCELLED = 3; + + // The job completed successfully. + SUCCEEDED = 4; + + // The job is no longer running due to an error. + FAILED = 5; + + // The job was cancelled outside of Dataplex. + ABORTED = 6; + } + + // Output only. The relative resource name of the job, of the form: + // `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "dataplex.googleapis.com/Job" + } + ]; + + // Output only. System generated globally unique ID for the job. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the job was started. + google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the job ended. + google.protobuf.Timestamp end_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Execution state for the job. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times the job has been retried (excluding the + // initial attempt). + uint32 retry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The underlying service running a job. + Service service = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full resource name for the job run under a particular service. + string service_job = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state. + string message = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-dataplex/protos/protos.d.ts b/packages/google-cloud-dataplex/protos/protos.d.ts new file mode 100644 index 000000000000..99f6b00514f8 --- /dev/null +++ b/packages/google-cloud-dataplex/protos/protos.d.ts @@ -0,0 +1,22745 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace dataplex. */ + namespace dataplex { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment displayName */ + displayName?: (string|null); + + /** Environment uid */ + uid?: (string|null); + + /** Environment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels */ + labels?: ({ [k: string]: string }|null); + + /** Environment description */ + description?: (string|null); + + /** Environment state */ + state?: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State|null); + + /** Environment infrastructureSpec */ + infrastructureSpec?: (google.cloud.dataplex.v1.Environment.IInfrastructureSpec|null); + + /** Environment sessionSpec */ + sessionSpec?: (google.cloud.dataplex.v1.Environment.ISessionSpec|null); + + /** Environment sessionStatus */ + sessionStatus?: (google.cloud.dataplex.v1.Environment.ISessionStatus|null); + + /** Environment endpoints */ + endpoints?: (google.cloud.dataplex.v1.Environment.IEndpoints|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment displayName. */ + public displayName: string; + + /** Environment uid. */ + public uid: string; + + /** Environment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels. */ + public labels: { [k: string]: string }; + + /** Environment description. */ + public description: string; + + /** Environment state. */ + public state: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State); + + /** Environment infrastructureSpec. */ + public infrastructureSpec?: (google.cloud.dataplex.v1.Environment.IInfrastructureSpec|null); + + /** Environment sessionSpec. */ + public sessionSpec?: (google.cloud.dataplex.v1.Environment.ISessionSpec|null); + + /** Environment sessionStatus. */ + public sessionStatus?: (google.cloud.dataplex.v1.Environment.ISessionStatus|null); + + /** Environment endpoints. */ + public endpoints?: (google.cloud.dataplex.v1.Environment.IEndpoints|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.dataplex.v1.IEnvironment): google.cloud.dataplex.v1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of an InfrastructureSpec. */ + interface IInfrastructureSpec { + + /** InfrastructureSpec compute */ + compute?: (google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources|null); + + /** InfrastructureSpec osImage */ + osImage?: (google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime|null); + } + + /** Represents an InfrastructureSpec. */ + class InfrastructureSpec implements IInfrastructureSpec { + + /** + * Constructs a new InfrastructureSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.IInfrastructureSpec); + + /** InfrastructureSpec compute. */ + public compute?: (google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources|null); + + /** InfrastructureSpec osImage. */ + public osImage?: (google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime|null); + + /** InfrastructureSpec resources. */ + public resources?: "compute"; + + /** InfrastructureSpec runtime. */ + public runtime?: "osImage"; + + /** + * Creates a new InfrastructureSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns InfrastructureSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.IInfrastructureSpec): google.cloud.dataplex.v1.Environment.InfrastructureSpec; + + /** + * Encodes the specified InfrastructureSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.verify|verify} messages. + * @param message InfrastructureSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.IInfrastructureSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfrastructureSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.verify|verify} messages. + * @param message InfrastructureSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.IInfrastructureSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.InfrastructureSpec; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.InfrastructureSpec; + + /** + * Verifies an InfrastructureSpec message. + * @param message Plain 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 InfrastructureSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfrastructureSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.InfrastructureSpec; + + /** + * Creates a plain object from an InfrastructureSpec message. Also converts values to other types if specified. + * @param message InfrastructureSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfrastructureSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InfrastructureSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InfrastructureSpec { + + /** Properties of a ComputeResources. */ + interface IComputeResources { + + /** ComputeResources diskSizeGb */ + diskSizeGb?: (number|null); + + /** ComputeResources nodeCount */ + nodeCount?: (number|null); + + /** ComputeResources maxNodeCount */ + maxNodeCount?: (number|null); + } + + /** Represents a ComputeResources. */ + class ComputeResources implements IComputeResources { + + /** + * Constructs a new ComputeResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources); + + /** ComputeResources diskSizeGb. */ + public diskSizeGb: number; + + /** ComputeResources nodeCount. */ + public nodeCount: number; + + /** ComputeResources maxNodeCount. */ + public maxNodeCount: number; + + /** + * Creates a new ComputeResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeResources instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources): google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources; + + /** + * Encodes the specified ComputeResources message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.verify|verify} messages. + * @param message ComputeResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeResources message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.verify|verify} messages. + * @param message ComputeResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources; + + /** + * Decodes a ComputeResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources; + + /** + * Verifies a ComputeResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources; + + /** + * Creates a plain object from a ComputeResources message. Also converts values to other types if specified. + * @param message ComputeResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OsImageRuntime. */ + interface IOsImageRuntime { + + /** OsImageRuntime imageVersion */ + imageVersion?: (string|null); + + /** OsImageRuntime javaLibraries */ + javaLibraries?: (string[]|null); + + /** OsImageRuntime pythonPackages */ + pythonPackages?: (string[]|null); + + /** OsImageRuntime properties */ + properties?: ({ [k: string]: string }|null); + } + + /** Represents an OsImageRuntime. */ + class OsImageRuntime implements IOsImageRuntime { + + /** + * Constructs a new OsImageRuntime. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime); + + /** OsImageRuntime imageVersion. */ + public imageVersion: string; + + /** OsImageRuntime javaLibraries. */ + public javaLibraries: string[]; + + /** OsImageRuntime pythonPackages. */ + public pythonPackages: string[]; + + /** OsImageRuntime properties. */ + public properties: { [k: string]: string }; + + /** + * Creates a new OsImageRuntime instance using the specified properties. + * @param [properties] Properties to set + * @returns OsImageRuntime instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime): google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime; + + /** + * Encodes the specified OsImageRuntime message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.verify|verify} messages. + * @param message OsImageRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsImageRuntime message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.verify|verify} messages. + * @param message OsImageRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsImageRuntime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime; + + /** + * Decodes an OsImageRuntime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime; + + /** + * Verifies an OsImageRuntime message. + * @param message Plain 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 OsImageRuntime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsImageRuntime + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime; + + /** + * Creates a plain object from an OsImageRuntime message. Also converts values to other types if specified. + * @param message OsImageRuntime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsImageRuntime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsImageRuntime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SessionSpec. */ + interface ISessionSpec { + + /** SessionSpec maxIdleDuration */ + maxIdleDuration?: (google.protobuf.IDuration|null); + + /** SessionSpec enableFastStartup */ + enableFastStartup?: (boolean|null); + } + + /** Represents a SessionSpec. */ + class SessionSpec implements ISessionSpec { + + /** + * Constructs a new SessionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.ISessionSpec); + + /** SessionSpec maxIdleDuration. */ + public maxIdleDuration?: (google.protobuf.IDuration|null); + + /** SessionSpec enableFastStartup. */ + public enableFastStartup: boolean; + + /** + * Creates a new SessionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.ISessionSpec): google.cloud.dataplex.v1.Environment.SessionSpec; + + /** + * Encodes the specified SessionSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionSpec.verify|verify} messages. + * @param message SessionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.ISessionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionSpec.verify|verify} messages. + * @param message SessionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.ISessionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.SessionSpec; + + /** + * Decodes a SessionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.SessionSpec; + + /** + * Verifies a SessionSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.SessionSpec; + + /** + * Creates a plain object from a SessionSpec message. Also converts values to other types if specified. + * @param message SessionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.SessionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionStatus. */ + interface ISessionStatus { + + /** SessionStatus active */ + active?: (boolean|null); + } + + /** Represents a SessionStatus. */ + class SessionStatus implements ISessionStatus { + + /** + * Constructs a new SessionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.ISessionStatus); + + /** SessionStatus active. */ + public active: boolean; + + /** + * Creates a new SessionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.ISessionStatus): google.cloud.dataplex.v1.Environment.SessionStatus; + + /** + * Encodes the specified SessionStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionStatus.verify|verify} messages. + * @param message SessionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.ISessionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionStatus.verify|verify} messages. + * @param message SessionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.ISessionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.SessionStatus; + + /** + * Decodes a SessionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.SessionStatus; + + /** + * Verifies a SessionStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.SessionStatus; + + /** + * Creates a plain object from a SessionStatus message. Also converts values to other types if specified. + * @param message SessionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.SessionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Endpoints. */ + interface IEndpoints { + + /** Endpoints notebooks */ + notebooks?: (string|null); + + /** Endpoints sql */ + sql?: (string|null); + } + + /** Represents an Endpoints. */ + class Endpoints implements IEndpoints { + + /** + * Constructs a new Endpoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Environment.IEndpoints); + + /** Endpoints notebooks. */ + public notebooks: string; + + /** Endpoints sql. */ + public sql: string; + + /** + * Creates a new Endpoints instance using the specified properties. + * @param [properties] Properties to set + * @returns Endpoints instance + */ + public static create(properties?: google.cloud.dataplex.v1.Environment.IEndpoints): google.cloud.dataplex.v1.Environment.Endpoints; + + /** + * Encodes the specified Endpoints message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.Endpoints.verify|verify} messages. + * @param message Endpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Environment.IEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Endpoints message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.Endpoints.verify|verify} messages. + * @param message Endpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Environment.IEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Endpoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Endpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Environment.Endpoints; + + /** + * Decodes an Endpoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Endpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Environment.Endpoints; + + /** + * Verifies an Endpoints message. + * @param message Plain 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 Endpoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Endpoints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Environment.Endpoints; + + /** + * Creates a plain object from an Endpoints message. Also converts values to other types if specified. + * @param message Endpoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Environment.Endpoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Endpoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Endpoints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Content. */ + interface IContent { + + /** Content name */ + name?: (string|null); + + /** Content uid */ + uid?: (string|null); + + /** Content path */ + path?: (string|null); + + /** Content createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Content updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Content labels */ + labels?: ({ [k: string]: string }|null); + + /** Content description */ + description?: (string|null); + + /** Content dataText */ + dataText?: (string|null); + + /** Content sqlScript */ + sqlScript?: (google.cloud.dataplex.v1.Content.ISqlScript|null); + + /** Content notebook */ + notebook?: (google.cloud.dataplex.v1.Content.INotebook|null); + } + + /** Represents a Content. */ + class Content implements IContent { + + /** + * Constructs a new Content. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IContent); + + /** Content name. */ + public name: string; + + /** Content uid. */ + public uid: string; + + /** Content path. */ + public path: string; + + /** Content createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Content updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Content labels. */ + public labels: { [k: string]: string }; + + /** Content description. */ + public description: string; + + /** Content dataText. */ + public dataText?: (string|null); + + /** Content sqlScript. */ + public sqlScript?: (google.cloud.dataplex.v1.Content.ISqlScript|null); + + /** Content notebook. */ + public notebook?: (google.cloud.dataplex.v1.Content.INotebook|null); + + /** Content data. */ + public data?: "dataText"; + + /** Content content. */ + public content?: ("sqlScript"|"notebook"); + + /** + * Creates a new Content instance using the specified properties. + * @param [properties] Properties to set + * @returns Content instance + */ + public static create(properties?: google.cloud.dataplex.v1.IContent): google.cloud.dataplex.v1.Content; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.cloud.dataplex.v1.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Content message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Content; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Content; + + /** + * Verifies a Content message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Content + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Content; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @param message Content + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Content, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Content to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Content + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Content { + + /** Properties of a SqlScript. */ + interface ISqlScript { + + /** SqlScript engine */ + engine?: (google.cloud.dataplex.v1.Content.SqlScript.QueryEngine|keyof typeof google.cloud.dataplex.v1.Content.SqlScript.QueryEngine|null); + } + + /** Represents a SqlScript. */ + class SqlScript implements ISqlScript { + + /** + * Constructs a new SqlScript. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Content.ISqlScript); + + /** SqlScript engine. */ + public engine: (google.cloud.dataplex.v1.Content.SqlScript.QueryEngine|keyof typeof google.cloud.dataplex.v1.Content.SqlScript.QueryEngine); + + /** + * Creates a new SqlScript instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlScript instance + */ + public static create(properties?: google.cloud.dataplex.v1.Content.ISqlScript): google.cloud.dataplex.v1.Content.SqlScript; + + /** + * Encodes the specified SqlScript message. Does not implicitly {@link google.cloud.dataplex.v1.Content.SqlScript.verify|verify} messages. + * @param message SqlScript message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Content.ISqlScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlScript message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.SqlScript.verify|verify} messages. + * @param message SqlScript message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Content.ISqlScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlScript message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Content.SqlScript; + + /** + * Decodes a SqlScript message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Content.SqlScript; + + /** + * Verifies a SqlScript message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlScript message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlScript + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Content.SqlScript; + + /** + * Creates a plain object from a SqlScript message. Also converts values to other types if specified. + * @param message SqlScript + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Content.SqlScript, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlScript to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlScript + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SqlScript { + + /** QueryEngine enum. */ + enum QueryEngine { + QUERY_ENGINE_UNSPECIFIED = 0, + SPARK = 2 + } + } + + /** Properties of a Notebook. */ + interface INotebook { + + /** Notebook kernelType */ + kernelType?: (google.cloud.dataplex.v1.Content.Notebook.KernelType|keyof typeof google.cloud.dataplex.v1.Content.Notebook.KernelType|null); + } + + /** Represents a Notebook. */ + class Notebook implements INotebook { + + /** + * Constructs a new Notebook. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Content.INotebook); + + /** Notebook kernelType. */ + public kernelType: (google.cloud.dataplex.v1.Content.Notebook.KernelType|keyof typeof google.cloud.dataplex.v1.Content.Notebook.KernelType); + + /** + * Creates a new Notebook instance using the specified properties. + * @param [properties] Properties to set + * @returns Notebook instance + */ + public static create(properties?: google.cloud.dataplex.v1.Content.INotebook): google.cloud.dataplex.v1.Content.Notebook; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.dataplex.v1.Content.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Content.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.Notebook.verify|verify} messages. + * @param message Notebook message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Content.INotebook, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Content.Notebook; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Content.Notebook; + + /** + * Verifies a Notebook message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notebook + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Content.Notebook; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @param message Notebook + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Content.Notebook, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notebook to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Notebook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Notebook { + + /** KernelType enum. */ + enum KernelType { + KERNEL_TYPE_UNSPECIFIED = 0, + PYTHON3 = 1 + } + } + } + + /** Properties of a Session. */ + interface ISession { + + /** Session name */ + name?: (string|null); + + /** Session userId */ + userId?: (string|null); + + /** Session createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Session state */ + state?: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State|null); + } + + /** Represents a Session. */ + class Session implements ISession { + + /** + * Constructs a new Session. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ISession); + + /** Session name. */ + public name: string; + + /** Session userId. */ + public userId: string; + + /** Session createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Session state. */ + public state: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State); + + /** + * Creates a new Session instance using the specified properties. + * @param [properties] Properties to set + * @returns Session instance + */ + public static create(properties?: google.cloud.dataplex.v1.ISession): google.cloud.dataplex.v1.Session; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataplex.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Session message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Session; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Session; + + /** + * Verifies a Session message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Session + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Session; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @param message Session + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Session to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Session + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Lake. */ + interface ILake { + + /** Lake name */ + name?: (string|null); + + /** Lake displayName */ + displayName?: (string|null); + + /** Lake uid */ + uid?: (string|null); + + /** Lake createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Lake updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Lake labels */ + labels?: ({ [k: string]: string }|null); + + /** Lake description */ + description?: (string|null); + + /** Lake state */ + state?: (google.cloud.dataplex.v1.Lake.MetastoreStatus.State|keyof typeof google.cloud.dataplex.v1.Lake.MetastoreStatus.State|null); + + /** Lake serviceAccount */ + serviceAccount?: (string|null); + + /** Lake metastore */ + metastore?: (google.cloud.dataplex.v1.Lake.IMetastore|null); + + /** Lake assetStatus */ + assetStatus?: (google.cloud.dataplex.v1.IAssetStatus|null); + + /** Lake metastoreStatus */ + metastoreStatus?: (google.cloud.dataplex.v1.Lake.IMetastoreStatus|null); + } + + /** Represents a Lake. */ + class Lake implements ILake { + + /** + * Constructs a new Lake. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ILake); + + /** Lake name. */ + public name: string; + + /** Lake displayName. */ + public displayName: string; + + /** Lake uid. */ + public uid: string; + + /** Lake createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Lake updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Lake labels. */ + public labels: { [k: string]: string }; + + /** Lake description. */ + public description: string; + + /** Lake state. */ + public state: (google.cloud.dataplex.v1.Lake.MetastoreStatus.State|keyof typeof google.cloud.dataplex.v1.Lake.MetastoreStatus.State); + + /** Lake serviceAccount. */ + public serviceAccount: string; + + /** Lake metastore. */ + public metastore?: (google.cloud.dataplex.v1.Lake.IMetastore|null); + + /** Lake assetStatus. */ + public assetStatus?: (google.cloud.dataplex.v1.IAssetStatus|null); + + /** Lake metastoreStatus. */ + public metastoreStatus?: (google.cloud.dataplex.v1.Lake.IMetastoreStatus|null); + + /** + * Creates a new Lake instance using the specified properties. + * @param [properties] Properties to set + * @returns Lake instance + */ + public static create(properties?: google.cloud.dataplex.v1.ILake): google.cloud.dataplex.v1.Lake; + + /** + * Encodes the specified Lake message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.verify|verify} messages. + * @param message Lake message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ILake, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Lake message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.verify|verify} messages. + * @param message Lake message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ILake, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Lake message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Lake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Lake; + + /** + * Decodes a Lake message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Lake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Lake; + + /** + * Verifies a Lake message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Lake message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Lake + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Lake; + + /** + * Creates a plain object from a Lake message. Also converts values to other types if specified. + * @param message Lake + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Lake, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Lake to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Lake + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Lake { + + /** Properties of a Metastore. */ + interface IMetastore { + + /** Metastore service */ + service?: (string|null); + } + + /** Represents a Metastore. */ + class Metastore implements IMetastore { + + /** + * Constructs a new Metastore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Lake.IMetastore); + + /** Metastore service. */ + public service: string; + + /** + * Creates a new Metastore instance using the specified properties. + * @param [properties] Properties to set + * @returns Metastore instance + */ + public static create(properties?: google.cloud.dataplex.v1.Lake.IMetastore): google.cloud.dataplex.v1.Lake.Metastore; + + /** + * Encodes the specified Metastore message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.Metastore.verify|verify} messages. + * @param message Metastore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Lake.IMetastore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metastore message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.Metastore.verify|verify} messages. + * @param message Metastore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Lake.IMetastore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metastore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metastore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Lake.Metastore; + + /** + * Decodes a Metastore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metastore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Lake.Metastore; + + /** + * Verifies a Metastore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metastore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metastore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Lake.Metastore; + + /** + * Creates a plain object from a Metastore message. Also converts values to other types if specified. + * @param message Metastore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Lake.Metastore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metastore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metastore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetastoreStatus. */ + interface IMetastoreStatus { + + /** MetastoreStatus state */ + state?: (google.cloud.dataplex.v1.Lake.MetastoreStatus.State|keyof typeof google.cloud.dataplex.v1.Lake.MetastoreStatus.State|null); + + /** MetastoreStatus message */ + message?: (string|null); + + /** MetastoreStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MetastoreStatus endpoint */ + endpoint?: (string|null); + } + + /** Represents a MetastoreStatus. */ + class MetastoreStatus implements IMetastoreStatus { + + /** + * Constructs a new MetastoreStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Lake.IMetastoreStatus); + + /** MetastoreStatus state. */ + public state: (google.cloud.dataplex.v1.Lake.MetastoreStatus.State|keyof typeof google.cloud.dataplex.v1.Lake.MetastoreStatus.State); + + /** MetastoreStatus message. */ + public message: string; + + /** MetastoreStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MetastoreStatus endpoint. */ + public endpoint: string; + + /** + * Creates a new MetastoreStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns MetastoreStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Lake.IMetastoreStatus): google.cloud.dataplex.v1.Lake.MetastoreStatus; + + /** + * Encodes the specified MetastoreStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.MetastoreStatus.verify|verify} messages. + * @param message MetastoreStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Lake.IMetastoreStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetastoreStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.MetastoreStatus.verify|verify} messages. + * @param message MetastoreStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Lake.IMetastoreStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetastoreStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetastoreStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Lake.MetastoreStatus; + + /** + * Decodes a MetastoreStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetastoreStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Lake.MetastoreStatus; + + /** + * Verifies a MetastoreStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetastoreStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetastoreStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Lake.MetastoreStatus; + + /** + * Creates a plain object from a MetastoreStatus message. Also converts values to other types if specified. + * @param message MetastoreStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Lake.MetastoreStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetastoreStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetastoreStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetastoreStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NONE = 1, + READY = 2, + UPDATING = 3, + ERROR = 4 + } + } + } + + /** Properties of an AssetStatus. */ + interface IAssetStatus { + + /** AssetStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AssetStatus activeAssets */ + activeAssets?: (number|null); + + /** AssetStatus securityPolicyApplyingAssets */ + securityPolicyApplyingAssets?: (number|null); + } + + /** Represents an AssetStatus. */ + class AssetStatus implements IAssetStatus { + + /** + * Constructs a new AssetStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IAssetStatus); + + /** AssetStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AssetStatus activeAssets. */ + public activeAssets: number; + + /** AssetStatus securityPolicyApplyingAssets. */ + public securityPolicyApplyingAssets: number; + + /** + * Creates a new AssetStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.IAssetStatus): google.cloud.dataplex.v1.AssetStatus; + + /** + * Encodes the specified AssetStatus message. Does not implicitly {@link google.cloud.dataplex.v1.AssetStatus.verify|verify} messages. + * @param message AssetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IAssetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.AssetStatus.verify|verify} messages. + * @param message AssetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IAssetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.AssetStatus; + + /** + * Decodes an AssetStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.AssetStatus; + + /** + * Verifies an AssetStatus message. + * @param message Plain 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 AssetStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.AssetStatus; + + /** + * Creates a plain object from an AssetStatus message. Also converts values to other types if specified. + * @param message AssetStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.AssetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Zone. */ + interface IZone { + + /** Zone name */ + name?: (string|null); + + /** Zone displayName */ + displayName?: (string|null); + + /** Zone uid */ + uid?: (string|null); + + /** Zone createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Zone updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Zone labels */ + labels?: ({ [k: string]: string }|null); + + /** Zone description */ + description?: (string|null); + + /** Zone state */ + state?: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State|null); + + /** Zone type */ + type?: (google.cloud.dataplex.v1.Zone.Type|keyof typeof google.cloud.dataplex.v1.Zone.Type|null); + + /** Zone discoverySpec */ + discoverySpec?: (google.cloud.dataplex.v1.Zone.IDiscoverySpec|null); + + /** Zone resourceSpec */ + resourceSpec?: (google.cloud.dataplex.v1.Zone.IResourceSpec|null); + + /** Zone assetStatus */ + assetStatus?: (google.cloud.dataplex.v1.IAssetStatus|null); + } + + /** Represents a Zone. */ + class Zone implements IZone { + + /** + * Constructs a new Zone. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IZone); + + /** Zone name. */ + public name: string; + + /** Zone displayName. */ + public displayName: string; + + /** Zone uid. */ + public uid: string; + + /** Zone createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Zone updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Zone labels. */ + public labels: { [k: string]: string }; + + /** Zone description. */ + public description: string; + + /** Zone state. */ + public state: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State); + + /** Zone type. */ + public type: (google.cloud.dataplex.v1.Zone.Type|keyof typeof google.cloud.dataplex.v1.Zone.Type); + + /** Zone discoverySpec. */ + public discoverySpec?: (google.cloud.dataplex.v1.Zone.IDiscoverySpec|null); + + /** Zone resourceSpec. */ + public resourceSpec?: (google.cloud.dataplex.v1.Zone.IResourceSpec|null); + + /** Zone assetStatus. */ + public assetStatus?: (google.cloud.dataplex.v1.IAssetStatus|null); + + /** + * Creates a new Zone instance using the specified properties. + * @param [properties] Properties to set + * @returns Zone instance + */ + public static create(properties?: google.cloud.dataplex.v1.IZone): google.cloud.dataplex.v1.Zone; + + /** + * Encodes the specified Zone message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.verify|verify} messages. + * @param message Zone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Zone message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.verify|verify} messages. + * @param message Zone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Zone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Zone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Zone; + + /** + * Decodes a Zone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Zone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Zone; + + /** + * Verifies a Zone message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Zone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Zone + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Zone; + + /** + * Creates a plain object from a Zone message. Also converts values to other types if specified. + * @param message Zone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Zone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Zone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Zone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Zone { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + RAW = 1, + CURATED = 2 + } + + /** Properties of a ResourceSpec. */ + interface IResourceSpec { + + /** ResourceSpec locationType */ + locationType?: (google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType|keyof typeof google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType|null); + } + + /** Represents a ResourceSpec. */ + class ResourceSpec implements IResourceSpec { + + /** + * Constructs a new ResourceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Zone.IResourceSpec); + + /** ResourceSpec locationType. */ + public locationType: (google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType|keyof typeof google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType); + + /** + * Creates a new ResourceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Zone.IResourceSpec): google.cloud.dataplex.v1.Zone.ResourceSpec; + + /** + * Encodes the specified ResourceSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.ResourceSpec.verify|verify} messages. + * @param message ResourceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Zone.IResourceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.ResourceSpec.verify|verify} messages. + * @param message ResourceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Zone.IResourceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Zone.ResourceSpec; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Zone.ResourceSpec; + + /** + * Verifies a ResourceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Zone.ResourceSpec; + + /** + * Creates a plain object from a ResourceSpec message. Also converts values to other types if specified. + * @param message ResourceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Zone.ResourceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceSpec { + + /** LocationType enum. */ + enum LocationType { + LOCATION_TYPE_UNSPECIFIED = 0, + SINGLE_REGION = 1, + MULTI_REGION = 2 + } + } + + /** Properties of a DiscoverySpec. */ + interface IDiscoverySpec { + + /** DiscoverySpec enabled */ + enabled?: (boolean|null); + + /** DiscoverySpec includePatterns */ + includePatterns?: (string[]|null); + + /** DiscoverySpec excludePatterns */ + excludePatterns?: (string[]|null); + + /** DiscoverySpec csvOptions */ + csvOptions?: (google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions|null); + + /** DiscoverySpec jsonOptions */ + jsonOptions?: (google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions|null); + + /** DiscoverySpec schedule */ + schedule?: (string|null); + } + + /** Represents a DiscoverySpec. */ + class DiscoverySpec implements IDiscoverySpec { + + /** + * Constructs a new DiscoverySpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Zone.IDiscoverySpec); + + /** DiscoverySpec enabled. */ + public enabled: boolean; + + /** DiscoverySpec includePatterns. */ + public includePatterns: string[]; + + /** DiscoverySpec excludePatterns. */ + public excludePatterns: string[]; + + /** DiscoverySpec csvOptions. */ + public csvOptions?: (google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions|null); + + /** DiscoverySpec jsonOptions. */ + public jsonOptions?: (google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions|null); + + /** DiscoverySpec schedule. */ + public schedule?: (string|null); + + /** DiscoverySpec trigger. */ + public trigger?: "schedule"; + + /** + * Creates a new DiscoverySpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DiscoverySpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Zone.IDiscoverySpec): google.cloud.dataplex.v1.Zone.DiscoverySpec; + + /** + * Encodes the specified DiscoverySpec message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.verify|verify} messages. + * @param message DiscoverySpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Zone.IDiscoverySpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiscoverySpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.verify|verify} messages. + * @param message DiscoverySpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Zone.IDiscoverySpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Zone.DiscoverySpec; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Zone.DiscoverySpec; + + /** + * Verifies a DiscoverySpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiscoverySpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiscoverySpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Zone.DiscoverySpec; + + /** + * Creates a plain object from a DiscoverySpec message. Also converts values to other types if specified. + * @param message DiscoverySpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Zone.DiscoverySpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiscoverySpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiscoverySpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiscoverySpec { + + /** Properties of a CsvOptions. */ + interface ICsvOptions { + + /** CsvOptions headerRows */ + headerRows?: (number|null); + + /** CsvOptions delimiter */ + delimiter?: (string|null); + + /** CsvOptions encoding */ + encoding?: (string|null); + + /** CsvOptions disableTypeInference */ + disableTypeInference?: (boolean|null); + } + + /** Represents a CsvOptions. */ + class CsvOptions implements ICsvOptions { + + /** + * Constructs a new CsvOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions); + + /** CsvOptions headerRows. */ + public headerRows: number; + + /** CsvOptions delimiter. */ + public delimiter: string; + + /** CsvOptions encoding. */ + public encoding: string; + + /** CsvOptions disableTypeInference. */ + public disableTypeInference: boolean; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions): google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions; + + /** + * Verifies a CsvOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @param message CsvOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JsonOptions. */ + interface IJsonOptions { + + /** JsonOptions encoding */ + encoding?: (string|null); + + /** JsonOptions disableTypeInference */ + disableTypeInference?: (boolean|null); + } + + /** Represents a JsonOptions. */ + class JsonOptions implements IJsonOptions { + + /** + * Constructs a new JsonOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions); + + /** JsonOptions encoding. */ + public encoding: string; + + /** JsonOptions disableTypeInference. */ + public disableTypeInference: boolean; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns JsonOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions): google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions; + + /** + * Verifies a JsonOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JsonOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @param message JsonOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JsonOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JsonOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an Action. */ + interface IAction { + + /** Action category */ + category?: (google.cloud.dataplex.v1.Action.Category|keyof typeof google.cloud.dataplex.v1.Action.Category|null); + + /** Action issue */ + issue?: (string|null); + + /** Action detectTime */ + detectTime?: (google.protobuf.ITimestamp|null); + + /** Action name */ + name?: (string|null); + + /** Action lake */ + lake?: (string|null); + + /** Action zone */ + zone?: (string|null); + + /** Action asset */ + asset?: (string|null); + + /** Action dataLocations */ + dataLocations?: (string[]|null); + + /** Action invalidDataFormat */ + invalidDataFormat?: (google.cloud.dataplex.v1.Action.IInvalidDataFormat|null); + + /** Action incompatibleDataSchema */ + incompatibleDataSchema?: (google.cloud.dataplex.v1.Action.IIncompatibleDataSchema|null); + + /** Action invalidDataPartition */ + invalidDataPartition?: (google.cloud.dataplex.v1.Action.IInvalidDataPartition|null); + + /** Action missingData */ + missingData?: (google.cloud.dataplex.v1.Action.IMissingData|null); + + /** Action missingResource */ + missingResource?: (google.cloud.dataplex.v1.Action.IMissingResource|null); + + /** Action unauthorizedResource */ + unauthorizedResource?: (google.cloud.dataplex.v1.Action.IUnauthorizedResource|null); + + /** Action failedSecurityPolicyApply */ + failedSecurityPolicyApply?: (google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply|null); + + /** Action invalidDataOrganization */ + invalidDataOrganization?: (google.cloud.dataplex.v1.Action.IInvalidDataOrganization|null); + } + + /** Represents an Action. */ + class Action implements IAction { + + /** + * Constructs a new Action. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IAction); + + /** Action category. */ + public category: (google.cloud.dataplex.v1.Action.Category|keyof typeof google.cloud.dataplex.v1.Action.Category); + + /** Action issue. */ + public issue: string; + + /** Action detectTime. */ + public detectTime?: (google.protobuf.ITimestamp|null); + + /** Action name. */ + public name: string; + + /** Action lake. */ + public lake: string; + + /** Action zone. */ + public zone: string; + + /** Action asset. */ + public asset: string; + + /** Action dataLocations. */ + public dataLocations: string[]; + + /** Action invalidDataFormat. */ + public invalidDataFormat?: (google.cloud.dataplex.v1.Action.IInvalidDataFormat|null); + + /** Action incompatibleDataSchema. */ + public incompatibleDataSchema?: (google.cloud.dataplex.v1.Action.IIncompatibleDataSchema|null); + + /** Action invalidDataPartition. */ + public invalidDataPartition?: (google.cloud.dataplex.v1.Action.IInvalidDataPartition|null); + + /** Action missingData. */ + public missingData?: (google.cloud.dataplex.v1.Action.IMissingData|null); + + /** Action missingResource. */ + public missingResource?: (google.cloud.dataplex.v1.Action.IMissingResource|null); + + /** Action unauthorizedResource. */ + public unauthorizedResource?: (google.cloud.dataplex.v1.Action.IUnauthorizedResource|null); + + /** Action failedSecurityPolicyApply. */ + public failedSecurityPolicyApply?: (google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply|null); + + /** Action invalidDataOrganization. */ + public invalidDataOrganization?: (google.cloud.dataplex.v1.Action.IInvalidDataOrganization|null); + + /** Action details. */ + public details?: ("invalidDataFormat"|"incompatibleDataSchema"|"invalidDataPartition"|"missingData"|"missingResource"|"unauthorizedResource"|"failedSecurityPolicyApply"|"invalidDataOrganization"); + + /** + * Creates a new Action instance using the specified properties. + * @param [properties] Properties to set + * @returns Action instance + */ + public static create(properties?: google.cloud.dataplex.v1.IAction): google.cloud.dataplex.v1.Action; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dataplex.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.verify|verify} messages. + * @param message Action message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Action message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action; + + /** + * Verifies an Action message. + * @param message Plain 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 Action message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Action + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @param message Action + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Action to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Action + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Action { + + /** Category enum. */ + enum Category { + CATEGORY_UNSPECIFIED = 0, + RESOURCE_MANAGEMENT = 1, + SECURITY_POLICY = 2, + DATA_DISCOVERY = 3 + } + + /** Properties of a MissingResource. */ + interface IMissingResource { + } + + /** Represents a MissingResource. */ + class MissingResource implements IMissingResource { + + /** + * Constructs a new MissingResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IMissingResource); + + /** + * Creates a new MissingResource instance using the specified properties. + * @param [properties] Properties to set + * @returns MissingResource instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IMissingResource): google.cloud.dataplex.v1.Action.MissingResource; + + /** + * Encodes the specified MissingResource message. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingResource.verify|verify} messages. + * @param message MissingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IMissingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MissingResource message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingResource.verify|verify} messages. + * @param message MissingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IMissingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MissingResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MissingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.MissingResource; + + /** + * Decodes a MissingResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MissingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.MissingResource; + + /** + * Verifies a MissingResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MissingResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MissingResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.MissingResource; + + /** + * Creates a plain object from a MissingResource message. Also converts values to other types if specified. + * @param message MissingResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.MissingResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MissingResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MissingResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnauthorizedResource. */ + interface IUnauthorizedResource { + } + + /** Represents an UnauthorizedResource. */ + class UnauthorizedResource implements IUnauthorizedResource { + + /** + * Constructs a new UnauthorizedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IUnauthorizedResource); + + /** + * Creates a new UnauthorizedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns UnauthorizedResource instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IUnauthorizedResource): google.cloud.dataplex.v1.Action.UnauthorizedResource; + + /** + * Encodes the specified UnauthorizedResource message. Does not implicitly {@link google.cloud.dataplex.v1.Action.UnauthorizedResource.verify|verify} messages. + * @param message UnauthorizedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IUnauthorizedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnauthorizedResource message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.UnauthorizedResource.verify|verify} messages. + * @param message UnauthorizedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IUnauthorizedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnauthorizedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnauthorizedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.UnauthorizedResource; + + /** + * Decodes an UnauthorizedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnauthorizedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.UnauthorizedResource; + + /** + * Verifies an UnauthorizedResource message. + * @param message Plain 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 UnauthorizedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnauthorizedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.UnauthorizedResource; + + /** + * Creates a plain object from an UnauthorizedResource message. Also converts values to other types if specified. + * @param message UnauthorizedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.UnauthorizedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnauthorizedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnauthorizedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FailedSecurityPolicyApply. */ + interface IFailedSecurityPolicyApply { + + /** FailedSecurityPolicyApply asset */ + asset?: (string|null); + } + + /** Represents a FailedSecurityPolicyApply. */ + class FailedSecurityPolicyApply implements IFailedSecurityPolicyApply { + + /** + * Constructs a new FailedSecurityPolicyApply. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply); + + /** FailedSecurityPolicyApply asset. */ + public asset: string; + + /** + * Creates a new FailedSecurityPolicyApply instance using the specified properties. + * @param [properties] Properties to set + * @returns FailedSecurityPolicyApply instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply): google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply; + + /** + * Encodes the specified FailedSecurityPolicyApply message. Does not implicitly {@link google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.verify|verify} messages. + * @param message FailedSecurityPolicyApply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailedSecurityPolicyApply message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.verify|verify} messages. + * @param message FailedSecurityPolicyApply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailedSecurityPolicyApply message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailedSecurityPolicyApply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply; + + /** + * Decodes a FailedSecurityPolicyApply message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailedSecurityPolicyApply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply; + + /** + * Verifies a FailedSecurityPolicyApply message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailedSecurityPolicyApply message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailedSecurityPolicyApply + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply; + + /** + * Creates a plain object from a FailedSecurityPolicyApply message. Also converts values to other types if specified. + * @param message FailedSecurityPolicyApply + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailedSecurityPolicyApply to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailedSecurityPolicyApply + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InvalidDataFormat. */ + interface IInvalidDataFormat { + + /** InvalidDataFormat sampledDataLocations */ + sampledDataLocations?: (string[]|null); + + /** InvalidDataFormat expectedFormat */ + expectedFormat?: (string|null); + + /** InvalidDataFormat newFormat */ + newFormat?: (string|null); + } + + /** Represents an InvalidDataFormat. */ + class InvalidDataFormat implements IInvalidDataFormat { + + /** + * Constructs a new InvalidDataFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IInvalidDataFormat); + + /** InvalidDataFormat sampledDataLocations. */ + public sampledDataLocations: string[]; + + /** InvalidDataFormat expectedFormat. */ + public expectedFormat: string; + + /** InvalidDataFormat newFormat. */ + public newFormat: string; + + /** + * Creates a new InvalidDataFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidDataFormat instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IInvalidDataFormat): google.cloud.dataplex.v1.Action.InvalidDataFormat; + + /** + * Encodes the specified InvalidDataFormat message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataFormat.verify|verify} messages. + * @param message InvalidDataFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IInvalidDataFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidDataFormat message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataFormat.verify|verify} messages. + * @param message InvalidDataFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IInvalidDataFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidDataFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidDataFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.InvalidDataFormat; + + /** + * Decodes an InvalidDataFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidDataFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.InvalidDataFormat; + + /** + * Verifies an InvalidDataFormat message. + * @param message Plain 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 InvalidDataFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidDataFormat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.InvalidDataFormat; + + /** + * Creates a plain object from an InvalidDataFormat message. Also converts values to other types if specified. + * @param message InvalidDataFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.InvalidDataFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidDataFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InvalidDataFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IncompatibleDataSchema. */ + interface IIncompatibleDataSchema { + + /** IncompatibleDataSchema table */ + table?: (string|null); + + /** IncompatibleDataSchema existingSchema */ + existingSchema?: (string|null); + + /** IncompatibleDataSchema newSchema */ + newSchema?: (string|null); + + /** IncompatibleDataSchema sampledDataLocations */ + sampledDataLocations?: (string[]|null); + + /** IncompatibleDataSchema schemaChange */ + schemaChange?: (google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange|keyof typeof google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange|null); + } + + /** Represents an IncompatibleDataSchema. */ + class IncompatibleDataSchema implements IIncompatibleDataSchema { + + /** + * Constructs a new IncompatibleDataSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IIncompatibleDataSchema); + + /** IncompatibleDataSchema table. */ + public table: string; + + /** IncompatibleDataSchema existingSchema. */ + public existingSchema: string; + + /** IncompatibleDataSchema newSchema. */ + public newSchema: string; + + /** IncompatibleDataSchema sampledDataLocations. */ + public sampledDataLocations: string[]; + + /** IncompatibleDataSchema schemaChange. */ + public schemaChange: (google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange|keyof typeof google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange); + + /** + * Creates a new IncompatibleDataSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns IncompatibleDataSchema instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IIncompatibleDataSchema): google.cloud.dataplex.v1.Action.IncompatibleDataSchema; + + /** + * Encodes the specified IncompatibleDataSchema message. Does not implicitly {@link google.cloud.dataplex.v1.Action.IncompatibleDataSchema.verify|verify} messages. + * @param message IncompatibleDataSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IIncompatibleDataSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncompatibleDataSchema message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.IncompatibleDataSchema.verify|verify} messages. + * @param message IncompatibleDataSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IIncompatibleDataSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncompatibleDataSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncompatibleDataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.IncompatibleDataSchema; + + /** + * Decodes an IncompatibleDataSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncompatibleDataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.IncompatibleDataSchema; + + /** + * Verifies an IncompatibleDataSchema message. + * @param message Plain 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 IncompatibleDataSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncompatibleDataSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.IncompatibleDataSchema; + + /** + * Creates a plain object from an IncompatibleDataSchema message. Also converts values to other types if specified. + * @param message IncompatibleDataSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.IncompatibleDataSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncompatibleDataSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncompatibleDataSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IncompatibleDataSchema { + + /** SchemaChange enum. */ + enum SchemaChange { + SCHEMA_CHANGE_UNSPECIFIED = 0, + INCOMPATIBLE = 1, + MODIFIED = 2 + } + } + + /** Properties of an InvalidDataPartition. */ + interface IInvalidDataPartition { + + /** InvalidDataPartition expectedStructure */ + expectedStructure?: (google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure|keyof typeof google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure|null); + } + + /** Represents an InvalidDataPartition. */ + class InvalidDataPartition implements IInvalidDataPartition { + + /** + * Constructs a new InvalidDataPartition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IInvalidDataPartition); + + /** InvalidDataPartition expectedStructure. */ + public expectedStructure: (google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure|keyof typeof google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure); + + /** + * Creates a new InvalidDataPartition instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidDataPartition instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IInvalidDataPartition): google.cloud.dataplex.v1.Action.InvalidDataPartition; + + /** + * Encodes the specified InvalidDataPartition message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataPartition.verify|verify} messages. + * @param message InvalidDataPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IInvalidDataPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidDataPartition message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataPartition.verify|verify} messages. + * @param message InvalidDataPartition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IInvalidDataPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidDataPartition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidDataPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.InvalidDataPartition; + + /** + * Decodes an InvalidDataPartition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidDataPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.InvalidDataPartition; + + /** + * Verifies an InvalidDataPartition message. + * @param message Plain 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 InvalidDataPartition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidDataPartition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.InvalidDataPartition; + + /** + * Creates a plain object from an InvalidDataPartition message. Also converts values to other types if specified. + * @param message InvalidDataPartition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.InvalidDataPartition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidDataPartition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InvalidDataPartition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InvalidDataPartition { + + /** PartitionStructure enum. */ + enum PartitionStructure { + PARTITION_STRUCTURE_UNSPECIFIED = 0, + CONSISTENT_KEYS = 1, + HIVE_STYLE_KEYS = 2 + } + } + + /** Properties of a MissingData. */ + interface IMissingData { + } + + /** Represents a MissingData. */ + class MissingData implements IMissingData { + + /** + * Constructs a new MissingData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IMissingData); + + /** + * Creates a new MissingData instance using the specified properties. + * @param [properties] Properties to set + * @returns MissingData instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IMissingData): google.cloud.dataplex.v1.Action.MissingData; + + /** + * Encodes the specified MissingData message. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingData.verify|verify} messages. + * @param message MissingData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IMissingData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MissingData message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingData.verify|verify} messages. + * @param message MissingData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IMissingData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MissingData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MissingData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.MissingData; + + /** + * Decodes a MissingData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MissingData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.MissingData; + + /** + * Verifies a MissingData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MissingData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MissingData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.MissingData; + + /** + * Creates a plain object from a MissingData message. Also converts values to other types if specified. + * @param message MissingData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.MissingData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MissingData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MissingData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InvalidDataOrganization. */ + interface IInvalidDataOrganization { + } + + /** Represents an InvalidDataOrganization. */ + class InvalidDataOrganization implements IInvalidDataOrganization { + + /** + * Constructs a new InvalidDataOrganization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Action.IInvalidDataOrganization); + + /** + * Creates a new InvalidDataOrganization instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidDataOrganization instance + */ + public static create(properties?: google.cloud.dataplex.v1.Action.IInvalidDataOrganization): google.cloud.dataplex.v1.Action.InvalidDataOrganization; + + /** + * Encodes the specified InvalidDataOrganization message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataOrganization.verify|verify} messages. + * @param message InvalidDataOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Action.IInvalidDataOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidDataOrganization message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataOrganization.verify|verify} messages. + * @param message InvalidDataOrganization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Action.IInvalidDataOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidDataOrganization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidDataOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Action.InvalidDataOrganization; + + /** + * Decodes an InvalidDataOrganization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidDataOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Action.InvalidDataOrganization; + + /** + * Verifies an InvalidDataOrganization message. + * @param message Plain 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 InvalidDataOrganization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidDataOrganization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Action.InvalidDataOrganization; + + /** + * Creates a plain object from an InvalidDataOrganization message. Also converts values to other types if specified. + * @param message InvalidDataOrganization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Action.InvalidDataOrganization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidDataOrganization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InvalidDataOrganization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset displayName */ + displayName?: (string|null); + + /** Asset uid */ + uid?: (string|null); + + /** Asset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset labels */ + labels?: ({ [k: string]: string }|null); + + /** Asset description */ + description?: (string|null); + + /** Asset state */ + state?: (google.cloud.dataplex.v1.Asset.SecurityStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.SecurityStatus.State|null); + + /** Asset resourceSpec */ + resourceSpec?: (google.cloud.dataplex.v1.Asset.IResourceSpec|null); + + /** Asset resourceStatus */ + resourceStatus?: (google.cloud.dataplex.v1.Asset.IResourceStatus|null); + + /** Asset securityStatus */ + securityStatus?: (google.cloud.dataplex.v1.Asset.ISecurityStatus|null); + + /** Asset discoverySpec */ + discoverySpec?: (google.cloud.dataplex.v1.Asset.IDiscoverySpec|null); + + /** Asset discoveryStatus */ + discoveryStatus?: (google.cloud.dataplex.v1.Asset.IDiscoveryStatus|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset displayName. */ + public displayName: string; + + /** Asset uid. */ + public uid: string; + + /** Asset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset labels. */ + public labels: { [k: string]: string }; + + /** Asset description. */ + public description: string; + + /** Asset state. */ + public state: (google.cloud.dataplex.v1.Asset.SecurityStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.SecurityStatus.State); + + /** Asset resourceSpec. */ + public resourceSpec?: (google.cloud.dataplex.v1.Asset.IResourceSpec|null); + + /** Asset resourceStatus. */ + public resourceStatus?: (google.cloud.dataplex.v1.Asset.IResourceStatus|null); + + /** Asset securityStatus. */ + public securityStatus?: (google.cloud.dataplex.v1.Asset.ISecurityStatus|null); + + /** Asset discoverySpec. */ + public discoverySpec?: (google.cloud.dataplex.v1.Asset.IDiscoverySpec|null); + + /** Asset discoveryStatus. */ + public discoveryStatus?: (google.cloud.dataplex.v1.Asset.IDiscoveryStatus|null); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.dataplex.v1.IAsset): google.cloud.dataplex.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain 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 Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Asset { + + /** Properties of a SecurityStatus. */ + interface ISecurityStatus { + + /** SecurityStatus state */ + state?: (google.cloud.dataplex.v1.Asset.SecurityStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.SecurityStatus.State|null); + + /** SecurityStatus message */ + message?: (string|null); + + /** SecurityStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SecurityStatus. */ + class SecurityStatus implements ISecurityStatus { + + /** + * Constructs a new SecurityStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.ISecurityStatus); + + /** SecurityStatus state. */ + public state: (google.cloud.dataplex.v1.Asset.SecurityStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.SecurityStatus.State); + + /** SecurityStatus message. */ + public message: string; + + /** SecurityStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SecurityStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.ISecurityStatus): google.cloud.dataplex.v1.Asset.SecurityStatus; + + /** + * Encodes the specified SecurityStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.SecurityStatus.verify|verify} messages. + * @param message SecurityStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.ISecurityStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.SecurityStatus.verify|verify} messages. + * @param message SecurityStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.ISecurityStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.SecurityStatus; + + /** + * Decodes a SecurityStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.SecurityStatus; + + /** + * Verifies a SecurityStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.SecurityStatus; + + /** + * Creates a plain object from a SecurityStatus message. Also converts values to other types if specified. + * @param message SecurityStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.SecurityStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SecurityStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + APPLYING = 2, + ERROR = 3 + } + } + + /** Properties of a DiscoverySpec. */ + interface IDiscoverySpec { + + /** DiscoverySpec enabled */ + enabled?: (boolean|null); + + /** DiscoverySpec includePatterns */ + includePatterns?: (string[]|null); + + /** DiscoverySpec excludePatterns */ + excludePatterns?: (string[]|null); + + /** DiscoverySpec csvOptions */ + csvOptions?: (google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions|null); + + /** DiscoverySpec jsonOptions */ + jsonOptions?: (google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions|null); + + /** DiscoverySpec schedule */ + schedule?: (string|null); + } + + /** Represents a DiscoverySpec. */ + class DiscoverySpec implements IDiscoverySpec { + + /** + * Constructs a new DiscoverySpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.IDiscoverySpec); + + /** DiscoverySpec enabled. */ + public enabled: boolean; + + /** DiscoverySpec includePatterns. */ + public includePatterns: string[]; + + /** DiscoverySpec excludePatterns. */ + public excludePatterns: string[]; + + /** DiscoverySpec csvOptions. */ + public csvOptions?: (google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions|null); + + /** DiscoverySpec jsonOptions. */ + public jsonOptions?: (google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions|null); + + /** DiscoverySpec schedule. */ + public schedule?: (string|null); + + /** DiscoverySpec trigger. */ + public trigger?: "schedule"; + + /** + * Creates a new DiscoverySpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DiscoverySpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.IDiscoverySpec): google.cloud.dataplex.v1.Asset.DiscoverySpec; + + /** + * Encodes the specified DiscoverySpec message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.verify|verify} messages. + * @param message DiscoverySpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.IDiscoverySpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiscoverySpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.verify|verify} messages. + * @param message DiscoverySpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.IDiscoverySpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.DiscoverySpec; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.DiscoverySpec; + + /** + * Verifies a DiscoverySpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiscoverySpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiscoverySpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.DiscoverySpec; + + /** + * Creates a plain object from a DiscoverySpec message. Also converts values to other types if specified. + * @param message DiscoverySpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.DiscoverySpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiscoverySpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiscoverySpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiscoverySpec { + + /** Properties of a CsvOptions. */ + interface ICsvOptions { + + /** CsvOptions headerRows */ + headerRows?: (number|null); + + /** CsvOptions delimiter */ + delimiter?: (string|null); + + /** CsvOptions encoding */ + encoding?: (string|null); + + /** CsvOptions disableTypeInference */ + disableTypeInference?: (boolean|null); + } + + /** Represents a CsvOptions. */ + class CsvOptions implements ICsvOptions { + + /** + * Constructs a new CsvOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions); + + /** CsvOptions headerRows. */ + public headerRows: number; + + /** CsvOptions delimiter. */ + public delimiter: string; + + /** CsvOptions encoding. */ + public encoding: string; + + /** CsvOptions disableTypeInference. */ + public disableTypeInference: boolean; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions): google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions; + + /** + * Verifies a CsvOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @param message CsvOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JsonOptions. */ + interface IJsonOptions { + + /** JsonOptions encoding */ + encoding?: (string|null); + + /** JsonOptions disableTypeInference */ + disableTypeInference?: (boolean|null); + } + + /** Represents a JsonOptions. */ + class JsonOptions implements IJsonOptions { + + /** + * Constructs a new JsonOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions); + + /** JsonOptions encoding. */ + public encoding: string; + + /** JsonOptions disableTypeInference. */ + public disableTypeInference: boolean; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns JsonOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions): google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions; + + /** + * Verifies a JsonOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JsonOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @param message JsonOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JsonOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JsonOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ResourceSpec. */ + interface IResourceSpec { + + /** ResourceSpec name */ + name?: (string|null); + + /** ResourceSpec type */ + type?: (google.cloud.dataplex.v1.Asset.ResourceSpec.Type|keyof typeof google.cloud.dataplex.v1.Asset.ResourceSpec.Type|null); + } + + /** Represents a ResourceSpec. */ + class ResourceSpec implements IResourceSpec { + + /** + * Constructs a new ResourceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.IResourceSpec); + + /** ResourceSpec name. */ + public name: string; + + /** ResourceSpec type. */ + public type: (google.cloud.dataplex.v1.Asset.ResourceSpec.Type|keyof typeof google.cloud.dataplex.v1.Asset.ResourceSpec.Type); + + /** + * Creates a new ResourceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.IResourceSpec): google.cloud.dataplex.v1.Asset.ResourceSpec; + + /** + * Encodes the specified ResourceSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceSpec.verify|verify} messages. + * @param message ResourceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.IResourceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceSpec.verify|verify} messages. + * @param message ResourceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.IResourceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.ResourceSpec; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.ResourceSpec; + + /** + * Verifies a ResourceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.ResourceSpec; + + /** + * Creates a plain object from a ResourceSpec message. Also converts values to other types if specified. + * @param message ResourceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.ResourceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceSpec { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STORAGE_BUCKET = 1, + BIGQUERY_DATASET = 2 + } + } + + /** Properties of a ResourceStatus. */ + interface IResourceStatus { + + /** ResourceStatus state */ + state?: (google.cloud.dataplex.v1.Asset.ResourceStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.ResourceStatus.State|null); + + /** ResourceStatus message */ + message?: (string|null); + + /** ResourceStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ResourceStatus. */ + class ResourceStatus implements IResourceStatus { + + /** + * Constructs a new ResourceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.IResourceStatus); + + /** ResourceStatus state. */ + public state: (google.cloud.dataplex.v1.Asset.ResourceStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.ResourceStatus.State); + + /** ResourceStatus message. */ + public message: string; + + /** ResourceStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ResourceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.IResourceStatus): google.cloud.dataplex.v1.Asset.ResourceStatus; + + /** + * Encodes the specified ResourceStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceStatus.verify|verify} messages. + * @param message ResourceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.IResourceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceStatus.verify|verify} messages. + * @param message ResourceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.IResourceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.ResourceStatus; + + /** + * Decodes a ResourceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.ResourceStatus; + + /** + * Verifies a ResourceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.ResourceStatus; + + /** + * Creates a plain object from a ResourceStatus message. Also converts values to other types if specified. + * @param message ResourceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.ResourceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + READY = 1, + ERROR = 2 + } + } + + /** Properties of a DiscoveryStatus. */ + interface IDiscoveryStatus { + + /** DiscoveryStatus state */ + state?: (google.cloud.dataplex.v1.Asset.DiscoveryStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.DiscoveryStatus.State|null); + + /** DiscoveryStatus message */ + message?: (string|null); + + /** DiscoveryStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DiscoveryStatus lastRunTime */ + lastRunTime?: (google.protobuf.ITimestamp|null); + + /** DiscoveryStatus stats */ + stats?: (google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats|null); + + /** DiscoveryStatus lastRunDuration */ + lastRunDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a DiscoveryStatus. */ + class DiscoveryStatus implements IDiscoveryStatus { + + /** + * Constructs a new DiscoveryStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.IDiscoveryStatus); + + /** DiscoveryStatus state. */ + public state: (google.cloud.dataplex.v1.Asset.DiscoveryStatus.State|keyof typeof google.cloud.dataplex.v1.Asset.DiscoveryStatus.State); + + /** DiscoveryStatus message. */ + public message: string; + + /** DiscoveryStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DiscoveryStatus lastRunTime. */ + public lastRunTime?: (google.protobuf.ITimestamp|null); + + /** DiscoveryStatus stats. */ + public stats?: (google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats|null); + + /** DiscoveryStatus lastRunDuration. */ + public lastRunDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new DiscoveryStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns DiscoveryStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.IDiscoveryStatus): google.cloud.dataplex.v1.Asset.DiscoveryStatus; + + /** + * Encodes the specified DiscoveryStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.verify|verify} messages. + * @param message DiscoveryStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.IDiscoveryStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiscoveryStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.verify|verify} messages. + * @param message DiscoveryStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.IDiscoveryStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiscoveryStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiscoveryStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.DiscoveryStatus; + + /** + * Decodes a DiscoveryStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiscoveryStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.DiscoveryStatus; + + /** + * Verifies a DiscoveryStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiscoveryStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiscoveryStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.DiscoveryStatus; + + /** + * Creates a plain object from a DiscoveryStatus message. Also converts values to other types if specified. + * @param message DiscoveryStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.DiscoveryStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiscoveryStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiscoveryStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiscoveryStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SCHEDULED = 1, + IN_PROGRESS = 2, + PAUSED = 3, + DISABLED = 5 + } + + /** Properties of a Stats. */ + interface IStats { + + /** Stats dataItems */ + dataItems?: (number|Long|string|null); + + /** Stats dataSize */ + dataSize?: (number|Long|string|null); + + /** Stats tables */ + tables?: (number|Long|string|null); + + /** Stats filesets */ + filesets?: (number|Long|string|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats); + + /** Stats dataItems. */ + public dataItems: (number|Long|string); + + /** Stats dataSize. */ + public dataSize: (number|Long|string); + + /** Stats tables. */ + public tables: (number|Long|string); + + /** Stats filesets. */ + public filesets: (number|Long|string); + + /** + * Creates a new Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Stats instance + */ + public static create(properties?: google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats): google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.verify|verify} messages. + * @param message Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats; + + /** + * Verifies a Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @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, + CREATING = 2, + DELETING = 3, + ACTION_REQUIRED = 4 + } + + /** Represents a ContentService */ + class ContentService extends $protobuf.rpc.Service { + + /** + * Constructs a new ContentService 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 ContentService 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): ContentService; + + /** + * Calls CreateContent. + * @param request CreateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Content + */ + public createContent(request: google.cloud.dataplex.v1.ICreateContentRequest, callback: google.cloud.dataplex.v1.ContentService.CreateContentCallback): void; + + /** + * Calls CreateContent. + * @param request CreateContentRequest message or plain object + * @returns Promise + */ + public createContent(request: google.cloud.dataplex.v1.ICreateContentRequest): Promise; + + /** + * Calls UpdateContent. + * @param request UpdateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Content + */ + public updateContent(request: google.cloud.dataplex.v1.IUpdateContentRequest, callback: google.cloud.dataplex.v1.ContentService.UpdateContentCallback): void; + + /** + * Calls UpdateContent. + * @param request UpdateContentRequest message or plain object + * @returns Promise + */ + public updateContent(request: google.cloud.dataplex.v1.IUpdateContentRequest): Promise; + + /** + * Calls DeleteContent. + * @param request DeleteContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteContent(request: google.cloud.dataplex.v1.IDeleteContentRequest, callback: google.cloud.dataplex.v1.ContentService.DeleteContentCallback): void; + + /** + * Calls DeleteContent. + * @param request DeleteContentRequest message or plain object + * @returns Promise + */ + public deleteContent(request: google.cloud.dataplex.v1.IDeleteContentRequest): Promise; + + /** + * Calls GetContent. + * @param request GetContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Content + */ + public getContent(request: google.cloud.dataplex.v1.IGetContentRequest, callback: google.cloud.dataplex.v1.ContentService.GetContentCallback): void; + + /** + * Calls GetContent. + * @param request GetContentRequest message or plain object + * @returns Promise + */ + public getContent(request: google.cloud.dataplex.v1.IGetContentRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.dataplex.v1.ContentService.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.dataplex.v1.ContentService.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.dataplex.v1.ContentService.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + + /** + * Calls ListContent. + * @param request ListContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContentResponse + */ + public listContent(request: google.cloud.dataplex.v1.IListContentRequest, callback: google.cloud.dataplex.v1.ContentService.ListContentCallback): void; + + /** + * Calls ListContent. + * @param request ListContentRequest message or plain object + * @returns Promise + */ + public listContent(request: google.cloud.dataplex.v1.IListContentRequest): Promise; + } + + namespace ContentService { + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|createContent}. + * @param error Error, if any + * @param [response] Content + */ + type CreateContentCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Content) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|updateContent}. + * @param error Error, if any + * @param [response] Content + */ + type UpdateContentCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Content) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|deleteContent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteContentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|getContent}. + * @param error Error, if any + * @param [response] Content + */ + type GetContentCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Content) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|listContent}. + * @param error Error, if any + * @param [response] ListContentResponse + */ + type ListContentCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListContentResponse) => void; + } + + /** Properties of a CreateContentRequest. */ + interface ICreateContentRequest { + + /** CreateContentRequest parent */ + parent?: (string|null); + + /** CreateContentRequest content */ + content?: (google.cloud.dataplex.v1.IContent|null); + + /** CreateContentRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateContentRequest. */ + class CreateContentRequest implements ICreateContentRequest { + + /** + * Constructs a new CreateContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateContentRequest); + + /** CreateContentRequest parent. */ + public parent: string; + + /** CreateContentRequest content. */ + public content?: (google.cloud.dataplex.v1.IContent|null); + + /** CreateContentRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateContentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateContentRequest): google.cloud.dataplex.v1.CreateContentRequest; + + /** + * Encodes the specified CreateContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateContentRequest.verify|verify} messages. + * @param message CreateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateContentRequest.verify|verify} messages. + * @param message CreateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateContentRequest; + + /** + * Decodes a CreateContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateContentRequest; + + /** + * Verifies a CreateContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateContentRequest; + + /** + * Creates a plain object from a CreateContentRequest message. Also converts values to other types if specified. + * @param message CreateContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateContentRequest. */ + interface IUpdateContentRequest { + + /** UpdateContentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateContentRequest content */ + content?: (google.cloud.dataplex.v1.IContent|null); + + /** UpdateContentRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateContentRequest. */ + class UpdateContentRequest implements IUpdateContentRequest { + + /** + * Constructs a new UpdateContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateContentRequest); + + /** UpdateContentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateContentRequest content. */ + public content?: (google.cloud.dataplex.v1.IContent|null); + + /** UpdateContentRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateContentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateContentRequest): google.cloud.dataplex.v1.UpdateContentRequest; + + /** + * Encodes the specified UpdateContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateContentRequest.verify|verify} messages. + * @param message UpdateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateContentRequest.verify|verify} messages. + * @param message UpdateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateContentRequest; + + /** + * Decodes an UpdateContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateContentRequest; + + /** + * Verifies an UpdateContentRequest message. + * @param message Plain 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 UpdateContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateContentRequest; + + /** + * Creates a plain object from an UpdateContentRequest message. Also converts values to other types if specified. + * @param message UpdateContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteContentRequest. */ + interface IDeleteContentRequest { + + /** DeleteContentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteContentRequest. */ + class DeleteContentRequest implements IDeleteContentRequest { + + /** + * Constructs a new DeleteContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteContentRequest); + + /** DeleteContentRequest name. */ + public name: string; + + /** + * Creates a new DeleteContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteContentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteContentRequest): google.cloud.dataplex.v1.DeleteContentRequest; + + /** + * Encodes the specified DeleteContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteContentRequest.verify|verify} messages. + * @param message DeleteContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteContentRequest.verify|verify} messages. + * @param message DeleteContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteContentRequest; + + /** + * Decodes a DeleteContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteContentRequest; + + /** + * Verifies a DeleteContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteContentRequest; + + /** + * Creates a plain object from a DeleteContentRequest message. Also converts values to other types if specified. + * @param message DeleteContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContentRequest. */ + interface IListContentRequest { + + /** ListContentRequest parent */ + parent?: (string|null); + + /** ListContentRequest pageSize */ + pageSize?: (number|null); + + /** ListContentRequest pageToken */ + pageToken?: (string|null); + + /** ListContentRequest filter */ + filter?: (string|null); + } + + /** Represents a ListContentRequest. */ + class ListContentRequest implements IListContentRequest { + + /** + * Constructs a new ListContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListContentRequest); + + /** ListContentRequest parent. */ + public parent: string; + + /** ListContentRequest pageSize. */ + public pageSize: number; + + /** ListContentRequest pageToken. */ + public pageToken: string; + + /** ListContentRequest filter. */ + public filter: string; + + /** + * Creates a new ListContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListContentRequest): google.cloud.dataplex.v1.ListContentRequest; + + /** + * Encodes the specified ListContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListContentRequest.verify|verify} messages. + * @param message ListContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListContentRequest.verify|verify} messages. + * @param message ListContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListContentRequest; + + /** + * Decodes a ListContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListContentRequest; + + /** + * Verifies a ListContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListContentRequest; + + /** + * Creates a plain object from a ListContentRequest message. Also converts values to other types if specified. + * @param message ListContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListContentResponse. */ + interface IListContentResponse { + + /** ListContentResponse content */ + content?: (google.cloud.dataplex.v1.IContent[]|null); + + /** ListContentResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContentResponse. */ + class ListContentResponse implements IListContentResponse { + + /** + * Constructs a new ListContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListContentResponse); + + /** ListContentResponse content. */ + public content: google.cloud.dataplex.v1.IContent[]; + + /** ListContentResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContentResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListContentResponse): google.cloud.dataplex.v1.ListContentResponse; + + /** + * Encodes the specified ListContentResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListContentResponse.verify|verify} messages. + * @param message ListContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContentResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListContentResponse.verify|verify} messages. + * @param message ListContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListContentResponse; + + /** + * Decodes a ListContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListContentResponse; + + /** + * Verifies a ListContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListContentResponse; + + /** + * Creates a plain object from a ListContentResponse message. Also converts values to other types if specified. + * @param message ListContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListContentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetContentRequest. */ + interface IGetContentRequest { + + /** GetContentRequest name */ + name?: (string|null); + + /** GetContentRequest view */ + view?: (google.cloud.dataplex.v1.GetContentRequest.ContentView|keyof typeof google.cloud.dataplex.v1.GetContentRequest.ContentView|null); + } + + /** Represents a GetContentRequest. */ + class GetContentRequest implements IGetContentRequest { + + /** + * Constructs a new GetContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetContentRequest); + + /** GetContentRequest name. */ + public name: string; + + /** GetContentRequest view. */ + public view: (google.cloud.dataplex.v1.GetContentRequest.ContentView|keyof typeof google.cloud.dataplex.v1.GetContentRequest.ContentView); + + /** + * Creates a new GetContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetContentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetContentRequest): google.cloud.dataplex.v1.GetContentRequest; + + /** + * Encodes the specified GetContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetContentRequest.verify|verify} messages. + * @param message GetContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetContentRequest.verify|verify} messages. + * @param message GetContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetContentRequest; + + /** + * Decodes a GetContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetContentRequest; + + /** + * Verifies a GetContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetContentRequest; + + /** + * Creates a plain object from a GetContentRequest message. Also converts values to other types if specified. + * @param message GetContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetContentRequest { + + /** ContentView enum. */ + enum ContentView { + CONTENT_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + } + + /** Properties of a DiscoveryEvent. */ + interface IDiscoveryEvent { + + /** DiscoveryEvent message */ + message?: (string|null); + + /** DiscoveryEvent lakeId */ + lakeId?: (string|null); + + /** DiscoveryEvent zoneId */ + zoneId?: (string|null); + + /** DiscoveryEvent assetId */ + assetId?: (string|null); + + /** DiscoveryEvent dataLocation */ + dataLocation?: (string|null); + + /** DiscoveryEvent type */ + type?: (google.cloud.dataplex.v1.DiscoveryEvent.EventType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EventType|null); + + /** DiscoveryEvent config */ + config?: (google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails|null); + + /** DiscoveryEvent entity */ + entity?: (google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails|null); + + /** DiscoveryEvent partition */ + partition?: (google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails|null); + + /** DiscoveryEvent action */ + action?: (google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails|null); + } + + /** Represents a DiscoveryEvent. */ + class DiscoveryEvent implements IDiscoveryEvent { + + /** + * Constructs a new DiscoveryEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDiscoveryEvent); + + /** DiscoveryEvent message. */ + public message: string; + + /** DiscoveryEvent lakeId. */ + public lakeId: string; + + /** DiscoveryEvent zoneId. */ + public zoneId: string; + + /** DiscoveryEvent assetId. */ + public assetId: string; + + /** DiscoveryEvent dataLocation. */ + public dataLocation: string; + + /** DiscoveryEvent type. */ + public type: (google.cloud.dataplex.v1.DiscoveryEvent.EventType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EventType); + + /** DiscoveryEvent config. */ + public config?: (google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails|null); + + /** DiscoveryEvent entity. */ + public entity?: (google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails|null); + + /** DiscoveryEvent partition. */ + public partition?: (google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails|null); + + /** DiscoveryEvent action. */ + public action?: (google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails|null); + + /** DiscoveryEvent details. */ + public details?: ("config"|"entity"|"partition"|"action"); + + /** + * Creates a new DiscoveryEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DiscoveryEvent instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDiscoveryEvent): google.cloud.dataplex.v1.DiscoveryEvent; + + /** + * Encodes the specified DiscoveryEvent message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.verify|verify} messages. + * @param message DiscoveryEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDiscoveryEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiscoveryEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.verify|verify} messages. + * @param message DiscoveryEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDiscoveryEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiscoveryEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiscoveryEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DiscoveryEvent; + + /** + * Decodes a DiscoveryEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiscoveryEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DiscoveryEvent; + + /** + * Verifies a DiscoveryEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiscoveryEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiscoveryEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DiscoveryEvent; + + /** + * Creates a plain object from a DiscoveryEvent message. Also converts values to other types if specified. + * @param message DiscoveryEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DiscoveryEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiscoveryEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiscoveryEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiscoveryEvent { + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + CONFIG = 1, + ENTITY_CREATED = 2, + ENTITY_UPDATED = 3, + ENTITY_DELETED = 4, + PARTITION_CREATED = 5, + PARTITION_UPDATED = 6, + PARTITION_DELETED = 7 + } + + /** EntityType enum. */ + enum EntityType { + ENTITY_TYPE_UNSPECIFIED = 0, + TABLE = 1, + FILESET = 2 + } + + /** Properties of a ConfigDetails. */ + interface IConfigDetails { + + /** ConfigDetails parameters */ + parameters?: ({ [k: string]: string }|null); + } + + /** Represents a ConfigDetails. */ + class ConfigDetails implements IConfigDetails { + + /** + * Constructs a new ConfigDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails); + + /** ConfigDetails parameters. */ + public parameters: { [k: string]: string }; + + /** + * Creates a new ConfigDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigDetails instance + */ + public static create(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails): google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails; + + /** + * Encodes the specified ConfigDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.verify|verify} messages. + * @param message ConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.verify|verify} messages. + * @param message ConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails; + + /** + * Decodes a ConfigDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails; + + /** + * Verifies a ConfigDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails; + + /** + * Creates a plain object from a ConfigDetails message. Also converts values to other types if specified. + * @param message ConfigDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EntityDetails. */ + interface IEntityDetails { + + /** EntityDetails entity */ + entity?: (string|null); + + /** EntityDetails type */ + type?: (google.cloud.dataplex.v1.DiscoveryEvent.EntityType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EntityType|null); + } + + /** Represents an EntityDetails. */ + class EntityDetails implements IEntityDetails { + + /** + * Constructs a new EntityDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails); + + /** EntityDetails entity. */ + public entity: string; + + /** EntityDetails type. */ + public type: (google.cloud.dataplex.v1.DiscoveryEvent.EntityType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EntityType); + + /** + * Creates a new EntityDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityDetails instance + */ + public static create(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails): google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails; + + /** + * Encodes the specified EntityDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.verify|verify} messages. + * @param message EntityDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.verify|verify} messages. + * @param message EntityDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails; + + /** + * Decodes an EntityDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails; + + /** + * Verifies an EntityDetails message. + * @param message Plain 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 EntityDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails; + + /** + * Creates a plain object from an EntityDetails message. Also converts values to other types if specified. + * @param message EntityDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionDetails. */ + interface IPartitionDetails { + + /** PartitionDetails partition */ + partition?: (string|null); + + /** PartitionDetails entity */ + entity?: (string|null); + + /** PartitionDetails type */ + type?: (google.cloud.dataplex.v1.DiscoveryEvent.EntityType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EntityType|null); + + /** PartitionDetails sampledDataLocations */ + sampledDataLocations?: (string[]|null); + } + + /** Represents a PartitionDetails. */ + class PartitionDetails implements IPartitionDetails { + + /** + * Constructs a new PartitionDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails); + + /** PartitionDetails partition. */ + public partition: string; + + /** PartitionDetails entity. */ + public entity: string; + + /** PartitionDetails type. */ + public type: (google.cloud.dataplex.v1.DiscoveryEvent.EntityType|keyof typeof google.cloud.dataplex.v1.DiscoveryEvent.EntityType); + + /** PartitionDetails sampledDataLocations. */ + public sampledDataLocations: string[]; + + /** + * Creates a new PartitionDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionDetails instance + */ + public static create(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails): google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails; + + /** + * Encodes the specified PartitionDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.verify|verify} messages. + * @param message PartitionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.verify|verify} messages. + * @param message PartitionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails; + + /** + * Decodes a PartitionDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails; + + /** + * Verifies a PartitionDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails; + + /** + * Creates a plain object from a PartitionDetails message. Also converts values to other types if specified. + * @param message PartitionDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActionDetails. */ + interface IActionDetails { + + /** ActionDetails type */ + type?: (string|null); + } + + /** Represents an ActionDetails. */ + class ActionDetails implements IActionDetails { + + /** + * Constructs a new ActionDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails); + + /** ActionDetails type. */ + public type: string; + + /** + * Creates a new ActionDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionDetails instance + */ + public static create(properties?: google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails): google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails; + + /** + * Encodes the specified ActionDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.verify|verify} messages. + * @param message ActionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.verify|verify} messages. + * @param message ActionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails; + + /** + * Decodes an ActionDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails; + + /** + * Verifies an ActionDetails message. + * @param message Plain 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 ActionDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails; + + /** + * Creates a plain object from an ActionDetails message. Also converts values to other types if specified. + * @param message ActionDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a JobEvent. */ + interface IJobEvent { + + /** JobEvent message */ + message?: (string|null); + + /** JobEvent jobId */ + jobId?: (string|null); + + /** JobEvent startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** JobEvent endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** JobEvent state */ + state?: (google.cloud.dataplex.v1.JobEvent.State|keyof typeof google.cloud.dataplex.v1.JobEvent.State|null); + + /** JobEvent retries */ + retries?: (number|null); + + /** JobEvent type */ + type?: (google.cloud.dataplex.v1.JobEvent.Type|keyof typeof google.cloud.dataplex.v1.JobEvent.Type|null); + + /** JobEvent service */ + service?: (google.cloud.dataplex.v1.JobEvent.Service|keyof typeof google.cloud.dataplex.v1.JobEvent.Service|null); + + /** JobEvent serviceJob */ + serviceJob?: (string|null); + } + + /** Represents a JobEvent. */ + class JobEvent implements IJobEvent { + + /** + * Constructs a new JobEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IJobEvent); + + /** JobEvent message. */ + public message: string; + + /** JobEvent jobId. */ + public jobId: string; + + /** JobEvent startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** JobEvent endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** JobEvent state. */ + public state: (google.cloud.dataplex.v1.JobEvent.State|keyof typeof google.cloud.dataplex.v1.JobEvent.State); + + /** JobEvent retries. */ + public retries: number; + + /** JobEvent type. */ + public type: (google.cloud.dataplex.v1.JobEvent.Type|keyof typeof google.cloud.dataplex.v1.JobEvent.Type); + + /** JobEvent service. */ + public service: (google.cloud.dataplex.v1.JobEvent.Service|keyof typeof google.cloud.dataplex.v1.JobEvent.Service); + + /** JobEvent serviceJob. */ + public serviceJob: string; + + /** + * Creates a new JobEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns JobEvent instance + */ + public static create(properties?: google.cloud.dataplex.v1.IJobEvent): google.cloud.dataplex.v1.JobEvent; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.dataplex.v1.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.JobEvent.verify|verify} messages. + * @param message JobEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IJobEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.JobEvent; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.JobEvent; + + /** + * Verifies a JobEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.JobEvent; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @param message JobEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.JobEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobEvent { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SPARK = 1, + NOTEBOOK = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + CANCELLED = 3, + ABORTED = 4 + } + + /** Service enum. */ + enum Service { + SERVICE_UNSPECIFIED = 0, + DATAPROC = 1 + } + } + + /** Properties of a SessionEvent. */ + interface ISessionEvent { + + /** SessionEvent message */ + message?: (string|null); + + /** SessionEvent userId */ + userId?: (string|null); + + /** SessionEvent sessionId */ + sessionId?: (string|null); + + /** SessionEvent type */ + type?: (google.cloud.dataplex.v1.SessionEvent.EventType|keyof typeof google.cloud.dataplex.v1.SessionEvent.EventType|null); + + /** SessionEvent query */ + query?: (google.cloud.dataplex.v1.SessionEvent.IQueryDetail|null); + + /** SessionEvent eventSucceeded */ + eventSucceeded?: (boolean|null); + + /** SessionEvent fastStartupEnabled */ + fastStartupEnabled?: (boolean|null); + + /** SessionEvent unassignedDuration */ + unassignedDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a SessionEvent. */ + class SessionEvent implements ISessionEvent { + + /** + * Constructs a new SessionEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ISessionEvent); + + /** SessionEvent message. */ + public message: string; + + /** SessionEvent userId. */ + public userId: string; + + /** SessionEvent sessionId. */ + public sessionId: string; + + /** SessionEvent type. */ + public type: (google.cloud.dataplex.v1.SessionEvent.EventType|keyof typeof google.cloud.dataplex.v1.SessionEvent.EventType); + + /** SessionEvent query. */ + public query?: (google.cloud.dataplex.v1.SessionEvent.IQueryDetail|null); + + /** SessionEvent eventSucceeded. */ + public eventSucceeded: boolean; + + /** SessionEvent fastStartupEnabled. */ + public fastStartupEnabled: boolean; + + /** SessionEvent unassignedDuration. */ + public unassignedDuration?: (google.protobuf.IDuration|null); + + /** SessionEvent detail. */ + public detail?: "query"; + + /** + * Creates a new SessionEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionEvent instance + */ + public static create(properties?: google.cloud.dataplex.v1.ISessionEvent): google.cloud.dataplex.v1.SessionEvent; + + /** + * Encodes the specified SessionEvent message. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.verify|verify} messages. + * @param message SessionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ISessionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.verify|verify} messages. + * @param message SessionEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ISessionEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.SessionEvent; + + /** + * Decodes a SessionEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.SessionEvent; + + /** + * Verifies a SessionEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.SessionEvent; + + /** + * Creates a plain object from a SessionEvent message. Also converts values to other types if specified. + * @param message SessionEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.SessionEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionEvent { + + /** EventType enum. */ + enum EventType { + EVENT_TYPE_UNSPECIFIED = 0, + START = 1, + STOP = 2, + QUERY = 3, + CREATE = 4 + } + + /** Properties of a QueryDetail. */ + interface IQueryDetail { + + /** QueryDetail queryId */ + queryId?: (string|null); + + /** QueryDetail queryText */ + queryText?: (string|null); + + /** QueryDetail engine */ + engine?: (google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine|keyof typeof google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine|null); + + /** QueryDetail duration */ + duration?: (google.protobuf.IDuration|null); + + /** QueryDetail resultSizeBytes */ + resultSizeBytes?: (number|Long|string|null); + + /** QueryDetail dataProcessedBytes */ + dataProcessedBytes?: (number|Long|string|null); + } + + /** Represents a QueryDetail. */ + class QueryDetail implements IQueryDetail { + + /** + * Constructs a new QueryDetail. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.SessionEvent.IQueryDetail); + + /** QueryDetail queryId. */ + public queryId: string; + + /** QueryDetail queryText. */ + public queryText: string; + + /** QueryDetail engine. */ + public engine: (google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine|keyof typeof google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine); + + /** QueryDetail duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** QueryDetail resultSizeBytes. */ + public resultSizeBytes: (number|Long|string); + + /** QueryDetail dataProcessedBytes. */ + public dataProcessedBytes: (number|Long|string); + + /** + * Creates a new QueryDetail instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryDetail instance + */ + public static create(properties?: google.cloud.dataplex.v1.SessionEvent.IQueryDetail): google.cloud.dataplex.v1.SessionEvent.QueryDetail; + + /** + * Encodes the specified QueryDetail message. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.QueryDetail.verify|verify} messages. + * @param message QueryDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.SessionEvent.IQueryDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryDetail message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.QueryDetail.verify|verify} messages. + * @param message QueryDetail message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.SessionEvent.IQueryDetail, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryDetail message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.SessionEvent.QueryDetail; + + /** + * Decodes a QueryDetail message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.SessionEvent.QueryDetail; + + /** + * Verifies a QueryDetail message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryDetail message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryDetail + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.SessionEvent.QueryDetail; + + /** + * Creates a plain object from a QueryDetail message. Also converts values to other types if specified. + * @param message QueryDetail + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.SessionEvent.QueryDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryDetail to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryDetail + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryDetail { + + /** Engine enum. */ + enum Engine { + ENGINE_UNSPECIFIED = 0, + SPARK_SQL = 1, + BIGQUERY = 2 + } + } + } + + /** Represents a MetadataService */ + class MetadataService extends $protobuf.rpc.Service { + + /** + * Constructs a new MetadataService 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 MetadataService 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): MetadataService; + + /** + * Calls CreateEntity. + * @param request CreateEntityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Entity + */ + public createEntity(request: google.cloud.dataplex.v1.ICreateEntityRequest, callback: google.cloud.dataplex.v1.MetadataService.CreateEntityCallback): void; + + /** + * Calls CreateEntity. + * @param request CreateEntityRequest message or plain object + * @returns Promise + */ + public createEntity(request: google.cloud.dataplex.v1.ICreateEntityRequest): Promise; + + /** + * Calls UpdateEntity. + * @param request UpdateEntityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Entity + */ + public updateEntity(request: google.cloud.dataplex.v1.IUpdateEntityRequest, callback: google.cloud.dataplex.v1.MetadataService.UpdateEntityCallback): void; + + /** + * Calls UpdateEntity. + * @param request UpdateEntityRequest message or plain object + * @returns Promise + */ + public updateEntity(request: google.cloud.dataplex.v1.IUpdateEntityRequest): Promise; + + /** + * Calls DeleteEntity. + * @param request DeleteEntityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEntity(request: google.cloud.dataplex.v1.IDeleteEntityRequest, callback: google.cloud.dataplex.v1.MetadataService.DeleteEntityCallback): void; + + /** + * Calls DeleteEntity. + * @param request DeleteEntityRequest message or plain object + * @returns Promise + */ + public deleteEntity(request: google.cloud.dataplex.v1.IDeleteEntityRequest): Promise; + + /** + * Calls GetEntity. + * @param request GetEntityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Entity + */ + public getEntity(request: google.cloud.dataplex.v1.IGetEntityRequest, callback: google.cloud.dataplex.v1.MetadataService.GetEntityCallback): void; + + /** + * Calls GetEntity. + * @param request GetEntityRequest message or plain object + * @returns Promise + */ + public getEntity(request: google.cloud.dataplex.v1.IGetEntityRequest): Promise; + + /** + * Calls ListEntities. + * @param request ListEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntitiesResponse + */ + public listEntities(request: google.cloud.dataplex.v1.IListEntitiesRequest, callback: google.cloud.dataplex.v1.MetadataService.ListEntitiesCallback): void; + + /** + * Calls ListEntities. + * @param request ListEntitiesRequest message or plain object + * @returns Promise + */ + public listEntities(request: google.cloud.dataplex.v1.IListEntitiesRequest): Promise; + + /** + * Calls CreatePartition. + * @param request CreatePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Partition + */ + public createPartition(request: google.cloud.dataplex.v1.ICreatePartitionRequest, callback: google.cloud.dataplex.v1.MetadataService.CreatePartitionCallback): void; + + /** + * Calls CreatePartition. + * @param request CreatePartitionRequest message or plain object + * @returns Promise + */ + public createPartition(request: google.cloud.dataplex.v1.ICreatePartitionRequest): Promise; + + /** + * Calls DeletePartition. + * @param request DeletePartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePartition(request: google.cloud.dataplex.v1.IDeletePartitionRequest, callback: google.cloud.dataplex.v1.MetadataService.DeletePartitionCallback): void; + + /** + * Calls DeletePartition. + * @param request DeletePartitionRequest message or plain object + * @returns Promise + */ + public deletePartition(request: google.cloud.dataplex.v1.IDeletePartitionRequest): Promise; + + /** + * Calls GetPartition. + * @param request GetPartitionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Partition + */ + public getPartition(request: google.cloud.dataplex.v1.IGetPartitionRequest, callback: google.cloud.dataplex.v1.MetadataService.GetPartitionCallback): void; + + /** + * Calls GetPartition. + * @param request GetPartitionRequest message or plain object + * @returns Promise + */ + public getPartition(request: google.cloud.dataplex.v1.IGetPartitionRequest): Promise; + + /** + * Calls ListPartitions. + * @param request ListPartitionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPartitionsResponse + */ + public listPartitions(request: google.cloud.dataplex.v1.IListPartitionsRequest, callback: google.cloud.dataplex.v1.MetadataService.ListPartitionsCallback): void; + + /** + * Calls ListPartitions. + * @param request ListPartitionsRequest message or plain object + * @returns Promise + */ + public listPartitions(request: google.cloud.dataplex.v1.IListPartitionsRequest): Promise; + } + + namespace MetadataService { + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|createEntity}. + * @param error Error, if any + * @param [response] Entity + */ + type CreateEntityCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Entity) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|updateEntity}. + * @param error Error, if any + * @param [response] Entity + */ + type UpdateEntityCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Entity) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|deleteEntity}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEntityCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|getEntity}. + * @param error Error, if any + * @param [response] Entity + */ + type GetEntityCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Entity) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|listEntities}. + * @param error Error, if any + * @param [response] ListEntitiesResponse + */ + type ListEntitiesCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListEntitiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|createPartition}. + * @param error Error, if any + * @param [response] Partition + */ + type CreatePartitionCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Partition) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|deletePartition}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePartitionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|getPartition}. + * @param error Error, if any + * @param [response] Partition + */ + type GetPartitionCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Partition) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|listPartitions}. + * @param error Error, if any + * @param [response] ListPartitionsResponse + */ + type ListPartitionsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListPartitionsResponse) => void; + } + + /** Properties of a CreateEntityRequest. */ + interface ICreateEntityRequest { + + /** CreateEntityRequest parent */ + parent?: (string|null); + + /** CreateEntityRequest entity */ + entity?: (google.cloud.dataplex.v1.IEntity|null); + + /** CreateEntityRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateEntityRequest. */ + class CreateEntityRequest implements ICreateEntityRequest { + + /** + * Constructs a new CreateEntityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateEntityRequest); + + /** CreateEntityRequest parent. */ + public parent: string; + + /** CreateEntityRequest entity. */ + public entity?: (google.cloud.dataplex.v1.IEntity|null); + + /** CreateEntityRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateEntityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntityRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateEntityRequest): google.cloud.dataplex.v1.CreateEntityRequest; + + /** + * Encodes the specified CreateEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateEntityRequest.verify|verify} messages. + * @param message CreateEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateEntityRequest.verify|verify} messages. + * @param message CreateEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateEntityRequest; + + /** + * Decodes a CreateEntityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateEntityRequest; + + /** + * Verifies a CreateEntityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEntityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateEntityRequest; + + /** + * Creates a plain object from a CreateEntityRequest message. Also converts values to other types if specified. + * @param message CreateEntityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateEntityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEntityRequest. */ + interface IUpdateEntityRequest { + + /** UpdateEntityRequest entity */ + entity?: (google.cloud.dataplex.v1.IEntity|null); + + /** UpdateEntityRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateEntityRequest. */ + class UpdateEntityRequest implements IUpdateEntityRequest { + + /** + * Constructs a new UpdateEntityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateEntityRequest); + + /** UpdateEntityRequest entity. */ + public entity?: (google.cloud.dataplex.v1.IEntity|null); + + /** UpdateEntityRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateEntityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEntityRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateEntityRequest): google.cloud.dataplex.v1.UpdateEntityRequest; + + /** + * Encodes the specified UpdateEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEntityRequest.verify|verify} messages. + * @param message UpdateEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEntityRequest.verify|verify} messages. + * @param message UpdateEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEntityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateEntityRequest; + + /** + * Decodes an UpdateEntityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateEntityRequest; + + /** + * Verifies an UpdateEntityRequest message. + * @param message Plain 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 UpdateEntityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEntityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateEntityRequest; + + /** + * Creates a plain object from an UpdateEntityRequest message. Also converts values to other types if specified. + * @param message UpdateEntityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateEntityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEntityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEntityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEntityRequest. */ + interface IDeleteEntityRequest { + + /** DeleteEntityRequest name */ + name?: (string|null); + + /** DeleteEntityRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteEntityRequest. */ + class DeleteEntityRequest implements IDeleteEntityRequest { + + /** + * Constructs a new DeleteEntityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteEntityRequest); + + /** DeleteEntityRequest name. */ + public name: string; + + /** DeleteEntityRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteEntityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEntityRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteEntityRequest): google.cloud.dataplex.v1.DeleteEntityRequest; + + /** + * Encodes the specified DeleteEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEntityRequest.verify|verify} messages. + * @param message DeleteEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEntityRequest.verify|verify} messages. + * @param message DeleteEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEntityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteEntityRequest; + + /** + * Decodes a DeleteEntityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteEntityRequest; + + /** + * Verifies a DeleteEntityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEntityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEntityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteEntityRequest; + + /** + * Creates a plain object from a DeleteEntityRequest message. Also converts values to other types if specified. + * @param message DeleteEntityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteEntityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEntityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEntityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntitiesRequest. */ + interface IListEntitiesRequest { + + /** ListEntitiesRequest parent */ + parent?: (string|null); + + /** ListEntitiesRequest view */ + view?: (google.cloud.dataplex.v1.ListEntitiesRequest.EntityView|keyof typeof google.cloud.dataplex.v1.ListEntitiesRequest.EntityView|null); + + /** ListEntitiesRequest pageSize */ + pageSize?: (number|null); + + /** ListEntitiesRequest pageToken */ + pageToken?: (string|null); + + /** ListEntitiesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListEntitiesRequest. */ + class ListEntitiesRequest implements IListEntitiesRequest { + + /** + * Constructs a new ListEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListEntitiesRequest); + + /** ListEntitiesRequest parent. */ + public parent: string; + + /** ListEntitiesRequest view. */ + public view: (google.cloud.dataplex.v1.ListEntitiesRequest.EntityView|keyof typeof google.cloud.dataplex.v1.ListEntitiesRequest.EntityView); + + /** ListEntitiesRequest pageSize. */ + public pageSize: number; + + /** ListEntitiesRequest pageToken. */ + public pageToken: string; + + /** ListEntitiesRequest filter. */ + public filter: string; + + /** + * Creates a new ListEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntitiesRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListEntitiesRequest): google.cloud.dataplex.v1.ListEntitiesRequest; + + /** + * Encodes the specified ListEntitiesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesRequest.verify|verify} messages. + * @param message ListEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesRequest.verify|verify} messages. + * @param message ListEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListEntitiesRequest; + + /** + * Decodes a ListEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListEntitiesRequest; + + /** + * Verifies a ListEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListEntitiesRequest; + + /** + * Creates a plain object from a ListEntitiesRequest message. Also converts values to other types if specified. + * @param message ListEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntitiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListEntitiesRequest { + + /** EntityView enum. */ + enum EntityView { + ENTITY_VIEW_UNSPECIFIED = 0, + TABLES = 1, + FILESETS = 2 + } + } + + /** Properties of a ListEntitiesResponse. */ + interface IListEntitiesResponse { + + /** ListEntitiesResponse entities */ + entities?: (google.cloud.dataplex.v1.IEntity[]|null); + + /** ListEntitiesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEntitiesResponse. */ + class ListEntitiesResponse implements IListEntitiesResponse { + + /** + * Constructs a new ListEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListEntitiesResponse); + + /** ListEntitiesResponse entities. */ + public entities: google.cloud.dataplex.v1.IEntity[]; + + /** ListEntitiesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntitiesResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListEntitiesResponse): google.cloud.dataplex.v1.ListEntitiesResponse; + + /** + * Encodes the specified ListEntitiesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesResponse.verify|verify} messages. + * @param message ListEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesResponse.verify|verify} messages. + * @param message ListEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListEntitiesResponse; + + /** + * Decodes a ListEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListEntitiesResponse; + + /** + * Verifies a ListEntitiesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListEntitiesResponse; + + /** + * Creates a plain object from a ListEntitiesResponse message. Also converts values to other types if specified. + * @param message ListEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntitiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEntityRequest. */ + interface IGetEntityRequest { + + /** GetEntityRequest name */ + name?: (string|null); + + /** GetEntityRequest view */ + view?: (google.cloud.dataplex.v1.GetEntityRequest.EntityView|keyof typeof google.cloud.dataplex.v1.GetEntityRequest.EntityView|null); + } + + /** Represents a GetEntityRequest. */ + class GetEntityRequest implements IGetEntityRequest { + + /** + * Constructs a new GetEntityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetEntityRequest); + + /** GetEntityRequest name. */ + public name: string; + + /** GetEntityRequest view. */ + public view: (google.cloud.dataplex.v1.GetEntityRequest.EntityView|keyof typeof google.cloud.dataplex.v1.GetEntityRequest.EntityView); + + /** + * Creates a new GetEntityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEntityRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetEntityRequest): google.cloud.dataplex.v1.GetEntityRequest; + + /** + * Encodes the specified GetEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetEntityRequest.verify|verify} messages. + * @param message GetEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetEntityRequest.verify|verify} messages. + * @param message GetEntityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetEntityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEntityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetEntityRequest; + + /** + * Decodes a GetEntityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetEntityRequest; + + /** + * Verifies a GetEntityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEntityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEntityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetEntityRequest; + + /** + * Creates a plain object from a GetEntityRequest message. Also converts values to other types if specified. + * @param message GetEntityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetEntityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEntityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEntityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetEntityRequest { + + /** EntityView enum. */ + enum EntityView { + ENTITY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + SCHEMA = 2, + FULL = 4 + } + } + + /** Properties of a ListPartitionsRequest. */ + interface IListPartitionsRequest { + + /** ListPartitionsRequest parent */ + parent?: (string|null); + + /** ListPartitionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPartitionsRequest pageToken */ + pageToken?: (string|null); + + /** ListPartitionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListPartitionsRequest. */ + class ListPartitionsRequest implements IListPartitionsRequest { + + /** + * Constructs a new ListPartitionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListPartitionsRequest); + + /** ListPartitionsRequest parent. */ + public parent: string; + + /** ListPartitionsRequest pageSize. */ + public pageSize: number; + + /** ListPartitionsRequest pageToken. */ + public pageToken: string; + + /** ListPartitionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListPartitionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPartitionsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListPartitionsRequest): google.cloud.dataplex.v1.ListPartitionsRequest; + + /** + * Encodes the specified ListPartitionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsRequest.verify|verify} messages. + * @param message ListPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPartitionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsRequest.verify|verify} messages. + * @param message ListPartitionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListPartitionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPartitionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListPartitionsRequest; + + /** + * Decodes a ListPartitionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListPartitionsRequest; + + /** + * Verifies a ListPartitionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPartitionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListPartitionsRequest; + + /** + * Creates a plain object from a ListPartitionsRequest message. Also converts values to other types if specified. + * @param message ListPartitionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListPartitionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPartitionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPartitionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePartitionRequest. */ + interface ICreatePartitionRequest { + + /** CreatePartitionRequest parent */ + parent?: (string|null); + + /** CreatePartitionRequest partition */ + partition?: (google.cloud.dataplex.v1.IPartition|null); + + /** CreatePartitionRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreatePartitionRequest. */ + class CreatePartitionRequest implements ICreatePartitionRequest { + + /** + * Constructs a new CreatePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreatePartitionRequest); + + /** CreatePartitionRequest parent. */ + public parent: string; + + /** CreatePartitionRequest partition. */ + public partition?: (google.cloud.dataplex.v1.IPartition|null); + + /** CreatePartitionRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreatePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePartitionRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreatePartitionRequest): google.cloud.dataplex.v1.CreatePartitionRequest; + + /** + * Encodes the specified CreatePartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreatePartitionRequest.verify|verify} messages. + * @param message CreatePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreatePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreatePartitionRequest.verify|verify} messages. + * @param message CreatePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreatePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreatePartitionRequest; + + /** + * Decodes a CreatePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreatePartitionRequest; + + /** + * Verifies a CreatePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreatePartitionRequest; + + /** + * Creates a plain object from a CreatePartitionRequest message. Also converts values to other types if specified. + * @param message CreatePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreatePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePartitionRequest. */ + interface IDeletePartitionRequest { + + /** DeletePartitionRequest name */ + name?: (string|null); + + /** DeletePartitionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeletePartitionRequest. */ + class DeletePartitionRequest implements IDeletePartitionRequest { + + /** + * Constructs a new DeletePartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeletePartitionRequest); + + /** DeletePartitionRequest name. */ + public name: string; + + /** DeletePartitionRequest etag. */ + public etag: string; + + /** + * Creates a new DeletePartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePartitionRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeletePartitionRequest): google.cloud.dataplex.v1.DeletePartitionRequest; + + /** + * Encodes the specified DeletePartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeletePartitionRequest.verify|verify} messages. + * @param message DeletePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeletePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeletePartitionRequest.verify|verify} messages. + * @param message DeletePartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeletePartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeletePartitionRequest; + + /** + * Decodes a DeletePartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeletePartitionRequest; + + /** + * Verifies a DeletePartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeletePartitionRequest; + + /** + * Creates a plain object from a DeletePartitionRequest message. Also converts values to other types if specified. + * @param message DeletePartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeletePartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPartitionsResponse. */ + interface IListPartitionsResponse { + + /** ListPartitionsResponse partitions */ + partitions?: (google.cloud.dataplex.v1.IPartition[]|null); + + /** ListPartitionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPartitionsResponse. */ + class ListPartitionsResponse implements IListPartitionsResponse { + + /** + * Constructs a new ListPartitionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListPartitionsResponse); + + /** ListPartitionsResponse partitions. */ + public partitions: google.cloud.dataplex.v1.IPartition[]; + + /** ListPartitionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPartitionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPartitionsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListPartitionsResponse): google.cloud.dataplex.v1.ListPartitionsResponse; + + /** + * Encodes the specified ListPartitionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsResponse.verify|verify} messages. + * @param message ListPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPartitionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsResponse.verify|verify} messages. + * @param message ListPartitionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListPartitionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPartitionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListPartitionsResponse; + + /** + * Decodes a ListPartitionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListPartitionsResponse; + + /** + * Verifies a ListPartitionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPartitionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListPartitionsResponse; + + /** + * Creates a plain object from a ListPartitionsResponse message. Also converts values to other types if specified. + * @param message ListPartitionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListPartitionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPartitionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPartitionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPartitionRequest. */ + interface IGetPartitionRequest { + + /** GetPartitionRequest name */ + name?: (string|null); + } + + /** Represents a GetPartitionRequest. */ + class GetPartitionRequest implements IGetPartitionRequest { + + /** + * Constructs a new GetPartitionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetPartitionRequest); + + /** GetPartitionRequest name. */ + public name: string; + + /** + * Creates a new GetPartitionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPartitionRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetPartitionRequest): google.cloud.dataplex.v1.GetPartitionRequest; + + /** + * Encodes the specified GetPartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetPartitionRequest.verify|verify} messages. + * @param message GetPartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetPartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetPartitionRequest.verify|verify} messages. + * @param message GetPartitionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetPartitionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPartitionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetPartitionRequest; + + /** + * Decodes a GetPartitionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetPartitionRequest; + + /** + * Verifies a GetPartitionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPartitionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPartitionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetPartitionRequest; + + /** + * Creates a plain object from a GetPartitionRequest message. Also converts values to other types if specified. + * @param message GetPartitionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetPartitionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPartitionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPartitionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity name */ + name?: (string|null); + + /** Entity displayName */ + displayName?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Entity updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Entity id */ + id?: (string|null); + + /** Entity etag */ + etag?: (string|null); + + /** Entity type */ + type?: (google.cloud.dataplex.v1.Entity.Type|keyof typeof google.cloud.dataplex.v1.Entity.Type|null); + + /** Entity asset */ + asset?: (string|null); + + /** Entity dataPath */ + dataPath?: (string|null); + + /** Entity dataPathPattern */ + dataPathPattern?: (string|null); + + /** Entity catalogEntry */ + catalogEntry?: (string|null); + + /** Entity system */ + system?: (google.cloud.dataplex.v1.StorageSystem|keyof typeof google.cloud.dataplex.v1.StorageSystem|null); + + /** Entity format */ + format?: (google.cloud.dataplex.v1.IStorageFormat|null); + + /** Entity compatibility */ + compatibility?: (google.cloud.dataplex.v1.Entity.ICompatibilityStatus|null); + + /** Entity schema */ + schema?: (google.cloud.dataplex.v1.ISchema|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IEntity); + + /** Entity name. */ + public name: string; + + /** Entity displayName. */ + public displayName: string; + + /** Entity description. */ + public description: string; + + /** Entity createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Entity updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Entity id. */ + public id: string; + + /** Entity etag. */ + public etag: string; + + /** Entity type. */ + public type: (google.cloud.dataplex.v1.Entity.Type|keyof typeof google.cloud.dataplex.v1.Entity.Type); + + /** Entity asset. */ + public asset: string; + + /** Entity dataPath. */ + public dataPath: string; + + /** Entity dataPathPattern. */ + public dataPathPattern: string; + + /** Entity catalogEntry. */ + public catalogEntry: string; + + /** Entity system. */ + public system: (google.cloud.dataplex.v1.StorageSystem|keyof typeof google.cloud.dataplex.v1.StorageSystem); + + /** Entity format. */ + public format?: (google.cloud.dataplex.v1.IStorageFormat|null); + + /** Entity compatibility. */ + public compatibility?: (google.cloud.dataplex.v1.Entity.ICompatibilityStatus|null); + + /** Entity schema. */ + public schema?: (google.cloud.dataplex.v1.ISchema|null); + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dataplex.v1.IEntity): google.cloud.dataplex.v1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entity { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TABLE = 1, + FILESET = 2 + } + + /** Properties of a CompatibilityStatus. */ + interface ICompatibilityStatus { + + /** CompatibilityStatus hiveMetastore */ + hiveMetastore?: (google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null); + + /** CompatibilityStatus bigquery */ + bigquery?: (google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null); + } + + /** Represents a CompatibilityStatus. */ + class CompatibilityStatus implements ICompatibilityStatus { + + /** + * Constructs a new CompatibilityStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Entity.ICompatibilityStatus); + + /** CompatibilityStatus hiveMetastore. */ + public hiveMetastore?: (google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null); + + /** CompatibilityStatus bigquery. */ + public bigquery?: (google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null); + + /** + * Creates a new CompatibilityStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns CompatibilityStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Entity.ICompatibilityStatus): google.cloud.dataplex.v1.Entity.CompatibilityStatus; + + /** + * Encodes the specified CompatibilityStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.verify|verify} messages. + * @param message CompatibilityStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Entity.ICompatibilityStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompatibilityStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.verify|verify} messages. + * @param message CompatibilityStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Entity.ICompatibilityStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompatibilityStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompatibilityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Entity.CompatibilityStatus; + + /** + * Decodes a CompatibilityStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompatibilityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Entity.CompatibilityStatus; + + /** + * Verifies a CompatibilityStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompatibilityStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompatibilityStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Entity.CompatibilityStatus; + + /** + * Creates a plain object from a CompatibilityStatus message. Also converts values to other types if specified. + * @param message CompatibilityStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Entity.CompatibilityStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompatibilityStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompatibilityStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CompatibilityStatus { + + /** Properties of a Compatibility. */ + interface ICompatibility { + + /** Compatibility compatible */ + compatible?: (boolean|null); + + /** Compatibility reason */ + reason?: (string|null); + } + + /** Represents a Compatibility. */ + class Compatibility implements ICompatibility { + + /** + * Constructs a new Compatibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility); + + /** Compatibility compatible. */ + public compatible: boolean; + + /** Compatibility reason. */ + public reason: string; + + /** + * Creates a new Compatibility instance using the specified properties. + * @param [properties] Properties to set + * @returns Compatibility instance + */ + public static create(properties?: google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility): google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility; + + /** + * Encodes the specified Compatibility message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify|verify} messages. + * @param message Compatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Compatibility message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify|verify} messages. + * @param message Compatibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Compatibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Compatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility; + + /** + * Decodes a Compatibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Compatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility; + + /** + * Verifies a Compatibility message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Compatibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Compatibility + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility; + + /** + * Creates a plain object from a Compatibility message. Also converts values to other types if specified. + * @param message Compatibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Compatibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Compatibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Partition. */ + interface IPartition { + + /** Partition name */ + name?: (string|null); + + /** Partition values */ + values?: (string[]|null); + + /** Partition location */ + location?: (string|null); + + /** Partition etag */ + etag?: (string|null); + } + + /** Represents a Partition. */ + class Partition implements IPartition { + + /** + * Constructs a new Partition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IPartition); + + /** Partition name. */ + public name: string; + + /** Partition values. */ + public values: string[]; + + /** Partition location. */ + public location: string; + + /** Partition etag. */ + public etag: string; + + /** + * Creates a new Partition instance using the specified properties. + * @param [properties] Properties to set + * @returns Partition instance + */ + public static create(properties?: google.cloud.dataplex.v1.IPartition): google.cloud.dataplex.v1.Partition; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.cloud.dataplex.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Partition.verify|verify} messages. + * @param message Partition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IPartition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Partition; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Partition; + + /** + * Verifies a Partition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Partition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Partition; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @param message Partition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Partition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Partition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Partition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema userManaged */ + userManaged?: (boolean|null); + + /** Schema fields */ + fields?: (google.cloud.dataplex.v1.Schema.ISchemaField[]|null); + + /** Schema partitionFields */ + partitionFields?: (google.cloud.dataplex.v1.Schema.IPartitionField[]|null); + + /** Schema partitionStyle */ + partitionStyle?: (google.cloud.dataplex.v1.Schema.PartitionStyle|keyof typeof google.cloud.dataplex.v1.Schema.PartitionStyle|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ISchema); + + /** Schema userManaged. */ + public userManaged: boolean; + + /** Schema fields. */ + public fields: google.cloud.dataplex.v1.Schema.ISchemaField[]; + + /** Schema partitionFields. */ + public partitionFields: google.cloud.dataplex.v1.Schema.IPartitionField[]; + + /** Schema partitionStyle. */ + public partitionStyle: (google.cloud.dataplex.v1.Schema.PartitionStyle|keyof typeof google.cloud.dataplex.v1.Schema.PartitionStyle); + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.cloud.dataplex.v1.ISchema): google.cloud.dataplex.v1.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.dataplex.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.cloud.dataplex.v1.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.dataplex.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.cloud.dataplex.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.cloud.dataplex.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.cloud.dataplex.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.cloud.dataplex.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.cloud.dataplex.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, + BOOLEAN = 1, + BYTE = 2, + INT16 = 3, + INT32 = 4, + INT64 = 5, + FLOAT = 6, + DOUBLE = 7, + DECIMAL = 8, + STRING = 9, + BINARY = 10, + TIMESTAMP = 11, + DATE = 12, + TIME = 13, + RECORD = 14, + NULL = 100 + } + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + REQUIRED = 1, + NULLABLE = 2, + REPEATED = 3 + } + + /** Properties of a SchemaField. */ + interface ISchemaField { + + /** SchemaField name */ + name?: (string|null); + + /** SchemaField description */ + description?: (string|null); + + /** SchemaField type */ + type?: (google.cloud.dataplex.v1.Schema.Type|keyof typeof google.cloud.dataplex.v1.Schema.Type|null); + + /** SchemaField mode */ + mode?: (google.cloud.dataplex.v1.Schema.Mode|keyof typeof google.cloud.dataplex.v1.Schema.Mode|null); + + /** SchemaField fields */ + fields?: (google.cloud.dataplex.v1.Schema.ISchemaField[]|null); + } + + /** Represents a SchemaField. */ + class SchemaField implements ISchemaField { + + /** + * Constructs a new SchemaField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Schema.ISchemaField); + + /** SchemaField name. */ + public name: string; + + /** SchemaField description. */ + public description: string; + + /** SchemaField type. */ + public type: (google.cloud.dataplex.v1.Schema.Type|keyof typeof google.cloud.dataplex.v1.Schema.Type); + + /** SchemaField mode. */ + public mode: (google.cloud.dataplex.v1.Schema.Mode|keyof typeof google.cloud.dataplex.v1.Schema.Mode); + + /** SchemaField fields. */ + public fields: google.cloud.dataplex.v1.Schema.ISchemaField[]; + + /** + * Creates a new SchemaField instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaField instance + */ + public static create(properties?: google.cloud.dataplex.v1.Schema.ISchemaField): google.cloud.dataplex.v1.Schema.SchemaField; + + /** + * Encodes the specified SchemaField message. Does not implicitly {@link google.cloud.dataplex.v1.Schema.SchemaField.verify|verify} messages. + * @param message SchemaField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Schema.ISchemaField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaField message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Schema.SchemaField.verify|verify} messages. + * @param message SchemaField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Schema.ISchemaField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Schema.SchemaField; + + /** + * Decodes a SchemaField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Schema.SchemaField; + + /** + * Verifies a SchemaField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchemaField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Schema.SchemaField; + + /** + * Creates a plain object from a SchemaField message. Also converts values to other types if specified. + * @param message SchemaField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Schema.SchemaField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionField. */ + interface IPartitionField { + + /** PartitionField name */ + name?: (string|null); + + /** PartitionField type */ + type?: (google.cloud.dataplex.v1.Schema.Type|keyof typeof google.cloud.dataplex.v1.Schema.Type|null); + } + + /** Represents a PartitionField. */ + class PartitionField implements IPartitionField { + + /** + * Constructs a new PartitionField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Schema.IPartitionField); + + /** PartitionField name. */ + public name: string; + + /** PartitionField type. */ + public type: (google.cloud.dataplex.v1.Schema.Type|keyof typeof google.cloud.dataplex.v1.Schema.Type); + + /** + * Creates a new PartitionField instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionField instance + */ + public static create(properties?: google.cloud.dataplex.v1.Schema.IPartitionField): google.cloud.dataplex.v1.Schema.PartitionField; + + /** + * Encodes the specified PartitionField message. Does not implicitly {@link google.cloud.dataplex.v1.Schema.PartitionField.verify|verify} messages. + * @param message PartitionField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Schema.IPartitionField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionField message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Schema.PartitionField.verify|verify} messages. + * @param message PartitionField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Schema.IPartitionField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Schema.PartitionField; + + /** + * Decodes a PartitionField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Schema.PartitionField; + + /** + * Verifies a PartitionField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Schema.PartitionField; + + /** + * Creates a plain object from a PartitionField message. Also converts values to other types if specified. + * @param message PartitionField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Schema.PartitionField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PartitionStyle enum. */ + enum PartitionStyle { + PARTITION_STYLE_UNSPECIFIED = 0, + HIVE_COMPATIBLE = 1 + } + } + + /** Properties of a StorageFormat. */ + interface IStorageFormat { + + /** StorageFormat format */ + format?: (google.cloud.dataplex.v1.StorageFormat.Format|keyof typeof google.cloud.dataplex.v1.StorageFormat.Format|null); + + /** StorageFormat compressionFormat */ + compressionFormat?: (google.cloud.dataplex.v1.StorageFormat.CompressionFormat|keyof typeof google.cloud.dataplex.v1.StorageFormat.CompressionFormat|null); + + /** StorageFormat mimeType */ + mimeType?: (string|null); + + /** StorageFormat csv */ + csv?: (google.cloud.dataplex.v1.StorageFormat.ICsvOptions|null); + + /** StorageFormat json */ + json?: (google.cloud.dataplex.v1.StorageFormat.IJsonOptions|null); + } + + /** Represents a StorageFormat. */ + class StorageFormat implements IStorageFormat { + + /** + * Constructs a new StorageFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IStorageFormat); + + /** StorageFormat format. */ + public format: (google.cloud.dataplex.v1.StorageFormat.Format|keyof typeof google.cloud.dataplex.v1.StorageFormat.Format); + + /** StorageFormat compressionFormat. */ + public compressionFormat: (google.cloud.dataplex.v1.StorageFormat.CompressionFormat|keyof typeof google.cloud.dataplex.v1.StorageFormat.CompressionFormat); + + /** StorageFormat mimeType. */ + public mimeType: string; + + /** StorageFormat csv. */ + public csv?: (google.cloud.dataplex.v1.StorageFormat.ICsvOptions|null); + + /** StorageFormat json. */ + public json?: (google.cloud.dataplex.v1.StorageFormat.IJsonOptions|null); + + /** StorageFormat options. */ + public options?: ("csv"|"json"); + + /** + * Creates a new StorageFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageFormat instance + */ + public static create(properties?: google.cloud.dataplex.v1.IStorageFormat): google.cloud.dataplex.v1.StorageFormat; + + /** + * Encodes the specified StorageFormat message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.verify|verify} messages. + * @param message StorageFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IStorageFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageFormat message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.verify|verify} messages. + * @param message StorageFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IStorageFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.StorageFormat; + + /** + * Decodes a StorageFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.StorageFormat; + + /** + * Verifies a StorageFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageFormat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.StorageFormat; + + /** + * Creates a plain object from a StorageFormat message. Also converts values to other types if specified. + * @param message StorageFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.StorageFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StorageFormat { + + /** Properties of a CsvOptions. */ + interface ICsvOptions { + + /** CsvOptions encoding */ + encoding?: (string|null); + + /** CsvOptions headerRows */ + headerRows?: (number|null); + + /** CsvOptions delimiter */ + delimiter?: (string|null); + + /** CsvOptions quote */ + quote?: (string|null); + } + + /** Represents a CsvOptions. */ + class CsvOptions implements ICsvOptions { + + /** + * Constructs a new CsvOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.StorageFormat.ICsvOptions); + + /** CsvOptions encoding. */ + public encoding: string; + + /** CsvOptions headerRows. */ + public headerRows: number; + + /** CsvOptions delimiter. */ + public delimiter: string; + + /** CsvOptions quote. */ + public quote: string; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.StorageFormat.ICsvOptions): google.cloud.dataplex.v1.StorageFormat.CsvOptions; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.StorageFormat.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.StorageFormat.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.StorageFormat.CsvOptions; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.StorageFormat.CsvOptions; + + /** + * Verifies a CsvOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.StorageFormat.CsvOptions; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @param message CsvOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.StorageFormat.CsvOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JsonOptions. */ + interface IJsonOptions { + + /** JsonOptions encoding */ + encoding?: (string|null); + } + + /** Represents a JsonOptions. */ + class JsonOptions implements IJsonOptions { + + /** + * Constructs a new JsonOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.StorageFormat.IJsonOptions); + + /** JsonOptions encoding. */ + public encoding: string; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns JsonOptions instance + */ + public static create(properties?: google.cloud.dataplex.v1.StorageFormat.IJsonOptions): google.cloud.dataplex.v1.StorageFormat.JsonOptions; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.StorageFormat.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.StorageFormat.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.StorageFormat.JsonOptions; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.StorageFormat.JsonOptions; + + /** + * Verifies a JsonOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JsonOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.StorageFormat.JsonOptions; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @param message JsonOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.StorageFormat.JsonOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JsonOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JsonOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + PARQUET = 1, + AVRO = 2, + ORC = 3, + CSV = 100, + JSON = 101, + IMAGE = 200, + AUDIO = 201, + VIDEO = 202, + TEXT = 203, + TFRECORD = 204, + OTHER = 1000, + UNKNOWN = 1001 + } + + /** CompressionFormat enum. */ + enum CompressionFormat { + COMPRESSION_FORMAT_UNSPECIFIED = 0, + GZIP = 2, + BZIP2 = 3 + } + } + + /** StorageSystem enum. */ + enum StorageSystem { + STORAGE_SYSTEM_UNSPECIFIED = 0, + CLOUD_STORAGE = 1, + BIGQUERY = 2 + } + + /** Represents a DataplexService */ + class DataplexService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataplexService 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 DataplexService 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): DataplexService; + + /** + * Calls CreateLake. + * @param request CreateLakeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createLake(request: google.cloud.dataplex.v1.ICreateLakeRequest, callback: google.cloud.dataplex.v1.DataplexService.CreateLakeCallback): void; + + /** + * Calls CreateLake. + * @param request CreateLakeRequest message or plain object + * @returns Promise + */ + public createLake(request: google.cloud.dataplex.v1.ICreateLakeRequest): Promise; + + /** + * Calls UpdateLake. + * @param request UpdateLakeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateLake(request: google.cloud.dataplex.v1.IUpdateLakeRequest, callback: google.cloud.dataplex.v1.DataplexService.UpdateLakeCallback): void; + + /** + * Calls UpdateLake. + * @param request UpdateLakeRequest message or plain object + * @returns Promise + */ + public updateLake(request: google.cloud.dataplex.v1.IUpdateLakeRequest): Promise; + + /** + * Calls DeleteLake. + * @param request DeleteLakeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteLake(request: google.cloud.dataplex.v1.IDeleteLakeRequest, callback: google.cloud.dataplex.v1.DataplexService.DeleteLakeCallback): void; + + /** + * Calls DeleteLake. + * @param request DeleteLakeRequest message or plain object + * @returns Promise + */ + public deleteLake(request: google.cloud.dataplex.v1.IDeleteLakeRequest): Promise; + + /** + * Calls ListLakes. + * @param request ListLakesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLakesResponse + */ + public listLakes(request: google.cloud.dataplex.v1.IListLakesRequest, callback: google.cloud.dataplex.v1.DataplexService.ListLakesCallback): void; + + /** + * Calls ListLakes. + * @param request ListLakesRequest message or plain object + * @returns Promise + */ + public listLakes(request: google.cloud.dataplex.v1.IListLakesRequest): Promise; + + /** + * Calls GetLake. + * @param request GetLakeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Lake + */ + public getLake(request: google.cloud.dataplex.v1.IGetLakeRequest, callback: google.cloud.dataplex.v1.DataplexService.GetLakeCallback): void; + + /** + * Calls GetLake. + * @param request GetLakeRequest message or plain object + * @returns Promise + */ + public getLake(request: google.cloud.dataplex.v1.IGetLakeRequest): Promise; + + /** + * Calls ListLakeActions. + * @param request ListLakeActionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListActionsResponse + */ + public listLakeActions(request: google.cloud.dataplex.v1.IListLakeActionsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListLakeActionsCallback): void; + + /** + * Calls ListLakeActions. + * @param request ListLakeActionsRequest message or plain object + * @returns Promise + */ + public listLakeActions(request: google.cloud.dataplex.v1.IListLakeActionsRequest): Promise; + + /** + * Calls CreateZone. + * @param request CreateZoneRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createZone(request: google.cloud.dataplex.v1.ICreateZoneRequest, callback: google.cloud.dataplex.v1.DataplexService.CreateZoneCallback): void; + + /** + * Calls CreateZone. + * @param request CreateZoneRequest message or plain object + * @returns Promise + */ + public createZone(request: google.cloud.dataplex.v1.ICreateZoneRequest): Promise; + + /** + * Calls UpdateZone. + * @param request UpdateZoneRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateZone(request: google.cloud.dataplex.v1.IUpdateZoneRequest, callback: google.cloud.dataplex.v1.DataplexService.UpdateZoneCallback): void; + + /** + * Calls UpdateZone. + * @param request UpdateZoneRequest message or plain object + * @returns Promise + */ + public updateZone(request: google.cloud.dataplex.v1.IUpdateZoneRequest): Promise; + + /** + * Calls DeleteZone. + * @param request DeleteZoneRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteZone(request: google.cloud.dataplex.v1.IDeleteZoneRequest, callback: google.cloud.dataplex.v1.DataplexService.DeleteZoneCallback): void; + + /** + * Calls DeleteZone. + * @param request DeleteZoneRequest message or plain object + * @returns Promise + */ + public deleteZone(request: google.cloud.dataplex.v1.IDeleteZoneRequest): Promise; + + /** + * Calls ListZones. + * @param request ListZonesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListZonesResponse + */ + public listZones(request: google.cloud.dataplex.v1.IListZonesRequest, callback: google.cloud.dataplex.v1.DataplexService.ListZonesCallback): void; + + /** + * Calls ListZones. + * @param request ListZonesRequest message or plain object + * @returns Promise + */ + public listZones(request: google.cloud.dataplex.v1.IListZonesRequest): Promise; + + /** + * Calls GetZone. + * @param request GetZoneRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Zone + */ + public getZone(request: google.cloud.dataplex.v1.IGetZoneRequest, callback: google.cloud.dataplex.v1.DataplexService.GetZoneCallback): void; + + /** + * Calls GetZone. + * @param request GetZoneRequest message or plain object + * @returns Promise + */ + public getZone(request: google.cloud.dataplex.v1.IGetZoneRequest): Promise; + + /** + * Calls ListZoneActions. + * @param request ListZoneActionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListActionsResponse + */ + public listZoneActions(request: google.cloud.dataplex.v1.IListZoneActionsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListZoneActionsCallback): void; + + /** + * Calls ListZoneActions. + * @param request ListZoneActionsRequest message or plain object + * @returns Promise + */ + public listZoneActions(request: google.cloud.dataplex.v1.IListZoneActionsRequest): Promise; + + /** + * Calls CreateAsset. + * @param request CreateAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAsset(request: google.cloud.dataplex.v1.ICreateAssetRequest, callback: google.cloud.dataplex.v1.DataplexService.CreateAssetCallback): void; + + /** + * Calls CreateAsset. + * @param request CreateAssetRequest message or plain object + * @returns Promise + */ + public createAsset(request: google.cloud.dataplex.v1.ICreateAssetRequest): Promise; + + /** + * Calls UpdateAsset. + * @param request UpdateAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAsset(request: google.cloud.dataplex.v1.IUpdateAssetRequest, callback: google.cloud.dataplex.v1.DataplexService.UpdateAssetCallback): void; + + /** + * Calls UpdateAsset. + * @param request UpdateAssetRequest message or plain object + * @returns Promise + */ + public updateAsset(request: google.cloud.dataplex.v1.IUpdateAssetRequest): Promise; + + /** + * Calls DeleteAsset. + * @param request DeleteAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAsset(request: google.cloud.dataplex.v1.IDeleteAssetRequest, callback: google.cloud.dataplex.v1.DataplexService.DeleteAssetCallback): void; + + /** + * Calls DeleteAsset. + * @param request DeleteAssetRequest message or plain object + * @returns Promise + */ + public deleteAsset(request: google.cloud.dataplex.v1.IDeleteAssetRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.dataplex.v1.IListAssetsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.dataplex.v1.IListAssetsRequest): Promise; + + /** + * Calls GetAsset. + * @param request GetAssetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Asset + */ + public getAsset(request: google.cloud.dataplex.v1.IGetAssetRequest, callback: google.cloud.dataplex.v1.DataplexService.GetAssetCallback): void; + + /** + * Calls GetAsset. + * @param request GetAssetRequest message or plain object + * @returns Promise + */ + public getAsset(request: google.cloud.dataplex.v1.IGetAssetRequest): Promise; + + /** + * Calls ListAssetActions. + * @param request ListAssetActionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListActionsResponse + */ + public listAssetActions(request: google.cloud.dataplex.v1.IListAssetActionsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListAssetActionsCallback): void; + + /** + * Calls ListAssetActions. + * @param request ListAssetActionsRequest message or plain object + * @returns Promise + */ + public listAssetActions(request: google.cloud.dataplex.v1.IListAssetActionsRequest): Promise; + + /** + * Calls CreateTask. + * @param request CreateTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTask(request: google.cloud.dataplex.v1.ICreateTaskRequest, callback: google.cloud.dataplex.v1.DataplexService.CreateTaskCallback): void; + + /** + * Calls CreateTask. + * @param request CreateTaskRequest message or plain object + * @returns Promise + */ + public createTask(request: google.cloud.dataplex.v1.ICreateTaskRequest): Promise; + + /** + * Calls UpdateTask. + * @param request UpdateTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTask(request: google.cloud.dataplex.v1.IUpdateTaskRequest, callback: google.cloud.dataplex.v1.DataplexService.UpdateTaskCallback): void; + + /** + * Calls UpdateTask. + * @param request UpdateTaskRequest message or plain object + * @returns Promise + */ + public updateTask(request: google.cloud.dataplex.v1.IUpdateTaskRequest): Promise; + + /** + * Calls DeleteTask. + * @param request DeleteTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTask(request: google.cloud.dataplex.v1.IDeleteTaskRequest, callback: google.cloud.dataplex.v1.DataplexService.DeleteTaskCallback): void; + + /** + * Calls DeleteTask. + * @param request DeleteTaskRequest message or plain object + * @returns Promise + */ + public deleteTask(request: google.cloud.dataplex.v1.IDeleteTaskRequest): Promise; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTasksResponse + */ + public listTasks(request: google.cloud.dataplex.v1.IListTasksRequest, callback: google.cloud.dataplex.v1.DataplexService.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.dataplex.v1.IListTasksRequest): Promise; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Task + */ + public getTask(request: google.cloud.dataplex.v1.IGetTaskRequest, callback: google.cloud.dataplex.v1.DataplexService.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.dataplex.v1.IGetTaskRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.dataplex.v1.IListJobsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.dataplex.v1.IListJobsRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.dataplex.v1.IGetJobRequest, callback: google.cloud.dataplex.v1.DataplexService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.dataplex.v1.IGetJobRequest): Promise; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelJob(request: google.cloud.dataplex.v1.ICancelJobRequest, callback: google.cloud.dataplex.v1.DataplexService.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.dataplex.v1.ICancelJobRequest): Promise; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEnvironment(request: google.cloud.dataplex.v1.ICreateEnvironmentRequest, callback: google.cloud.dataplex.v1.DataplexService.CreateEnvironmentCallback): void; + + /** + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @returns Promise + */ + public createEnvironment(request: google.cloud.dataplex.v1.ICreateEnvironmentRequest): Promise; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEnvironment(request: google.cloud.dataplex.v1.IUpdateEnvironmentRequest, callback: google.cloud.dataplex.v1.DataplexService.UpdateEnvironmentCallback): void; + + /** + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @returns Promise + */ + public updateEnvironment(request: google.cloud.dataplex.v1.IUpdateEnvironmentRequest): Promise; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEnvironment(request: google.cloud.dataplex.v1.IDeleteEnvironmentRequest, callback: google.cloud.dataplex.v1.DataplexService.DeleteEnvironmentCallback): void; + + /** + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @returns Promise + */ + public deleteEnvironment(request: google.cloud.dataplex.v1.IDeleteEnvironmentRequest): Promise; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.dataplex.v1.IListEnvironmentsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.dataplex.v1.IListEnvironmentsRequest): Promise; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment + */ + public getEnvironment(request: google.cloud.dataplex.v1.IGetEnvironmentRequest, callback: google.cloud.dataplex.v1.DataplexService.GetEnvironmentCallback): void; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise + */ + public getEnvironment(request: google.cloud.dataplex.v1.IGetEnvironmentRequest): Promise; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionsResponse + */ + public listSessions(request: google.cloud.dataplex.v1.IListSessionsRequest, callback: google.cloud.dataplex.v1.DataplexService.ListSessionsCallback): void; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @returns Promise + */ + public listSessions(request: google.cloud.dataplex.v1.IListSessionsRequest): Promise; + } + + namespace DataplexService { + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createLake}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateLakeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateLake}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateLakeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteLake}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteLakeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listLakes}. + * @param error Error, if any + * @param [response] ListLakesResponse + */ + type ListLakesCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListLakesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getLake}. + * @param error Error, if any + * @param [response] Lake + */ + type GetLakeCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Lake) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listLakeActions}. + * @param error Error, if any + * @param [response] ListActionsResponse + */ + type ListLakeActionsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListActionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createZone}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateZoneCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateZone}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateZoneCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteZone}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteZoneCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listZones}. + * @param error Error, if any + * @param [response] ListZonesResponse + */ + type ListZonesCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListZonesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getZone}. + * @param error Error, if any + * @param [response] Zone + */ + type GetZoneCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Zone) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listZoneActions}. + * @param error Error, if any + * @param [response] ListActionsResponse + */ + type ListZoneActionsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListActionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createAsset}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAssetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateAsset}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAssetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteAsset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAssetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getAsset}. + * @param error Error, if any + * @param [response] Asset + */ + type GetAssetCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Asset) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listAssetActions}. + * @param error Error, if any + * @param [response] ListActionsResponse + */ + type ListAssetActionsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListActionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createTask}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTaskCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateTask}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTaskCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteTask}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTaskCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListTasksResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Task) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|cancelJob}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListEnvironmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.Environment) => void; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listSessions}. + * @param error Error, if any + * @param [response] ListSessionsResponse + */ + type ListSessionsCallback = (error: (Error|null), response?: google.cloud.dataplex.v1.ListSessionsResponse) => void; + } + + /** Properties of a CreateLakeRequest. */ + interface ICreateLakeRequest { + + /** CreateLakeRequest parent */ + parent?: (string|null); + + /** CreateLakeRequest lakeId */ + lakeId?: (string|null); + + /** CreateLakeRequest lake */ + lake?: (google.cloud.dataplex.v1.ILake|null); + + /** CreateLakeRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateLakeRequest. */ + class CreateLakeRequest implements ICreateLakeRequest { + + /** + * Constructs a new CreateLakeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateLakeRequest); + + /** CreateLakeRequest parent. */ + public parent: string; + + /** CreateLakeRequest lakeId. */ + public lakeId: string; + + /** CreateLakeRequest lake. */ + public lake?: (google.cloud.dataplex.v1.ILake|null); + + /** CreateLakeRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateLakeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLakeRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateLakeRequest): google.cloud.dataplex.v1.CreateLakeRequest; + + /** + * Encodes the specified CreateLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateLakeRequest.verify|verify} messages. + * @param message CreateLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateLakeRequest.verify|verify} messages. + * @param message CreateLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLakeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateLakeRequest; + + /** + * Decodes a CreateLakeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateLakeRequest; + + /** + * Verifies a CreateLakeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateLakeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLakeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateLakeRequest; + + /** + * Creates a plain object from a CreateLakeRequest message. Also converts values to other types if specified. + * @param message CreateLakeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateLakeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLakeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLakeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLakeRequest. */ + interface IUpdateLakeRequest { + + /** UpdateLakeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateLakeRequest lake */ + lake?: (google.cloud.dataplex.v1.ILake|null); + + /** UpdateLakeRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateLakeRequest. */ + class UpdateLakeRequest implements IUpdateLakeRequest { + + /** + * Constructs a new UpdateLakeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateLakeRequest); + + /** UpdateLakeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateLakeRequest lake. */ + public lake?: (google.cloud.dataplex.v1.ILake|null); + + /** UpdateLakeRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateLakeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateLakeRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateLakeRequest): google.cloud.dataplex.v1.UpdateLakeRequest; + + /** + * Encodes the specified UpdateLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateLakeRequest.verify|verify} messages. + * @param message UpdateLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateLakeRequest.verify|verify} messages. + * @param message UpdateLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateLakeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateLakeRequest; + + /** + * Decodes an UpdateLakeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateLakeRequest; + + /** + * Verifies an UpdateLakeRequest message. + * @param message Plain 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 UpdateLakeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateLakeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateLakeRequest; + + /** + * Creates a plain object from an UpdateLakeRequest message. Also converts values to other types if specified. + * @param message UpdateLakeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateLakeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateLakeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateLakeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteLakeRequest. */ + interface IDeleteLakeRequest { + + /** DeleteLakeRequest name */ + name?: (string|null); + } + + /** Represents a DeleteLakeRequest. */ + class DeleteLakeRequest implements IDeleteLakeRequest { + + /** + * Constructs a new DeleteLakeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteLakeRequest); + + /** DeleteLakeRequest name. */ + public name: string; + + /** + * Creates a new DeleteLakeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLakeRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteLakeRequest): google.cloud.dataplex.v1.DeleteLakeRequest; + + /** + * Encodes the specified DeleteLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteLakeRequest.verify|verify} messages. + * @param message DeleteLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteLakeRequest.verify|verify} messages. + * @param message DeleteLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLakeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteLakeRequest; + + /** + * Decodes a DeleteLakeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteLakeRequest; + + /** + * Verifies a DeleteLakeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteLakeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLakeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteLakeRequest; + + /** + * Creates a plain object from a DeleteLakeRequest message. Also converts values to other types if specified. + * @param message DeleteLakeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteLakeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLakeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLakeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLakesRequest. */ + interface IListLakesRequest { + + /** ListLakesRequest parent */ + parent?: (string|null); + + /** ListLakesRequest pageSize */ + pageSize?: (number|null); + + /** ListLakesRequest pageToken */ + pageToken?: (string|null); + + /** ListLakesRequest filter */ + filter?: (string|null); + + /** ListLakesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListLakesRequest. */ + class ListLakesRequest implements IListLakesRequest { + + /** + * Constructs a new ListLakesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListLakesRequest); + + /** ListLakesRequest parent. */ + public parent: string; + + /** ListLakesRequest pageSize. */ + public pageSize: number; + + /** ListLakesRequest pageToken. */ + public pageToken: string; + + /** ListLakesRequest filter. */ + public filter: string; + + /** ListLakesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListLakesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLakesRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListLakesRequest): google.cloud.dataplex.v1.ListLakesRequest; + + /** + * Encodes the specified ListLakesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesRequest.verify|verify} messages. + * @param message ListLakesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListLakesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLakesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesRequest.verify|verify} messages. + * @param message ListLakesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListLakesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLakesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLakesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListLakesRequest; + + /** + * Decodes a ListLakesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLakesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListLakesRequest; + + /** + * Verifies a ListLakesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLakesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLakesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListLakesRequest; + + /** + * Creates a plain object from a ListLakesRequest message. Also converts values to other types if specified. + * @param message ListLakesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListLakesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLakesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLakesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLakesResponse. */ + interface IListLakesResponse { + + /** ListLakesResponse lakes */ + lakes?: (google.cloud.dataplex.v1.ILake[]|null); + + /** ListLakesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListLakesResponse unreachableLocations */ + unreachableLocations?: (string[]|null); + } + + /** Represents a ListLakesResponse. */ + class ListLakesResponse implements IListLakesResponse { + + /** + * Constructs a new ListLakesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListLakesResponse); + + /** ListLakesResponse lakes. */ + public lakes: google.cloud.dataplex.v1.ILake[]; + + /** ListLakesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListLakesResponse unreachableLocations. */ + public unreachableLocations: string[]; + + /** + * Creates a new ListLakesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLakesResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListLakesResponse): google.cloud.dataplex.v1.ListLakesResponse; + + /** + * Encodes the specified ListLakesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesResponse.verify|verify} messages. + * @param message ListLakesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListLakesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLakesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesResponse.verify|verify} messages. + * @param message ListLakesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListLakesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLakesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLakesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListLakesResponse; + + /** + * Decodes a ListLakesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLakesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListLakesResponse; + + /** + * Verifies a ListLakesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLakesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLakesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListLakesResponse; + + /** + * Creates a plain object from a ListLakesResponse message. Also converts values to other types if specified. + * @param message ListLakesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListLakesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLakesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLakesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLakeActionsRequest. */ + interface IListLakeActionsRequest { + + /** ListLakeActionsRequest parent */ + parent?: (string|null); + + /** ListLakeActionsRequest pageSize */ + pageSize?: (number|null); + + /** ListLakeActionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListLakeActionsRequest. */ + class ListLakeActionsRequest implements IListLakeActionsRequest { + + /** + * Constructs a new ListLakeActionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListLakeActionsRequest); + + /** ListLakeActionsRequest parent. */ + public parent: string; + + /** ListLakeActionsRequest pageSize. */ + public pageSize: number; + + /** ListLakeActionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListLakeActionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLakeActionsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListLakeActionsRequest): google.cloud.dataplex.v1.ListLakeActionsRequest; + + /** + * Encodes the specified ListLakeActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakeActionsRequest.verify|verify} messages. + * @param message ListLakeActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListLakeActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLakeActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakeActionsRequest.verify|verify} messages. + * @param message ListLakeActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListLakeActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLakeActionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLakeActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListLakeActionsRequest; + + /** + * Decodes a ListLakeActionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLakeActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListLakeActionsRequest; + + /** + * Verifies a ListLakeActionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLakeActionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLakeActionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListLakeActionsRequest; + + /** + * Creates a plain object from a ListLakeActionsRequest message. Also converts values to other types if specified. + * @param message ListLakeActionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListLakeActionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLakeActionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLakeActionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListActionsResponse. */ + interface IListActionsResponse { + + /** ListActionsResponse actions */ + actions?: (google.cloud.dataplex.v1.IAction[]|null); + + /** ListActionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListActionsResponse. */ + class ListActionsResponse implements IListActionsResponse { + + /** + * Constructs a new ListActionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListActionsResponse); + + /** ListActionsResponse actions. */ + public actions: google.cloud.dataplex.v1.IAction[]; + + /** ListActionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListActionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListActionsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListActionsResponse): google.cloud.dataplex.v1.ListActionsResponse; + + /** + * Encodes the specified ListActionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListActionsResponse.verify|verify} messages. + * @param message ListActionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListActionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListActionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListActionsResponse.verify|verify} messages. + * @param message ListActionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListActionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListActionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListActionsResponse; + + /** + * Decodes a ListActionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListActionsResponse; + + /** + * Verifies a ListActionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListActionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListActionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListActionsResponse; + + /** + * Creates a plain object from a ListActionsResponse message. Also converts values to other types if specified. + * @param message ListActionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListActionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListActionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListActionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLakeRequest. */ + interface IGetLakeRequest { + + /** GetLakeRequest name */ + name?: (string|null); + } + + /** Represents a GetLakeRequest. */ + class GetLakeRequest implements IGetLakeRequest { + + /** + * Constructs a new GetLakeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetLakeRequest); + + /** GetLakeRequest name. */ + public name: string; + + /** + * Creates a new GetLakeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLakeRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetLakeRequest): google.cloud.dataplex.v1.GetLakeRequest; + + /** + * Encodes the specified GetLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetLakeRequest.verify|verify} messages. + * @param message GetLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetLakeRequest.verify|verify} messages. + * @param message GetLakeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetLakeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLakeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetLakeRequest; + + /** + * Decodes a GetLakeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetLakeRequest; + + /** + * Verifies a GetLakeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLakeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLakeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetLakeRequest; + + /** + * Creates a plain object from a GetLakeRequest message. Also converts values to other types if specified. + * @param message GetLakeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetLakeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLakeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLakeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateZoneRequest. */ + interface ICreateZoneRequest { + + /** CreateZoneRequest parent */ + parent?: (string|null); + + /** CreateZoneRequest zoneId */ + zoneId?: (string|null); + + /** CreateZoneRequest zone */ + zone?: (google.cloud.dataplex.v1.IZone|null); + + /** CreateZoneRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateZoneRequest. */ + class CreateZoneRequest implements ICreateZoneRequest { + + /** + * Constructs a new CreateZoneRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateZoneRequest); + + /** CreateZoneRequest parent. */ + public parent: string; + + /** CreateZoneRequest zoneId. */ + public zoneId: string; + + /** CreateZoneRequest zone. */ + public zone?: (google.cloud.dataplex.v1.IZone|null); + + /** CreateZoneRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateZoneRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateZoneRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateZoneRequest): google.cloud.dataplex.v1.CreateZoneRequest; + + /** + * Encodes the specified CreateZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateZoneRequest.verify|verify} messages. + * @param message CreateZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateZoneRequest.verify|verify} messages. + * @param message CreateZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateZoneRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateZoneRequest; + + /** + * Decodes a CreateZoneRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateZoneRequest; + + /** + * Verifies a CreateZoneRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateZoneRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateZoneRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateZoneRequest; + + /** + * Creates a plain object from a CreateZoneRequest message. Also converts values to other types if specified. + * @param message CreateZoneRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateZoneRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateZoneRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateZoneRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateZoneRequest. */ + interface IUpdateZoneRequest { + + /** UpdateZoneRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateZoneRequest zone */ + zone?: (google.cloud.dataplex.v1.IZone|null); + + /** UpdateZoneRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateZoneRequest. */ + class UpdateZoneRequest implements IUpdateZoneRequest { + + /** + * Constructs a new UpdateZoneRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateZoneRequest); + + /** UpdateZoneRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateZoneRequest zone. */ + public zone?: (google.cloud.dataplex.v1.IZone|null); + + /** UpdateZoneRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateZoneRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateZoneRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateZoneRequest): google.cloud.dataplex.v1.UpdateZoneRequest; + + /** + * Encodes the specified UpdateZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateZoneRequest.verify|verify} messages. + * @param message UpdateZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateZoneRequest.verify|verify} messages. + * @param message UpdateZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateZoneRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateZoneRequest; + + /** + * Decodes an UpdateZoneRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateZoneRequest; + + /** + * Verifies an UpdateZoneRequest message. + * @param message Plain 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 UpdateZoneRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateZoneRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateZoneRequest; + + /** + * Creates a plain object from an UpdateZoneRequest message. Also converts values to other types if specified. + * @param message UpdateZoneRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateZoneRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateZoneRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateZoneRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteZoneRequest. */ + interface IDeleteZoneRequest { + + /** DeleteZoneRequest name */ + name?: (string|null); + } + + /** Represents a DeleteZoneRequest. */ + class DeleteZoneRequest implements IDeleteZoneRequest { + + /** + * Constructs a new DeleteZoneRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteZoneRequest); + + /** DeleteZoneRequest name. */ + public name: string; + + /** + * Creates a new DeleteZoneRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteZoneRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteZoneRequest): google.cloud.dataplex.v1.DeleteZoneRequest; + + /** + * Encodes the specified DeleteZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteZoneRequest.verify|verify} messages. + * @param message DeleteZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteZoneRequest.verify|verify} messages. + * @param message DeleteZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteZoneRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteZoneRequest; + + /** + * Decodes a DeleteZoneRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteZoneRequest; + + /** + * Verifies a DeleteZoneRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteZoneRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteZoneRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteZoneRequest; + + /** + * Creates a plain object from a DeleteZoneRequest message. Also converts values to other types if specified. + * @param message DeleteZoneRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteZoneRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteZoneRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteZoneRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListZonesRequest. */ + interface IListZonesRequest { + + /** ListZonesRequest parent */ + parent?: (string|null); + + /** ListZonesRequest pageSize */ + pageSize?: (number|null); + + /** ListZonesRequest pageToken */ + pageToken?: (string|null); + + /** ListZonesRequest filter */ + filter?: (string|null); + + /** ListZonesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListZonesRequest. */ + class ListZonesRequest implements IListZonesRequest { + + /** + * Constructs a new ListZonesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListZonesRequest); + + /** ListZonesRequest parent. */ + public parent: string; + + /** ListZonesRequest pageSize. */ + public pageSize: number; + + /** ListZonesRequest pageToken. */ + public pageToken: string; + + /** ListZonesRequest filter. */ + public filter: string; + + /** ListZonesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListZonesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListZonesRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListZonesRequest): google.cloud.dataplex.v1.ListZonesRequest; + + /** + * Encodes the specified ListZonesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesRequest.verify|verify} messages. + * @param message ListZonesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListZonesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListZonesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesRequest.verify|verify} messages. + * @param message ListZonesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListZonesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListZonesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListZonesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListZonesRequest; + + /** + * Decodes a ListZonesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListZonesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListZonesRequest; + + /** + * Verifies a ListZonesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListZonesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListZonesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListZonesRequest; + + /** + * Creates a plain object from a ListZonesRequest message. Also converts values to other types if specified. + * @param message ListZonesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListZonesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListZonesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListZonesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListZonesResponse. */ + interface IListZonesResponse { + + /** ListZonesResponse zones */ + zones?: (google.cloud.dataplex.v1.IZone[]|null); + + /** ListZonesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListZonesResponse. */ + class ListZonesResponse implements IListZonesResponse { + + /** + * Constructs a new ListZonesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListZonesResponse); + + /** ListZonesResponse zones. */ + public zones: google.cloud.dataplex.v1.IZone[]; + + /** ListZonesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListZonesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListZonesResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListZonesResponse): google.cloud.dataplex.v1.ListZonesResponse; + + /** + * Encodes the specified ListZonesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesResponse.verify|verify} messages. + * @param message ListZonesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListZonesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListZonesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesResponse.verify|verify} messages. + * @param message ListZonesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListZonesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListZonesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListZonesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListZonesResponse; + + /** + * Decodes a ListZonesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListZonesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListZonesResponse; + + /** + * Verifies a ListZonesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListZonesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListZonesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListZonesResponse; + + /** + * Creates a plain object from a ListZonesResponse message. Also converts values to other types if specified. + * @param message ListZonesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListZonesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListZonesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListZonesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListZoneActionsRequest. */ + interface IListZoneActionsRequest { + + /** ListZoneActionsRequest parent */ + parent?: (string|null); + + /** ListZoneActionsRequest pageSize */ + pageSize?: (number|null); + + /** ListZoneActionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListZoneActionsRequest. */ + class ListZoneActionsRequest implements IListZoneActionsRequest { + + /** + * Constructs a new ListZoneActionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListZoneActionsRequest); + + /** ListZoneActionsRequest parent. */ + public parent: string; + + /** ListZoneActionsRequest pageSize. */ + public pageSize: number; + + /** ListZoneActionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListZoneActionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListZoneActionsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListZoneActionsRequest): google.cloud.dataplex.v1.ListZoneActionsRequest; + + /** + * Encodes the specified ListZoneActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListZoneActionsRequest.verify|verify} messages. + * @param message ListZoneActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListZoneActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListZoneActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZoneActionsRequest.verify|verify} messages. + * @param message ListZoneActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListZoneActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListZoneActionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListZoneActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListZoneActionsRequest; + + /** + * Decodes a ListZoneActionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListZoneActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListZoneActionsRequest; + + /** + * Verifies a ListZoneActionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListZoneActionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListZoneActionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListZoneActionsRequest; + + /** + * Creates a plain object from a ListZoneActionsRequest message. Also converts values to other types if specified. + * @param message ListZoneActionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListZoneActionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListZoneActionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListZoneActionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetZoneRequest. */ + interface IGetZoneRequest { + + /** GetZoneRequest name */ + name?: (string|null); + } + + /** Represents a GetZoneRequest. */ + class GetZoneRequest implements IGetZoneRequest { + + /** + * Constructs a new GetZoneRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetZoneRequest); + + /** GetZoneRequest name. */ + public name: string; + + /** + * Creates a new GetZoneRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetZoneRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetZoneRequest): google.cloud.dataplex.v1.GetZoneRequest; + + /** + * Encodes the specified GetZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetZoneRequest.verify|verify} messages. + * @param message GetZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetZoneRequest.verify|verify} messages. + * @param message GetZoneRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetZoneRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetZoneRequest; + + /** + * Decodes a GetZoneRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetZoneRequest; + + /** + * Verifies a GetZoneRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetZoneRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetZoneRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetZoneRequest; + + /** + * Creates a plain object from a GetZoneRequest message. Also converts values to other types if specified. + * @param message GetZoneRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetZoneRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetZoneRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetZoneRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAssetRequest. */ + interface ICreateAssetRequest { + + /** CreateAssetRequest parent */ + parent?: (string|null); + + /** CreateAssetRequest assetId */ + assetId?: (string|null); + + /** CreateAssetRequest asset */ + asset?: (google.cloud.dataplex.v1.IAsset|null); + + /** CreateAssetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateAssetRequest. */ + class CreateAssetRequest implements ICreateAssetRequest { + + /** + * Constructs a new CreateAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateAssetRequest); + + /** CreateAssetRequest parent. */ + public parent: string; + + /** CreateAssetRequest assetId. */ + public assetId: string; + + /** CreateAssetRequest asset. */ + public asset?: (google.cloud.dataplex.v1.IAsset|null); + + /** CreateAssetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssetRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateAssetRequest): google.cloud.dataplex.v1.CreateAssetRequest; + + /** + * Encodes the specified CreateAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateAssetRequest.verify|verify} messages. + * @param message CreateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateAssetRequest.verify|verify} messages. + * @param message CreateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateAssetRequest; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateAssetRequest; + + /** + * Verifies a CreateAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateAssetRequest; + + /** + * Creates a plain object from a CreateAssetRequest message. Also converts values to other types if specified. + * @param message CreateAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAssetRequest. */ + interface IUpdateAssetRequest { + + /** UpdateAssetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAssetRequest asset */ + asset?: (google.cloud.dataplex.v1.IAsset|null); + + /** UpdateAssetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateAssetRequest. */ + class UpdateAssetRequest implements IUpdateAssetRequest { + + /** + * Constructs a new UpdateAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateAssetRequest); + + /** UpdateAssetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAssetRequest asset. */ + public asset?: (google.cloud.dataplex.v1.IAsset|null); + + /** UpdateAssetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAssetRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateAssetRequest): google.cloud.dataplex.v1.UpdateAssetRequest; + + /** + * Encodes the specified UpdateAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateAssetRequest.verify|verify} messages. + * @param message UpdateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateAssetRequest.verify|verify} messages. + * @param message UpdateAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateAssetRequest; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateAssetRequest; + + /** + * Verifies an UpdateAssetRequest message. + * @param message Plain 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 UpdateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateAssetRequest; + + /** + * Creates a plain object from an UpdateAssetRequest message. Also converts values to other types if specified. + * @param message UpdateAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAssetRequest. */ + interface IDeleteAssetRequest { + + /** DeleteAssetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAssetRequest. */ + class DeleteAssetRequest implements IDeleteAssetRequest { + + /** + * Constructs a new DeleteAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteAssetRequest); + + /** DeleteAssetRequest name. */ + public name: string; + + /** + * Creates a new DeleteAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAssetRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteAssetRequest): google.cloud.dataplex.v1.DeleteAssetRequest; + + /** + * Encodes the specified DeleteAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteAssetRequest.verify|verify} messages. + * @param message DeleteAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteAssetRequest.verify|verify} messages. + * @param message DeleteAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteAssetRequest; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteAssetRequest; + + /** + * Verifies a DeleteAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteAssetRequest; + + /** + * Creates a plain object from a DeleteAssetRequest message. Also converts values to other types if specified. + * @param message DeleteAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest filter */ + filter?: (string|null); + + /** ListAssetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest filter. */ + public filter: string; + + /** ListAssetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListAssetsRequest): google.cloud.dataplex.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse assets */ + assets?: (google.cloud.dataplex.v1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListAssetsResponse); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.dataplex.v1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListAssetsResponse): google.cloud.dataplex.v1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetActionsRequest. */ + interface IListAssetActionsRequest { + + /** ListAssetActionsRequest parent */ + parent?: (string|null); + + /** ListAssetActionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetActionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssetActionsRequest. */ + class ListAssetActionsRequest implements IListAssetActionsRequest { + + /** + * Constructs a new ListAssetActionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListAssetActionsRequest); + + /** ListAssetActionsRequest parent. */ + public parent: string; + + /** ListAssetActionsRequest pageSize. */ + public pageSize: number; + + /** ListAssetActionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssetActionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetActionsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListAssetActionsRequest): google.cloud.dataplex.v1.ListAssetActionsRequest; + + /** + * Encodes the specified ListAssetActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetActionsRequest.verify|verify} messages. + * @param message ListAssetActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListAssetActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetActionsRequest.verify|verify} messages. + * @param message ListAssetActionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListAssetActionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetActionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListAssetActionsRequest; + + /** + * Decodes a ListAssetActionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListAssetActionsRequest; + + /** + * Verifies a ListAssetActionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssetActionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetActionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListAssetActionsRequest; + + /** + * Creates a plain object from a ListAssetActionsRequest message. Also converts values to other types if specified. + * @param message ListAssetActionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListAssetActionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetActionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetActionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAssetRequest. */ + interface IGetAssetRequest { + + /** GetAssetRequest name */ + name?: (string|null); + } + + /** Represents a GetAssetRequest. */ + class GetAssetRequest implements IGetAssetRequest { + + /** + * Constructs a new GetAssetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetAssetRequest); + + /** GetAssetRequest name. */ + public name: string; + + /** + * Creates a new GetAssetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAssetRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetAssetRequest): google.cloud.dataplex.v1.GetAssetRequest; + + /** + * Encodes the specified GetAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetAssetRequest.verify|verify} messages. + * @param message GetAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetAssetRequest.verify|verify} messages. + * @param message GetAssetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetAssetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetAssetRequest; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetAssetRequest; + + /** + * Verifies a GetAssetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAssetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAssetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetAssetRequest; + + /** + * Creates a plain object from a GetAssetRequest message. Also converts values to other types if specified. + * @param message GetAssetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetAssetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAssetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAssetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.dataplex.v1.IOperationMetadata): google.cloud.dataplex.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.dataplex.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTaskRequest. */ + interface ICreateTaskRequest { + + /** CreateTaskRequest parent */ + parent?: (string|null); + + /** CreateTaskRequest taskId */ + taskId?: (string|null); + + /** CreateTaskRequest task */ + task?: (google.cloud.dataplex.v1.ITask|null); + + /** CreateTaskRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTaskRequest. */ + class CreateTaskRequest implements ICreateTaskRequest { + + /** + * Constructs a new CreateTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateTaskRequest); + + /** CreateTaskRequest parent. */ + public parent: string; + + /** CreateTaskRequest taskId. */ + public taskId: string; + + /** CreateTaskRequest task. */ + public task?: (google.cloud.dataplex.v1.ITask|null); + + /** CreateTaskRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTaskRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateTaskRequest): google.cloud.dataplex.v1.CreateTaskRequest; + + /** + * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateTaskRequest.verify|verify} messages. + * @param message CreateTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateTaskRequest.verify|verify} messages. + * @param message CreateTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateTaskRequest; + + /** + * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateTaskRequest; + + /** + * Verifies a CreateTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateTaskRequest; + + /** + * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. + * @param message CreateTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTaskRequest. */ + interface IUpdateTaskRequest { + + /** UpdateTaskRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTaskRequest task */ + task?: (google.cloud.dataplex.v1.ITask|null); + + /** UpdateTaskRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateTaskRequest. */ + class UpdateTaskRequest implements IUpdateTaskRequest { + + /** + * Constructs a new UpdateTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateTaskRequest); + + /** UpdateTaskRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTaskRequest task. */ + public task?: (google.cloud.dataplex.v1.ITask|null); + + /** UpdateTaskRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTaskRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateTaskRequest): google.cloud.dataplex.v1.UpdateTaskRequest; + + /** + * Encodes the specified UpdateTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateTaskRequest.verify|verify} messages. + * @param message UpdateTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateTaskRequest.verify|verify} messages. + * @param message UpdateTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateTaskRequest; + + /** + * Decodes an UpdateTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateTaskRequest; + + /** + * Verifies an UpdateTaskRequest message. + * @param message Plain 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 UpdateTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateTaskRequest; + + /** + * Creates a plain object from an UpdateTaskRequest message. Also converts values to other types if specified. + * @param message UpdateTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTaskRequest. */ + interface IDeleteTaskRequest { + + /** DeleteTaskRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTaskRequest. */ + class DeleteTaskRequest implements IDeleteTaskRequest { + + /** + * Constructs a new DeleteTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteTaskRequest); + + /** DeleteTaskRequest name. */ + public name: string; + + /** + * Creates a new DeleteTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTaskRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteTaskRequest): google.cloud.dataplex.v1.DeleteTaskRequest; + + /** + * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteTaskRequest.verify|verify} messages. + * @param message DeleteTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteTaskRequest.verify|verify} messages. + * @param message DeleteTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteTaskRequest; + + /** + * Decodes a DeleteTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteTaskRequest; + + /** + * Verifies a DeleteTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteTaskRequest; + + /** + * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. + * @param message DeleteTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + + /** ListTasksRequest filter */ + filter?: (string|null); + + /** ListTasksRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** ListTasksRequest filter. */ + public filter: string; + + /** ListTasksRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListTasksRequest): google.cloud.dataplex.v1.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListTasksRequest; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListTasksRequest; + + /** + * Verifies a ListTasksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListTasksRequest; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @param message ListTasksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksResponse. */ + interface IListTasksResponse { + + /** ListTasksResponse tasks */ + tasks?: (google.cloud.dataplex.v1.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTasksResponse unreachableLocations */ + unreachableLocations?: (string[]|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.dataplex.v1.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTasksResponse unreachableLocations. */ + public unreachableLocations: string[]; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListTasksResponse): google.cloud.dataplex.v1.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListTasksResponse; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListTasksResponse; + + /** + * Verifies a ListTasksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListTasksResponse; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @param message ListTasksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTaskRequest. */ + interface IGetTaskRequest { + + /** GetTaskRequest name */ + name?: (string|null); + } + + /** Represents a GetTaskRequest. */ + class GetTaskRequest implements IGetTaskRequest { + + /** + * Constructs a new GetTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetTaskRequest); + + /** GetTaskRequest name. */ + public name: string; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaskRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetTaskRequest): google.cloud.dataplex.v1.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetTaskRequest; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetTaskRequest; + + /** + * Verifies a GetTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetTaskRequest; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @param message GetTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetJobRequest): google.cloud.dataplex.v1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListJobsRequest): google.cloud.dataplex.v1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.dataplex.v1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.dataplex.v1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListJobsResponse): google.cloud.dataplex.v1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICancelJobRequest); + + /** CancelJobRequest name. */ + public name: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICancelJobRequest): google.cloud.dataplex.v1.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEnvironmentRequest. */ + interface ICreateEnvironmentRequest { + + /** CreateEnvironmentRequest parent */ + parent?: (string|null); + + /** CreateEnvironmentRequest environmentId */ + environmentId?: (string|null); + + /** CreateEnvironmentRequest environment */ + environment?: (google.cloud.dataplex.v1.IEnvironment|null); + + /** CreateEnvironmentRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateEnvironmentRequest. */ + class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + + /** + * Constructs a new CreateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ICreateEnvironmentRequest); + + /** CreateEnvironmentRequest parent. */ + public parent: string; + + /** CreateEnvironmentRequest environmentId. */ + public environmentId: string; + + /** CreateEnvironmentRequest environment. */ + public environment?: (google.cloud.dataplex.v1.IEnvironment|null); + + /** CreateEnvironmentRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.ICreateEnvironmentRequest): google.cloud.dataplex.v1.CreateEnvironmentRequest; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.CreateEnvironmentRequest; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.CreateEnvironmentRequest; + + /** + * Verifies a CreateEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.CreateEnvironmentRequest; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @param message CreateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEnvironmentRequest. */ + interface IUpdateEnvironmentRequest { + + /** UpdateEnvironmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEnvironmentRequest environment */ + environment?: (google.cloud.dataplex.v1.IEnvironment|null); + + /** UpdateEnvironmentRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateEnvironmentRequest. */ + class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + + /** + * Constructs a new UpdateEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IUpdateEnvironmentRequest); + + /** UpdateEnvironmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEnvironmentRequest environment. */ + public environment?: (google.cloud.dataplex.v1.IEnvironment|null); + + /** UpdateEnvironmentRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IUpdateEnvironmentRequest): google.cloud.dataplex.v1.UpdateEnvironmentRequest; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.UpdateEnvironmentRequest; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.UpdateEnvironmentRequest; + + /** + * Verifies an UpdateEnvironmentRequest message. + * @param message Plain 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 UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.UpdateEnvironmentRequest; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @param message UpdateEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEnvironmentRequest. */ + interface IDeleteEnvironmentRequest { + + /** DeleteEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEnvironmentRequest. */ + class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + + /** + * Constructs a new DeleteEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IDeleteEnvironmentRequest); + + /** DeleteEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IDeleteEnvironmentRequest): google.cloud.dataplex.v1.DeleteEnvironmentRequest; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.DeleteEnvironmentRequest; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.DeleteEnvironmentRequest; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.DeleteEnvironmentRequest; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @param message DeleteEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + + /** ListEnvironmentsRequest filter */ + filter?: (string|null); + + /** ListEnvironmentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** ListEnvironmentsRequest filter. */ + public filter: string; + + /** ListEnvironmentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListEnvironmentsRequest): google.cloud.dataplex.v1.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.dataplex.v1.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.dataplex.v1.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListEnvironmentsResponse): google.cloud.dataplex.v1.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { + + /** GetEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { + + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGetEnvironmentRequest); + + /** GetEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGetEnvironmentRequest): google.cloud.dataplex.v1.GetEnvironmentRequest; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GetEnvironmentRequest; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GetEnvironmentRequest; + + /** + * Verifies a GetEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GetEnvironmentRequest; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsRequest. */ + interface IListSessionsRequest { + + /** ListSessionsRequest parent */ + parent?: (string|null); + + /** ListSessionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSessionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSessionsRequest. */ + class ListSessionsRequest implements IListSessionsRequest { + + /** + * Constructs a new ListSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListSessionsRequest); + + /** ListSessionsRequest parent. */ + public parent: string; + + /** ListSessionsRequest pageSize. */ + public pageSize: number; + + /** ListSessionsRequest pageToken. */ + public pageToken: string; + + /** ListSessionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsRequest instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListSessionsRequest): google.cloud.dataplex.v1.ListSessionsRequest; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListSessionsRequest; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListSessionsRequest; + + /** + * Verifies a ListSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListSessionsRequest; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @param message ListSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsResponse. */ + interface IListSessionsResponse { + + /** ListSessionsResponse sessions */ + sessions?: (google.cloud.dataplex.v1.ISession[]|null); + + /** ListSessionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionsResponse. */ + class ListSessionsResponse implements IListSessionsResponse { + + /** + * Constructs a new ListSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IListSessionsResponse); + + /** ListSessionsResponse sessions. */ + public sessions: google.cloud.dataplex.v1.ISession[]; + + /** ListSessionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsResponse instance + */ + public static create(properties?: google.cloud.dataplex.v1.IListSessionsResponse): google.cloud.dataplex.v1.ListSessionsResponse; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.ListSessionsResponse; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.ListSessionsResponse; + + /** + * Verifies a ListSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.ListSessionsResponse; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @param message ListSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task uid */ + uid?: (string|null); + + /** Task createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Task updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Task description */ + description?: (string|null); + + /** Task displayName */ + displayName?: (string|null); + + /** Task state */ + state?: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State|null); + + /** Task labels */ + labels?: ({ [k: string]: string }|null); + + /** Task triggerSpec */ + triggerSpec?: (google.cloud.dataplex.v1.Task.ITriggerSpec|null); + + /** Task executionSpec */ + executionSpec?: (google.cloud.dataplex.v1.Task.IExecutionSpec|null); + + /** Task executionStatus */ + executionStatus?: (google.cloud.dataplex.v1.Task.IExecutionStatus|null); + + /** Task spark */ + spark?: (google.cloud.dataplex.v1.Task.ISparkTaskConfig|null); + + /** Task notebook */ + notebook?: (google.cloud.dataplex.v1.Task.INotebookTaskConfig|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.ITask); + + /** Task name. */ + public name: string; + + /** Task uid. */ + public uid: string; + + /** Task createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Task updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Task description. */ + public description: string; + + /** Task displayName. */ + public displayName: string; + + /** Task state. */ + public state: (google.cloud.dataplex.v1.State|keyof typeof google.cloud.dataplex.v1.State); + + /** Task labels. */ + public labels: { [k: string]: string }; + + /** Task triggerSpec. */ + public triggerSpec?: (google.cloud.dataplex.v1.Task.ITriggerSpec|null); + + /** Task executionSpec. */ + public executionSpec?: (google.cloud.dataplex.v1.Task.IExecutionSpec|null); + + /** Task executionStatus. */ + public executionStatus?: (google.cloud.dataplex.v1.Task.IExecutionStatus|null); + + /** Task spark. */ + public spark?: (google.cloud.dataplex.v1.Task.ISparkTaskConfig|null); + + /** Task notebook. */ + public notebook?: (google.cloud.dataplex.v1.Task.INotebookTaskConfig|null); + + /** Task config. */ + public config?: ("spark"|"notebook"); + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.dataplex.v1.ITask): google.cloud.dataplex.v1.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.dataplex.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Task message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task; + + /** + * Verifies a Task message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Task + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @param message Task + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Task to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Task + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Task { + + /** Properties of an InfrastructureSpec. */ + interface IInfrastructureSpec { + + /** InfrastructureSpec batch */ + batch?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources|null); + + /** InfrastructureSpec containerImage */ + containerImage?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime|null); + + /** InfrastructureSpec vpcNetwork */ + vpcNetwork?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork|null); + } + + /** Represents an InfrastructureSpec. */ + class InfrastructureSpec implements IInfrastructureSpec { + + /** + * Constructs a new InfrastructureSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.IInfrastructureSpec); + + /** InfrastructureSpec batch. */ + public batch?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources|null); + + /** InfrastructureSpec containerImage. */ + public containerImage?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime|null); + + /** InfrastructureSpec vpcNetwork. */ + public vpcNetwork?: (google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork|null); + + /** InfrastructureSpec resources. */ + public resources?: "batch"; + + /** InfrastructureSpec runtime. */ + public runtime?: "containerImage"; + + /** InfrastructureSpec network. */ + public network?: "vpcNetwork"; + + /** + * Creates a new InfrastructureSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns InfrastructureSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.IInfrastructureSpec): google.cloud.dataplex.v1.Task.InfrastructureSpec; + + /** + * Encodes the specified InfrastructureSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.verify|verify} messages. + * @param message InfrastructureSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.IInfrastructureSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InfrastructureSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.verify|verify} messages. + * @param message InfrastructureSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.IInfrastructureSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.InfrastructureSpec; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.InfrastructureSpec; + + /** + * Verifies an InfrastructureSpec message. + * @param message Plain 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 InfrastructureSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InfrastructureSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.InfrastructureSpec; + + /** + * Creates a plain object from an InfrastructureSpec message. Also converts values to other types if specified. + * @param message InfrastructureSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.InfrastructureSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InfrastructureSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InfrastructureSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InfrastructureSpec { + + /** Properties of a BatchComputeResources. */ + interface IBatchComputeResources { + + /** BatchComputeResources executorsCount */ + executorsCount?: (number|null); + + /** BatchComputeResources maxExecutorsCount */ + maxExecutorsCount?: (number|null); + } + + /** Represents a BatchComputeResources. */ + class BatchComputeResources implements IBatchComputeResources { + + /** + * Constructs a new BatchComputeResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources); + + /** BatchComputeResources executorsCount. */ + public executorsCount: number; + + /** BatchComputeResources maxExecutorsCount. */ + public maxExecutorsCount: number; + + /** + * Creates a new BatchComputeResources instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchComputeResources instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources): google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources; + + /** + * Encodes the specified BatchComputeResources message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.verify|verify} messages. + * @param message BatchComputeResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchComputeResources message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.verify|verify} messages. + * @param message BatchComputeResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchComputeResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources; + + /** + * Decodes a BatchComputeResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources; + + /** + * Verifies a BatchComputeResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchComputeResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchComputeResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources; + + /** + * Creates a plain object from a BatchComputeResources message. Also converts values to other types if specified. + * @param message BatchComputeResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchComputeResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchComputeResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContainerImageRuntime. */ + interface IContainerImageRuntime { + + /** ContainerImageRuntime image */ + image?: (string|null); + + /** ContainerImageRuntime javaJars */ + javaJars?: (string[]|null); + + /** ContainerImageRuntime pythonPackages */ + pythonPackages?: (string[]|null); + + /** ContainerImageRuntime properties */ + properties?: ({ [k: string]: string }|null); + } + + /** Represents a ContainerImageRuntime. */ + class ContainerImageRuntime implements IContainerImageRuntime { + + /** + * Constructs a new ContainerImageRuntime. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime); + + /** ContainerImageRuntime image. */ + public image: string; + + /** ContainerImageRuntime javaJars. */ + public javaJars: string[]; + + /** ContainerImageRuntime pythonPackages. */ + public pythonPackages: string[]; + + /** ContainerImageRuntime properties. */ + public properties: { [k: string]: string }; + + /** + * Creates a new ContainerImageRuntime instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerImageRuntime instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime): google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime; + + /** + * Encodes the specified ContainerImageRuntime message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.verify|verify} messages. + * @param message ContainerImageRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerImageRuntime message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.verify|verify} messages. + * @param message ContainerImageRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerImageRuntime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime; + + /** + * Decodes a ContainerImageRuntime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime; + + /** + * Verifies a ContainerImageRuntime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerImageRuntime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerImageRuntime + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime; + + /** + * Creates a plain object from a ContainerImageRuntime message. Also converts values to other types if specified. + * @param message ContainerImageRuntime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerImageRuntime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerImageRuntime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VpcNetwork. */ + interface IVpcNetwork { + + /** VpcNetwork network */ + network?: (string|null); + + /** VpcNetwork subNetwork */ + subNetwork?: (string|null); + + /** VpcNetwork networkTags */ + networkTags?: (string[]|null); + } + + /** Represents a VpcNetwork. */ + class VpcNetwork implements IVpcNetwork { + + /** + * Constructs a new VpcNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork); + + /** VpcNetwork network. */ + public network?: (string|null); + + /** VpcNetwork subNetwork. */ + public subNetwork?: (string|null); + + /** VpcNetwork networkTags. */ + public networkTags: string[]; + + /** VpcNetwork networkName. */ + public networkName?: ("network"|"subNetwork"); + + /** + * Creates a new VpcNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcNetwork instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork): google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork; + + /** + * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.verify|verify} messages. + * @param message VpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.verify|verify} messages. + * @param message VpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork; + + /** + * Verifies a VpcNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork; + + /** + * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. + * @param message VpcNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TriggerSpec. */ + interface ITriggerSpec { + + /** TriggerSpec type */ + type?: (google.cloud.dataplex.v1.Task.TriggerSpec.Type|keyof typeof google.cloud.dataplex.v1.Task.TriggerSpec.Type|null); + + /** TriggerSpec startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TriggerSpec disabled */ + disabled?: (boolean|null); + + /** TriggerSpec maxRetries */ + maxRetries?: (number|null); + + /** TriggerSpec schedule */ + schedule?: (string|null); + } + + /** Represents a TriggerSpec. */ + class TriggerSpec implements ITriggerSpec { + + /** + * Constructs a new TriggerSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.ITriggerSpec); + + /** TriggerSpec type. */ + public type: (google.cloud.dataplex.v1.Task.TriggerSpec.Type|keyof typeof google.cloud.dataplex.v1.Task.TriggerSpec.Type); + + /** TriggerSpec startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TriggerSpec disabled. */ + public disabled: boolean; + + /** TriggerSpec maxRetries. */ + public maxRetries: number; + + /** TriggerSpec schedule. */ + public schedule?: (string|null); + + /** TriggerSpec trigger. */ + public trigger?: "schedule"; + + /** + * Creates a new TriggerSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.ITriggerSpec): google.cloud.dataplex.v1.Task.TriggerSpec; + + /** + * Encodes the specified TriggerSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.TriggerSpec.verify|verify} messages. + * @param message TriggerSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.ITriggerSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.TriggerSpec.verify|verify} messages. + * @param message TriggerSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.ITriggerSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.TriggerSpec; + + /** + * Decodes a TriggerSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.TriggerSpec; + + /** + * Verifies a TriggerSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.TriggerSpec; + + /** + * Creates a plain object from a TriggerSpec message. Also converts values to other types if specified. + * @param message TriggerSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.TriggerSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TriggerSpec { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ON_DEMAND = 1, + RECURRING = 2 + } + } + + /** Properties of an ExecutionSpec. */ + interface IExecutionSpec { + + /** ExecutionSpec args */ + args?: ({ [k: string]: string }|null); + + /** ExecutionSpec serviceAccount */ + serviceAccount?: (string|null); + + /** ExecutionSpec project */ + project?: (string|null); + + /** ExecutionSpec maxJobExecutionLifetime */ + maxJobExecutionLifetime?: (google.protobuf.IDuration|null); + + /** ExecutionSpec kmsKey */ + kmsKey?: (string|null); + } + + /** Represents an ExecutionSpec. */ + class ExecutionSpec implements IExecutionSpec { + + /** + * Constructs a new ExecutionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.IExecutionSpec); + + /** ExecutionSpec args. */ + public args: { [k: string]: string }; + + /** ExecutionSpec serviceAccount. */ + public serviceAccount: string; + + /** ExecutionSpec project. */ + public project: string; + + /** ExecutionSpec maxJobExecutionLifetime. */ + public maxJobExecutionLifetime?: (google.protobuf.IDuration|null); + + /** ExecutionSpec kmsKey. */ + public kmsKey: string; + + /** + * Creates a new ExecutionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionSpec instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.IExecutionSpec): google.cloud.dataplex.v1.Task.ExecutionSpec; + + /** + * Encodes the specified ExecutionSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionSpec.verify|verify} messages. + * @param message ExecutionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.IExecutionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionSpec.verify|verify} messages. + * @param message ExecutionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.IExecutionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.ExecutionSpec; + + /** + * Decodes an ExecutionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.ExecutionSpec; + + /** + * Verifies an ExecutionSpec message. + * @param message Plain 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 ExecutionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.ExecutionSpec; + + /** + * Creates a plain object from an ExecutionSpec message. Also converts values to other types if specified. + * @param message ExecutionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.ExecutionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkTaskConfig. */ + interface ISparkTaskConfig { + + /** SparkTaskConfig mainJarFileUri */ + mainJarFileUri?: (string|null); + + /** SparkTaskConfig mainClass */ + mainClass?: (string|null); + + /** SparkTaskConfig pythonScriptFile */ + pythonScriptFile?: (string|null); + + /** SparkTaskConfig sqlScriptFile */ + sqlScriptFile?: (string|null); + + /** SparkTaskConfig sqlScript */ + sqlScript?: (string|null); + + /** SparkTaskConfig fileUris */ + fileUris?: (string[]|null); + + /** SparkTaskConfig archiveUris */ + archiveUris?: (string[]|null); + + /** SparkTaskConfig infrastructureSpec */ + infrastructureSpec?: (google.cloud.dataplex.v1.Task.IInfrastructureSpec|null); + } + + /** Represents a SparkTaskConfig. */ + class SparkTaskConfig implements ISparkTaskConfig { + + /** + * Constructs a new SparkTaskConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.ISparkTaskConfig); + + /** SparkTaskConfig mainJarFileUri. */ + public mainJarFileUri?: (string|null); + + /** SparkTaskConfig mainClass. */ + public mainClass?: (string|null); + + /** SparkTaskConfig pythonScriptFile. */ + public pythonScriptFile?: (string|null); + + /** SparkTaskConfig sqlScriptFile. */ + public sqlScriptFile?: (string|null); + + /** SparkTaskConfig sqlScript. */ + public sqlScript?: (string|null); + + /** SparkTaskConfig fileUris. */ + public fileUris: string[]; + + /** SparkTaskConfig archiveUris. */ + public archiveUris: string[]; + + /** SparkTaskConfig infrastructureSpec. */ + public infrastructureSpec?: (google.cloud.dataplex.v1.Task.IInfrastructureSpec|null); + + /** SparkTaskConfig driver. */ + public driver?: ("mainJarFileUri"|"mainClass"|"pythonScriptFile"|"sqlScriptFile"|"sqlScript"); + + /** + * Creates a new SparkTaskConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkTaskConfig instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.ISparkTaskConfig): google.cloud.dataplex.v1.Task.SparkTaskConfig; + + /** + * Encodes the specified SparkTaskConfig message. Does not implicitly {@link google.cloud.dataplex.v1.Task.SparkTaskConfig.verify|verify} messages. + * @param message SparkTaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.ISparkTaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkTaskConfig message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.SparkTaskConfig.verify|verify} messages. + * @param message SparkTaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.ISparkTaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkTaskConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.SparkTaskConfig; + + /** + * Decodes a SparkTaskConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.SparkTaskConfig; + + /** + * Verifies a SparkTaskConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkTaskConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkTaskConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.SparkTaskConfig; + + /** + * Creates a plain object from a SparkTaskConfig message. Also converts values to other types if specified. + * @param message SparkTaskConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.SparkTaskConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkTaskConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkTaskConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NotebookTaskConfig. */ + interface INotebookTaskConfig { + + /** NotebookTaskConfig notebook */ + notebook?: (string|null); + + /** NotebookTaskConfig infrastructureSpec */ + infrastructureSpec?: (google.cloud.dataplex.v1.Task.IInfrastructureSpec|null); + + /** NotebookTaskConfig fileUris */ + fileUris?: (string[]|null); + + /** NotebookTaskConfig archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a NotebookTaskConfig. */ + class NotebookTaskConfig implements INotebookTaskConfig { + + /** + * Constructs a new NotebookTaskConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.INotebookTaskConfig); + + /** NotebookTaskConfig notebook. */ + public notebook: string; + + /** NotebookTaskConfig infrastructureSpec. */ + public infrastructureSpec?: (google.cloud.dataplex.v1.Task.IInfrastructureSpec|null); + + /** NotebookTaskConfig fileUris. */ + public fileUris: string[]; + + /** NotebookTaskConfig archiveUris. */ + public archiveUris: string[]; + + /** + * Creates a new NotebookTaskConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotebookTaskConfig instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.INotebookTaskConfig): google.cloud.dataplex.v1.Task.NotebookTaskConfig; + + /** + * Encodes the specified NotebookTaskConfig message. Does not implicitly {@link google.cloud.dataplex.v1.Task.NotebookTaskConfig.verify|verify} messages. + * @param message NotebookTaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.INotebookTaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotebookTaskConfig message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.NotebookTaskConfig.verify|verify} messages. + * @param message NotebookTaskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.INotebookTaskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotebookTaskConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotebookTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.NotebookTaskConfig; + + /** + * Decodes a NotebookTaskConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotebookTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.NotebookTaskConfig; + + /** + * Verifies a NotebookTaskConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotebookTaskConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotebookTaskConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.NotebookTaskConfig; + + /** + * Creates a plain object from a NotebookTaskConfig message. Also converts values to other types if specified. + * @param message NotebookTaskConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.NotebookTaskConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotebookTaskConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotebookTaskConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionStatus. */ + interface IExecutionStatus { + + /** ExecutionStatus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionStatus latestJob */ + latestJob?: (google.cloud.dataplex.v1.IJob|null); + } + + /** Represents an ExecutionStatus. */ + class ExecutionStatus implements IExecutionStatus { + + /** + * Constructs a new ExecutionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.Task.IExecutionStatus); + + /** ExecutionStatus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionStatus latestJob. */ + public latestJob?: (google.cloud.dataplex.v1.IJob|null); + + /** + * Creates a new ExecutionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionStatus instance + */ + public static create(properties?: google.cloud.dataplex.v1.Task.IExecutionStatus): google.cloud.dataplex.v1.Task.ExecutionStatus; + + /** + * Encodes the specified ExecutionStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionStatus.verify|verify} messages. + * @param message ExecutionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.Task.IExecutionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionStatus.verify|verify} messages. + * @param message ExecutionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.Task.IExecutionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Task.ExecutionStatus; + + /** + * Decodes an ExecutionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Task.ExecutionStatus; + + /** + * Verifies an ExecutionStatus message. + * @param message Plain 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 ExecutionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Task.ExecutionStatus; + + /** + * Creates a plain object from an ExecutionStatus message. Also converts values to other types if specified. + * @param message ExecutionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Task.ExecutionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job uid */ + uid?: (string|null); + + /** Job startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Job endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Job state */ + state?: (google.cloud.dataplex.v1.Job.State|keyof typeof google.cloud.dataplex.v1.Job.State|null); + + /** Job retryCount */ + retryCount?: (number|null); + + /** Job service */ + service?: (google.cloud.dataplex.v1.Job.Service|keyof typeof google.cloud.dataplex.v1.Job.Service|null); + + /** Job serviceJob */ + serviceJob?: (string|null); + + /** Job message */ + message?: (string|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Job endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Job state. */ + public state: (google.cloud.dataplex.v1.Job.State|keyof typeof google.cloud.dataplex.v1.Job.State); + + /** Job retryCount. */ + public retryCount: number; + + /** Job service. */ + public service: (google.cloud.dataplex.v1.Job.Service|keyof typeof google.cloud.dataplex.v1.Job.Service); + + /** Job serviceJob. */ + public serviceJob: string; + + /** Job message. */ + public message: string; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.dataplex.v1.IJob): google.cloud.dataplex.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataplex.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** Service enum. */ + enum Service { + SERVICE_UNSPECIFIED = 0, + DATAPROC = 1 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + CANCELLING = 2, + CANCELLED = 3, + SUCCEEDED = 4, + FAILED = 5, + ABORTED = 6 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** 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; + } + + /** 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-dataplex/protos/protos.js b/packages/google-cloud-dataplex/protos/protos.js new file mode 100644 index 000000000000..46481b770130 --- /dev/null +++ b/packages/google-cloud-dataplex/protos/protos.js @@ -0,0 +1,56773 @@ +// Copyright 2022 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_dataplex_protos || ($protobuf.roots._google_cloud_dataplex_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.dataplex = (function() { + + /** + * Namespace dataplex. + * @memberof google.cloud + * @namespace + */ + var dataplex = {}; + + dataplex.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.dataplex + * @namespace + */ + var v1 = {}; + + v1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.dataplex.v1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [displayName] Environment displayName + * @property {string|null} [uid] Environment uid + * @property {google.protobuf.ITimestamp|null} [createTime] Environment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @property {Object.|null} [labels] Environment labels + * @property {string|null} [description] Environment description + * @property {google.cloud.dataplex.v1.State|null} [state] Environment state + * @property {google.cloud.dataplex.v1.Environment.IInfrastructureSpec|null} [infrastructureSpec] Environment infrastructureSpec + * @property {google.cloud.dataplex.v1.Environment.ISessionSpec|null} [sessionSpec] Environment sessionSpec + * @property {google.cloud.dataplex.v1.Environment.ISessionStatus|null} [sessionStatus] Environment sessionStatus + * @property {google.cloud.dataplex.v1.Environment.IEndpoints|null} [endpoints] Environment endpoints + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.dataplex.v1.IEnvironment=} [properties] Properties to set + */ + function Environment(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]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.displayName = ""; + + /** + * Environment uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.uid = ""; + + /** + * Environment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.createTime = null; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Environment labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.labels = $util.emptyObject; + + /** + * Environment description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.description = ""; + + /** + * Environment state. + * @member {google.cloud.dataplex.v1.State} state + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.state = 0; + + /** + * Environment infrastructureSpec. + * @member {google.cloud.dataplex.v1.Environment.IInfrastructureSpec|null|undefined} infrastructureSpec + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.infrastructureSpec = null; + + /** + * Environment sessionSpec. + * @member {google.cloud.dataplex.v1.Environment.ISessionSpec|null|undefined} sessionSpec + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.sessionSpec = null; + + /** + * Environment sessionStatus. + * @member {google.cloud.dataplex.v1.Environment.ISessionStatus|null|undefined} sessionStatus + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.sessionStatus = null; + + /** + * Environment endpoints. + * @member {google.cloud.dataplex.v1.Environment.IEndpoints|null|undefined} endpoints + * @memberof google.cloud.dataplex.v1.Environment + * @instance + */ + Environment.prototype.endpoints = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {google.cloud.dataplex.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {google.cloud.dataplex.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.infrastructureSpec != null && Object.hasOwnProperty.call(message, "infrastructureSpec")) + $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.encode(message.infrastructureSpec, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.sessionSpec != null && Object.hasOwnProperty.call(message, "sessionSpec")) + $root.google.cloud.dataplex.v1.Environment.SessionSpec.encode(message.sessionSpec, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.sessionStatus != null && Object.hasOwnProperty.call(message, "sessionStatus")) + $root.google.cloud.dataplex.v1.Environment.SessionStatus.encode(message.sessionStatus, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.endpoints != null && Object.hasOwnProperty.call(message, "endpoints")) + $root.google.cloud.dataplex.v1.Environment.Endpoints.encode(message.endpoints, writer.uint32(/* id 200, wireType 2 =*/1602).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {google.cloud.dataplex.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.description = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 100: { + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.decode(reader, reader.uint32()); + break; + } + case 101: { + message.sessionSpec = $root.google.cloud.dataplex.v1.Environment.SessionSpec.decode(reader, reader.uint32()); + break; + } + case 102: { + message.sessionStatus = $root.google.cloud.dataplex.v1.Environment.SessionStatus.decode(reader, reader.uint32()); + break; + } + case 200: { + message.endpoints = $root.google.cloud.dataplex.v1.Environment.Endpoints.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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: + break; + } + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) { + var error = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.verify(message.infrastructureSpec); + if (error) + return "infrastructureSpec." + error; + } + if (message.sessionSpec != null && message.hasOwnProperty("sessionSpec")) { + var error = $root.google.cloud.dataplex.v1.Environment.SessionSpec.verify(message.sessionSpec); + if (error) + return "sessionSpec." + error; + } + if (message.sessionStatus != null && message.hasOwnProperty("sessionStatus")) { + var error = $root.google.cloud.dataplex.v1.Environment.SessionStatus.verify(message.sessionStatus); + if (error) + return "sessionStatus." + error; + } + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + var error = $root.google.cloud.dataplex.v1.Environment.Endpoints.verify(message.endpoints); + if (error) + return "endpoints." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.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.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACTION_REQUIRED": + case 4: + message.state = 4; + break; + } + if (object.infrastructureSpec != null) { + if (typeof object.infrastructureSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.infrastructureSpec: object expected"); + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.fromObject(object.infrastructureSpec); + } + if (object.sessionSpec != null) { + if (typeof object.sessionSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.sessionSpec: object expected"); + message.sessionSpec = $root.google.cloud.dataplex.v1.Environment.SessionSpec.fromObject(object.sessionSpec); + } + if (object.sessionStatus != null) { + if (typeof object.sessionStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.sessionStatus: object expected"); + message.sessionStatus = $root.google.cloud.dataplex.v1.Environment.SessionStatus.fromObject(object.sessionStatus); + } + if (object.endpoints != null) { + if (typeof object.endpoints !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.endpoints: object expected"); + message.endpoints = $root.google.cloud.dataplex.v1.Environment.Endpoints.fromObject(object.endpoints); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {google.cloud.dataplex.v1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.infrastructureSpec = null; + object.sessionSpec = null; + object.sessionStatus = null; + object.endpoints = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.State[message.state] : message.state; + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) + object.infrastructureSpec = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.toObject(message.infrastructureSpec, options); + if (message.sessionSpec != null && message.hasOwnProperty("sessionSpec")) + object.sessionSpec = $root.google.cloud.dataplex.v1.Environment.SessionSpec.toObject(message.sessionSpec, options); + if (message.sessionStatus != null && message.hasOwnProperty("sessionStatus")) + object.sessionStatus = $root.google.cloud.dataplex.v1.Environment.SessionStatus.toObject(message.sessionStatus, options); + if (message.endpoints != null && message.hasOwnProperty("endpoints")) + object.endpoints = $root.google.cloud.dataplex.v1.Environment.Endpoints.toObject(message.endpoints, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment"; + }; + + Environment.InfrastructureSpec = (function() { + + /** + * Properties of an InfrastructureSpec. + * @memberof google.cloud.dataplex.v1.Environment + * @interface IInfrastructureSpec + * @property {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources|null} [compute] InfrastructureSpec compute + * @property {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime|null} [osImage] InfrastructureSpec osImage + */ + + /** + * Constructs a new InfrastructureSpec. + * @memberof google.cloud.dataplex.v1.Environment + * @classdesc Represents an InfrastructureSpec. + * @implements IInfrastructureSpec + * @constructor + * @param {google.cloud.dataplex.v1.Environment.IInfrastructureSpec=} [properties] Properties to set + */ + function InfrastructureSpec(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]]; + } + + /** + * InfrastructureSpec compute. + * @member {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources|null|undefined} compute + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @instance + */ + InfrastructureSpec.prototype.compute = null; + + /** + * InfrastructureSpec osImage. + * @member {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime|null|undefined} osImage + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @instance + */ + InfrastructureSpec.prototype.osImage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InfrastructureSpec resources. + * @member {"compute"|undefined} resources + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @instance + */ + Object.defineProperty(InfrastructureSpec.prototype, "resources", { + get: $util.oneOfGetter($oneOfFields = ["compute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InfrastructureSpec runtime. + * @member {"osImage"|undefined} runtime + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @instance + */ + Object.defineProperty(InfrastructureSpec.prototype, "runtime", { + get: $util.oneOfGetter($oneOfFields = ["osImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InfrastructureSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.IInfrastructureSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec} InfrastructureSpec instance + */ + InfrastructureSpec.create = function create(properties) { + return new InfrastructureSpec(properties); + }; + + /** + * Encodes the specified InfrastructureSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.IInfrastructureSpec} message InfrastructureSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfrastructureSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.compute != null && Object.hasOwnProperty.call(message, "compute")) + $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.encode(message.compute, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.osImage != null && Object.hasOwnProperty.call(message, "osImage")) + $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.encode(message.osImage, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfrastructureSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.IInfrastructureSpec} message InfrastructureSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfrastructureSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec} InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfrastructureSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 50: { + message.compute = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.decode(reader, reader.uint32()); + break; + } + case 100: { + message.osImage = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec} InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfrastructureSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfrastructureSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfrastructureSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.compute != null && message.hasOwnProperty("compute")) { + properties.resources = 1; + { + var error = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.verify(message.compute); + if (error) + return "compute." + error; + } + } + if (message.osImage != null && message.hasOwnProperty("osImage")) { + properties.runtime = 1; + { + var error = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.verify(message.osImage); + if (error) + return "osImage." + error; + } + } + return null; + }; + + /** + * Creates an InfrastructureSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec} InfrastructureSpec + */ + InfrastructureSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec(); + if (object.compute != null) { + if (typeof object.compute !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.InfrastructureSpec.compute: object expected"); + message.compute = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.fromObject(object.compute); + } + if (object.osImage != null) { + if (typeof object.osImage !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.InfrastructureSpec.osImage: object expected"); + message.osImage = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.fromObject(object.osImage); + } + return message; + }; + + /** + * Creates a plain object from an InfrastructureSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec} message InfrastructureSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfrastructureSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.compute != null && message.hasOwnProperty("compute")) { + object.compute = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.toObject(message.compute, options); + if (options.oneofs) + object.resources = "compute"; + } + if (message.osImage != null && message.hasOwnProperty("osImage")) { + object.osImage = $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.toObject(message.osImage, options); + if (options.oneofs) + object.runtime = "osImage"; + } + return object; + }; + + /** + * Converts this InfrastructureSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @instance + * @returns {Object.} JSON object + */ + InfrastructureSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InfrastructureSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InfrastructureSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.InfrastructureSpec"; + }; + + InfrastructureSpec.ComputeResources = (function() { + + /** + * Properties of a ComputeResources. + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @interface IComputeResources + * @property {number|null} [diskSizeGb] ComputeResources diskSizeGb + * @property {number|null} [nodeCount] ComputeResources nodeCount + * @property {number|null} [maxNodeCount] ComputeResources maxNodeCount + */ + + /** + * Constructs a new ComputeResources. + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @classdesc Represents a ComputeResources. + * @implements IComputeResources + * @constructor + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources=} [properties] Properties to set + */ + function ComputeResources(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]]; + } + + /** + * ComputeResources diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @instance + */ + ComputeResources.prototype.diskSizeGb = 0; + + /** + * ComputeResources nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @instance + */ + ComputeResources.prototype.nodeCount = 0; + + /** + * ComputeResources maxNodeCount. + * @member {number} maxNodeCount + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @instance + */ + ComputeResources.prototype.maxNodeCount = 0; + + /** + * Creates a new ComputeResources instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources} ComputeResources instance + */ + ComputeResources.create = function create(properties) { + return new ComputeResources(properties); + }; + + /** + * Encodes the specified ComputeResources message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources} message ComputeResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.diskSizeGb); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodeCount); + return writer; + }; + + /** + * Encodes the specified ComputeResources message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IComputeResources} message ComputeResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources} ComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.diskSizeGb = reader.int32(); + break; + } + case 2: { + message.nodeCount = reader.int32(); + break; + } + case 3: { + message.maxNodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources} ComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeResources message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + if (!$util.isInteger(message.maxNodeCount)) + return "maxNodeCount: integer expected"; + return null; + }; + + /** + * Creates a ComputeResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources} ComputeResources + */ + ComputeResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources(); + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.maxNodeCount != null) + message.maxNodeCount = object.maxNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a ComputeResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources} message ComputeResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.diskSizeGb = 0; + object.nodeCount = 0; + object.maxNodeCount = 0; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + object.maxNodeCount = message.maxNodeCount; + return object; + }; + + /** + * Converts this ComputeResources to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @instance + * @returns {Object.} JSON object + */ + ComputeResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeResources + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.InfrastructureSpec.ComputeResources"; + }; + + return ComputeResources; + })(); + + InfrastructureSpec.OsImageRuntime = (function() { + + /** + * Properties of an OsImageRuntime. + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @interface IOsImageRuntime + * @property {string|null} [imageVersion] OsImageRuntime imageVersion + * @property {Array.|null} [javaLibraries] OsImageRuntime javaLibraries + * @property {Array.|null} [pythonPackages] OsImageRuntime pythonPackages + * @property {Object.|null} [properties] OsImageRuntime properties + */ + + /** + * Constructs a new OsImageRuntime. + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec + * @classdesc Represents an OsImageRuntime. + * @implements IOsImageRuntime + * @constructor + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime=} [properties] Properties to set + */ + function OsImageRuntime(properties) { + this.javaLibraries = []; + this.pythonPackages = []; + this.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]]; + } + + /** + * OsImageRuntime imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @instance + */ + OsImageRuntime.prototype.imageVersion = ""; + + /** + * OsImageRuntime javaLibraries. + * @member {Array.} javaLibraries + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @instance + */ + OsImageRuntime.prototype.javaLibraries = $util.emptyArray; + + /** + * OsImageRuntime pythonPackages. + * @member {Array.} pythonPackages + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @instance + */ + OsImageRuntime.prototype.pythonPackages = $util.emptyArray; + + /** + * OsImageRuntime properties. + * @member {Object.} properties + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @instance + */ + OsImageRuntime.prototype.properties = $util.emptyObject; + + /** + * Creates a new OsImageRuntime instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime} OsImageRuntime instance + */ + OsImageRuntime.create = function create(properties) { + return new OsImageRuntime(properties); + }; + + /** + * Encodes the specified OsImageRuntime message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime} message OsImageRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsImageRuntime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); + if (message.javaLibraries != null && message.javaLibraries.length) + for (var i = 0; i < message.javaLibraries.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.javaLibraries[i]); + if (message.pythonPackages != null && message.pythonPackages.length) + for (var i = 0; i < message.pythonPackages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonPackages[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.properties[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified OsImageRuntime message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.IOsImageRuntime} message OsImageRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsImageRuntime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsImageRuntime message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime} OsImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsImageRuntime.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageVersion = reader.string(); + break; + } + case 2: { + if (!(message.javaLibraries && message.javaLibraries.length)) + message.javaLibraries = []; + message.javaLibraries.push(reader.string()); + break; + } + case 3: { + if (!(message.pythonPackages && message.pythonPackages.length)) + message.pythonPackages = []; + message.pythonPackages.push(reader.string()); + break; + } + case 4: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsImageRuntime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime} OsImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsImageRuntime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsImageRuntime message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsImageRuntime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.javaLibraries != null && message.hasOwnProperty("javaLibraries")) { + if (!Array.isArray(message.javaLibraries)) + return "javaLibraries: array expected"; + for (var i = 0; i < message.javaLibraries.length; ++i) + if (!$util.isString(message.javaLibraries[i])) + return "javaLibraries: string[] expected"; + } + if (message.pythonPackages != null && message.hasOwnProperty("pythonPackages")) { + if (!Array.isArray(message.pythonPackages)) + return "pythonPackages: array expected"; + for (var i = 0; i < message.pythonPackages.length; ++i) + if (!$util.isString(message.pythonPackages[i])) + return "pythonPackages: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an OsImageRuntime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime} OsImageRuntime + */ + OsImageRuntime.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime(); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.javaLibraries) { + if (!Array.isArray(object.javaLibraries)) + throw TypeError(".google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.javaLibraries: array expected"); + message.javaLibraries = []; + for (var i = 0; i < object.javaLibraries.length; ++i) + message.javaLibraries[i] = String(object.javaLibraries[i]); + } + if (object.pythonPackages) { + if (!Array.isArray(object.pythonPackages)) + throw TypeError(".google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.pythonPackages: array expected"); + message.pythonPackages = []; + for (var i = 0; i < object.pythonPackages.length; ++i) + message.pythonPackages[i] = String(object.pythonPackages[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an OsImageRuntime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime} message OsImageRuntime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsImageRuntime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.javaLibraries = []; + object.pythonPackages = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.imageVersion = ""; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + if (message.javaLibraries && message.javaLibraries.length) { + object.javaLibraries = []; + for (var j = 0; j < message.javaLibraries.length; ++j) + object.javaLibraries[j] = message.javaLibraries[j]; + } + if (message.pythonPackages && message.pythonPackages.length) { + object.pythonPackages = []; + for (var j = 0; j < message.pythonPackages.length; ++j) + object.pythonPackages[j] = message.pythonPackages[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + return object; + }; + + /** + * Converts this OsImageRuntime to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @instance + * @returns {Object.} JSON object + */ + OsImageRuntime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsImageRuntime + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsImageRuntime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.InfrastructureSpec.OsImageRuntime"; + }; + + return OsImageRuntime; + })(); + + return InfrastructureSpec; + })(); + + Environment.SessionSpec = (function() { + + /** + * Properties of a SessionSpec. + * @memberof google.cloud.dataplex.v1.Environment + * @interface ISessionSpec + * @property {google.protobuf.IDuration|null} [maxIdleDuration] SessionSpec maxIdleDuration + * @property {boolean|null} [enableFastStartup] SessionSpec enableFastStartup + */ + + /** + * Constructs a new SessionSpec. + * @memberof google.cloud.dataplex.v1.Environment + * @classdesc Represents a SessionSpec. + * @implements ISessionSpec + * @constructor + * @param {google.cloud.dataplex.v1.Environment.ISessionSpec=} [properties] Properties to set + */ + function SessionSpec(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]]; + } + + /** + * SessionSpec maxIdleDuration. + * @member {google.protobuf.IDuration|null|undefined} maxIdleDuration + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @instance + */ + SessionSpec.prototype.maxIdleDuration = null; + + /** + * SessionSpec enableFastStartup. + * @member {boolean} enableFastStartup + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @instance + */ + SessionSpec.prototype.enableFastStartup = false; + + /** + * Creates a new SessionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.SessionSpec} SessionSpec instance + */ + SessionSpec.create = function create(properties) { + return new SessionSpec(properties); + }; + + /** + * Encodes the specified SessionSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionSpec} message SessionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxIdleDuration != null && Object.hasOwnProperty.call(message, "maxIdleDuration")) + $root.google.protobuf.Duration.encode(message.maxIdleDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.enableFastStartup != null && Object.hasOwnProperty.call(message, "enableFastStartup")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableFastStartup); + return writer; + }; + + /** + * Encodes the specified SessionSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionSpec} message SessionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.SessionSpec} SessionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.SessionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxIdleDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.enableFastStartup = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.SessionSpec} SessionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxIdleDuration != null && message.hasOwnProperty("maxIdleDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxIdleDuration); + if (error) + return "maxIdleDuration." + error; + } + if (message.enableFastStartup != null && message.hasOwnProperty("enableFastStartup")) + if (typeof message.enableFastStartup !== "boolean") + return "enableFastStartup: boolean expected"; + return null; + }; + + /** + * Creates a SessionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.SessionSpec} SessionSpec + */ + SessionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.SessionSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.SessionSpec(); + if (object.maxIdleDuration != null) { + if (typeof object.maxIdleDuration !== "object") + throw TypeError(".google.cloud.dataplex.v1.Environment.SessionSpec.maxIdleDuration: object expected"); + message.maxIdleDuration = $root.google.protobuf.Duration.fromObject(object.maxIdleDuration); + } + if (object.enableFastStartup != null) + message.enableFastStartup = Boolean(object.enableFastStartup); + return message; + }; + + /** + * Creates a plain object from a SessionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {google.cloud.dataplex.v1.Environment.SessionSpec} message SessionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxIdleDuration = null; + object.enableFastStartup = false; + } + if (message.maxIdleDuration != null && message.hasOwnProperty("maxIdleDuration")) + object.maxIdleDuration = $root.google.protobuf.Duration.toObject(message.maxIdleDuration, options); + if (message.enableFastStartup != null && message.hasOwnProperty("enableFastStartup")) + object.enableFastStartup = message.enableFastStartup; + return object; + }; + + /** + * Converts this SessionSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @instance + * @returns {Object.} JSON object + */ + SessionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.SessionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.SessionSpec"; + }; + + return SessionSpec; + })(); + + Environment.SessionStatus = (function() { + + /** + * Properties of a SessionStatus. + * @memberof google.cloud.dataplex.v1.Environment + * @interface ISessionStatus + * @property {boolean|null} [active] SessionStatus active + */ + + /** + * Constructs a new SessionStatus. + * @memberof google.cloud.dataplex.v1.Environment + * @classdesc Represents a SessionStatus. + * @implements ISessionStatus + * @constructor + * @param {google.cloud.dataplex.v1.Environment.ISessionStatus=} [properties] Properties to set + */ + function SessionStatus(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]]; + } + + /** + * SessionStatus active. + * @member {boolean} active + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @instance + */ + SessionStatus.prototype.active = false; + + /** + * Creates a new SessionStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.SessionStatus} SessionStatus instance + */ + SessionStatus.create = function create(properties) { + return new SessionStatus(properties); + }; + + /** + * Encodes the specified SessionStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionStatus} message SessionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.active != null && Object.hasOwnProperty.call(message, "active")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active); + return writer; + }; + + /** + * Encodes the specified SessionStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.SessionStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {google.cloud.dataplex.v1.Environment.ISessionStatus} message SessionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.SessionStatus} SessionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.SessionStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.active = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.SessionStatus} SessionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.active != null && message.hasOwnProperty("active")) + if (typeof message.active !== "boolean") + return "active: boolean expected"; + return null; + }; + + /** + * Creates a SessionStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.SessionStatus} SessionStatus + */ + SessionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.SessionStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.SessionStatus(); + if (object.active != null) + message.active = Boolean(object.active); + return message; + }; + + /** + * Creates a plain object from a SessionStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {google.cloud.dataplex.v1.Environment.SessionStatus} message SessionStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.active = false; + if (message.active != null && message.hasOwnProperty("active")) + object.active = message.active; + return object; + }; + + /** + * Converts this SessionStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @instance + * @returns {Object.} JSON object + */ + SessionStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.SessionStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.SessionStatus"; + }; + + return SessionStatus; + })(); + + Environment.Endpoints = (function() { + + /** + * Properties of an Endpoints. + * @memberof google.cloud.dataplex.v1.Environment + * @interface IEndpoints + * @property {string|null} [notebooks] Endpoints notebooks + * @property {string|null} [sql] Endpoints sql + */ + + /** + * Constructs a new Endpoints. + * @memberof google.cloud.dataplex.v1.Environment + * @classdesc Represents an Endpoints. + * @implements IEndpoints + * @constructor + * @param {google.cloud.dataplex.v1.Environment.IEndpoints=} [properties] Properties to set + */ + function Endpoints(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]]; + } + + /** + * Endpoints notebooks. + * @member {string} notebooks + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @instance + */ + Endpoints.prototype.notebooks = ""; + + /** + * Endpoints sql. + * @member {string} sql + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @instance + */ + Endpoints.prototype.sql = ""; + + /** + * Creates a new Endpoints instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {google.cloud.dataplex.v1.Environment.IEndpoints=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Environment.Endpoints} Endpoints instance + */ + Endpoints.create = function create(properties) { + return new Endpoints(properties); + }; + + /** + * Encodes the specified Endpoints message. Does not implicitly {@link google.cloud.dataplex.v1.Environment.Endpoints.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {google.cloud.dataplex.v1.Environment.IEndpoints} message Endpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Endpoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notebooks != null && Object.hasOwnProperty.call(message, "notebooks")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notebooks); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sql); + return writer; + }; + + /** + * Encodes the specified Endpoints message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Environment.Endpoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {google.cloud.dataplex.v1.Environment.IEndpoints} message Endpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Endpoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Endpoints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Environment.Endpoints} Endpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Endpoints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Environment.Endpoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.notebooks = reader.string(); + break; + } + case 2: { + message.sql = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Endpoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Environment.Endpoints} Endpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Endpoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Endpoints message. + * @function verify + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Endpoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notebooks != null && message.hasOwnProperty("notebooks")) + if (!$util.isString(message.notebooks)) + return "notebooks: string expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + return null; + }; + + /** + * Creates an Endpoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Environment.Endpoints} Endpoints + */ + Endpoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Environment.Endpoints) + return object; + var message = new $root.google.cloud.dataplex.v1.Environment.Endpoints(); + if (object.notebooks != null) + message.notebooks = String(object.notebooks); + if (object.sql != null) + message.sql = String(object.sql); + return message; + }; + + /** + * Creates a plain object from an Endpoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {google.cloud.dataplex.v1.Environment.Endpoints} message Endpoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Endpoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.notebooks = ""; + object.sql = ""; + } + if (message.notebooks != null && message.hasOwnProperty("notebooks")) + object.notebooks = message.notebooks; + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + return object; + }; + + /** + * Converts this Endpoints to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @instance + * @returns {Object.} JSON object + */ + Endpoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Endpoints + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Environment.Endpoints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Endpoints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Environment.Endpoints"; + }; + + return Endpoints; + })(); + + return Environment; + })(); + + v1.Content = (function() { + + /** + * Properties of a Content. + * @memberof google.cloud.dataplex.v1 + * @interface IContent + * @property {string|null} [name] Content name + * @property {string|null} [uid] Content uid + * @property {string|null} [path] Content path + * @property {google.protobuf.ITimestamp|null} [createTime] Content createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Content updateTime + * @property {Object.|null} [labels] Content labels + * @property {string|null} [description] Content description + * @property {string|null} [dataText] Content dataText + * @property {google.cloud.dataplex.v1.Content.ISqlScript|null} [sqlScript] Content sqlScript + * @property {google.cloud.dataplex.v1.Content.INotebook|null} [notebook] Content notebook + */ + + /** + * Constructs a new Content. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Content. + * @implements IContent + * @constructor + * @param {google.cloud.dataplex.v1.IContent=} [properties] Properties to set + */ + function Content(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]]; + } + + /** + * Content name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.name = ""; + + /** + * Content uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.uid = ""; + + /** + * Content path. + * @member {string} path + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.path = ""; + + /** + * Content createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.createTime = null; + + /** + * Content updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.updateTime = null; + + /** + * Content labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.labels = $util.emptyObject; + + /** + * Content description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.description = ""; + + /** + * Content dataText. + * @member {string|null|undefined} dataText + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.dataText = null; + + /** + * Content sqlScript. + * @member {google.cloud.dataplex.v1.Content.ISqlScript|null|undefined} sqlScript + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.sqlScript = null; + + /** + * Content notebook. + * @member {google.cloud.dataplex.v1.Content.INotebook|null|undefined} notebook + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Content.prototype.notebook = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Content data. + * @member {"dataText"|undefined} data + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Object.defineProperty(Content.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["dataText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Content content. + * @member {"sqlScript"|"notebook"|undefined} content + * @memberof google.cloud.dataplex.v1.Content + * @instance + */ + Object.defineProperty(Content.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["sqlScript", "notebook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Content instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {google.cloud.dataplex.v1.IContent=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Content} Content instance + */ + Content.create = function create(properties) { + return new Content(properties); + }; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.cloud.dataplex.v1.Content.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {google.cloud.dataplex.v1.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.dataText != null && Object.hasOwnProperty.call(message, "dataText")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataText); + if (message.sqlScript != null && Object.hasOwnProperty.call(message, "sqlScript")) + $root.google.cloud.dataplex.v1.Content.SqlScript.encode(message.sqlScript, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) + $root.google.cloud.dataplex.v1.Content.Notebook.encode(message.notebook, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {google.cloud.dataplex.v1.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Content message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Content(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.path = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.description = reader.string(); + break; + } + case 9: { + message.dataText = reader.string(); + break; + } + case 100: { + message.sqlScript = $root.google.cloud.dataplex.v1.Content.SqlScript.decode(reader, reader.uint32()); + break; + } + case 101: { + message.notebook = $root.google.cloud.dataplex.v1.Content.Notebook.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Content message. + * @function verify + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Content.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataText != null && message.hasOwnProperty("dataText")) { + properties.data = 1; + if (!$util.isString(message.dataText)) + return "dataText: string expected"; + } + if (message.sqlScript != null && message.hasOwnProperty("sqlScript")) { + properties.content = 1; + { + var error = $root.google.cloud.dataplex.v1.Content.SqlScript.verify(message.sqlScript); + if (error) + return "sqlScript." + error; + } + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.cloud.dataplex.v1.Content.Notebook.verify(message.notebook); + if (error) + return "notebook." + error; + } + } + return null; + }; + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Content} Content + */ + Content.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Content) + return object; + var message = new $root.google.cloud.dataplex.v1.Content(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.path != null) + message.path = String(object.path); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Content.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Content.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Content.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.description != null) + message.description = String(object.description); + if (object.dataText != null) + message.dataText = String(object.dataText); + if (object.sqlScript != null) { + if (typeof object.sqlScript !== "object") + throw TypeError(".google.cloud.dataplex.v1.Content.sqlScript: object expected"); + message.sqlScript = $root.google.cloud.dataplex.v1.Content.SqlScript.fromObject(object.sqlScript); + } + if (object.notebook != null) { + if (typeof object.notebook !== "object") + throw TypeError(".google.cloud.dataplex.v1.Content.notebook: object expected"); + message.notebook = $root.google.cloud.dataplex.v1.Content.Notebook.fromObject(object.notebook); + } + return message; + }; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {google.cloud.dataplex.v1.Content} message Content + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Content.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.path = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataText != null && message.hasOwnProperty("dataText")) { + object.dataText = message.dataText; + if (options.oneofs) + object.data = "dataText"; + } + if (message.sqlScript != null && message.hasOwnProperty("sqlScript")) { + object.sqlScript = $root.google.cloud.dataplex.v1.Content.SqlScript.toObject(message.sqlScript, options); + if (options.oneofs) + object.content = "sqlScript"; + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + object.notebook = $root.google.cloud.dataplex.v1.Content.Notebook.toObject(message.notebook, options); + if (options.oneofs) + object.content = "notebook"; + } + return object; + }; + + /** + * Converts this Content to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Content + * @instance + * @returns {Object.} JSON object + */ + Content.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Content + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Content + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Content"; + }; + + Content.SqlScript = (function() { + + /** + * Properties of a SqlScript. + * @memberof google.cloud.dataplex.v1.Content + * @interface ISqlScript + * @property {google.cloud.dataplex.v1.Content.SqlScript.QueryEngine|null} [engine] SqlScript engine + */ + + /** + * Constructs a new SqlScript. + * @memberof google.cloud.dataplex.v1.Content + * @classdesc Represents a SqlScript. + * @implements ISqlScript + * @constructor + * @param {google.cloud.dataplex.v1.Content.ISqlScript=} [properties] Properties to set + */ + function SqlScript(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]]; + } + + /** + * SqlScript engine. + * @member {google.cloud.dataplex.v1.Content.SqlScript.QueryEngine} engine + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @instance + */ + SqlScript.prototype.engine = 0; + + /** + * Creates a new SqlScript instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {google.cloud.dataplex.v1.Content.ISqlScript=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Content.SqlScript} SqlScript instance + */ + SqlScript.create = function create(properties) { + return new SqlScript(properties); + }; + + /** + * Encodes the specified SqlScript message. Does not implicitly {@link google.cloud.dataplex.v1.Content.SqlScript.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {google.cloud.dataplex.v1.Content.ISqlScript} message SqlScript message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlScript.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.engine); + return writer; + }; + + /** + * Encodes the specified SqlScript message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.SqlScript.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {google.cloud.dataplex.v1.Content.ISqlScript} message SqlScript message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlScript.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlScript message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Content.SqlScript} SqlScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlScript.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Content.SqlScript(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.engine = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlScript message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Content.SqlScript} SqlScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlScript.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlScript message. + * @function verify + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlScript.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 2: + break; + } + return null; + }; + + /** + * Creates a SqlScript message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Content.SqlScript} SqlScript + */ + SqlScript.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Content.SqlScript) + return object; + var message = new $root.google.cloud.dataplex.v1.Content.SqlScript(); + switch (object.engine) { + case "QUERY_ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "SPARK": + case 2: + message.engine = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SqlScript message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {google.cloud.dataplex.v1.Content.SqlScript} message SqlScript + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlScript.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.engine = options.enums === String ? "QUERY_ENGINE_UNSPECIFIED" : 0; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.dataplex.v1.Content.SqlScript.QueryEngine[message.engine] : message.engine; + return object; + }; + + /** + * Converts this SqlScript to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @instance + * @returns {Object.} JSON object + */ + SqlScript.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlScript + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Content.SqlScript + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlScript.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Content.SqlScript"; + }; + + /** + * QueryEngine enum. + * @name google.cloud.dataplex.v1.Content.SqlScript.QueryEngine + * @enum {number} + * @property {number} QUERY_ENGINE_UNSPECIFIED=0 QUERY_ENGINE_UNSPECIFIED value + * @property {number} SPARK=2 SPARK value + */ + SqlScript.QueryEngine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUERY_ENGINE_UNSPECIFIED"] = 0; + values[valuesById[2] = "SPARK"] = 2; + return values; + })(); + + return SqlScript; + })(); + + Content.Notebook = (function() { + + /** + * Properties of a Notebook. + * @memberof google.cloud.dataplex.v1.Content + * @interface INotebook + * @property {google.cloud.dataplex.v1.Content.Notebook.KernelType|null} [kernelType] Notebook kernelType + */ + + /** + * Constructs a new Notebook. + * @memberof google.cloud.dataplex.v1.Content + * @classdesc Represents a Notebook. + * @implements INotebook + * @constructor + * @param {google.cloud.dataplex.v1.Content.INotebook=} [properties] Properties to set + */ + function Notebook(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]]; + } + + /** + * Notebook kernelType. + * @member {google.cloud.dataplex.v1.Content.Notebook.KernelType} kernelType + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @instance + */ + Notebook.prototype.kernelType = 0; + + /** + * Creates a new Notebook instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {google.cloud.dataplex.v1.Content.INotebook=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Content.Notebook} Notebook instance + */ + Notebook.create = function create(properties) { + return new Notebook(properties); + }; + + /** + * Encodes the specified Notebook message. Does not implicitly {@link google.cloud.dataplex.v1.Content.Notebook.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {google.cloud.dataplex.v1.Content.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kernelType != null && Object.hasOwnProperty.call(message, "kernelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kernelType); + return writer; + }; + + /** + * Encodes the specified Notebook message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Content.Notebook.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {google.cloud.dataplex.v1.Content.INotebook} message Notebook message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notebook.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Notebook message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Content.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Content.Notebook(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kernelType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Notebook message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Content.Notebook} Notebook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notebook.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Notebook message. + * @function verify + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Notebook.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kernelType != null && message.hasOwnProperty("kernelType")) + switch (message.kernelType) { + default: + return "kernelType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Notebook message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Content.Notebook} Notebook + */ + Notebook.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Content.Notebook) + return object; + var message = new $root.google.cloud.dataplex.v1.Content.Notebook(); + switch (object.kernelType) { + case "KERNEL_TYPE_UNSPECIFIED": + case 0: + message.kernelType = 0; + break; + case "PYTHON3": + case 1: + message.kernelType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Notebook message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {google.cloud.dataplex.v1.Content.Notebook} message Notebook + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Notebook.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kernelType = options.enums === String ? "KERNEL_TYPE_UNSPECIFIED" : 0; + if (message.kernelType != null && message.hasOwnProperty("kernelType")) + object.kernelType = options.enums === String ? $root.google.cloud.dataplex.v1.Content.Notebook.KernelType[message.kernelType] : message.kernelType; + return object; + }; + + /** + * Converts this Notebook to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @instance + * @returns {Object.} JSON object + */ + Notebook.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Notebook + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Content.Notebook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Notebook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Content.Notebook"; + }; + + /** + * KernelType enum. + * @name google.cloud.dataplex.v1.Content.Notebook.KernelType + * @enum {number} + * @property {number} KERNEL_TYPE_UNSPECIFIED=0 KERNEL_TYPE_UNSPECIFIED value + * @property {number} PYTHON3=1 PYTHON3 value + */ + Notebook.KernelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KERNEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PYTHON3"] = 1; + return values; + })(); + + return Notebook; + })(); + + return Content; + })(); + + v1.Session = (function() { + + /** + * Properties of a Session. + * @memberof google.cloud.dataplex.v1 + * @interface ISession + * @property {string|null} [name] Session name + * @property {string|null} [userId] Session userId + * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime + * @property {google.cloud.dataplex.v1.State|null} [state] Session state + */ + + /** + * Constructs a new Session. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Session. + * @implements ISession + * @constructor + * @param {google.cloud.dataplex.v1.ISession=} [properties] Properties to set + */ + function Session(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]]; + } + + /** + * Session name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Session + * @instance + */ + Session.prototype.name = ""; + + /** + * Session userId. + * @member {string} userId + * @memberof google.cloud.dataplex.v1.Session + * @instance + */ + Session.prototype.userId = ""; + + /** + * Session createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Session + * @instance + */ + Session.prototype.createTime = null; + + /** + * Session state. + * @member {google.cloud.dataplex.v1.State} state + * @memberof google.cloud.dataplex.v1.Session + * @instance + */ + Session.prototype.state = 0; + + /** + * Creates a new Session instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {google.cloud.dataplex.v1.ISession=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Session} Session instance + */ + Session.create = function create(properties) { + return new Session(properties); + }; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataplex.v1.Session.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {google.cloud.dataplex.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.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.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Session.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {google.cloud.dataplex.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Session message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Session(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Session message. + * @function verify + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Session.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.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + 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: + break; + } + return null; + }; + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Session} Session + */ + Session.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Session) + return object; + var message = new $root.google.cloud.dataplex.v1.Session(); + if (object.name != null) + message.name = String(object.name); + if (object.userId != null) + message.userId = String(object.userId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Session.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACTION_REQUIRED": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {google.cloud.dataplex.v1.Session} message Session + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Session.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.userId = ""; + object.createTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Session to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Session + * @instance + * @returns {Object.} JSON object + */ + Session.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Session + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Session + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Session"; + }; + + return Session; + })(); + + v1.Lake = (function() { + + /** + * Properties of a Lake. + * @memberof google.cloud.dataplex.v1 + * @interface ILake + * @property {string|null} [name] Lake name + * @property {string|null} [displayName] Lake displayName + * @property {string|null} [uid] Lake uid + * @property {google.protobuf.ITimestamp|null} [createTime] Lake createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Lake updateTime + * @property {Object.|null} [labels] Lake labels + * @property {string|null} [description] Lake description + * @property {google.cloud.dataplex.v1.Lake.MetastoreStatus.State|null} [state] Lake state + * @property {string|null} [serviceAccount] Lake serviceAccount + * @property {google.cloud.dataplex.v1.Lake.IMetastore|null} [metastore] Lake metastore + * @property {google.cloud.dataplex.v1.IAssetStatus|null} [assetStatus] Lake assetStatus + * @property {google.cloud.dataplex.v1.Lake.IMetastoreStatus|null} [metastoreStatus] Lake metastoreStatus + */ + + /** + * Constructs a new Lake. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Lake. + * @implements ILake + * @constructor + * @param {google.cloud.dataplex.v1.ILake=} [properties] Properties to set + */ + function Lake(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]]; + } + + /** + * Lake name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.name = ""; + + /** + * Lake displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.displayName = ""; + + /** + * Lake uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.uid = ""; + + /** + * Lake createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.createTime = null; + + /** + * Lake updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.updateTime = null; + + /** + * Lake labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.labels = $util.emptyObject; + + /** + * Lake description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.description = ""; + + /** + * Lake state. + * @member {google.cloud.dataplex.v1.Lake.MetastoreStatus.State} state + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.state = 0; + + /** + * Lake serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.serviceAccount = ""; + + /** + * Lake metastore. + * @member {google.cloud.dataplex.v1.Lake.IMetastore|null|undefined} metastore + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.metastore = null; + + /** + * Lake assetStatus. + * @member {google.cloud.dataplex.v1.IAssetStatus|null|undefined} assetStatus + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.assetStatus = null; + + /** + * Lake metastoreStatus. + * @member {google.cloud.dataplex.v1.Lake.IMetastoreStatus|null|undefined} metastoreStatus + * @memberof google.cloud.dataplex.v1.Lake + * @instance + */ + Lake.prototype.metastoreStatus = null; + + /** + * Creates a new Lake instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {google.cloud.dataplex.v1.ILake=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Lake} Lake instance + */ + Lake.create = function create(properties) { + return new Lake(properties); + }; + + /** + * Encodes the specified Lake message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {google.cloud.dataplex.v1.ILake} message Lake message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lake.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); + if (message.metastore != null && Object.hasOwnProperty.call(message, "metastore")) + $root.google.cloud.dataplex.v1.Lake.Metastore.encode(message.metastore, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.assetStatus != null && Object.hasOwnProperty.call(message, "assetStatus")) + $root.google.cloud.dataplex.v1.AssetStatus.encode(message.assetStatus, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.metastoreStatus != null && Object.hasOwnProperty.call(message, "metastoreStatus")) + $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.encode(message.metastoreStatus, writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Lake message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {google.cloud.dataplex.v1.ILake} message Lake message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Lake.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Lake message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Lake} Lake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lake.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Lake(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.description = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.serviceAccount = reader.string(); + break; + } + case 102: { + message.metastore = $root.google.cloud.dataplex.v1.Lake.Metastore.decode(reader, reader.uint32()); + break; + } + case 103: { + message.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.decode(reader, reader.uint32()); + break; + } + case 104: { + message.metastoreStatus = $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Lake message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Lake} Lake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Lake.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Lake message. + * @function verify + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Lake.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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: + break; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.metastore != null && message.hasOwnProperty("metastore")) { + var error = $root.google.cloud.dataplex.v1.Lake.Metastore.verify(message.metastore); + if (error) + return "metastore." + error; + } + if (message.assetStatus != null && message.hasOwnProperty("assetStatus")) { + var error = $root.google.cloud.dataplex.v1.AssetStatus.verify(message.assetStatus); + if (error) + return "assetStatus." + error; + } + if (message.metastoreStatus != null && message.hasOwnProperty("metastoreStatus")) { + var error = $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.verify(message.metastoreStatus); + if (error) + return "metastoreStatus." + error; + } + return null; + }; + + /** + * Creates a Lake message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Lake} Lake + */ + Lake.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Lake) + return object; + var message = new $root.google.cloud.dataplex.v1.Lake(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.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.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NONE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.metastore != null) { + if (typeof object.metastore !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.metastore: object expected"); + message.metastore = $root.google.cloud.dataplex.v1.Lake.Metastore.fromObject(object.metastore); + } + if (object.assetStatus != null) { + if (typeof object.assetStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.assetStatus: object expected"); + message.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.fromObject(object.assetStatus); + } + if (object.metastoreStatus != null) { + if (typeof object.metastoreStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.metastoreStatus: object expected"); + message.metastoreStatus = $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.fromObject(object.metastoreStatus); + } + return message; + }; + + /** + * Creates a plain object from a Lake message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {google.cloud.dataplex.v1.Lake} message Lake + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Lake.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.serviceAccount = ""; + object.metastore = null; + object.assetStatus = null; + object.metastoreStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.State[message.state] : message.state; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.metastore != null && message.hasOwnProperty("metastore")) + object.metastore = $root.google.cloud.dataplex.v1.Lake.Metastore.toObject(message.metastore, options); + if (message.assetStatus != null && message.hasOwnProperty("assetStatus")) + object.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.toObject(message.assetStatus, options); + if (message.metastoreStatus != null && message.hasOwnProperty("metastoreStatus")) + object.metastoreStatus = $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.toObject(message.metastoreStatus, options); + return object; + }; + + /** + * Converts this Lake to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Lake + * @instance + * @returns {Object.} JSON object + */ + Lake.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Lake + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Lake + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Lake.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Lake"; + }; + + Lake.Metastore = (function() { + + /** + * Properties of a Metastore. + * @memberof google.cloud.dataplex.v1.Lake + * @interface IMetastore + * @property {string|null} [service] Metastore service + */ + + /** + * Constructs a new Metastore. + * @memberof google.cloud.dataplex.v1.Lake + * @classdesc Represents a Metastore. + * @implements IMetastore + * @constructor + * @param {google.cloud.dataplex.v1.Lake.IMetastore=} [properties] Properties to set + */ + function Metastore(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]]; + } + + /** + * Metastore service. + * @member {string} service + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @instance + */ + Metastore.prototype.service = ""; + + /** + * Creates a new Metastore instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastore=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Lake.Metastore} Metastore instance + */ + Metastore.create = function create(properties) { + return new Metastore(properties); + }; + + /** + * Encodes the specified Metastore message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.Metastore.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastore} message Metastore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metastore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; + + /** + * Encodes the specified Metastore message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.Metastore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastore} message Metastore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metastore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metastore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Lake.Metastore} Metastore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metastore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Lake.Metastore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metastore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Lake.Metastore} Metastore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metastore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metastore message. + * @function verify + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metastore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a Metastore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Lake.Metastore} Metastore + */ + Metastore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Lake.Metastore) + return object; + var message = new $root.google.cloud.dataplex.v1.Lake.Metastore(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a Metastore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {google.cloud.dataplex.v1.Lake.Metastore} message Metastore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metastore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this Metastore to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @instance + * @returns {Object.} JSON object + */ + Metastore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metastore + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Lake.Metastore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metastore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Lake.Metastore"; + }; + + return Metastore; + })(); + + Lake.MetastoreStatus = (function() { + + /** + * Properties of a MetastoreStatus. + * @memberof google.cloud.dataplex.v1.Lake + * @interface IMetastoreStatus + * @property {google.cloud.dataplex.v1.Lake.MetastoreStatus.State|null} [state] MetastoreStatus state + * @property {string|null} [message] MetastoreStatus message + * @property {google.protobuf.ITimestamp|null} [updateTime] MetastoreStatus updateTime + * @property {string|null} [endpoint] MetastoreStatus endpoint + */ + + /** + * Constructs a new MetastoreStatus. + * @memberof google.cloud.dataplex.v1.Lake + * @classdesc Represents a MetastoreStatus. + * @implements IMetastoreStatus + * @constructor + * @param {google.cloud.dataplex.v1.Lake.IMetastoreStatus=} [properties] Properties to set + */ + function MetastoreStatus(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]]; + } + + /** + * MetastoreStatus state. + * @member {google.cloud.dataplex.v1.Lake.MetastoreStatus.State} state + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @instance + */ + MetastoreStatus.prototype.state = 0; + + /** + * MetastoreStatus message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @instance + */ + MetastoreStatus.prototype.message = ""; + + /** + * MetastoreStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @instance + */ + MetastoreStatus.prototype.updateTime = null; + + /** + * MetastoreStatus endpoint. + * @member {string} endpoint + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @instance + */ + MetastoreStatus.prototype.endpoint = ""; + + /** + * Creates a new MetastoreStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastoreStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Lake.MetastoreStatus} MetastoreStatus instance + */ + MetastoreStatus.create = function create(properties) { + return new MetastoreStatus(properties); + }; + + /** + * Encodes the specified MetastoreStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Lake.MetastoreStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastoreStatus} message MetastoreStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetastoreStatus.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.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpoint); + return writer; + }; + + /** + * Encodes the specified MetastoreStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Lake.MetastoreStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {google.cloud.dataplex.v1.Lake.IMetastoreStatus} message MetastoreStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetastoreStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetastoreStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Lake.MetastoreStatus} MetastoreStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetastoreStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Lake.MetastoreStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetastoreStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Lake.MetastoreStatus} MetastoreStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetastoreStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetastoreStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetastoreStatus.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: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + return null; + }; + + /** + * Creates a MetastoreStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Lake.MetastoreStatus} MetastoreStatus + */ + MetastoreStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Lake.MetastoreStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Lake.MetastoreStatus(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NONE": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Lake.MetastoreStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + return message; + }; + + /** + * Creates a plain object from a MetastoreStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {google.cloud.dataplex.v1.Lake.MetastoreStatus} message MetastoreStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetastoreStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.message = ""; + object.updateTime = null; + object.endpoint = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Lake.MetastoreStatus.State[message.state] : message.state; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + return object; + }; + + /** + * Converts this MetastoreStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @instance + * @returns {Object.} JSON object + */ + MetastoreStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetastoreStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Lake.MetastoreStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetastoreStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Lake.MetastoreStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataplex.v1.Lake.MetastoreStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} READY=2 READY value + * @property {number} UPDATING=3 UPDATING value + * @property {number} ERROR=4 ERROR value + */ + MetastoreStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return MetastoreStatus; + })(); + + return Lake; + })(); + + v1.AssetStatus = (function() { + + /** + * Properties of an AssetStatus. + * @memberof google.cloud.dataplex.v1 + * @interface IAssetStatus + * @property {google.protobuf.ITimestamp|null} [updateTime] AssetStatus updateTime + * @property {number|null} [activeAssets] AssetStatus activeAssets + * @property {number|null} [securityPolicyApplyingAssets] AssetStatus securityPolicyApplyingAssets + */ + + /** + * Constructs a new AssetStatus. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an AssetStatus. + * @implements IAssetStatus + * @constructor + * @param {google.cloud.dataplex.v1.IAssetStatus=} [properties] Properties to set + */ + function AssetStatus(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]]; + } + + /** + * AssetStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.AssetStatus + * @instance + */ + AssetStatus.prototype.updateTime = null; + + /** + * AssetStatus activeAssets. + * @member {number} activeAssets + * @memberof google.cloud.dataplex.v1.AssetStatus + * @instance + */ + AssetStatus.prototype.activeAssets = 0; + + /** + * AssetStatus securityPolicyApplyingAssets. + * @member {number} securityPolicyApplyingAssets + * @memberof google.cloud.dataplex.v1.AssetStatus + * @instance + */ + AssetStatus.prototype.securityPolicyApplyingAssets = 0; + + /** + * Creates a new AssetStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {google.cloud.dataplex.v1.IAssetStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.AssetStatus} AssetStatus instance + */ + AssetStatus.create = function create(properties) { + return new AssetStatus(properties); + }; + + /** + * Encodes the specified AssetStatus message. Does not implicitly {@link google.cloud.dataplex.v1.AssetStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {google.cloud.dataplex.v1.IAssetStatus} message AssetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.activeAssets != null && Object.hasOwnProperty.call(message, "activeAssets")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.activeAssets); + if (message.securityPolicyApplyingAssets != null && Object.hasOwnProperty.call(message, "securityPolicyApplyingAssets")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.securityPolicyApplyingAssets); + return writer; + }; + + /** + * Encodes the specified AssetStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.AssetStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {google.cloud.dataplex.v1.IAssetStatus} message AssetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.AssetStatus} AssetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.AssetStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.activeAssets = reader.int32(); + break; + } + case 3: { + message.securityPolicyApplyingAssets = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssetStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.AssetStatus} AssetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssetStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.activeAssets != null && message.hasOwnProperty("activeAssets")) + if (!$util.isInteger(message.activeAssets)) + return "activeAssets: integer expected"; + if (message.securityPolicyApplyingAssets != null && message.hasOwnProperty("securityPolicyApplyingAssets")) + if (!$util.isInteger(message.securityPolicyApplyingAssets)) + return "securityPolicyApplyingAssets: integer expected"; + return null; + }; + + /** + * Creates an AssetStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.AssetStatus} AssetStatus + */ + AssetStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.AssetStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.AssetStatus(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.AssetStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.activeAssets != null) + message.activeAssets = object.activeAssets | 0; + if (object.securityPolicyApplyingAssets != null) + message.securityPolicyApplyingAssets = object.securityPolicyApplyingAssets | 0; + return message; + }; + + /** + * Creates a plain object from an AssetStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {google.cloud.dataplex.v1.AssetStatus} message AssetStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateTime = null; + object.activeAssets = 0; + object.securityPolicyApplyingAssets = 0; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.activeAssets != null && message.hasOwnProperty("activeAssets")) + object.activeAssets = message.activeAssets; + if (message.securityPolicyApplyingAssets != null && message.hasOwnProperty("securityPolicyApplyingAssets")) + object.securityPolicyApplyingAssets = message.securityPolicyApplyingAssets; + return object; + }; + + /** + * Converts this AssetStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.AssetStatus + * @instance + * @returns {Object.} JSON object + */ + AssetStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssetStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.AssetStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.AssetStatus"; + }; + + return AssetStatus; + })(); + + v1.Zone = (function() { + + /** + * Properties of a Zone. + * @memberof google.cloud.dataplex.v1 + * @interface IZone + * @property {string|null} [name] Zone name + * @property {string|null} [displayName] Zone displayName + * @property {string|null} [uid] Zone uid + * @property {google.protobuf.ITimestamp|null} [createTime] Zone createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Zone updateTime + * @property {Object.|null} [labels] Zone labels + * @property {string|null} [description] Zone description + * @property {google.cloud.dataplex.v1.State|null} [state] Zone state + * @property {google.cloud.dataplex.v1.Zone.Type|null} [type] Zone type + * @property {google.cloud.dataplex.v1.Zone.IDiscoverySpec|null} [discoverySpec] Zone discoverySpec + * @property {google.cloud.dataplex.v1.Zone.IResourceSpec|null} [resourceSpec] Zone resourceSpec + * @property {google.cloud.dataplex.v1.IAssetStatus|null} [assetStatus] Zone assetStatus + */ + + /** + * Constructs a new Zone. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Zone. + * @implements IZone + * @constructor + * @param {google.cloud.dataplex.v1.IZone=} [properties] Properties to set + */ + function Zone(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]]; + } + + /** + * Zone name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.name = ""; + + /** + * Zone displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.displayName = ""; + + /** + * Zone uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.uid = ""; + + /** + * Zone createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.createTime = null; + + /** + * Zone updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.updateTime = null; + + /** + * Zone labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.labels = $util.emptyObject; + + /** + * Zone description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.description = ""; + + /** + * Zone state. + * @member {google.cloud.dataplex.v1.State} state + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.state = 0; + + /** + * Zone type. + * @member {google.cloud.dataplex.v1.Zone.Type} type + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.type = 0; + + /** + * Zone discoverySpec. + * @member {google.cloud.dataplex.v1.Zone.IDiscoverySpec|null|undefined} discoverySpec + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.discoverySpec = null; + + /** + * Zone resourceSpec. + * @member {google.cloud.dataplex.v1.Zone.IResourceSpec|null|undefined} resourceSpec + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.resourceSpec = null; + + /** + * Zone assetStatus. + * @member {google.cloud.dataplex.v1.IAssetStatus|null|undefined} assetStatus + * @memberof google.cloud.dataplex.v1.Zone + * @instance + */ + Zone.prototype.assetStatus = null; + + /** + * Creates a new Zone instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {google.cloud.dataplex.v1.IZone=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Zone} Zone instance + */ + Zone.create = function create(properties) { + return new Zone(properties); + }; + + /** + * Encodes the specified Zone message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {google.cloud.dataplex.v1.IZone} message Zone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zone.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.type); + if (message.discoverySpec != null && Object.hasOwnProperty.call(message, "discoverySpec")) + $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.encode(message.discoverySpec, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.resourceSpec != null && Object.hasOwnProperty.call(message, "resourceSpec")) + $root.google.cloud.dataplex.v1.Zone.ResourceSpec.encode(message.resourceSpec, writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); + if (message.assetStatus != null && Object.hasOwnProperty.call(message, "assetStatus")) + $root.google.cloud.dataplex.v1.AssetStatus.encode(message.assetStatus, writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Zone message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {google.cloud.dataplex.v1.IZone} message Zone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Zone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Zone message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Zone} Zone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zone.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Zone(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.description = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.type = reader.int32(); + break; + } + case 103: { + message.discoverySpec = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.decode(reader, reader.uint32()); + break; + } + case 104: { + message.resourceSpec = $root.google.cloud.dataplex.v1.Zone.ResourceSpec.decode(reader, reader.uint32()); + break; + } + case 105: { + message.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Zone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Zone} Zone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Zone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Zone message. + * @function verify + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Zone.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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: + break; + } + 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.discoverySpec != null && message.hasOwnProperty("discoverySpec")) { + var error = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.verify(message.discoverySpec); + if (error) + return "discoverySpec." + error; + } + if (message.resourceSpec != null && message.hasOwnProperty("resourceSpec")) { + var error = $root.google.cloud.dataplex.v1.Zone.ResourceSpec.verify(message.resourceSpec); + if (error) + return "resourceSpec." + error; + } + if (message.assetStatus != null && message.hasOwnProperty("assetStatus")) { + var error = $root.google.cloud.dataplex.v1.AssetStatus.verify(message.assetStatus); + if (error) + return "assetStatus." + error; + } + return null; + }; + + /** + * Creates a Zone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Zone} Zone + */ + Zone.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Zone) + return object; + var message = new $root.google.cloud.dataplex.v1.Zone(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.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.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACTION_REQUIRED": + case 4: + message.state = 4; + break; + } + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "RAW": + case 1: + message.type = 1; + break; + case "CURATED": + case 2: + message.type = 2; + break; + } + if (object.discoverySpec != null) { + if (typeof object.discoverySpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.discoverySpec: object expected"); + message.discoverySpec = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.fromObject(object.discoverySpec); + } + if (object.resourceSpec != null) { + if (typeof object.resourceSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.resourceSpec: object expected"); + message.resourceSpec = $root.google.cloud.dataplex.v1.Zone.ResourceSpec.fromObject(object.resourceSpec); + } + if (object.assetStatus != null) { + if (typeof object.assetStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.assetStatus: object expected"); + message.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.fromObject(object.assetStatus); + } + return message; + }; + + /** + * Creates a plain object from a Zone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {google.cloud.dataplex.v1.Zone} message Zone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Zone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.discoverySpec = null; + object.resourceSpec = null; + object.assetStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.Zone.Type[message.type] : message.type; + if (message.discoverySpec != null && message.hasOwnProperty("discoverySpec")) + object.discoverySpec = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.toObject(message.discoverySpec, options); + if (message.resourceSpec != null && message.hasOwnProperty("resourceSpec")) + object.resourceSpec = $root.google.cloud.dataplex.v1.Zone.ResourceSpec.toObject(message.resourceSpec, options); + if (message.assetStatus != null && message.hasOwnProperty("assetStatus")) + object.assetStatus = $root.google.cloud.dataplex.v1.AssetStatus.toObject(message.assetStatus, options); + return object; + }; + + /** + * Converts this Zone to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Zone + * @instance + * @returns {Object.} JSON object + */ + Zone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Zone + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Zone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Zone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Zone"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.Zone.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} RAW=1 RAW value + * @property {number} CURATED=2 CURATED value + */ + Zone.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RAW"] = 1; + values[valuesById[2] = "CURATED"] = 2; + return values; + })(); + + Zone.ResourceSpec = (function() { + + /** + * Properties of a ResourceSpec. + * @memberof google.cloud.dataplex.v1.Zone + * @interface IResourceSpec + * @property {google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType|null} [locationType] ResourceSpec locationType + */ + + /** + * Constructs a new ResourceSpec. + * @memberof google.cloud.dataplex.v1.Zone + * @classdesc Represents a ResourceSpec. + * @implements IResourceSpec + * @constructor + * @param {google.cloud.dataplex.v1.Zone.IResourceSpec=} [properties] Properties to set + */ + function ResourceSpec(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]]; + } + + /** + * ResourceSpec locationType. + * @member {google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType} locationType + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @instance + */ + ResourceSpec.prototype.locationType = 0; + + /** + * Creates a new ResourceSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IResourceSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Zone.ResourceSpec} ResourceSpec instance + */ + ResourceSpec.create = function create(properties) { + return new ResourceSpec(properties); + }; + + /** + * Encodes the specified ResourceSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.ResourceSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IResourceSpec} message ResourceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationType != null && Object.hasOwnProperty.call(message, "locationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.locationType); + return writer; + }; + + /** + * Encodes the specified ResourceSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.ResourceSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IResourceSpec} message ResourceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Zone.ResourceSpec} ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Zone.ResourceSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Zone.ResourceSpec} ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationType != null && message.hasOwnProperty("locationType")) + switch (message.locationType) { + default: + return "locationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ResourceSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Zone.ResourceSpec} ResourceSpec + */ + ResourceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Zone.ResourceSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Zone.ResourceSpec(); + switch (object.locationType) { + case "LOCATION_TYPE_UNSPECIFIED": + case 0: + message.locationType = 0; + break; + case "SINGLE_REGION": + case 1: + message.locationType = 1; + break; + case "MULTI_REGION": + case 2: + message.locationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Zone.ResourceSpec} message ResourceSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.locationType = options.enums === String ? "LOCATION_TYPE_UNSPECIFIED" : 0; + if (message.locationType != null && message.hasOwnProperty("locationType")) + object.locationType = options.enums === String ? $root.google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType[message.locationType] : message.locationType; + return object; + }; + + /** + * Converts this ResourceSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @instance + * @returns {Object.} JSON object + */ + ResourceSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Zone.ResourceSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Zone.ResourceSpec"; + }; + + /** + * LocationType enum. + * @name google.cloud.dataplex.v1.Zone.ResourceSpec.LocationType + * @enum {number} + * @property {number} LOCATION_TYPE_UNSPECIFIED=0 LOCATION_TYPE_UNSPECIFIED value + * @property {number} SINGLE_REGION=1 SINGLE_REGION value + * @property {number} MULTI_REGION=2 MULTI_REGION value + */ + ResourceSpec.LocationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SINGLE_REGION"] = 1; + values[valuesById[2] = "MULTI_REGION"] = 2; + return values; + })(); + + return ResourceSpec; + })(); + + Zone.DiscoverySpec = (function() { + + /** + * Properties of a DiscoverySpec. + * @memberof google.cloud.dataplex.v1.Zone + * @interface IDiscoverySpec + * @property {boolean|null} [enabled] DiscoverySpec enabled + * @property {Array.|null} [includePatterns] DiscoverySpec includePatterns + * @property {Array.|null} [excludePatterns] DiscoverySpec excludePatterns + * @property {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions|null} [csvOptions] DiscoverySpec csvOptions + * @property {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions|null} [jsonOptions] DiscoverySpec jsonOptions + * @property {string|null} [schedule] DiscoverySpec schedule + */ + + /** + * Constructs a new DiscoverySpec. + * @memberof google.cloud.dataplex.v1.Zone + * @classdesc Represents a DiscoverySpec. + * @implements IDiscoverySpec + * @constructor + * @param {google.cloud.dataplex.v1.Zone.IDiscoverySpec=} [properties] Properties to set + */ + function DiscoverySpec(properties) { + this.includePatterns = []; + this.excludePatterns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiscoverySpec enabled. + * @member {boolean} enabled + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.enabled = false; + + /** + * DiscoverySpec includePatterns. + * @member {Array.} includePatterns + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.includePatterns = $util.emptyArray; + + /** + * DiscoverySpec excludePatterns. + * @member {Array.} excludePatterns + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.excludePatterns = $util.emptyArray; + + /** + * DiscoverySpec csvOptions. + * @member {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions|null|undefined} csvOptions + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.csvOptions = null; + + /** + * DiscoverySpec jsonOptions. + * @member {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions|null|undefined} jsonOptions + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.jsonOptions = null; + + /** + * DiscoverySpec schedule. + * @member {string|null|undefined} schedule + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiscoverySpec trigger. + * @member {"schedule"|undefined} trigger + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + */ + Object.defineProperty(DiscoverySpec.prototype, "trigger", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiscoverySpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IDiscoverySpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec} DiscoverySpec instance + */ + DiscoverySpec.create = function create(properties) { + return new DiscoverySpec(properties); + }; + + /** + * Encodes the specified DiscoverySpec message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IDiscoverySpec} message DiscoverySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoverySpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.includePatterns != null && message.includePatterns.length) + for (var i = 0; i < message.includePatterns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.includePatterns[i]); + if (message.excludePatterns != null && message.excludePatterns.length) + for (var i = 0; i < message.excludePatterns.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludePatterns[i]); + if (message.csvOptions != null && Object.hasOwnProperty.call(message, "csvOptions")) + $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.encode(message.csvOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jsonOptions != null && Object.hasOwnProperty.call(message, "jsonOptions")) + $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.encode(message.jsonOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.schedule); + return writer; + }; + + /** + * Encodes the specified DiscoverySpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Zone.IDiscoverySpec} message DiscoverySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoverySpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec} DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoverySpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + if (!(message.includePatterns && message.includePatterns.length)) + message.includePatterns = []; + message.includePatterns.push(reader.string()); + break; + } + case 3: { + if (!(message.excludePatterns && message.excludePatterns.length)) + message.excludePatterns = []; + message.excludePatterns.push(reader.string()); + break; + } + case 4: { + message.csvOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jsonOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.schedule = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec} DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoverySpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiscoverySpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiscoverySpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.includePatterns != null && message.hasOwnProperty("includePatterns")) { + if (!Array.isArray(message.includePatterns)) + return "includePatterns: array expected"; + for (var i = 0; i < message.includePatterns.length; ++i) + if (!$util.isString(message.includePatterns[i])) + return "includePatterns: string[] expected"; + } + if (message.excludePatterns != null && message.hasOwnProperty("excludePatterns")) { + if (!Array.isArray(message.excludePatterns)) + return "excludePatterns: array expected"; + for (var i = 0; i < message.excludePatterns.length; ++i) + if (!$util.isString(message.excludePatterns[i])) + return "excludePatterns: string[] expected"; + } + if (message.csvOptions != null && message.hasOwnProperty("csvOptions")) { + var error = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.verify(message.csvOptions); + if (error) + return "csvOptions." + error; + } + if (message.jsonOptions != null && message.hasOwnProperty("jsonOptions")) { + var error = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.verify(message.jsonOptions); + if (error) + return "jsonOptions." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties.trigger = 1; + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + } + return null; + }; + + /** + * Creates a DiscoverySpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec} DiscoverySpec + */ + DiscoverySpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Zone.DiscoverySpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.includePatterns) { + if (!Array.isArray(object.includePatterns)) + throw TypeError(".google.cloud.dataplex.v1.Zone.DiscoverySpec.includePatterns: array expected"); + message.includePatterns = []; + for (var i = 0; i < object.includePatterns.length; ++i) + message.includePatterns[i] = String(object.includePatterns[i]); + } + if (object.excludePatterns) { + if (!Array.isArray(object.excludePatterns)) + throw TypeError(".google.cloud.dataplex.v1.Zone.DiscoverySpec.excludePatterns: array expected"); + message.excludePatterns = []; + for (var i = 0; i < object.excludePatterns.length; ++i) + message.excludePatterns[i] = String(object.excludePatterns[i]); + } + if (object.csvOptions != null) { + if (typeof object.csvOptions !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.DiscoverySpec.csvOptions: object expected"); + message.csvOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.fromObject(object.csvOptions); + } + if (object.jsonOptions != null) { + if (typeof object.jsonOptions !== "object") + throw TypeError(".google.cloud.dataplex.v1.Zone.DiscoverySpec.jsonOptions: object expected"); + message.jsonOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.fromObject(object.jsonOptions); + } + if (object.schedule != null) + message.schedule = String(object.schedule); + return message; + }; + + /** + * Creates a plain object from a DiscoverySpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec} message DiscoverySpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiscoverySpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.includePatterns = []; + object.excludePatterns = []; + } + if (options.defaults) { + object.enabled = false; + object.csvOptions = null; + object.jsonOptions = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.includePatterns && message.includePatterns.length) { + object.includePatterns = []; + for (var j = 0; j < message.includePatterns.length; ++j) + object.includePatterns[j] = message.includePatterns[j]; + } + if (message.excludePatterns && message.excludePatterns.length) { + object.excludePatterns = []; + for (var j = 0; j < message.excludePatterns.length; ++j) + object.excludePatterns[j] = message.excludePatterns[j]; + } + if (message.csvOptions != null && message.hasOwnProperty("csvOptions")) + object.csvOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.toObject(message.csvOptions, options); + if (message.jsonOptions != null && message.hasOwnProperty("jsonOptions")) + object.jsonOptions = $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.toObject(message.jsonOptions, options); + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = message.schedule; + if (options.oneofs) + object.trigger = "schedule"; + } + return object; + }; + + /** + * Converts this DiscoverySpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @instance + * @returns {Object.} JSON object + */ + DiscoverySpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiscoverySpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiscoverySpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Zone.DiscoverySpec"; + }; + + DiscoverySpec.CsvOptions = (function() { + + /** + * Properties of a CsvOptions. + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @interface ICsvOptions + * @property {number|null} [headerRows] CsvOptions headerRows + * @property {string|null} [delimiter] CsvOptions delimiter + * @property {string|null} [encoding] CsvOptions encoding + * @property {boolean|null} [disableTypeInference] CsvOptions disableTypeInference + */ + + /** + * Constructs a new CsvOptions. + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @classdesc Represents a CsvOptions. + * @implements ICsvOptions + * @constructor + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions=} [properties] Properties to set + */ + function CsvOptions(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]]; + } + + /** + * CsvOptions headerRows. + * @member {number} headerRows + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.headerRows = 0; + + /** + * CsvOptions delimiter. + * @member {string} delimiter + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.delimiter = ""; + + /** + * CsvOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.encoding = ""; + + /** + * CsvOptions disableTypeInference. + * @member {boolean} disableTypeInference + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.disableTypeInference = false; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions} CsvOptions instance + */ + CsvOptions.create = function create(properties) { + return new CsvOptions(properties); + }; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerRows != null && Object.hasOwnProperty.call(message, "headerRows")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headerRows); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.delimiter); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.encoding); + if (message.disableTypeInference != null && Object.hasOwnProperty.call(message, "disableTypeInference")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableTypeInference); + return writer; + }; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headerRows = reader.int32(); + break; + } + case 2: { + message.delimiter = reader.string(); + break; + } + case 3: { + message.encoding = reader.string(); + break; + } + case 4: { + message.disableTypeInference = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + if (!$util.isInteger(message.headerRows)) + return "headerRows: integer expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + if (typeof message.disableTypeInference !== "boolean") + return "disableTypeInference: boolean expected"; + return null; + }; + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions} CsvOptions + */ + CsvOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions(); + if (object.headerRows != null) + message.headerRows = object.headerRows | 0; + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.disableTypeInference != null) + message.disableTypeInference = Boolean(object.disableTypeInference); + return message; + }; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions} message CsvOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.headerRows = 0; + object.delimiter = ""; + object.encoding = ""; + object.disableTypeInference = false; + } + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + object.headerRows = message.headerRows; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + object.disableTypeInference = message.disableTypeInference; + return object; + }; + + /** + * Converts this CsvOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @instance + * @returns {Object.} JSON object + */ + CsvOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Zone.DiscoverySpec.CsvOptions"; + }; + + return CsvOptions; + })(); + + DiscoverySpec.JsonOptions = (function() { + + /** + * Properties of a JsonOptions. + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @interface IJsonOptions + * @property {string|null} [encoding] JsonOptions encoding + * @property {boolean|null} [disableTypeInference] JsonOptions disableTypeInference + */ + + /** + * Constructs a new JsonOptions. + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec + * @classdesc Represents a JsonOptions. + * @implements IJsonOptions + * @constructor + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions=} [properties] Properties to set + */ + function JsonOptions(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]]; + } + + /** + * JsonOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @instance + */ + JsonOptions.prototype.encoding = ""; + + /** + * JsonOptions disableTypeInference. + * @member {boolean} disableTypeInference + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @instance + */ + JsonOptions.prototype.disableTypeInference = false; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions} JsonOptions instance + */ + JsonOptions.create = function create(properties) { + return new JsonOptions(properties); + }; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encoding); + if (message.disableTypeInference != null && Object.hasOwnProperty.call(message, "disableTypeInference")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disableTypeInference); + return writer; + }; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encoding = reader.string(); + break; + } + case 2: { + message.disableTypeInference = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JsonOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JsonOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + if (typeof message.disableTypeInference !== "boolean") + return "disableTypeInference: boolean expected"; + return null; + }; + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions} JsonOptions + */ + JsonOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions(); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.disableTypeInference != null) + message.disableTypeInference = Boolean(object.disableTypeInference); + return message; + }; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions} message JsonOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JsonOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encoding = ""; + object.disableTypeInference = false; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + object.disableTypeInference = message.disableTypeInference; + return object; + }; + + /** + * Converts this JsonOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @instance + * @returns {Object.} JSON object + */ + JsonOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JsonOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JsonOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Zone.DiscoverySpec.JsonOptions"; + }; + + return JsonOptions; + })(); + + return DiscoverySpec; + })(); + + return Zone; + })(); + + v1.Action = (function() { + + /** + * Properties of an Action. + * @memberof google.cloud.dataplex.v1 + * @interface IAction + * @property {google.cloud.dataplex.v1.Action.Category|null} [category] Action category + * @property {string|null} [issue] Action issue + * @property {google.protobuf.ITimestamp|null} [detectTime] Action detectTime + * @property {string|null} [name] Action name + * @property {string|null} [lake] Action lake + * @property {string|null} [zone] Action zone + * @property {string|null} [asset] Action asset + * @property {Array.|null} [dataLocations] Action dataLocations + * @property {google.cloud.dataplex.v1.Action.IInvalidDataFormat|null} [invalidDataFormat] Action invalidDataFormat + * @property {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema|null} [incompatibleDataSchema] Action incompatibleDataSchema + * @property {google.cloud.dataplex.v1.Action.IInvalidDataPartition|null} [invalidDataPartition] Action invalidDataPartition + * @property {google.cloud.dataplex.v1.Action.IMissingData|null} [missingData] Action missingData + * @property {google.cloud.dataplex.v1.Action.IMissingResource|null} [missingResource] Action missingResource + * @property {google.cloud.dataplex.v1.Action.IUnauthorizedResource|null} [unauthorizedResource] Action unauthorizedResource + * @property {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply|null} [failedSecurityPolicyApply] Action failedSecurityPolicyApply + * @property {google.cloud.dataplex.v1.Action.IInvalidDataOrganization|null} [invalidDataOrganization] Action invalidDataOrganization + */ + + /** + * Constructs a new Action. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an Action. + * @implements IAction + * @constructor + * @param {google.cloud.dataplex.v1.IAction=} [properties] Properties to set + */ + function Action(properties) { + this.dataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Action category. + * @member {google.cloud.dataplex.v1.Action.Category} category + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.category = 0; + + /** + * Action issue. + * @member {string} issue + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.issue = ""; + + /** + * Action detectTime. + * @member {google.protobuf.ITimestamp|null|undefined} detectTime + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.detectTime = null; + + /** + * Action name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.name = ""; + + /** + * Action lake. + * @member {string} lake + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.lake = ""; + + /** + * Action zone. + * @member {string} zone + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.zone = ""; + + /** + * Action asset. + * @member {string} asset + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.asset = ""; + + /** + * Action dataLocations. + * @member {Array.} dataLocations + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.dataLocations = $util.emptyArray; + + /** + * Action invalidDataFormat. + * @member {google.cloud.dataplex.v1.Action.IInvalidDataFormat|null|undefined} invalidDataFormat + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.invalidDataFormat = null; + + /** + * Action incompatibleDataSchema. + * @member {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema|null|undefined} incompatibleDataSchema + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.incompatibleDataSchema = null; + + /** + * Action invalidDataPartition. + * @member {google.cloud.dataplex.v1.Action.IInvalidDataPartition|null|undefined} invalidDataPartition + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.invalidDataPartition = null; + + /** + * Action missingData. + * @member {google.cloud.dataplex.v1.Action.IMissingData|null|undefined} missingData + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.missingData = null; + + /** + * Action missingResource. + * @member {google.cloud.dataplex.v1.Action.IMissingResource|null|undefined} missingResource + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.missingResource = null; + + /** + * Action unauthorizedResource. + * @member {google.cloud.dataplex.v1.Action.IUnauthorizedResource|null|undefined} unauthorizedResource + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.unauthorizedResource = null; + + /** + * Action failedSecurityPolicyApply. + * @member {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply|null|undefined} failedSecurityPolicyApply + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.failedSecurityPolicyApply = null; + + /** + * Action invalidDataOrganization. + * @member {google.cloud.dataplex.v1.Action.IInvalidDataOrganization|null|undefined} invalidDataOrganization + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Action.prototype.invalidDataOrganization = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Action details. + * @member {"invalidDataFormat"|"incompatibleDataSchema"|"invalidDataPartition"|"missingData"|"missingResource"|"unauthorizedResource"|"failedSecurityPolicyApply"|"invalidDataOrganization"|undefined} details + * @memberof google.cloud.dataplex.v1.Action + * @instance + */ + Object.defineProperty(Action.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["invalidDataFormat", "incompatibleDataSchema", "invalidDataPartition", "missingData", "missingResource", "unauthorizedResource", "failedSecurityPolicyApply", "invalidDataOrganization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Action instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {google.cloud.dataplex.v1.IAction=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action} Action instance + */ + Action.create = function create(properties) { + return new Action(properties); + }; + + /** + * Encodes the specified Action message. Does not implicitly {@link google.cloud.dataplex.v1.Action.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {google.cloud.dataplex.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.issue != null && Object.hasOwnProperty.call(message, "issue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.issue); + if (message.detectTime != null && Object.hasOwnProperty.call(message, "detectTime")) + $root.google.protobuf.Timestamp.encode(message.detectTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.lake != null && Object.hasOwnProperty.call(message, "lake")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lake); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.zone); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.asset); + if (message.dataLocations != null && message.dataLocations.length) + for (var i = 0; i < message.dataLocations.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataLocations[i]); + if (message.invalidDataFormat != null && Object.hasOwnProperty.call(message, "invalidDataFormat")) + $root.google.cloud.dataplex.v1.Action.InvalidDataFormat.encode(message.invalidDataFormat, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.incompatibleDataSchema != null && Object.hasOwnProperty.call(message, "incompatibleDataSchema")) + $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.encode(message.incompatibleDataSchema, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.invalidDataPartition != null && Object.hasOwnProperty.call(message, "invalidDataPartition")) + $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.encode(message.invalidDataPartition, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.missingData != null && Object.hasOwnProperty.call(message, "missingData")) + $root.google.cloud.dataplex.v1.Action.MissingData.encode(message.missingData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.missingResource != null && Object.hasOwnProperty.call(message, "missingResource")) + $root.google.cloud.dataplex.v1.Action.MissingResource.encode(message.missingResource, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.unauthorizedResource != null && Object.hasOwnProperty.call(message, "unauthorizedResource")) + $root.google.cloud.dataplex.v1.Action.UnauthorizedResource.encode(message.unauthorizedResource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.failedSecurityPolicyApply != null && Object.hasOwnProperty.call(message, "failedSecurityPolicyApply")) + $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.encode(message.failedSecurityPolicyApply, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.invalidDataOrganization != null && Object.hasOwnProperty.call(message, "invalidDataOrganization")) + $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization.encode(message.invalidDataOrganization, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Action message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {google.cloud.dataplex.v1.IAction} message Action message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Action.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Action message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 2: { + message.issue = reader.string(); + break; + } + case 4: { + message.detectTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.name = reader.string(); + break; + } + case 6: { + message.lake = reader.string(); + break; + } + case 7: { + message.zone = reader.string(); + break; + } + case 8: { + message.asset = reader.string(); + break; + } + case 9: { + if (!(message.dataLocations && message.dataLocations.length)) + message.dataLocations = []; + message.dataLocations.push(reader.string()); + break; + } + case 10: { + message.invalidDataFormat = $root.google.cloud.dataplex.v1.Action.InvalidDataFormat.decode(reader, reader.uint32()); + break; + } + case 11: { + message.incompatibleDataSchema = $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.decode(reader, reader.uint32()); + break; + } + case 12: { + message.invalidDataPartition = $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.decode(reader, reader.uint32()); + break; + } + case 13: { + message.missingData = $root.google.cloud.dataplex.v1.Action.MissingData.decode(reader, reader.uint32()); + break; + } + case 14: { + message.missingResource = $root.google.cloud.dataplex.v1.Action.MissingResource.decode(reader, reader.uint32()); + break; + } + case 15: { + message.unauthorizedResource = $root.google.cloud.dataplex.v1.Action.UnauthorizedResource.decode(reader, reader.uint32()); + break; + } + case 21: { + message.failedSecurityPolicyApply = $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.decode(reader, reader.uint32()); + break; + } + case 22: { + message.invalidDataOrganization = $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Action message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action} Action + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Action.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Action message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Action.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.issue != null && message.hasOwnProperty("issue")) + if (!$util.isString(message.issue)) + return "issue: string expected"; + if (message.detectTime != null && message.hasOwnProperty("detectTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.detectTime); + if (error) + return "detectTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lake != null && message.hasOwnProperty("lake")) + if (!$util.isString(message.lake)) + return "lake: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.dataLocations != null && message.hasOwnProperty("dataLocations")) { + if (!Array.isArray(message.dataLocations)) + return "dataLocations: array expected"; + for (var i = 0; i < message.dataLocations.length; ++i) + if (!$util.isString(message.dataLocations[i])) + return "dataLocations: string[] expected"; + } + if (message.invalidDataFormat != null && message.hasOwnProperty("invalidDataFormat")) { + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.InvalidDataFormat.verify(message.invalidDataFormat); + if (error) + return "invalidDataFormat." + error; + } + } + if (message.incompatibleDataSchema != null && message.hasOwnProperty("incompatibleDataSchema")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.verify(message.incompatibleDataSchema); + if (error) + return "incompatibleDataSchema." + error; + } + } + if (message.invalidDataPartition != null && message.hasOwnProperty("invalidDataPartition")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.verify(message.invalidDataPartition); + if (error) + return "invalidDataPartition." + error; + } + } + if (message.missingData != null && message.hasOwnProperty("missingData")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.MissingData.verify(message.missingData); + if (error) + return "missingData." + error; + } + } + if (message.missingResource != null && message.hasOwnProperty("missingResource")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.MissingResource.verify(message.missingResource); + if (error) + return "missingResource." + error; + } + } + if (message.unauthorizedResource != null && message.hasOwnProperty("unauthorizedResource")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.UnauthorizedResource.verify(message.unauthorizedResource); + if (error) + return "unauthorizedResource." + error; + } + } + if (message.failedSecurityPolicyApply != null && message.hasOwnProperty("failedSecurityPolicyApply")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.verify(message.failedSecurityPolicyApply); + if (error) + return "failedSecurityPolicyApply." + error; + } + } + if (message.invalidDataOrganization != null && message.hasOwnProperty("invalidDataOrganization")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization.verify(message.invalidDataOrganization); + if (error) + return "invalidDataOrganization." + error; + } + } + return null; + }; + + /** + * Creates an Action message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action} Action + */ + Action.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action) + return object; + var message = new $root.google.cloud.dataplex.v1.Action(); + switch (object.category) { + case "CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "RESOURCE_MANAGEMENT": + case 1: + message.category = 1; + break; + case "SECURITY_POLICY": + case 2: + message.category = 2; + break; + case "DATA_DISCOVERY": + case 3: + message.category = 3; + break; + } + if (object.issue != null) + message.issue = String(object.issue); + if (object.detectTime != null) { + if (typeof object.detectTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.detectTime: object expected"); + message.detectTime = $root.google.protobuf.Timestamp.fromObject(object.detectTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.lake != null) + message.lake = String(object.lake); + if (object.zone != null) + message.zone = String(object.zone); + if (object.asset != null) + message.asset = String(object.asset); + if (object.dataLocations) { + if (!Array.isArray(object.dataLocations)) + throw TypeError(".google.cloud.dataplex.v1.Action.dataLocations: array expected"); + message.dataLocations = []; + for (var i = 0; i < object.dataLocations.length; ++i) + message.dataLocations[i] = String(object.dataLocations[i]); + } + if (object.invalidDataFormat != null) { + if (typeof object.invalidDataFormat !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.invalidDataFormat: object expected"); + message.invalidDataFormat = $root.google.cloud.dataplex.v1.Action.InvalidDataFormat.fromObject(object.invalidDataFormat); + } + if (object.incompatibleDataSchema != null) { + if (typeof object.incompatibleDataSchema !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.incompatibleDataSchema: object expected"); + message.incompatibleDataSchema = $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.fromObject(object.incompatibleDataSchema); + } + if (object.invalidDataPartition != null) { + if (typeof object.invalidDataPartition !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.invalidDataPartition: object expected"); + message.invalidDataPartition = $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.fromObject(object.invalidDataPartition); + } + if (object.missingData != null) { + if (typeof object.missingData !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.missingData: object expected"); + message.missingData = $root.google.cloud.dataplex.v1.Action.MissingData.fromObject(object.missingData); + } + if (object.missingResource != null) { + if (typeof object.missingResource !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.missingResource: object expected"); + message.missingResource = $root.google.cloud.dataplex.v1.Action.MissingResource.fromObject(object.missingResource); + } + if (object.unauthorizedResource != null) { + if (typeof object.unauthorizedResource !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.unauthorizedResource: object expected"); + message.unauthorizedResource = $root.google.cloud.dataplex.v1.Action.UnauthorizedResource.fromObject(object.unauthorizedResource); + } + if (object.failedSecurityPolicyApply != null) { + if (typeof object.failedSecurityPolicyApply !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.failedSecurityPolicyApply: object expected"); + message.failedSecurityPolicyApply = $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.fromObject(object.failedSecurityPolicyApply); + } + if (object.invalidDataOrganization != null) { + if (typeof object.invalidDataOrganization !== "object") + throw TypeError(".google.cloud.dataplex.v1.Action.invalidDataOrganization: object expected"); + message.invalidDataOrganization = $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization.fromObject(object.invalidDataOrganization); + } + return message; + }; + + /** + * Creates a plain object from an Action message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {google.cloud.dataplex.v1.Action} message Action + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Action.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataLocations = []; + if (options.defaults) { + object.category = options.enums === String ? "CATEGORY_UNSPECIFIED" : 0; + object.issue = ""; + object.detectTime = null; + object.name = ""; + object.lake = ""; + object.zone = ""; + object.asset = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.dataplex.v1.Action.Category[message.category] : message.category; + if (message.issue != null && message.hasOwnProperty("issue")) + object.issue = message.issue; + if (message.detectTime != null && message.hasOwnProperty("detectTime")) + object.detectTime = $root.google.protobuf.Timestamp.toObject(message.detectTime, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lake != null && message.hasOwnProperty("lake")) + object.lake = message.lake; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.dataLocations && message.dataLocations.length) { + object.dataLocations = []; + for (var j = 0; j < message.dataLocations.length; ++j) + object.dataLocations[j] = message.dataLocations[j]; + } + if (message.invalidDataFormat != null && message.hasOwnProperty("invalidDataFormat")) { + object.invalidDataFormat = $root.google.cloud.dataplex.v1.Action.InvalidDataFormat.toObject(message.invalidDataFormat, options); + if (options.oneofs) + object.details = "invalidDataFormat"; + } + if (message.incompatibleDataSchema != null && message.hasOwnProperty("incompatibleDataSchema")) { + object.incompatibleDataSchema = $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.toObject(message.incompatibleDataSchema, options); + if (options.oneofs) + object.details = "incompatibleDataSchema"; + } + if (message.invalidDataPartition != null && message.hasOwnProperty("invalidDataPartition")) { + object.invalidDataPartition = $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.toObject(message.invalidDataPartition, options); + if (options.oneofs) + object.details = "invalidDataPartition"; + } + if (message.missingData != null && message.hasOwnProperty("missingData")) { + object.missingData = $root.google.cloud.dataplex.v1.Action.MissingData.toObject(message.missingData, options); + if (options.oneofs) + object.details = "missingData"; + } + if (message.missingResource != null && message.hasOwnProperty("missingResource")) { + object.missingResource = $root.google.cloud.dataplex.v1.Action.MissingResource.toObject(message.missingResource, options); + if (options.oneofs) + object.details = "missingResource"; + } + if (message.unauthorizedResource != null && message.hasOwnProperty("unauthorizedResource")) { + object.unauthorizedResource = $root.google.cloud.dataplex.v1.Action.UnauthorizedResource.toObject(message.unauthorizedResource, options); + if (options.oneofs) + object.details = "unauthorizedResource"; + } + if (message.failedSecurityPolicyApply != null && message.hasOwnProperty("failedSecurityPolicyApply")) { + object.failedSecurityPolicyApply = $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.toObject(message.failedSecurityPolicyApply, options); + if (options.oneofs) + object.details = "failedSecurityPolicyApply"; + } + if (message.invalidDataOrganization != null && message.hasOwnProperty("invalidDataOrganization")) { + object.invalidDataOrganization = $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization.toObject(message.invalidDataOrganization, options); + if (options.oneofs) + object.details = "invalidDataOrganization"; + } + return object; + }; + + /** + * Converts this Action to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action + * @instance + * @returns {Object.} JSON object + */ + Action.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Action + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action"; + }; + + /** + * Category enum. + * @name google.cloud.dataplex.v1.Action.Category + * @enum {number} + * @property {number} CATEGORY_UNSPECIFIED=0 CATEGORY_UNSPECIFIED value + * @property {number} RESOURCE_MANAGEMENT=1 RESOURCE_MANAGEMENT value + * @property {number} SECURITY_POLICY=2 SECURITY_POLICY value + * @property {number} DATA_DISCOVERY=3 DATA_DISCOVERY value + */ + Action.Category = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_MANAGEMENT"] = 1; + values[valuesById[2] = "SECURITY_POLICY"] = 2; + values[valuesById[3] = "DATA_DISCOVERY"] = 3; + return values; + })(); + + Action.MissingResource = (function() { + + /** + * Properties of a MissingResource. + * @memberof google.cloud.dataplex.v1.Action + * @interface IMissingResource + */ + + /** + * Constructs a new MissingResource. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents a MissingResource. + * @implements IMissingResource + * @constructor + * @param {google.cloud.dataplex.v1.Action.IMissingResource=} [properties] Properties to set + */ + function MissingResource(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 MissingResource instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingResource=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.MissingResource} MissingResource instance + */ + MissingResource.create = function create(properties) { + return new MissingResource(properties); + }; + + /** + * Encodes the specified MissingResource message. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingResource} message MissingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MissingResource message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingResource} message MissingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MissingResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.MissingResource} MissingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.MissingResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MissingResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.MissingResource} MissingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MissingResource message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MissingResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MissingResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.MissingResource} MissingResource + */ + MissingResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.MissingResource) + return object; + return new $root.google.cloud.dataplex.v1.Action.MissingResource(); + }; + + /** + * Creates a plain object from a MissingResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {google.cloud.dataplex.v1.Action.MissingResource} message MissingResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MissingResource.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MissingResource to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @instance + * @returns {Object.} JSON object + */ + MissingResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MissingResource + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.MissingResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MissingResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.MissingResource"; + }; + + return MissingResource; + })(); + + Action.UnauthorizedResource = (function() { + + /** + * Properties of an UnauthorizedResource. + * @memberof google.cloud.dataplex.v1.Action + * @interface IUnauthorizedResource + */ + + /** + * Constructs a new UnauthorizedResource. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents an UnauthorizedResource. + * @implements IUnauthorizedResource + * @constructor + * @param {google.cloud.dataplex.v1.Action.IUnauthorizedResource=} [properties] Properties to set + */ + function UnauthorizedResource(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 UnauthorizedResource instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {google.cloud.dataplex.v1.Action.IUnauthorizedResource=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.UnauthorizedResource} UnauthorizedResource instance + */ + UnauthorizedResource.create = function create(properties) { + return new UnauthorizedResource(properties); + }; + + /** + * Encodes the specified UnauthorizedResource message. Does not implicitly {@link google.cloud.dataplex.v1.Action.UnauthorizedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {google.cloud.dataplex.v1.Action.IUnauthorizedResource} message UnauthorizedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnauthorizedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UnauthorizedResource message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.UnauthorizedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {google.cloud.dataplex.v1.Action.IUnauthorizedResource} message UnauthorizedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnauthorizedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnauthorizedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.UnauthorizedResource} UnauthorizedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnauthorizedResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.UnauthorizedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnauthorizedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.UnauthorizedResource} UnauthorizedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnauthorizedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnauthorizedResource message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnauthorizedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UnauthorizedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.UnauthorizedResource} UnauthorizedResource + */ + UnauthorizedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.UnauthorizedResource) + return object; + return new $root.google.cloud.dataplex.v1.Action.UnauthorizedResource(); + }; + + /** + * Creates a plain object from an UnauthorizedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {google.cloud.dataplex.v1.Action.UnauthorizedResource} message UnauthorizedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnauthorizedResource.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UnauthorizedResource to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @instance + * @returns {Object.} JSON object + */ + UnauthorizedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnauthorizedResource + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.UnauthorizedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnauthorizedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.UnauthorizedResource"; + }; + + return UnauthorizedResource; + })(); + + Action.FailedSecurityPolicyApply = (function() { + + /** + * Properties of a FailedSecurityPolicyApply. + * @memberof google.cloud.dataplex.v1.Action + * @interface IFailedSecurityPolicyApply + * @property {string|null} [asset] FailedSecurityPolicyApply asset + */ + + /** + * Constructs a new FailedSecurityPolicyApply. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents a FailedSecurityPolicyApply. + * @implements IFailedSecurityPolicyApply + * @constructor + * @param {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply=} [properties] Properties to set + */ + function FailedSecurityPolicyApply(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]]; + } + + /** + * FailedSecurityPolicyApply asset. + * @member {string} asset + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @instance + */ + FailedSecurityPolicyApply.prototype.asset = ""; + + /** + * Creates a new FailedSecurityPolicyApply instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply} FailedSecurityPolicyApply instance + */ + FailedSecurityPolicyApply.create = function create(properties) { + return new FailedSecurityPolicyApply(properties); + }; + + /** + * Encodes the specified FailedSecurityPolicyApply message. Does not implicitly {@link google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply} message FailedSecurityPolicyApply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailedSecurityPolicyApply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + return writer; + }; + + /** + * Encodes the specified FailedSecurityPolicyApply message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {google.cloud.dataplex.v1.Action.IFailedSecurityPolicyApply} message FailedSecurityPolicyApply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailedSecurityPolicyApply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailedSecurityPolicyApply message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply} FailedSecurityPolicyApply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailedSecurityPolicyApply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FailedSecurityPolicyApply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply} FailedSecurityPolicyApply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailedSecurityPolicyApply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailedSecurityPolicyApply message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailedSecurityPolicyApply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + return null; + }; + + /** + * Creates a FailedSecurityPolicyApply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply} FailedSecurityPolicyApply + */ + FailedSecurityPolicyApply.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply) + return object; + var message = new $root.google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply(); + if (object.asset != null) + message.asset = String(object.asset); + return message; + }; + + /** + * Creates a plain object from a FailedSecurityPolicyApply message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply} message FailedSecurityPolicyApply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailedSecurityPolicyApply.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.asset = ""; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + return object; + }; + + /** + * Converts this FailedSecurityPolicyApply to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @instance + * @returns {Object.} JSON object + */ + FailedSecurityPolicyApply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailedSecurityPolicyApply + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailedSecurityPolicyApply.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.FailedSecurityPolicyApply"; + }; + + return FailedSecurityPolicyApply; + })(); + + Action.InvalidDataFormat = (function() { + + /** + * Properties of an InvalidDataFormat. + * @memberof google.cloud.dataplex.v1.Action + * @interface IInvalidDataFormat + * @property {Array.|null} [sampledDataLocations] InvalidDataFormat sampledDataLocations + * @property {string|null} [expectedFormat] InvalidDataFormat expectedFormat + * @property {string|null} [newFormat] InvalidDataFormat newFormat + */ + + /** + * Constructs a new InvalidDataFormat. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents an InvalidDataFormat. + * @implements IInvalidDataFormat + * @constructor + * @param {google.cloud.dataplex.v1.Action.IInvalidDataFormat=} [properties] Properties to set + */ + function InvalidDataFormat(properties) { + this.sampledDataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InvalidDataFormat sampledDataLocations. + * @member {Array.} sampledDataLocations + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @instance + */ + InvalidDataFormat.prototype.sampledDataLocations = $util.emptyArray; + + /** + * InvalidDataFormat expectedFormat. + * @member {string} expectedFormat + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @instance + */ + InvalidDataFormat.prototype.expectedFormat = ""; + + /** + * InvalidDataFormat newFormat. + * @member {string} newFormat + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @instance + */ + InvalidDataFormat.prototype.newFormat = ""; + + /** + * Creates a new InvalidDataFormat instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataFormat=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.InvalidDataFormat} InvalidDataFormat instance + */ + InvalidDataFormat.create = function create(properties) { + return new InvalidDataFormat(properties); + }; + + /** + * Encodes the specified InvalidDataFormat message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataFormat.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataFormat} message InvalidDataFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sampledDataLocations != null && message.sampledDataLocations.length) + for (var i = 0; i < message.sampledDataLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sampledDataLocations[i]); + if (message.expectedFormat != null && Object.hasOwnProperty.call(message, "expectedFormat")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.expectedFormat); + if (message.newFormat != null && Object.hasOwnProperty.call(message, "newFormat")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.newFormat); + return writer; + }; + + /** + * Encodes the specified InvalidDataFormat message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataFormat} message InvalidDataFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidDataFormat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.InvalidDataFormat} InvalidDataFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataFormat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.InvalidDataFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sampledDataLocations && message.sampledDataLocations.length)) + message.sampledDataLocations = []; + message.sampledDataLocations.push(reader.string()); + break; + } + case 2: { + message.expectedFormat = reader.string(); + break; + } + case 3: { + message.newFormat = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidDataFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.InvalidDataFormat} InvalidDataFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidDataFormat message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidDataFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sampledDataLocations != null && message.hasOwnProperty("sampledDataLocations")) { + if (!Array.isArray(message.sampledDataLocations)) + return "sampledDataLocations: array expected"; + for (var i = 0; i < message.sampledDataLocations.length; ++i) + if (!$util.isString(message.sampledDataLocations[i])) + return "sampledDataLocations: string[] expected"; + } + if (message.expectedFormat != null && message.hasOwnProperty("expectedFormat")) + if (!$util.isString(message.expectedFormat)) + return "expectedFormat: string expected"; + if (message.newFormat != null && message.hasOwnProperty("newFormat")) + if (!$util.isString(message.newFormat)) + return "newFormat: string expected"; + return null; + }; + + /** + * Creates an InvalidDataFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.InvalidDataFormat} InvalidDataFormat + */ + InvalidDataFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.InvalidDataFormat) + return object; + var message = new $root.google.cloud.dataplex.v1.Action.InvalidDataFormat(); + if (object.sampledDataLocations) { + if (!Array.isArray(object.sampledDataLocations)) + throw TypeError(".google.cloud.dataplex.v1.Action.InvalidDataFormat.sampledDataLocations: array expected"); + message.sampledDataLocations = []; + for (var i = 0; i < object.sampledDataLocations.length; ++i) + message.sampledDataLocations[i] = String(object.sampledDataLocations[i]); + } + if (object.expectedFormat != null) + message.expectedFormat = String(object.expectedFormat); + if (object.newFormat != null) + message.newFormat = String(object.newFormat); + return message; + }; + + /** + * Creates a plain object from an InvalidDataFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {google.cloud.dataplex.v1.Action.InvalidDataFormat} message InvalidDataFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidDataFormat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sampledDataLocations = []; + if (options.defaults) { + object.expectedFormat = ""; + object.newFormat = ""; + } + if (message.sampledDataLocations && message.sampledDataLocations.length) { + object.sampledDataLocations = []; + for (var j = 0; j < message.sampledDataLocations.length; ++j) + object.sampledDataLocations[j] = message.sampledDataLocations[j]; + } + if (message.expectedFormat != null && message.hasOwnProperty("expectedFormat")) + object.expectedFormat = message.expectedFormat; + if (message.newFormat != null && message.hasOwnProperty("newFormat")) + object.newFormat = message.newFormat; + return object; + }; + + /** + * Converts this InvalidDataFormat to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @instance + * @returns {Object.} JSON object + */ + InvalidDataFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InvalidDataFormat + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.InvalidDataFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InvalidDataFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.InvalidDataFormat"; + }; + + return InvalidDataFormat; + })(); + + Action.IncompatibleDataSchema = (function() { + + /** + * Properties of an IncompatibleDataSchema. + * @memberof google.cloud.dataplex.v1.Action + * @interface IIncompatibleDataSchema + * @property {string|null} [table] IncompatibleDataSchema table + * @property {string|null} [existingSchema] IncompatibleDataSchema existingSchema + * @property {string|null} [newSchema] IncompatibleDataSchema newSchema + * @property {Array.|null} [sampledDataLocations] IncompatibleDataSchema sampledDataLocations + * @property {google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange|null} [schemaChange] IncompatibleDataSchema schemaChange + */ + + /** + * Constructs a new IncompatibleDataSchema. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents an IncompatibleDataSchema. + * @implements IIncompatibleDataSchema + * @constructor + * @param {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema=} [properties] Properties to set + */ + function IncompatibleDataSchema(properties) { + this.sampledDataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IncompatibleDataSchema table. + * @member {string} table + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + */ + IncompatibleDataSchema.prototype.table = ""; + + /** + * IncompatibleDataSchema existingSchema. + * @member {string} existingSchema + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + */ + IncompatibleDataSchema.prototype.existingSchema = ""; + + /** + * IncompatibleDataSchema newSchema. + * @member {string} newSchema + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + */ + IncompatibleDataSchema.prototype.newSchema = ""; + + /** + * IncompatibleDataSchema sampledDataLocations. + * @member {Array.} sampledDataLocations + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + */ + IncompatibleDataSchema.prototype.sampledDataLocations = $util.emptyArray; + + /** + * IncompatibleDataSchema schemaChange. + * @member {google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange} schemaChange + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + */ + IncompatibleDataSchema.prototype.schemaChange = 0; + + /** + * Creates a new IncompatibleDataSchema instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.IncompatibleDataSchema} IncompatibleDataSchema instance + */ + IncompatibleDataSchema.create = function create(properties) { + return new IncompatibleDataSchema(properties); + }; + + /** + * Encodes the specified IncompatibleDataSchema message. Does not implicitly {@link google.cloud.dataplex.v1.Action.IncompatibleDataSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema} message IncompatibleDataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncompatibleDataSchema.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.existingSchema != null && Object.hasOwnProperty.call(message, "existingSchema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingSchema); + if (message.newSchema != null && Object.hasOwnProperty.call(message, "newSchema")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.newSchema); + if (message.sampledDataLocations != null && message.sampledDataLocations.length) + for (var i = 0; i < message.sampledDataLocations.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sampledDataLocations[i]); + if (message.schemaChange != null && Object.hasOwnProperty.call(message, "schemaChange")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.schemaChange); + return writer; + }; + + /** + * Encodes the specified IncompatibleDataSchema message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.IncompatibleDataSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {google.cloud.dataplex.v1.Action.IIncompatibleDataSchema} message IncompatibleDataSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncompatibleDataSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IncompatibleDataSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.IncompatibleDataSchema} IncompatibleDataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncompatibleDataSchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.existingSchema = reader.string(); + break; + } + case 3: { + message.newSchema = reader.string(); + break; + } + case 4: { + if (!(message.sampledDataLocations && message.sampledDataLocations.length)) + message.sampledDataLocations = []; + message.sampledDataLocations.push(reader.string()); + break; + } + case 5: { + message.schemaChange = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IncompatibleDataSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.IncompatibleDataSchema} IncompatibleDataSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncompatibleDataSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncompatibleDataSchema message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncompatibleDataSchema.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.existingSchema != null && message.hasOwnProperty("existingSchema")) + if (!$util.isString(message.existingSchema)) + return "existingSchema: string expected"; + if (message.newSchema != null && message.hasOwnProperty("newSchema")) + if (!$util.isString(message.newSchema)) + return "newSchema: string expected"; + if (message.sampledDataLocations != null && message.hasOwnProperty("sampledDataLocations")) { + if (!Array.isArray(message.sampledDataLocations)) + return "sampledDataLocations: array expected"; + for (var i = 0; i < message.sampledDataLocations.length; ++i) + if (!$util.isString(message.sampledDataLocations[i])) + return "sampledDataLocations: string[] expected"; + } + if (message.schemaChange != null && message.hasOwnProperty("schemaChange")) + switch (message.schemaChange) { + default: + return "schemaChange: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an IncompatibleDataSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.IncompatibleDataSchema} IncompatibleDataSchema + */ + IncompatibleDataSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema) + return object; + var message = new $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema(); + if (object.table != null) + message.table = String(object.table); + if (object.existingSchema != null) + message.existingSchema = String(object.existingSchema); + if (object.newSchema != null) + message.newSchema = String(object.newSchema); + if (object.sampledDataLocations) { + if (!Array.isArray(object.sampledDataLocations)) + throw TypeError(".google.cloud.dataplex.v1.Action.IncompatibleDataSchema.sampledDataLocations: array expected"); + message.sampledDataLocations = []; + for (var i = 0; i < object.sampledDataLocations.length; ++i) + message.sampledDataLocations[i] = String(object.sampledDataLocations[i]); + } + switch (object.schemaChange) { + case "SCHEMA_CHANGE_UNSPECIFIED": + case 0: + message.schemaChange = 0; + break; + case "INCOMPATIBLE": + case 1: + message.schemaChange = 1; + break; + case "MODIFIED": + case 2: + message.schemaChange = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an IncompatibleDataSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {google.cloud.dataplex.v1.Action.IncompatibleDataSchema} message IncompatibleDataSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncompatibleDataSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sampledDataLocations = []; + if (options.defaults) { + object.table = ""; + object.existingSchema = ""; + object.newSchema = ""; + object.schemaChange = options.enums === String ? "SCHEMA_CHANGE_UNSPECIFIED" : 0; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.existingSchema != null && message.hasOwnProperty("existingSchema")) + object.existingSchema = message.existingSchema; + if (message.newSchema != null && message.hasOwnProperty("newSchema")) + object.newSchema = message.newSchema; + if (message.sampledDataLocations && message.sampledDataLocations.length) { + object.sampledDataLocations = []; + for (var j = 0; j < message.sampledDataLocations.length; ++j) + object.sampledDataLocations[j] = message.sampledDataLocations[j]; + } + if (message.schemaChange != null && message.hasOwnProperty("schemaChange")) + object.schemaChange = options.enums === String ? $root.google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange[message.schemaChange] : message.schemaChange; + return object; + }; + + /** + * Converts this IncompatibleDataSchema to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @instance + * @returns {Object.} JSON object + */ + IncompatibleDataSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncompatibleDataSchema + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.IncompatibleDataSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncompatibleDataSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.IncompatibleDataSchema"; + }; + + /** + * SchemaChange enum. + * @name google.cloud.dataplex.v1.Action.IncompatibleDataSchema.SchemaChange + * @enum {number} + * @property {number} SCHEMA_CHANGE_UNSPECIFIED=0 SCHEMA_CHANGE_UNSPECIFIED value + * @property {number} INCOMPATIBLE=1 INCOMPATIBLE value + * @property {number} MODIFIED=2 MODIFIED value + */ + IncompatibleDataSchema.SchemaChange = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEMA_CHANGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCOMPATIBLE"] = 1; + values[valuesById[2] = "MODIFIED"] = 2; + return values; + })(); + + return IncompatibleDataSchema; + })(); + + Action.InvalidDataPartition = (function() { + + /** + * Properties of an InvalidDataPartition. + * @memberof google.cloud.dataplex.v1.Action + * @interface IInvalidDataPartition + * @property {google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure|null} [expectedStructure] InvalidDataPartition expectedStructure + */ + + /** + * Constructs a new InvalidDataPartition. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents an InvalidDataPartition. + * @implements IInvalidDataPartition + * @constructor + * @param {google.cloud.dataplex.v1.Action.IInvalidDataPartition=} [properties] Properties to set + */ + function InvalidDataPartition(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]]; + } + + /** + * InvalidDataPartition expectedStructure. + * @member {google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure} expectedStructure + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @instance + */ + InvalidDataPartition.prototype.expectedStructure = 0; + + /** + * Creates a new InvalidDataPartition instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataPartition=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.InvalidDataPartition} InvalidDataPartition instance + */ + InvalidDataPartition.create = function create(properties) { + return new InvalidDataPartition(properties); + }; + + /** + * Encodes the specified InvalidDataPartition message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataPartition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataPartition} message InvalidDataPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataPartition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expectedStructure != null && Object.hasOwnProperty.call(message, "expectedStructure")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.expectedStructure); + return writer; + }; + + /** + * Encodes the specified InvalidDataPartition message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataPartition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataPartition} message InvalidDataPartition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataPartition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidDataPartition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.InvalidDataPartition} InvalidDataPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataPartition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.InvalidDataPartition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expectedStructure = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidDataPartition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.InvalidDataPartition} InvalidDataPartition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataPartition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidDataPartition message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidDataPartition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expectedStructure != null && message.hasOwnProperty("expectedStructure")) + switch (message.expectedStructure) { + default: + return "expectedStructure: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an InvalidDataPartition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.InvalidDataPartition} InvalidDataPartition + */ + InvalidDataPartition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.InvalidDataPartition) + return object; + var message = new $root.google.cloud.dataplex.v1.Action.InvalidDataPartition(); + switch (object.expectedStructure) { + case "PARTITION_STRUCTURE_UNSPECIFIED": + case 0: + message.expectedStructure = 0; + break; + case "CONSISTENT_KEYS": + case 1: + message.expectedStructure = 1; + break; + case "HIVE_STYLE_KEYS": + case 2: + message.expectedStructure = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an InvalidDataPartition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {google.cloud.dataplex.v1.Action.InvalidDataPartition} message InvalidDataPartition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidDataPartition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expectedStructure = options.enums === String ? "PARTITION_STRUCTURE_UNSPECIFIED" : 0; + if (message.expectedStructure != null && message.hasOwnProperty("expectedStructure")) + object.expectedStructure = options.enums === String ? $root.google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure[message.expectedStructure] : message.expectedStructure; + return object; + }; + + /** + * Converts this InvalidDataPartition to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @instance + * @returns {Object.} JSON object + */ + InvalidDataPartition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InvalidDataPartition + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.InvalidDataPartition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InvalidDataPartition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.InvalidDataPartition"; + }; + + /** + * PartitionStructure enum. + * @name google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure + * @enum {number} + * @property {number} PARTITION_STRUCTURE_UNSPECIFIED=0 PARTITION_STRUCTURE_UNSPECIFIED value + * @property {number} CONSISTENT_KEYS=1 CONSISTENT_KEYS value + * @property {number} HIVE_STYLE_KEYS=2 HIVE_STYLE_KEYS value + */ + InvalidDataPartition.PartitionStructure = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_STRUCTURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONSISTENT_KEYS"] = 1; + values[valuesById[2] = "HIVE_STYLE_KEYS"] = 2; + return values; + })(); + + return InvalidDataPartition; + })(); + + Action.MissingData = (function() { + + /** + * Properties of a MissingData. + * @memberof google.cloud.dataplex.v1.Action + * @interface IMissingData + */ + + /** + * Constructs a new MissingData. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents a MissingData. + * @implements IMissingData + * @constructor + * @param {google.cloud.dataplex.v1.Action.IMissingData=} [properties] Properties to set + */ + function MissingData(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 MissingData instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingData=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.MissingData} MissingData instance + */ + MissingData.create = function create(properties) { + return new MissingData(properties); + }; + + /** + * Encodes the specified MissingData message. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingData.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingData} message MissingData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MissingData message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.MissingData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {google.cloud.dataplex.v1.Action.IMissingData} message MissingData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MissingData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MissingData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.MissingData} MissingData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.MissingData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MissingData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.MissingData} MissingData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MissingData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MissingData message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MissingData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MissingData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.MissingData} MissingData + */ + MissingData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.MissingData) + return object; + return new $root.google.cloud.dataplex.v1.Action.MissingData(); + }; + + /** + * Creates a plain object from a MissingData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {google.cloud.dataplex.v1.Action.MissingData} message MissingData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MissingData.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MissingData to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @instance + * @returns {Object.} JSON object + */ + MissingData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MissingData + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.MissingData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MissingData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.MissingData"; + }; + + return MissingData; + })(); + + Action.InvalidDataOrganization = (function() { + + /** + * Properties of an InvalidDataOrganization. + * @memberof google.cloud.dataplex.v1.Action + * @interface IInvalidDataOrganization + */ + + /** + * Constructs a new InvalidDataOrganization. + * @memberof google.cloud.dataplex.v1.Action + * @classdesc Represents an InvalidDataOrganization. + * @implements IInvalidDataOrganization + * @constructor + * @param {google.cloud.dataplex.v1.Action.IInvalidDataOrganization=} [properties] Properties to set + */ + function InvalidDataOrganization(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 InvalidDataOrganization instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataOrganization=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Action.InvalidDataOrganization} InvalidDataOrganization instance + */ + InvalidDataOrganization.create = function create(properties) { + return new InvalidDataOrganization(properties); + }; + + /** + * Encodes the specified InvalidDataOrganization message. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataOrganization.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataOrganization} message InvalidDataOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataOrganization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified InvalidDataOrganization message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Action.InvalidDataOrganization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {google.cloud.dataplex.v1.Action.IInvalidDataOrganization} message InvalidDataOrganization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidDataOrganization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidDataOrganization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Action.InvalidDataOrganization} InvalidDataOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataOrganization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidDataOrganization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Action.InvalidDataOrganization} InvalidDataOrganization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidDataOrganization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidDataOrganization message. + * @function verify + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidDataOrganization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an InvalidDataOrganization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Action.InvalidDataOrganization} InvalidDataOrganization + */ + InvalidDataOrganization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization) + return object; + return new $root.google.cloud.dataplex.v1.Action.InvalidDataOrganization(); + }; + + /** + * Creates a plain object from an InvalidDataOrganization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {google.cloud.dataplex.v1.Action.InvalidDataOrganization} message InvalidDataOrganization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidDataOrganization.toObject = function toObject() { + return {}; + }; + + /** + * Converts this InvalidDataOrganization to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @instance + * @returns {Object.} JSON object + */ + InvalidDataOrganization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InvalidDataOrganization + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Action.InvalidDataOrganization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InvalidDataOrganization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Action.InvalidDataOrganization"; + }; + + return InvalidDataOrganization; + })(); + + return Action; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.dataplex.v1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [displayName] Asset displayName + * @property {string|null} [uid] Asset uid + * @property {google.protobuf.ITimestamp|null} [createTime] Asset createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {Object.|null} [labels] Asset labels + * @property {string|null} [description] Asset description + * @property {google.cloud.dataplex.v1.Asset.SecurityStatus.State|null} [state] Asset state + * @property {google.cloud.dataplex.v1.Asset.IResourceSpec|null} [resourceSpec] Asset resourceSpec + * @property {google.cloud.dataplex.v1.Asset.IResourceStatus|null} [resourceStatus] Asset resourceStatus + * @property {google.cloud.dataplex.v1.Asset.ISecurityStatus|null} [securityStatus] Asset securityStatus + * @property {google.cloud.dataplex.v1.Asset.IDiscoverySpec|null} [discoverySpec] Asset discoverySpec + * @property {google.cloud.dataplex.v1.Asset.IDiscoveryStatus|null} [discoveryStatus] Asset discoveryStatus + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.dataplex.v1.IAsset=} [properties] Properties to set + */ + function Asset(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]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.displayName = ""; + + /** + * Asset uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.uid = ""; + + /** + * Asset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.createTime = null; + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.labels = $util.emptyObject; + + /** + * Asset description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.description = ""; + + /** + * Asset state. + * @member {google.cloud.dataplex.v1.Asset.SecurityStatus.State} state + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.state = 0; + + /** + * Asset resourceSpec. + * @member {google.cloud.dataplex.v1.Asset.IResourceSpec|null|undefined} resourceSpec + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.resourceSpec = null; + + /** + * Asset resourceStatus. + * @member {google.cloud.dataplex.v1.Asset.IResourceStatus|null|undefined} resourceStatus + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.resourceStatus = null; + + /** + * Asset securityStatus. + * @member {google.cloud.dataplex.v1.Asset.ISecurityStatus|null|undefined} securityStatus + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.securityStatus = null; + + /** + * Asset discoverySpec. + * @member {google.cloud.dataplex.v1.Asset.IDiscoverySpec|null|undefined} discoverySpec + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.discoverySpec = null; + + /** + * Asset discoveryStatus. + * @member {google.cloud.dataplex.v1.Asset.IDiscoveryStatus|null|undefined} discoveryStatus + * @memberof google.cloud.dataplex.v1.Asset + * @instance + */ + Asset.prototype.discoveryStatus = null; + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {google.cloud.dataplex.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {google.cloud.dataplex.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.resourceSpec != null && Object.hasOwnProperty.call(message, "resourceSpec")) + $root.google.cloud.dataplex.v1.Asset.ResourceSpec.encode(message.resourceSpec, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.resourceStatus != null && Object.hasOwnProperty.call(message, "resourceStatus")) + $root.google.cloud.dataplex.v1.Asset.ResourceStatus.encode(message.resourceStatus, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.securityStatus != null && Object.hasOwnProperty.call(message, "securityStatus")) + $root.google.cloud.dataplex.v1.Asset.SecurityStatus.encode(message.securityStatus, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.discoverySpec != null && Object.hasOwnProperty.call(message, "discoverySpec")) + $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.encode(message.discoverySpec, writer.uint32(/* id 106, wireType 2 =*/850).fork()).ldelim(); + if (message.discoveryStatus != null && Object.hasOwnProperty.call(message, "discoveryStatus")) + $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.encode(message.discoveryStatus, writer.uint32(/* id 107, wireType 2 =*/858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {google.cloud.dataplex.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.description = reader.string(); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 100: { + message.resourceSpec = $root.google.cloud.dataplex.v1.Asset.ResourceSpec.decode(reader, reader.uint32()); + break; + } + case 101: { + message.resourceStatus = $root.google.cloud.dataplex.v1.Asset.ResourceStatus.decode(reader, reader.uint32()); + break; + } + case 103: { + message.securityStatus = $root.google.cloud.dataplex.v1.Asset.SecurityStatus.decode(reader, reader.uint32()); + break; + } + case 106: { + message.discoverySpec = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.decode(reader, reader.uint32()); + break; + } + case 107: { + message.discoveryStatus = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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: + break; + } + if (message.resourceSpec != null && message.hasOwnProperty("resourceSpec")) { + var error = $root.google.cloud.dataplex.v1.Asset.ResourceSpec.verify(message.resourceSpec); + if (error) + return "resourceSpec." + error; + } + if (message.resourceStatus != null && message.hasOwnProperty("resourceStatus")) { + var error = $root.google.cloud.dataplex.v1.Asset.ResourceStatus.verify(message.resourceStatus); + if (error) + return "resourceStatus." + error; + } + if (message.securityStatus != null && message.hasOwnProperty("securityStatus")) { + var error = $root.google.cloud.dataplex.v1.Asset.SecurityStatus.verify(message.securityStatus); + if (error) + return "securityStatus." + error; + } + if (message.discoverySpec != null && message.hasOwnProperty("discoverySpec")) { + var error = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.verify(message.discoverySpec); + if (error) + return "discoverySpec." + error; + } + if (message.discoveryStatus != null && message.hasOwnProperty("discoveryStatus")) { + var error = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.verify(message.discoveryStatus); + if (error) + return "discoveryStatus." + error; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.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.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "APPLYING": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.resourceSpec != null) { + if (typeof object.resourceSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.resourceSpec: object expected"); + message.resourceSpec = $root.google.cloud.dataplex.v1.Asset.ResourceSpec.fromObject(object.resourceSpec); + } + if (object.resourceStatus != null) { + if (typeof object.resourceStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.resourceStatus: object expected"); + message.resourceStatus = $root.google.cloud.dataplex.v1.Asset.ResourceStatus.fromObject(object.resourceStatus); + } + if (object.securityStatus != null) { + if (typeof object.securityStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.securityStatus: object expected"); + message.securityStatus = $root.google.cloud.dataplex.v1.Asset.SecurityStatus.fromObject(object.securityStatus); + } + if (object.discoverySpec != null) { + if (typeof object.discoverySpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.discoverySpec: object expected"); + message.discoverySpec = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.fromObject(object.discoverySpec); + } + if (object.discoveryStatus != null) { + if (typeof object.discoveryStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.discoveryStatus: object expected"); + message.discoveryStatus = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.fromObject(object.discoveryStatus); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {google.cloud.dataplex.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceSpec = null; + object.resourceStatus = null; + object.securityStatus = null; + object.discoverySpec = null; + object.discoveryStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Asset.SecurityStatus.State[message.state] : message.state; + if (message.resourceSpec != null && message.hasOwnProperty("resourceSpec")) + object.resourceSpec = $root.google.cloud.dataplex.v1.Asset.ResourceSpec.toObject(message.resourceSpec, options); + if (message.resourceStatus != null && message.hasOwnProperty("resourceStatus")) + object.resourceStatus = $root.google.cloud.dataplex.v1.Asset.ResourceStatus.toObject(message.resourceStatus, options); + if (message.securityStatus != null && message.hasOwnProperty("securityStatus")) + object.securityStatus = $root.google.cloud.dataplex.v1.Asset.SecurityStatus.toObject(message.securityStatus, options); + if (message.discoverySpec != null && message.hasOwnProperty("discoverySpec")) + object.discoverySpec = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.toObject(message.discoverySpec, options); + if (message.discoveryStatus != null && message.hasOwnProperty("discoveryStatus")) + object.discoveryStatus = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.toObject(message.discoveryStatus, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset"; + }; + + Asset.SecurityStatus = (function() { + + /** + * Properties of a SecurityStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @interface ISecurityStatus + * @property {google.cloud.dataplex.v1.Asset.SecurityStatus.State|null} [state] SecurityStatus state + * @property {string|null} [message] SecurityStatus message + * @property {google.protobuf.ITimestamp|null} [updateTime] SecurityStatus updateTime + */ + + /** + * Constructs a new SecurityStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @classdesc Represents a SecurityStatus. + * @implements ISecurityStatus + * @constructor + * @param {google.cloud.dataplex.v1.Asset.ISecurityStatus=} [properties] Properties to set + */ + function SecurityStatus(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]]; + } + + /** + * SecurityStatus state. + * @member {google.cloud.dataplex.v1.Asset.SecurityStatus.State} state + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @instance + */ + SecurityStatus.prototype.state = 0; + + /** + * SecurityStatus message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @instance + */ + SecurityStatus.prototype.message = ""; + + /** + * SecurityStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @instance + */ + SecurityStatus.prototype.updateTime = null; + + /** + * Creates a new SecurityStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.ISecurityStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.SecurityStatus} SecurityStatus instance + */ + SecurityStatus.create = function create(properties) { + return new SecurityStatus(properties); + }; + + /** + * Encodes the specified SecurityStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.SecurityStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.ISecurityStatus} message SecurityStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityStatus.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.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.SecurityStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.ISecurityStatus} message SecurityStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.SecurityStatus} SecurityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.SecurityStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.SecurityStatus} SecurityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityStatus.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: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a SecurityStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.SecurityStatus} SecurityStatus + */ + SecurityStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.SecurityStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.SecurityStatus(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "APPLYING": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.SecurityStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a SecurityStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.SecurityStatus} message SecurityStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.message = ""; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Asset.SecurityStatus.State[message.state] : message.state; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this SecurityStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @instance + * @returns {Object.} JSON object + */ + SecurityStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.SecurityStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.SecurityStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataplex.v1.Asset.SecurityStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} APPLYING=2 APPLYING value + * @property {number} ERROR=3 ERROR value + */ + SecurityStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "APPLYING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return SecurityStatus; + })(); + + Asset.DiscoverySpec = (function() { + + /** + * Properties of a DiscoverySpec. + * @memberof google.cloud.dataplex.v1.Asset + * @interface IDiscoverySpec + * @property {boolean|null} [enabled] DiscoverySpec enabled + * @property {Array.|null} [includePatterns] DiscoverySpec includePatterns + * @property {Array.|null} [excludePatterns] DiscoverySpec excludePatterns + * @property {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions|null} [csvOptions] DiscoverySpec csvOptions + * @property {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions|null} [jsonOptions] DiscoverySpec jsonOptions + * @property {string|null} [schedule] DiscoverySpec schedule + */ + + /** + * Constructs a new DiscoverySpec. + * @memberof google.cloud.dataplex.v1.Asset + * @classdesc Represents a DiscoverySpec. + * @implements IDiscoverySpec + * @constructor + * @param {google.cloud.dataplex.v1.Asset.IDiscoverySpec=} [properties] Properties to set + */ + function DiscoverySpec(properties) { + this.includePatterns = []; + this.excludePatterns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiscoverySpec enabled. + * @member {boolean} enabled + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.enabled = false; + + /** + * DiscoverySpec includePatterns. + * @member {Array.} includePatterns + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.includePatterns = $util.emptyArray; + + /** + * DiscoverySpec excludePatterns. + * @member {Array.} excludePatterns + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.excludePatterns = $util.emptyArray; + + /** + * DiscoverySpec csvOptions. + * @member {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions|null|undefined} csvOptions + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.csvOptions = null; + + /** + * DiscoverySpec jsonOptions. + * @member {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions|null|undefined} jsonOptions + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.jsonOptions = null; + + /** + * DiscoverySpec schedule. + * @member {string|null|undefined} schedule + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + DiscoverySpec.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiscoverySpec trigger. + * @member {"schedule"|undefined} trigger + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + */ + Object.defineProperty(DiscoverySpec.prototype, "trigger", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiscoverySpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoverySpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec} DiscoverySpec instance + */ + DiscoverySpec.create = function create(properties) { + return new DiscoverySpec(properties); + }; + + /** + * Encodes the specified DiscoverySpec message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoverySpec} message DiscoverySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoverySpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.includePatterns != null && message.includePatterns.length) + for (var i = 0; i < message.includePatterns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.includePatterns[i]); + if (message.excludePatterns != null && message.excludePatterns.length) + for (var i = 0; i < message.excludePatterns.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludePatterns[i]); + if (message.csvOptions != null && Object.hasOwnProperty.call(message, "csvOptions")) + $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.encode(message.csvOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.jsonOptions != null && Object.hasOwnProperty.call(message, "jsonOptions")) + $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.encode(message.jsonOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.schedule); + return writer; + }; + + /** + * Encodes the specified DiscoverySpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoverySpec} message DiscoverySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoverySpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec} DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoverySpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + if (!(message.includePatterns && message.includePatterns.length)) + message.includePatterns = []; + message.includePatterns.push(reader.string()); + break; + } + case 3: { + if (!(message.excludePatterns && message.excludePatterns.length)) + message.excludePatterns = []; + message.excludePatterns.push(reader.string()); + break; + } + case 4: { + message.csvOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.jsonOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + message.schedule = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiscoverySpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec} DiscoverySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoverySpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiscoverySpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiscoverySpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.includePatterns != null && message.hasOwnProperty("includePatterns")) { + if (!Array.isArray(message.includePatterns)) + return "includePatterns: array expected"; + for (var i = 0; i < message.includePatterns.length; ++i) + if (!$util.isString(message.includePatterns[i])) + return "includePatterns: string[] expected"; + } + if (message.excludePatterns != null && message.hasOwnProperty("excludePatterns")) { + if (!Array.isArray(message.excludePatterns)) + return "excludePatterns: array expected"; + for (var i = 0; i < message.excludePatterns.length; ++i) + if (!$util.isString(message.excludePatterns[i])) + return "excludePatterns: string[] expected"; + } + if (message.csvOptions != null && message.hasOwnProperty("csvOptions")) { + var error = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.verify(message.csvOptions); + if (error) + return "csvOptions." + error; + } + if (message.jsonOptions != null && message.hasOwnProperty("jsonOptions")) { + var error = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.verify(message.jsonOptions); + if (error) + return "jsonOptions." + error; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties.trigger = 1; + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + } + return null; + }; + + /** + * Creates a DiscoverySpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec} DiscoverySpec + */ + DiscoverySpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.DiscoverySpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.includePatterns) { + if (!Array.isArray(object.includePatterns)) + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoverySpec.includePatterns: array expected"); + message.includePatterns = []; + for (var i = 0; i < object.includePatterns.length; ++i) + message.includePatterns[i] = String(object.includePatterns[i]); + } + if (object.excludePatterns) { + if (!Array.isArray(object.excludePatterns)) + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoverySpec.excludePatterns: array expected"); + message.excludePatterns = []; + for (var i = 0; i < object.excludePatterns.length; ++i) + message.excludePatterns[i] = String(object.excludePatterns[i]); + } + if (object.csvOptions != null) { + if (typeof object.csvOptions !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoverySpec.csvOptions: object expected"); + message.csvOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.fromObject(object.csvOptions); + } + if (object.jsonOptions != null) { + if (typeof object.jsonOptions !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoverySpec.jsonOptions: object expected"); + message.jsonOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.fromObject(object.jsonOptions); + } + if (object.schedule != null) + message.schedule = String(object.schedule); + return message; + }; + + /** + * Creates a plain object from a DiscoverySpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec} message DiscoverySpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiscoverySpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.includePatterns = []; + object.excludePatterns = []; + } + if (options.defaults) { + object.enabled = false; + object.csvOptions = null; + object.jsonOptions = null; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.includePatterns && message.includePatterns.length) { + object.includePatterns = []; + for (var j = 0; j < message.includePatterns.length; ++j) + object.includePatterns[j] = message.includePatterns[j]; + } + if (message.excludePatterns && message.excludePatterns.length) { + object.excludePatterns = []; + for (var j = 0; j < message.excludePatterns.length; ++j) + object.excludePatterns[j] = message.excludePatterns[j]; + } + if (message.csvOptions != null && message.hasOwnProperty("csvOptions")) + object.csvOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.toObject(message.csvOptions, options); + if (message.jsonOptions != null && message.hasOwnProperty("jsonOptions")) + object.jsonOptions = $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.toObject(message.jsonOptions, options); + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = message.schedule; + if (options.oneofs) + object.trigger = "schedule"; + } + return object; + }; + + /** + * Converts this DiscoverySpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @instance + * @returns {Object.} JSON object + */ + DiscoverySpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiscoverySpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiscoverySpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.DiscoverySpec"; + }; + + DiscoverySpec.CsvOptions = (function() { + + /** + * Properties of a CsvOptions. + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @interface ICsvOptions + * @property {number|null} [headerRows] CsvOptions headerRows + * @property {string|null} [delimiter] CsvOptions delimiter + * @property {string|null} [encoding] CsvOptions encoding + * @property {boolean|null} [disableTypeInference] CsvOptions disableTypeInference + */ + + /** + * Constructs a new CsvOptions. + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @classdesc Represents a CsvOptions. + * @implements ICsvOptions + * @constructor + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions=} [properties] Properties to set + */ + function CsvOptions(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]]; + } + + /** + * CsvOptions headerRows. + * @member {number} headerRows + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.headerRows = 0; + + /** + * CsvOptions delimiter. + * @member {string} delimiter + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.delimiter = ""; + + /** + * CsvOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.encoding = ""; + + /** + * CsvOptions disableTypeInference. + * @member {boolean} disableTypeInference + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @instance + */ + CsvOptions.prototype.disableTypeInference = false; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions} CsvOptions instance + */ + CsvOptions.create = function create(properties) { + return new CsvOptions(properties); + }; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerRows != null && Object.hasOwnProperty.call(message, "headerRows")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headerRows); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.delimiter); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.encoding); + if (message.disableTypeInference != null && Object.hasOwnProperty.call(message, "disableTypeInference")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableTypeInference); + return writer; + }; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headerRows = reader.int32(); + break; + } + case 2: { + message.delimiter = reader.string(); + break; + } + case 3: { + message.encoding = reader.string(); + break; + } + case 4: { + message.disableTypeInference = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + if (!$util.isInteger(message.headerRows)) + return "headerRows: integer expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + if (typeof message.disableTypeInference !== "boolean") + return "disableTypeInference: boolean expected"; + return null; + }; + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions} CsvOptions + */ + CsvOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions(); + if (object.headerRows != null) + message.headerRows = object.headerRows | 0; + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.disableTypeInference != null) + message.disableTypeInference = Boolean(object.disableTypeInference); + return message; + }; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions} message CsvOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.headerRows = 0; + object.delimiter = ""; + object.encoding = ""; + object.disableTypeInference = false; + } + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + object.headerRows = message.headerRows; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + object.disableTypeInference = message.disableTypeInference; + return object; + }; + + /** + * Converts this CsvOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @instance + * @returns {Object.} JSON object + */ + CsvOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.DiscoverySpec.CsvOptions"; + }; + + return CsvOptions; + })(); + + DiscoverySpec.JsonOptions = (function() { + + /** + * Properties of a JsonOptions. + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @interface IJsonOptions + * @property {string|null} [encoding] JsonOptions encoding + * @property {boolean|null} [disableTypeInference] JsonOptions disableTypeInference + */ + + /** + * Constructs a new JsonOptions. + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec + * @classdesc Represents a JsonOptions. + * @implements IJsonOptions + * @constructor + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions=} [properties] Properties to set + */ + function JsonOptions(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]]; + } + + /** + * JsonOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @instance + */ + JsonOptions.prototype.encoding = ""; + + /** + * JsonOptions disableTypeInference. + * @member {boolean} disableTypeInference + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @instance + */ + JsonOptions.prototype.disableTypeInference = false; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions} JsonOptions instance + */ + JsonOptions.create = function create(properties) { + return new JsonOptions(properties); + }; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encoding); + if (message.disableTypeInference != null && Object.hasOwnProperty.call(message, "disableTypeInference")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.disableTypeInference); + return writer; + }; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encoding = reader.string(); + break; + } + case 2: { + message.disableTypeInference = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JsonOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JsonOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + if (typeof message.disableTypeInference !== "boolean") + return "disableTypeInference: boolean expected"; + return null; + }; + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions} JsonOptions + */ + JsonOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions(); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.disableTypeInference != null) + message.disableTypeInference = Boolean(object.disableTypeInference); + return message; + }; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions} message JsonOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JsonOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encoding = ""; + object.disableTypeInference = false; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + if (message.disableTypeInference != null && message.hasOwnProperty("disableTypeInference")) + object.disableTypeInference = message.disableTypeInference; + return object; + }; + + /** + * Converts this JsonOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @instance + * @returns {Object.} JSON object + */ + JsonOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JsonOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JsonOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.DiscoverySpec.JsonOptions"; + }; + + return JsonOptions; + })(); + + return DiscoverySpec; + })(); + + Asset.ResourceSpec = (function() { + + /** + * Properties of a ResourceSpec. + * @memberof google.cloud.dataplex.v1.Asset + * @interface IResourceSpec + * @property {string|null} [name] ResourceSpec name + * @property {google.cloud.dataplex.v1.Asset.ResourceSpec.Type|null} [type] ResourceSpec type + */ + + /** + * Constructs a new ResourceSpec. + * @memberof google.cloud.dataplex.v1.Asset + * @classdesc Represents a ResourceSpec. + * @implements IResourceSpec + * @constructor + * @param {google.cloud.dataplex.v1.Asset.IResourceSpec=} [properties] Properties to set + */ + function ResourceSpec(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]]; + } + + /** + * ResourceSpec name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @instance + */ + ResourceSpec.prototype.name = ""; + + /** + * ResourceSpec type. + * @member {google.cloud.dataplex.v1.Asset.ResourceSpec.Type} type + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @instance + */ + ResourceSpec.prototype.type = 0; + + /** + * Creates a new ResourceSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.ResourceSpec} ResourceSpec instance + */ + ResourceSpec.create = function create(properties) { + return new ResourceSpec(properties); + }; + + /** + * Encodes the specified ResourceSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceSpec} message ResourceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpec.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); + return writer; + }; + + /** + * Encodes the specified ResourceSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceSpec} message ResourceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.ResourceSpec} ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.ResourceSpec(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.ResourceSpec} ResourceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSpec.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; + } + return null; + }; + + /** + * Creates a ResourceSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.ResourceSpec} ResourceSpec + */ + ResourceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.ResourceSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.ResourceSpec(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STORAGE_BUCKET": + case 1: + message.type = 1; + break; + case "BIGQUERY_DATASET": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {google.cloud.dataplex.v1.Asset.ResourceSpec} message ResourceSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + 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.cloud.dataplex.v1.Asset.ResourceSpec.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this ResourceSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @instance + * @returns {Object.} JSON object + */ + ResourceSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.ResourceSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.ResourceSpec"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.Asset.ResourceSpec.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STORAGE_BUCKET=1 STORAGE_BUCKET value + * @property {number} BIGQUERY_DATASET=2 BIGQUERY_DATASET value + */ + ResourceSpec.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STORAGE_BUCKET"] = 1; + values[valuesById[2] = "BIGQUERY_DATASET"] = 2; + return values; + })(); + + return ResourceSpec; + })(); + + Asset.ResourceStatus = (function() { + + /** + * Properties of a ResourceStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @interface IResourceStatus + * @property {google.cloud.dataplex.v1.Asset.ResourceStatus.State|null} [state] ResourceStatus state + * @property {string|null} [message] ResourceStatus message + * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceStatus updateTime + */ + + /** + * Constructs a new ResourceStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @classdesc Represents a ResourceStatus. + * @implements IResourceStatus + * @constructor + * @param {google.cloud.dataplex.v1.Asset.IResourceStatus=} [properties] Properties to set + */ + function ResourceStatus(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]]; + } + + /** + * ResourceStatus state. + * @member {google.cloud.dataplex.v1.Asset.ResourceStatus.State} state + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @instance + */ + ResourceStatus.prototype.state = 0; + + /** + * ResourceStatus message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @instance + */ + ResourceStatus.prototype.message = ""; + + /** + * ResourceStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @instance + */ + ResourceStatus.prototype.updateTime = null; + + /** + * Creates a new ResourceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.ResourceStatus} ResourceStatus instance + */ + ResourceStatus.create = function create(properties) { + return new ResourceStatus(properties); + }; + + /** + * Encodes the specified ResourceStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceStatus} message ResourceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceStatus.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.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.ResourceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IResourceStatus} message ResourceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.ResourceStatus} ResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.ResourceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.ResourceStatus} ResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceStatus.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: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a ResourceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.ResourceStatus} ResourceStatus + */ + ResourceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.ResourceStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.ResourceStatus(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "READY": + case 1: + message.state = 1; + break; + case "ERROR": + case 2: + message.state = 2; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.ResourceStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a ResourceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.ResourceStatus} message ResourceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.message = ""; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Asset.ResourceStatus.State[message.state] : message.state; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this ResourceStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @instance + * @returns {Object.} JSON object + */ + ResourceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.ResourceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.ResourceStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataplex.v1.Asset.ResourceStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} READY=1 READY value + * @property {number} ERROR=2 ERROR value + */ + ResourceStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "ERROR"] = 2; + return values; + })(); + + return ResourceStatus; + })(); + + Asset.DiscoveryStatus = (function() { + + /** + * Properties of a DiscoveryStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @interface IDiscoveryStatus + * @property {google.cloud.dataplex.v1.Asset.DiscoveryStatus.State|null} [state] DiscoveryStatus state + * @property {string|null} [message] DiscoveryStatus message + * @property {google.protobuf.ITimestamp|null} [updateTime] DiscoveryStatus updateTime + * @property {google.protobuf.ITimestamp|null} [lastRunTime] DiscoveryStatus lastRunTime + * @property {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats|null} [stats] DiscoveryStatus stats + * @property {google.protobuf.IDuration|null} [lastRunDuration] DiscoveryStatus lastRunDuration + */ + + /** + * Constructs a new DiscoveryStatus. + * @memberof google.cloud.dataplex.v1.Asset + * @classdesc Represents a DiscoveryStatus. + * @implements IDiscoveryStatus + * @constructor + * @param {google.cloud.dataplex.v1.Asset.IDiscoveryStatus=} [properties] Properties to set + */ + function DiscoveryStatus(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]]; + } + + /** + * DiscoveryStatus state. + * @member {google.cloud.dataplex.v1.Asset.DiscoveryStatus.State} state + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.state = 0; + + /** + * DiscoveryStatus message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.message = ""; + + /** + * DiscoveryStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.updateTime = null; + + /** + * DiscoveryStatus lastRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastRunTime + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.lastRunTime = null; + + /** + * DiscoveryStatus stats. + * @member {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats|null|undefined} stats + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.stats = null; + + /** + * DiscoveryStatus lastRunDuration. + * @member {google.protobuf.IDuration|null|undefined} lastRunDuration + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + */ + DiscoveryStatus.prototype.lastRunDuration = null; + + /** + * Creates a new DiscoveryStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoveryStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus} DiscoveryStatus instance + */ + DiscoveryStatus.create = function create(properties) { + return new DiscoveryStatus(properties); + }; + + /** + * Encodes the specified DiscoveryStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoveryStatus} message DiscoveryStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoveryStatus.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.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastRunTime != null && Object.hasOwnProperty.call(message, "lastRunTime")) + $root.google.protobuf.Timestamp.encode(message.lastRunTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.encode(message.stats, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.lastRunDuration != null && Object.hasOwnProperty.call(message, "lastRunDuration")) + $root.google.protobuf.Duration.encode(message.lastRunDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiscoveryStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.IDiscoveryStatus} message DiscoveryStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoveryStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiscoveryStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus} DiscoveryStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoveryStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lastRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.stats = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.decode(reader, reader.uint32()); + break; + } + case 7: { + message.lastRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiscoveryStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus} DiscoveryStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoveryStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiscoveryStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiscoveryStatus.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 5: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.lastRunTime != null && message.hasOwnProperty("lastRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastRunTime); + if (error) + return "lastRunTime." + error; + } + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.lastRunDuration != null && message.hasOwnProperty("lastRunDuration")) { + var error = $root.google.protobuf.Duration.verify(message.lastRunDuration); + if (error) + return "lastRunDuration." + error; + } + return null; + }; + + /** + * Creates a DiscoveryStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus} DiscoveryStatus + */ + DiscoveryStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SCHEDULED": + case 1: + message.state = 1; + break; + case "IN_PROGRESS": + case 2: + message.state = 2; + break; + case "PAUSED": + case 3: + message.state = 3; + break; + case "DISABLED": + case 5: + message.state = 5; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoveryStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastRunTime != null) { + if (typeof object.lastRunTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoveryStatus.lastRunTime: object expected"); + message.lastRunTime = $root.google.protobuf.Timestamp.fromObject(object.lastRunTime); + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoveryStatus.stats: object expected"); + message.stats = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.fromObject(object.stats); + } + if (object.lastRunDuration != null) { + if (typeof object.lastRunDuration !== "object") + throw TypeError(".google.cloud.dataplex.v1.Asset.DiscoveryStatus.lastRunDuration: object expected"); + message.lastRunDuration = $root.google.protobuf.Duration.fromObject(object.lastRunDuration); + } + return message; + }; + + /** + * Creates a plain object from a DiscoveryStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus} message DiscoveryStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiscoveryStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.message = ""; + object.updateTime = null; + object.lastRunTime = null; + object.stats = null; + object.lastRunDuration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.State[message.state] : message.state; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastRunTime != null && message.hasOwnProperty("lastRunTime")) + object.lastRunTime = $root.google.protobuf.Timestamp.toObject(message.lastRunTime, options); + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.toObject(message.stats, options); + if (message.lastRunDuration != null && message.hasOwnProperty("lastRunDuration")) + object.lastRunDuration = $root.google.protobuf.Duration.toObject(message.lastRunDuration, options); + return object; + }; + + /** + * Converts this DiscoveryStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @instance + * @returns {Object.} JSON object + */ + DiscoveryStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiscoveryStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiscoveryStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.DiscoveryStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataplex.v1.Asset.DiscoveryStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} IN_PROGRESS=2 IN_PROGRESS value + * @property {number} PAUSED=3 PAUSED value + * @property {number} DISABLED=5 DISABLED value + */ + DiscoveryStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "IN_PROGRESS"] = 2; + values[valuesById[3] = "PAUSED"] = 3; + values[valuesById[5] = "DISABLED"] = 5; + return values; + })(); + + DiscoveryStatus.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @interface IStats + * @property {number|Long|null} [dataItems] Stats dataItems + * @property {number|Long|null} [dataSize] Stats dataSize + * @property {number|Long|null} [tables] Stats tables + * @property {number|Long|null} [filesets] Stats filesets + */ + + /** + * Constructs a new Stats. + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats=} [properties] Properties to set + */ + function Stats(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]]; + } + + /** + * Stats dataItems. + * @member {number|Long} dataItems + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @instance + */ + Stats.prototype.dataItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stats dataSize. + * @member {number|Long} dataSize + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @instance + */ + Stats.prototype.dataSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stats tables. + * @member {number|Long} tables + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @instance + */ + Stats.prototype.tables = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stats filesets. + * @member {number|Long} filesets + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @instance + */ + Stats.prototype.filesets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Stats instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats} Stats instance + */ + Stats.create = function create(properties) { + return new Stats(properties); + }; + + /** + * Encodes the specified Stats message. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataItems != null && Object.hasOwnProperty.call(message, "dataItems")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.dataItems); + if (message.dataSize != null && Object.hasOwnProperty.call(message, "dataSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.dataSize); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.tables); + if (message.filesets != null && Object.hasOwnProperty.call(message, "filesets")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.filesets); + return writer; + }; + + /** + * Encodes the specified Stats message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus.IStats} message Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataItems = reader.int64(); + break; + } + case 2: { + message.dataSize = reader.int64(); + break; + } + case 3: { + message.tables = reader.int64(); + break; + } + case 4: { + message.filesets = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats} Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stats message. + * @function verify + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataItems != null && message.hasOwnProperty("dataItems")) + if (!$util.isInteger(message.dataItems) && !(message.dataItems && $util.isInteger(message.dataItems.low) && $util.isInteger(message.dataItems.high))) + return "dataItems: integer|Long expected"; + if (message.dataSize != null && message.hasOwnProperty("dataSize")) + if (!$util.isInteger(message.dataSize) && !(message.dataSize && $util.isInteger(message.dataSize.low) && $util.isInteger(message.dataSize.high))) + return "dataSize: integer|Long expected"; + if (message.tables != null && message.hasOwnProperty("tables")) + if (!$util.isInteger(message.tables) && !(message.tables && $util.isInteger(message.tables.low) && $util.isInteger(message.tables.high))) + return "tables: integer|Long expected"; + if (message.filesets != null && message.hasOwnProperty("filesets")) + if (!$util.isInteger(message.filesets) && !(message.filesets && $util.isInteger(message.filesets.low) && $util.isInteger(message.filesets.high))) + return "filesets: integer|Long expected"; + return null; + }; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats) + return object; + var message = new $root.google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats(); + if (object.dataItems != null) + if ($util.Long) + (message.dataItems = $util.Long.fromValue(object.dataItems)).unsigned = false; + else if (typeof object.dataItems === "string") + message.dataItems = parseInt(object.dataItems, 10); + else if (typeof object.dataItems === "number") + message.dataItems = object.dataItems; + else if (typeof object.dataItems === "object") + message.dataItems = new $util.LongBits(object.dataItems.low >>> 0, object.dataItems.high >>> 0).toNumber(); + if (object.dataSize != null) + if ($util.Long) + (message.dataSize = $util.Long.fromValue(object.dataSize)).unsigned = false; + else if (typeof object.dataSize === "string") + message.dataSize = parseInt(object.dataSize, 10); + else if (typeof object.dataSize === "number") + message.dataSize = object.dataSize; + else if (typeof object.dataSize === "object") + message.dataSize = new $util.LongBits(object.dataSize.low >>> 0, object.dataSize.high >>> 0).toNumber(); + if (object.tables != null) + if ($util.Long) + (message.tables = $util.Long.fromValue(object.tables)).unsigned = false; + else if (typeof object.tables === "string") + message.tables = parseInt(object.tables, 10); + else if (typeof object.tables === "number") + message.tables = object.tables; + else if (typeof object.tables === "object") + message.tables = new $util.LongBits(object.tables.low >>> 0, object.tables.high >>> 0).toNumber(); + if (object.filesets != null) + if ($util.Long) + (message.filesets = $util.Long.fromValue(object.filesets)).unsigned = false; + else if (typeof object.filesets === "string") + message.filesets = parseInt(object.filesets, 10); + else if (typeof object.filesets === "number") + message.filesets = object.filesets; + else if (typeof object.filesets === "object") + message.filesets = new $util.LongBits(object.filesets.low >>> 0, object.filesets.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.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.dataItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataItems = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.tables = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tables = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.filesets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.filesets = options.longs === String ? "0" : 0; + } + if (message.dataItems != null && message.hasOwnProperty("dataItems")) + if (typeof message.dataItems === "number") + object.dataItems = options.longs === String ? String(message.dataItems) : message.dataItems; + else + object.dataItems = options.longs === String ? $util.Long.prototype.toString.call(message.dataItems) : options.longs === Number ? new $util.LongBits(message.dataItems.low >>> 0, message.dataItems.high >>> 0).toNumber() : message.dataItems; + if (message.dataSize != null && message.hasOwnProperty("dataSize")) + if (typeof message.dataSize === "number") + object.dataSize = options.longs === String ? String(message.dataSize) : message.dataSize; + else + object.dataSize = options.longs === String ? $util.Long.prototype.toString.call(message.dataSize) : options.longs === Number ? new $util.LongBits(message.dataSize.low >>> 0, message.dataSize.high >>> 0).toNumber() : message.dataSize; + if (message.tables != null && message.hasOwnProperty("tables")) + if (typeof message.tables === "number") + object.tables = options.longs === String ? String(message.tables) : message.tables; + else + object.tables = options.longs === String ? $util.Long.prototype.toString.call(message.tables) : options.longs === Number ? new $util.LongBits(message.tables.low >>> 0, message.tables.high >>> 0).toNumber() : message.tables; + if (message.filesets != null && message.hasOwnProperty("filesets")) + if (typeof message.filesets === "number") + object.filesets = options.longs === String ? String(message.filesets) : message.filesets; + else + object.filesets = options.longs === String ? $util.Long.prototype.toString.call(message.filesets) : options.longs === Number ? new $util.LongBits(message.filesets.low >>> 0, message.filesets.high >>> 0).toNumber() : message.filesets; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Asset.DiscoveryStatus.Stats"; + }; + + return Stats; + })(); + + return DiscoveryStatus; + })(); + + return Asset; + })(); + + /** + * State enum. + * @name google.cloud.dataplex.v1.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + * @property {number} ACTION_REQUIRED=4 ACTION_REQUIRED value + */ + v1.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ACTION_REQUIRED"] = 4; + return values; + })(); + + v1.ContentService = (function() { + + /** + * Constructs a new ContentService service. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ContentService + * @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 ContentService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ContentService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ContentService; + + /** + * Creates new ContentService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataplex.v1.ContentService + * @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 {ContentService} RPC service. Useful where requests and/or responses are streamed. + */ + ContentService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|createContent}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef CreateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Content} [response] Content + */ + + /** + * Calls CreateContent. + * @function createContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.ICreateContentRequest} request CreateContentRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.CreateContentCallback} callback Node-style callback called with the error, if any, and Content + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.createContent = function createContent(request, callback) { + return this.rpcCall(createContent, $root.google.cloud.dataplex.v1.CreateContentRequest, $root.google.cloud.dataplex.v1.Content, request, callback); + }, "name", { value: "CreateContent" }); + + /** + * Calls CreateContent. + * @function createContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.ICreateContentRequest} request CreateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|updateContent}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef UpdateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Content} [response] Content + */ + + /** + * Calls UpdateContent. + * @function updateContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateContentRequest} request UpdateContentRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.UpdateContentCallback} callback Node-style callback called with the error, if any, and Content + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.updateContent = function updateContent(request, callback) { + return this.rpcCall(updateContent, $root.google.cloud.dataplex.v1.UpdateContentRequest, $root.google.cloud.dataplex.v1.Content, request, callback); + }, "name", { value: "UpdateContent" }); + + /** + * Calls UpdateContent. + * @function updateContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateContentRequest} request UpdateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|deleteContent}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef DeleteContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteContent. + * @function deleteContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteContentRequest} request DeleteContentRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.DeleteContentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.deleteContent = function deleteContent(request, callback) { + return this.rpcCall(deleteContent, $root.google.cloud.dataplex.v1.DeleteContentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteContent" }); + + /** + * Calls DeleteContent. + * @function deleteContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteContentRequest} request DeleteContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|getContent}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef GetContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Content} [response] Content + */ + + /** + * Calls GetContent. + * @function getContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IGetContentRequest} request GetContentRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.GetContentCallback} callback Node-style callback called with the error, if any, and Content + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.getContent = function getContent(request, callback) { + return this.rpcCall(getContent, $root.google.cloud.dataplex.v1.GetContentRequest, $root.google.cloud.dataplex.v1.Content, request, callback); + }, "name", { value: "GetContent" }); + + /** + * Calls GetContent. + * @function getContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IGetContentRequest} request GetContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|getIamPolicy}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|setIamPolicy}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|testIamPermissions}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.ContentService|listContent}. + * @memberof google.cloud.dataplex.v1.ContentService + * @typedef ListContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListContentResponse} [response] ListContentResponse + */ + + /** + * Calls ListContent. + * @function listContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IListContentRequest} request ListContentRequest message or plain object + * @param {google.cloud.dataplex.v1.ContentService.ListContentCallback} callback Node-style callback called with the error, if any, and ListContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContentService.prototype.listContent = function listContent(request, callback) { + return this.rpcCall(listContent, $root.google.cloud.dataplex.v1.ListContentRequest, $root.google.cloud.dataplex.v1.ListContentResponse, request, callback); + }, "name", { value: "ListContent" }); + + /** + * Calls ListContent. + * @function listContent + * @memberof google.cloud.dataplex.v1.ContentService + * @instance + * @param {google.cloud.dataplex.v1.IListContentRequest} request ListContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ContentService; + })(); + + v1.CreateContentRequest = (function() { + + /** + * Properties of a CreateContentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateContentRequest + * @property {string|null} [parent] CreateContentRequest parent + * @property {google.cloud.dataplex.v1.IContent|null} [content] CreateContentRequest content + * @property {boolean|null} [validateOnly] CreateContentRequest validateOnly + */ + + /** + * Constructs a new CreateContentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateContentRequest. + * @implements ICreateContentRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateContentRequest=} [properties] Properties to set + */ + function CreateContentRequest(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]]; + } + + /** + * CreateContentRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @instance + */ + CreateContentRequest.prototype.parent = ""; + + /** + * CreateContentRequest content. + * @member {google.cloud.dataplex.v1.IContent|null|undefined} content + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @instance + */ + CreateContentRequest.prototype.content = null; + + /** + * CreateContentRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @instance + */ + CreateContentRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateContentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateContentRequest} CreateContentRequest instance + */ + CreateContentRequest.create = function create(properties) { + return new CreateContentRequest(properties); + }; + + /** + * Encodes the specified CreateContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateContentRequest} message CreateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContentRequest.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.dataplex.v1.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateContentRequest} message CreateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateContentRequest} CreateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.content = $root.google.cloud.dataplex.v1.Content.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateContentRequest} CreateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateContentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateContentRequest.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.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.dataplex.v1.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateContentRequest} CreateContentRequest + */ + CreateContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateContentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateContentRequest.content: object expected"); + message.content = $root.google.cloud.dataplex.v1.Content.fromObject(object.content); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {google.cloud.dataplex.v1.CreateContentRequest} message CreateContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.content = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.dataplex.v1.Content.toObject(message.content, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateContentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateContentRequest"; + }; + + return CreateContentRequest; + })(); + + v1.UpdateContentRequest = (function() { + + /** + * Properties of an UpdateContentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateContentRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContentRequest updateMask + * @property {google.cloud.dataplex.v1.IContent|null} [content] UpdateContentRequest content + * @property {boolean|null} [validateOnly] UpdateContentRequest validateOnly + */ + + /** + * Constructs a new UpdateContentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateContentRequest. + * @implements IUpdateContentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateContentRequest=} [properties] Properties to set + */ + function UpdateContentRequest(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]]; + } + + /** + * UpdateContentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @instance + */ + UpdateContentRequest.prototype.updateMask = null; + + /** + * UpdateContentRequest content. + * @member {google.cloud.dataplex.v1.IContent|null|undefined} content + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @instance + */ + UpdateContentRequest.prototype.content = null; + + /** + * UpdateContentRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @instance + */ + UpdateContentRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateContentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateContentRequest} UpdateContentRequest instance + */ + UpdateContentRequest.create = function create(properties) { + return new UpdateContentRequest(properties); + }; + + /** + * Encodes the specified UpdateContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateContentRequest} message UpdateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.dataplex.v1.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateContentRequest} message UpdateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateContentRequest} UpdateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.content = $root.google.cloud.dataplex.v1.Content.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateContentRequest} UpdateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateContentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.dataplex.v1.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateContentRequest} UpdateContentRequest + */ + UpdateContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateContentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateContentRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateContentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateContentRequest.content: object expected"); + message.content = $root.google.cloud.dataplex.v1.Content.fromObject(object.content); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateContentRequest} message UpdateContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.content = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.dataplex.v1.Content.toObject(message.content, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateContentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateContentRequest"; + }; + + return UpdateContentRequest; + })(); + + v1.DeleteContentRequest = (function() { + + /** + * Properties of a DeleteContentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteContentRequest + * @property {string|null} [name] DeleteContentRequest name + */ + + /** + * Constructs a new DeleteContentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteContentRequest. + * @implements IDeleteContentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteContentRequest=} [properties] Properties to set + */ + function DeleteContentRequest(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]]; + } + + /** + * DeleteContentRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @instance + */ + DeleteContentRequest.prototype.name = ""; + + /** + * Creates a new DeleteContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteContentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteContentRequest} DeleteContentRequest instance + */ + DeleteContentRequest.create = function create(properties) { + return new DeleteContentRequest(properties); + }; + + /** + * Encodes the specified DeleteContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteContentRequest} message DeleteContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContentRequest.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 DeleteContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteContentRequest} message DeleteContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteContentRequest} DeleteContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteContentRequest(); + 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 DeleteContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteContentRequest} DeleteContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteContentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteContentRequest.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 DeleteContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteContentRequest} DeleteContentRequest + */ + DeleteContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteContentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteContentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteContentRequest} message DeleteContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteContentRequest.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 DeleteContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteContentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteContentRequest"; + }; + + return DeleteContentRequest; + })(); + + v1.ListContentRequest = (function() { + + /** + * Properties of a ListContentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListContentRequest + * @property {string|null} [parent] ListContentRequest parent + * @property {number|null} [pageSize] ListContentRequest pageSize + * @property {string|null} [pageToken] ListContentRequest pageToken + * @property {string|null} [filter] ListContentRequest filter + */ + + /** + * Constructs a new ListContentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListContentRequest. + * @implements IListContentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListContentRequest=} [properties] Properties to set + */ + function ListContentRequest(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]]; + } + + /** + * ListContentRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @instance + */ + ListContentRequest.prototype.parent = ""; + + /** + * ListContentRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @instance + */ + ListContentRequest.prototype.pageSize = 0; + + /** + * ListContentRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @instance + */ + ListContentRequest.prototype.pageToken = ""; + + /** + * ListContentRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @instance + */ + ListContentRequest.prototype.filter = ""; + + /** + * Creates a new ListContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {google.cloud.dataplex.v1.IListContentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListContentRequest} ListContentRequest instance + */ + ListContentRequest.create = function create(properties) { + return new ListContentRequest(properties); + }; + + /** + * Encodes the specified ListContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {google.cloud.dataplex.v1.IListContentRequest} message ListContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {google.cloud.dataplex.v1.IListContentRequest} message ListContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListContentRequest} ListContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListContentRequest} ListContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContentRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListContentRequest} ListContentRequest + */ + ListContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListContentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {google.cloud.dataplex.v1.ListContentRequest} message ListContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @instance + * @returns {Object.} JSON object + */ + ListContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListContentRequest"; + }; + + return ListContentRequest; + })(); + + v1.ListContentResponse = (function() { + + /** + * Properties of a ListContentResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListContentResponse + * @property {Array.|null} [content] ListContentResponse content + * @property {string|null} [nextPageToken] ListContentResponse nextPageToken + */ + + /** + * Constructs a new ListContentResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListContentResponse. + * @implements IListContentResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListContentResponse=} [properties] Properties to set + */ + function ListContentResponse(properties) { + this.content = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContentResponse content. + * @member {Array.} content + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @instance + */ + ListContentResponse.prototype.content = $util.emptyArray; + + /** + * ListContentResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @instance + */ + ListContentResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {google.cloud.dataplex.v1.IListContentResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListContentResponse} ListContentResponse instance + */ + ListContentResponse.create = function create(properties) { + return new ListContentResponse(properties); + }; + + /** + * Encodes the specified ListContentResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListContentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {google.cloud.dataplex.v1.IListContentResponse} message ListContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && message.content.length) + for (var i = 0; i < message.content.length; ++i) + $root.google.cloud.dataplex.v1.Content.encode(message.content[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 ListContentResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {google.cloud.dataplex.v1.IListContentResponse} message ListContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListContentResponse} ListContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.content && message.content.length)) + message.content = []; + message.content.push($root.google.cloud.dataplex.v1.Content.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListContentResponse} ListContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContentResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) { + if (!Array.isArray(message.content)) + return "content: array expected"; + for (var i = 0; i < message.content.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Content.verify(message.content[i]); + if (error) + return "content." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListContentResponse} ListContentResponse + */ + ListContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListContentResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListContentResponse(); + if (object.content) { + if (!Array.isArray(object.content)) + throw TypeError(".google.cloud.dataplex.v1.ListContentResponse.content: array expected"); + message.content = []; + for (var i = 0; i < object.content.length; ++i) { + if (typeof object.content[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListContentResponse.content: object expected"); + message.content[i] = $root.google.cloud.dataplex.v1.Content.fromObject(object.content[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {google.cloud.dataplex.v1.ListContentResponse} message ListContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.content = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.content && message.content.length) { + object.content = []; + for (var j = 0; j < message.content.length; ++j) + object.content[j] = $root.google.cloud.dataplex.v1.Content.toObject(message.content[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @instance + * @returns {Object.} JSON object + */ + ListContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListContentResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListContentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListContentResponse"; + }; + + return ListContentResponse; + })(); + + v1.GetContentRequest = (function() { + + /** + * Properties of a GetContentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetContentRequest + * @property {string|null} [name] GetContentRequest name + * @property {google.cloud.dataplex.v1.GetContentRequest.ContentView|null} [view] GetContentRequest view + */ + + /** + * Constructs a new GetContentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetContentRequest. + * @implements IGetContentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetContentRequest=} [properties] Properties to set + */ + function GetContentRequest(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]]; + } + + /** + * GetContentRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @instance + */ + GetContentRequest.prototype.name = ""; + + /** + * GetContentRequest view. + * @member {google.cloud.dataplex.v1.GetContentRequest.ContentView} view + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @instance + */ + GetContentRequest.prototype.view = 0; + + /** + * Creates a new GetContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetContentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetContentRequest} GetContentRequest instance + */ + GetContentRequest.create = function create(properties) { + return new GetContentRequest(properties); + }; + + /** + * Encodes the specified GetContentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetContentRequest} message GetContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContentRequest.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 GetContentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetContentRequest} message GetContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetContentRequest} GetContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetContentRequest(); + 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 GetContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetContentRequest} GetContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContentRequest.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 GetContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetContentRequest} GetContentRequest + */ + GetContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetContentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetContentRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "CONTENT_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 GetContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {google.cloud.dataplex.v1.GetContentRequest} message GetContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CONTENT_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.cloud.dataplex.v1.GetContentRequest.ContentView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @instance + * @returns {Object.} JSON object + */ + GetContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetContentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetContentRequest"; + }; + + /** + * ContentView enum. + * @name google.cloud.dataplex.v1.GetContentRequest.ContentView + * @enum {number} + * @property {number} CONTENT_VIEW_UNSPECIFIED=0 CONTENT_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + GetContentRequest.ContentView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return GetContentRequest; + })(); + + v1.DiscoveryEvent = (function() { + + /** + * Properties of a DiscoveryEvent. + * @memberof google.cloud.dataplex.v1 + * @interface IDiscoveryEvent + * @property {string|null} [message] DiscoveryEvent message + * @property {string|null} [lakeId] DiscoveryEvent lakeId + * @property {string|null} [zoneId] DiscoveryEvent zoneId + * @property {string|null} [assetId] DiscoveryEvent assetId + * @property {string|null} [dataLocation] DiscoveryEvent dataLocation + * @property {google.cloud.dataplex.v1.DiscoveryEvent.EventType|null} [type] DiscoveryEvent type + * @property {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails|null} [config] DiscoveryEvent config + * @property {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails|null} [entity] DiscoveryEvent entity + * @property {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails|null} [partition] DiscoveryEvent partition + * @property {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails|null} [action] DiscoveryEvent action + */ + + /** + * Constructs a new DiscoveryEvent. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DiscoveryEvent. + * @implements IDiscoveryEvent + * @constructor + * @param {google.cloud.dataplex.v1.IDiscoveryEvent=} [properties] Properties to set + */ + function DiscoveryEvent(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]]; + } + + /** + * DiscoveryEvent message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.message = ""; + + /** + * DiscoveryEvent lakeId. + * @member {string} lakeId + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.lakeId = ""; + + /** + * DiscoveryEvent zoneId. + * @member {string} zoneId + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.zoneId = ""; + + /** + * DiscoveryEvent assetId. + * @member {string} assetId + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.assetId = ""; + + /** + * DiscoveryEvent dataLocation. + * @member {string} dataLocation + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.dataLocation = ""; + + /** + * DiscoveryEvent type. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.EventType} type + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.type = 0; + + /** + * DiscoveryEvent config. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails|null|undefined} config + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.config = null; + + /** + * DiscoveryEvent entity. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails|null|undefined} entity + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.entity = null; + + /** + * DiscoveryEvent partition. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails|null|undefined} partition + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.partition = null; + + /** + * DiscoveryEvent action. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails|null|undefined} action + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + DiscoveryEvent.prototype.action = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiscoveryEvent details. + * @member {"config"|"entity"|"partition"|"action"|undefined} details + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + */ + Object.defineProperty(DiscoveryEvent.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["config", "entity", "partition", "action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiscoveryEvent instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {google.cloud.dataplex.v1.IDiscoveryEvent=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DiscoveryEvent} DiscoveryEvent instance + */ + DiscoveryEvent.create = function create(properties) { + return new DiscoveryEvent(properties); + }; + + /** + * Encodes the specified DiscoveryEvent message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {google.cloud.dataplex.v1.IDiscoveryEvent} message DiscoveryEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoveryEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.lakeId != null && Object.hasOwnProperty.call(message, "lakeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.lakeId); + if (message.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.zoneId); + if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.assetId); + if (message.dataLocation != null && Object.hasOwnProperty.call(message, "dataLocation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataLocation); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.encode(message.config, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.encode(message.entity, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.encode(message.partition, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.encode(message.action, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiscoveryEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {google.cloud.dataplex.v1.IDiscoveryEvent} message DiscoveryEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscoveryEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiscoveryEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DiscoveryEvent} DiscoveryEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoveryEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DiscoveryEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.lakeId = reader.string(); + break; + } + case 3: { + message.zoneId = reader.string(); + break; + } + case 4: { + message.assetId = reader.string(); + break; + } + case 5: { + message.dataLocation = reader.string(); + break; + } + case 10: { + message.type = reader.int32(); + break; + } + case 20: { + message.config = $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.decode(reader, reader.uint32()); + break; + } + case 21: { + message.entity = $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.decode(reader, reader.uint32()); + break; + } + case 22: { + message.partition = $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.decode(reader, reader.uint32()); + break; + } + case 23: { + message.action = $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiscoveryEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DiscoveryEvent} DiscoveryEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscoveryEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiscoveryEvent message. + * @function verify + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiscoveryEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.lakeId != null && message.hasOwnProperty("lakeId")) + if (!$util.isString(message.lakeId)) + return "lakeId: string expected"; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.assetId != null && message.hasOwnProperty("assetId")) + if (!$util.isString(message.assetId)) + return "assetId: string expected"; + if (message.dataLocation != null && message.hasOwnProperty("dataLocation")) + if (!$util.isString(message.dataLocation)) + return "dataLocation: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.config != null && message.hasOwnProperty("config")) { + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.entity != null && message.hasOwnProperty("entity")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.verify(message.entity); + if (error) + return "entity." + error; + } + } + if (message.partition != null && message.hasOwnProperty("partition")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.verify(message.partition); + if (error) + return "partition." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.verify(message.action); + if (error) + return "action." + error; + } + } + return null; + }; + + /** + * Creates a DiscoveryEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DiscoveryEvent} DiscoveryEvent + */ + DiscoveryEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DiscoveryEvent) + return object; + var message = new $root.google.cloud.dataplex.v1.DiscoveryEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.lakeId != null) + message.lakeId = String(object.lakeId); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.assetId != null) + message.assetId = String(object.assetId); + if (object.dataLocation != null) + message.dataLocation = String(object.dataLocation); + switch (object.type) { + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CONFIG": + case 1: + message.type = 1; + break; + case "ENTITY_CREATED": + case 2: + message.type = 2; + break; + case "ENTITY_UPDATED": + case 3: + message.type = 3; + break; + case "ENTITY_DELETED": + case 4: + message.type = 4; + break; + case "PARTITION_CREATED": + case 5: + message.type = 5; + break; + case "PARTITION_UPDATED": + case 6: + message.type = 6; + break; + case "PARTITION_DELETED": + case 7: + message.type = 7; + break; + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.config: object expected"); + message.config = $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.fromObject(object.config); + } + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.entity: object expected"); + message.entity = $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.fromObject(object.entity); + } + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.partition: object expected"); + message.partition = $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.fromObject(object.partition); + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.action: object expected"); + message.action = $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a DiscoveryEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent} message DiscoveryEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiscoveryEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.lakeId = ""; + object.zoneId = ""; + object.assetId = ""; + object.dataLocation = ""; + object.type = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.lakeId != null && message.hasOwnProperty("lakeId")) + object.lakeId = message.lakeId; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.assetId != null && message.hasOwnProperty("assetId")) + object.assetId = message.assetId; + if (message.dataLocation != null && message.hasOwnProperty("dataLocation")) + object.dataLocation = message.dataLocation; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.DiscoveryEvent.EventType[message.type] : message.type; + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.toObject(message.config, options); + if (options.oneofs) + object.details = "config"; + } + if (message.entity != null && message.hasOwnProperty("entity")) { + object.entity = $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.toObject(message.entity, options); + if (options.oneofs) + object.details = "entity"; + } + if (message.partition != null && message.hasOwnProperty("partition")) { + object.partition = $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.toObject(message.partition, options); + if (options.oneofs) + object.details = "partition"; + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.toObject(message.action, options); + if (options.oneofs) + object.details = "action"; + } + return object; + }; + + /** + * Converts this DiscoveryEvent to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @instance + * @returns {Object.} JSON object + */ + DiscoveryEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiscoveryEvent + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiscoveryEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DiscoveryEvent"; + }; + + /** + * EventType enum. + * @name google.cloud.dataplex.v1.DiscoveryEvent.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} CONFIG=1 CONFIG value + * @property {number} ENTITY_CREATED=2 ENTITY_CREATED value + * @property {number} ENTITY_UPDATED=3 ENTITY_UPDATED value + * @property {number} ENTITY_DELETED=4 ENTITY_DELETED value + * @property {number} PARTITION_CREATED=5 PARTITION_CREATED value + * @property {number} PARTITION_UPDATED=6 PARTITION_UPDATED value + * @property {number} PARTITION_DELETED=7 PARTITION_DELETED value + */ + DiscoveryEvent.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFIG"] = 1; + values[valuesById[2] = "ENTITY_CREATED"] = 2; + values[valuesById[3] = "ENTITY_UPDATED"] = 3; + values[valuesById[4] = "ENTITY_DELETED"] = 4; + values[valuesById[5] = "PARTITION_CREATED"] = 5; + values[valuesById[6] = "PARTITION_UPDATED"] = 6; + values[valuesById[7] = "PARTITION_DELETED"] = 7; + return values; + })(); + + /** + * EntityType enum. + * @name google.cloud.dataplex.v1.DiscoveryEvent.EntityType + * @enum {number} + * @property {number} ENTITY_TYPE_UNSPECIFIED=0 ENTITY_TYPE_UNSPECIFIED value + * @property {number} TABLE=1 TABLE value + * @property {number} FILESET=2 FILESET value + */ + DiscoveryEvent.EntityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE"] = 1; + values[valuesById[2] = "FILESET"] = 2; + return values; + })(); + + DiscoveryEvent.ConfigDetails = (function() { + + /** + * Properties of a ConfigDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @interface IConfigDetails + * @property {Object.|null} [parameters] ConfigDetails parameters + */ + + /** + * Constructs a new ConfigDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @classdesc Represents a ConfigDetails. + * @implements IConfigDetails + * @constructor + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails=} [properties] Properties to set + */ + function ConfigDetails(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigDetails parameters. + * @member {Object.} parameters + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @instance + */ + ConfigDetails.prototype.parameters = $util.emptyObject; + + /** + * Creates a new ConfigDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails} ConfigDetails instance + */ + ConfigDetails.create = function create(properties) { + return new ConfigDetails(properties); + }; + + /** + * Encodes the specified ConfigDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails} message ConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfigDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IConfigDetails} message ConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails} ConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + 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.parameters[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails} ConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigDetails message. + * @function verify + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ConfigDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails} ConfigDetails + */ + ConfigDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails) + return object; + var message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails(); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ConfigDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails} message ConfigDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + return object; + }; + + /** + * Converts this ConfigDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @instance + * @returns {Object.} JSON object + */ + ConfigDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigDetails + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DiscoveryEvent.ConfigDetails"; + }; + + return ConfigDetails; + })(); + + DiscoveryEvent.EntityDetails = (function() { + + /** + * Properties of an EntityDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @interface IEntityDetails + * @property {string|null} [entity] EntityDetails entity + * @property {google.cloud.dataplex.v1.DiscoveryEvent.EntityType|null} [type] EntityDetails type + */ + + /** + * Constructs a new EntityDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @classdesc Represents an EntityDetails. + * @implements IEntityDetails + * @constructor + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails=} [properties] Properties to set + */ + function EntityDetails(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]]; + } + + /** + * EntityDetails entity. + * @member {string} entity + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @instance + */ + EntityDetails.prototype.entity = ""; + + /** + * EntityDetails type. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.EntityType} type + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @instance + */ + EntityDetails.prototype.type = 0; + + /** + * Creates a new EntityDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails} EntityDetails instance + */ + EntityDetails.create = function create(properties) { + return new EntityDetails(properties); + }; + + /** + * Encodes the specified EntityDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails} message EntityDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + return writer; + }; + + /** + * Encodes the specified EntityDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IEntityDetails} message EntityDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails} EntityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails} EntityDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityDetails message. + * @function verify + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: 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; + } + return null; + }; + + /** + * Creates an EntityDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails} EntityDetails + */ + EntityDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails) + return object; + var message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails(); + if (object.entity != null) + message.entity = String(object.entity); + switch (object.type) { + case "ENTITY_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TABLE": + case 1: + message.type = 1; + break; + case "FILESET": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntityDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails} message EntityDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entity = ""; + object.type = options.enums === String ? "ENTITY_TYPE_UNSPECIFIED" : 0; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityType[message.type] : message.type; + return object; + }; + + /** + * Converts this EntityDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @instance + * @returns {Object.} JSON object + */ + EntityDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityDetails + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DiscoveryEvent.EntityDetails"; + }; + + return EntityDetails; + })(); + + DiscoveryEvent.PartitionDetails = (function() { + + /** + * Properties of a PartitionDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @interface IPartitionDetails + * @property {string|null} [partition] PartitionDetails partition + * @property {string|null} [entity] PartitionDetails entity + * @property {google.cloud.dataplex.v1.DiscoveryEvent.EntityType|null} [type] PartitionDetails type + * @property {Array.|null} [sampledDataLocations] PartitionDetails sampledDataLocations + */ + + /** + * Constructs a new PartitionDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @classdesc Represents a PartitionDetails. + * @implements IPartitionDetails + * @constructor + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails=} [properties] Properties to set + */ + function PartitionDetails(properties) { + this.sampledDataLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionDetails partition. + * @member {string} partition + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @instance + */ + PartitionDetails.prototype.partition = ""; + + /** + * PartitionDetails entity. + * @member {string} entity + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @instance + */ + PartitionDetails.prototype.entity = ""; + + /** + * PartitionDetails type. + * @member {google.cloud.dataplex.v1.DiscoveryEvent.EntityType} type + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @instance + */ + PartitionDetails.prototype.type = 0; + + /** + * PartitionDetails sampledDataLocations. + * @member {Array.} sampledDataLocations + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @instance + */ + PartitionDetails.prototype.sampledDataLocations = $util.emptyArray; + + /** + * Creates a new PartitionDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails} PartitionDetails instance + */ + PartitionDetails.create = function create(properties) { + return new PartitionDetails(properties); + }; + + /** + * Encodes the specified PartitionDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails} message PartitionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.partition); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entity); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.sampledDataLocations != null && message.sampledDataLocations.length) + for (var i = 0; i < message.sampledDataLocations.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sampledDataLocations[i]); + return writer; + }; + + /** + * Encodes the specified PartitionDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IPartitionDetails} message PartitionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails} PartitionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.partition = reader.string(); + break; + } + case 2: { + message.entity = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + if (!(message.sampledDataLocations && message.sampledDataLocations.length)) + message.sampledDataLocations = []; + message.sampledDataLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails} PartitionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionDetails message. + * @function verify + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partition != null && message.hasOwnProperty("partition")) + if (!$util.isString(message.partition)) + return "partition: string expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: 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.sampledDataLocations != null && message.hasOwnProperty("sampledDataLocations")) { + if (!Array.isArray(message.sampledDataLocations)) + return "sampledDataLocations: array expected"; + for (var i = 0; i < message.sampledDataLocations.length; ++i) + if (!$util.isString(message.sampledDataLocations[i])) + return "sampledDataLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a PartitionDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails} PartitionDetails + */ + PartitionDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails) + return object; + var message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails(); + if (object.partition != null) + message.partition = String(object.partition); + if (object.entity != null) + message.entity = String(object.entity); + switch (object.type) { + case "ENTITY_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TABLE": + case 1: + message.type = 1; + break; + case "FILESET": + case 2: + message.type = 2; + break; + } + if (object.sampledDataLocations) { + if (!Array.isArray(object.sampledDataLocations)) + throw TypeError(".google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails.sampledDataLocations: array expected"); + message.sampledDataLocations = []; + for (var i = 0; i < object.sampledDataLocations.length; ++i) + message.sampledDataLocations[i] = String(object.sampledDataLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a PartitionDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails} message PartitionDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sampledDataLocations = []; + if (options.defaults) { + object.partition = ""; + object.entity = ""; + object.type = options.enums === String ? "ENTITY_TYPE_UNSPECIFIED" : 0; + } + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = message.partition; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.DiscoveryEvent.EntityType[message.type] : message.type; + if (message.sampledDataLocations && message.sampledDataLocations.length) { + object.sampledDataLocations = []; + for (var j = 0; j < message.sampledDataLocations.length; ++j) + object.sampledDataLocations[j] = message.sampledDataLocations[j]; + } + return object; + }; + + /** + * Converts this PartitionDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @instance + * @returns {Object.} JSON object + */ + PartitionDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionDetails + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DiscoveryEvent.PartitionDetails"; + }; + + return PartitionDetails; + })(); + + DiscoveryEvent.ActionDetails = (function() { + + /** + * Properties of an ActionDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @interface IActionDetails + * @property {string|null} [type] ActionDetails type + */ + + /** + * Constructs a new ActionDetails. + * @memberof google.cloud.dataplex.v1.DiscoveryEvent + * @classdesc Represents an ActionDetails. + * @implements IActionDetails + * @constructor + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails=} [properties] Properties to set + */ + function ActionDetails(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]]; + } + + /** + * ActionDetails type. + * @member {string} type + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @instance + */ + ActionDetails.prototype.type = ""; + + /** + * Creates a new ActionDetails instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails} ActionDetails instance + */ + ActionDetails.create = function create(properties) { + return new ActionDetails(properties); + }; + + /** + * Encodes the specified ActionDetails message. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails} message ActionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionDetails.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); + return writer; + }; + + /** + * Encodes the specified ActionDetails message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.IActionDetails} message ActionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails} ActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails} ActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionDetails message. + * @function verify + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionDetails.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"; + return null; + }; + + /** + * Creates an ActionDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails} ActionDetails + */ + ActionDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails) + return object; + var message = new $root.google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails(); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from an ActionDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails} message ActionDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this ActionDetails to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @instance + * @returns {Object.} JSON object + */ + ActionDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionDetails + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DiscoveryEvent.ActionDetails"; + }; + + return ActionDetails; + })(); + + return DiscoveryEvent; + })(); + + v1.JobEvent = (function() { + + /** + * Properties of a JobEvent. + * @memberof google.cloud.dataplex.v1 + * @interface IJobEvent + * @property {string|null} [message] JobEvent message + * @property {string|null} [jobId] JobEvent jobId + * @property {google.protobuf.ITimestamp|null} [startTime] JobEvent startTime + * @property {google.protobuf.ITimestamp|null} [endTime] JobEvent endTime + * @property {google.cloud.dataplex.v1.JobEvent.State|null} [state] JobEvent state + * @property {number|null} [retries] JobEvent retries + * @property {google.cloud.dataplex.v1.JobEvent.Type|null} [type] JobEvent type + * @property {google.cloud.dataplex.v1.JobEvent.Service|null} [service] JobEvent service + * @property {string|null} [serviceJob] JobEvent serviceJob + */ + + /** + * Constructs a new JobEvent. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a JobEvent. + * @implements IJobEvent + * @constructor + * @param {google.cloud.dataplex.v1.IJobEvent=} [properties] Properties to set + */ + function JobEvent(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]]; + } + + /** + * JobEvent message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.message = ""; + + /** + * JobEvent jobId. + * @member {string} jobId + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.jobId = ""; + + /** + * JobEvent startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.startTime = null; + + /** + * JobEvent endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.endTime = null; + + /** + * JobEvent state. + * @member {google.cloud.dataplex.v1.JobEvent.State} state + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.state = 0; + + /** + * JobEvent retries. + * @member {number} retries + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.retries = 0; + + /** + * JobEvent type. + * @member {google.cloud.dataplex.v1.JobEvent.Type} type + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.type = 0; + + /** + * JobEvent service. + * @member {google.cloud.dataplex.v1.JobEvent.Service} service + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.service = 0; + + /** + * JobEvent serviceJob. + * @member {string} serviceJob + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + */ + JobEvent.prototype.serviceJob = ""; + + /** + * Creates a new JobEvent instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {google.cloud.dataplex.v1.IJobEvent=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.JobEvent} JobEvent instance + */ + JobEvent.create = function create(properties) { + return new JobEvent(properties); + }; + + /** + * Encodes the specified JobEvent message. Does not implicitly {@link google.cloud.dataplex.v1.JobEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {google.cloud.dataplex.v1.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.retries != null && Object.hasOwnProperty.call(message, "retries")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.retries); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.service); + if (message.serviceJob != null && Object.hasOwnProperty.call(message, "serviceJob")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceJob); + return writer; + }; + + /** + * Encodes the specified JobEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.JobEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {google.cloud.dataplex.v1.IJobEvent} message JobEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.JobEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.retries = reader.int32(); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + case 8: { + message.service = reader.int32(); + break; + } + case 9: { + message.serviceJob = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.JobEvent} JobEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobEvent message. + * @function verify + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + 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: + break; + } + if (message.retries != null && message.hasOwnProperty("retries")) + if (!$util.isInteger(message.retries)) + return "retries: integer 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.service != null && message.hasOwnProperty("service")) + switch (message.service) { + default: + return "service: enum value expected"; + case 0: + case 1: + break; + } + if (message.serviceJob != null && message.hasOwnProperty("serviceJob")) + if (!$util.isString(message.serviceJob)) + return "serviceJob: string expected"; + return null; + }; + + /** + * Creates a JobEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.JobEvent} JobEvent + */ + JobEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.JobEvent) + return object; + var message = new $root.google.cloud.dataplex.v1.JobEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.JobEvent.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.JobEvent.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SUCCEEDED": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "CANCELLED": + case 3: + message.state = 3; + break; + case "ABORTED": + case 4: + message.state = 4; + break; + } + if (object.retries != null) + message.retries = object.retries | 0; + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SPARK": + case 1: + message.type = 1; + break; + case "NOTEBOOK": + case 2: + message.type = 2; + break; + } + switch (object.service) { + case "SERVICE_UNSPECIFIED": + case 0: + message.service = 0; + break; + case "DATAPROC": + case 1: + message.service = 1; + break; + } + if (object.serviceJob != null) + message.serviceJob = String(object.serviceJob); + return message; + }; + + /** + * Creates a plain object from a JobEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {google.cloud.dataplex.v1.JobEvent} message JobEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.jobId = ""; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.retries = 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.service = options.enums === String ? "SERVICE_UNSPECIFIED" : 0; + object.serviceJob = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.JobEvent.State[message.state] : message.state; + if (message.retries != null && message.hasOwnProperty("retries")) + object.retries = message.retries; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.JobEvent.Type[message.type] : message.type; + if (message.service != null && message.hasOwnProperty("service")) + object.service = options.enums === String ? $root.google.cloud.dataplex.v1.JobEvent.Service[message.service] : message.service; + if (message.serviceJob != null && message.hasOwnProperty("serviceJob")) + object.serviceJob = message.serviceJob; + return object; + }; + + /** + * Converts this JobEvent to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.JobEvent + * @instance + * @returns {Object.} JSON object + */ + JobEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobEvent + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.JobEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.JobEvent"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.JobEvent.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SPARK=1 SPARK value + * @property {number} NOTEBOOK=2 NOTEBOOK value + */ + JobEvent.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPARK"] = 1; + values[valuesById[2] = "NOTEBOOK"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.cloud.dataplex.v1.JobEvent.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} ABORTED=4 ABORTED value + */ + JobEvent.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "ABORTED"] = 4; + return values; + })(); + + /** + * Service enum. + * @name google.cloud.dataplex.v1.JobEvent.Service + * @enum {number} + * @property {number} SERVICE_UNSPECIFIED=0 SERVICE_UNSPECIFIED value + * @property {number} DATAPROC=1 DATAPROC value + */ + JobEvent.Service = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATAPROC"] = 1; + return values; + })(); + + return JobEvent; + })(); + + v1.SessionEvent = (function() { + + /** + * Properties of a SessionEvent. + * @memberof google.cloud.dataplex.v1 + * @interface ISessionEvent + * @property {string|null} [message] SessionEvent message + * @property {string|null} [userId] SessionEvent userId + * @property {string|null} [sessionId] SessionEvent sessionId + * @property {google.cloud.dataplex.v1.SessionEvent.EventType|null} [type] SessionEvent type + * @property {google.cloud.dataplex.v1.SessionEvent.IQueryDetail|null} [query] SessionEvent query + * @property {boolean|null} [eventSucceeded] SessionEvent eventSucceeded + * @property {boolean|null} [fastStartupEnabled] SessionEvent fastStartupEnabled + * @property {google.protobuf.IDuration|null} [unassignedDuration] SessionEvent unassignedDuration + */ + + /** + * Constructs a new SessionEvent. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a SessionEvent. + * @implements ISessionEvent + * @constructor + * @param {google.cloud.dataplex.v1.ISessionEvent=} [properties] Properties to set + */ + function SessionEvent(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]]; + } + + /** + * SessionEvent message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.message = ""; + + /** + * SessionEvent userId. + * @member {string} userId + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.userId = ""; + + /** + * SessionEvent sessionId. + * @member {string} sessionId + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.sessionId = ""; + + /** + * SessionEvent type. + * @member {google.cloud.dataplex.v1.SessionEvent.EventType} type + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.type = 0; + + /** + * SessionEvent query. + * @member {google.cloud.dataplex.v1.SessionEvent.IQueryDetail|null|undefined} query + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.query = null; + + /** + * SessionEvent eventSucceeded. + * @member {boolean} eventSucceeded + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.eventSucceeded = false; + + /** + * SessionEvent fastStartupEnabled. + * @member {boolean} fastStartupEnabled + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.fastStartupEnabled = false; + + /** + * SessionEvent unassignedDuration. + * @member {google.protobuf.IDuration|null|undefined} unassignedDuration + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + SessionEvent.prototype.unassignedDuration = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionEvent detail. + * @member {"query"|undefined} detail + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + */ + Object.defineProperty(SessionEvent.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["query"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionEvent instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {google.cloud.dataplex.v1.ISessionEvent=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.SessionEvent} SessionEvent instance + */ + SessionEvent.create = function create(properties) { + return new SessionEvent(properties); + }; + + /** + * Encodes the specified SessionEvent message. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {google.cloud.dataplex.v1.ISessionEvent} message SessionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.encode(message.query, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.eventSucceeded != null && Object.hasOwnProperty.call(message, "eventSucceeded")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.eventSucceeded); + if (message.fastStartupEnabled != null && Object.hasOwnProperty.call(message, "fastStartupEnabled")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.fastStartupEnabled); + if (message.unassignedDuration != null && Object.hasOwnProperty.call(message, "unassignedDuration")) + $root.google.protobuf.Duration.encode(message.unassignedDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {google.cloud.dataplex.v1.ISessionEvent} message SessionEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.SessionEvent} SessionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.SessionEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.sessionId = reader.string(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + message.query = $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.decode(reader, reader.uint32()); + break; + } + case 6: { + message.eventSucceeded = reader.bool(); + break; + } + case 7: { + message.fastStartupEnabled = reader.bool(); + break; + } + case 8: { + message.unassignedDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.SessionEvent} SessionEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionEvent message. + * @function verify + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.query != null && message.hasOwnProperty("query")) { + properties.detail = 1; + { + var error = $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.eventSucceeded != null && message.hasOwnProperty("eventSucceeded")) + if (typeof message.eventSucceeded !== "boolean") + return "eventSucceeded: boolean expected"; + if (message.fastStartupEnabled != null && message.hasOwnProperty("fastStartupEnabled")) + if (typeof message.fastStartupEnabled !== "boolean") + return "fastStartupEnabled: boolean expected"; + if (message.unassignedDuration != null && message.hasOwnProperty("unassignedDuration")) { + var error = $root.google.protobuf.Duration.verify(message.unassignedDuration); + if (error) + return "unassignedDuration." + error; + } + return null; + }; + + /** + * Creates a SessionEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.SessionEvent} SessionEvent + */ + SessionEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.SessionEvent) + return object; + var message = new $root.google.cloud.dataplex.v1.SessionEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.userId != null) + message.userId = String(object.userId); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + switch (object.type) { + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "START": + case 1: + message.type = 1; + break; + case "STOP": + case 2: + message.type = 2; + break; + case "QUERY": + case 3: + message.type = 3; + break; + case "CREATE": + case 4: + message.type = 4; + break; + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.cloud.dataplex.v1.SessionEvent.query: object expected"); + message.query = $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.fromObject(object.query); + } + if (object.eventSucceeded != null) + message.eventSucceeded = Boolean(object.eventSucceeded); + if (object.fastStartupEnabled != null) + message.fastStartupEnabled = Boolean(object.fastStartupEnabled); + if (object.unassignedDuration != null) { + if (typeof object.unassignedDuration !== "object") + throw TypeError(".google.cloud.dataplex.v1.SessionEvent.unassignedDuration: object expected"); + message.unassignedDuration = $root.google.protobuf.Duration.fromObject(object.unassignedDuration); + } + return message; + }; + + /** + * Creates a plain object from a SessionEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {google.cloud.dataplex.v1.SessionEvent} message SessionEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.userId = ""; + object.sessionId = ""; + object.type = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + object.eventSucceeded = false; + object.fastStartupEnabled = false; + object.unassignedDuration = null; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.SessionEvent.EventType[message.type] : message.type; + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.toObject(message.query, options); + if (options.oneofs) + object.detail = "query"; + } + if (message.eventSucceeded != null && message.hasOwnProperty("eventSucceeded")) + object.eventSucceeded = message.eventSucceeded; + if (message.fastStartupEnabled != null && message.hasOwnProperty("fastStartupEnabled")) + object.fastStartupEnabled = message.fastStartupEnabled; + if (message.unassignedDuration != null && message.hasOwnProperty("unassignedDuration")) + object.unassignedDuration = $root.google.protobuf.Duration.toObject(message.unassignedDuration, options); + return object; + }; + + /** + * Converts this SessionEvent to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.SessionEvent + * @instance + * @returns {Object.} JSON object + */ + SessionEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionEvent + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.SessionEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.SessionEvent"; + }; + + /** + * EventType enum. + * @name google.cloud.dataplex.v1.SessionEvent.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} START=1 START value + * @property {number} STOP=2 STOP value + * @property {number} QUERY=3 QUERY value + * @property {number} CREATE=4 CREATE value + */ + SessionEvent.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "START"] = 1; + values[valuesById[2] = "STOP"] = 2; + values[valuesById[3] = "QUERY"] = 3; + values[valuesById[4] = "CREATE"] = 4; + return values; + })(); + + SessionEvent.QueryDetail = (function() { + + /** + * Properties of a QueryDetail. + * @memberof google.cloud.dataplex.v1.SessionEvent + * @interface IQueryDetail + * @property {string|null} [queryId] QueryDetail queryId + * @property {string|null} [queryText] QueryDetail queryText + * @property {google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine|null} [engine] QueryDetail engine + * @property {google.protobuf.IDuration|null} [duration] QueryDetail duration + * @property {number|Long|null} [resultSizeBytes] QueryDetail resultSizeBytes + * @property {number|Long|null} [dataProcessedBytes] QueryDetail dataProcessedBytes + */ + + /** + * Constructs a new QueryDetail. + * @memberof google.cloud.dataplex.v1.SessionEvent + * @classdesc Represents a QueryDetail. + * @implements IQueryDetail + * @constructor + * @param {google.cloud.dataplex.v1.SessionEvent.IQueryDetail=} [properties] Properties to set + */ + function QueryDetail(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]]; + } + + /** + * QueryDetail queryId. + * @member {string} queryId + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.queryId = ""; + + /** + * QueryDetail queryText. + * @member {string} queryText + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.queryText = ""; + + /** + * QueryDetail engine. + * @member {google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine} engine + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.engine = 0; + + /** + * QueryDetail duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.duration = null; + + /** + * QueryDetail resultSizeBytes. + * @member {number|Long} resultSizeBytes + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.resultSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QueryDetail dataProcessedBytes. + * @member {number|Long} dataProcessedBytes + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + */ + QueryDetail.prototype.dataProcessedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryDetail instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {google.cloud.dataplex.v1.SessionEvent.IQueryDetail=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.SessionEvent.QueryDetail} QueryDetail instance + */ + QueryDetail.create = function create(properties) { + return new QueryDetail(properties); + }; + + /** + * Encodes the specified QueryDetail message. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.QueryDetail.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {google.cloud.dataplex.v1.SessionEvent.IQueryDetail} message QueryDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDetail.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryId != null && Object.hasOwnProperty.call(message, "queryId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryId); + if (message.queryText != null && Object.hasOwnProperty.call(message, "queryText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryText); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.engine); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resultSizeBytes != null && Object.hasOwnProperty.call(message, "resultSizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.resultSizeBytes); + if (message.dataProcessedBytes != null && Object.hasOwnProperty.call(message, "dataProcessedBytes")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.dataProcessedBytes); + return writer; + }; + + /** + * Encodes the specified QueryDetail message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.SessionEvent.QueryDetail.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {google.cloud.dataplex.v1.SessionEvent.IQueryDetail} message QueryDetail message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDetail.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDetail message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.SessionEvent.QueryDetail} QueryDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDetail.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.queryId = reader.string(); + break; + } + case 2: { + message.queryText = reader.string(); + break; + } + case 3: { + message.engine = reader.int32(); + break; + } + case 4: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.resultSizeBytes = reader.int64(); + break; + } + case 6: { + message.dataProcessedBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDetail message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.SessionEvent.QueryDetail} QueryDetail + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDetail.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDetail message. + * @function verify + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDetail.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryId != null && message.hasOwnProperty("queryId")) + if (!$util.isString(message.queryId)) + return "queryId: string expected"; + if (message.queryText != null && message.hasOwnProperty("queryText")) + if (!$util.isString(message.queryText)) + return "queryText: string expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.resultSizeBytes != null && message.hasOwnProperty("resultSizeBytes")) + if (!$util.isInteger(message.resultSizeBytes) && !(message.resultSizeBytes && $util.isInteger(message.resultSizeBytes.low) && $util.isInteger(message.resultSizeBytes.high))) + return "resultSizeBytes: integer|Long expected"; + if (message.dataProcessedBytes != null && message.hasOwnProperty("dataProcessedBytes")) + if (!$util.isInteger(message.dataProcessedBytes) && !(message.dataProcessedBytes && $util.isInteger(message.dataProcessedBytes.low) && $util.isInteger(message.dataProcessedBytes.high))) + return "dataProcessedBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryDetail message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.SessionEvent.QueryDetail} QueryDetail + */ + QueryDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail) + return object; + var message = new $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail(); + if (object.queryId != null) + message.queryId = String(object.queryId); + if (object.queryText != null) + message.queryText = String(object.queryText); + switch (object.engine) { + case "ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "SPARK_SQL": + case 1: + message.engine = 1; + break; + case "BIGQUERY": + case 2: + message.engine = 2; + break; + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.dataplex.v1.SessionEvent.QueryDetail.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.resultSizeBytes != null) + if ($util.Long) + (message.resultSizeBytes = $util.Long.fromValue(object.resultSizeBytes)).unsigned = false; + else if (typeof object.resultSizeBytes === "string") + message.resultSizeBytes = parseInt(object.resultSizeBytes, 10); + else if (typeof object.resultSizeBytes === "number") + message.resultSizeBytes = object.resultSizeBytes; + else if (typeof object.resultSizeBytes === "object") + message.resultSizeBytes = new $util.LongBits(object.resultSizeBytes.low >>> 0, object.resultSizeBytes.high >>> 0).toNumber(); + if (object.dataProcessedBytes != null) + if ($util.Long) + (message.dataProcessedBytes = $util.Long.fromValue(object.dataProcessedBytes)).unsigned = false; + else if (typeof object.dataProcessedBytes === "string") + message.dataProcessedBytes = parseInt(object.dataProcessedBytes, 10); + else if (typeof object.dataProcessedBytes === "number") + message.dataProcessedBytes = object.dataProcessedBytes; + else if (typeof object.dataProcessedBytes === "object") + message.dataProcessedBytes = new $util.LongBits(object.dataProcessedBytes.low >>> 0, object.dataProcessedBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryDetail message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {google.cloud.dataplex.v1.SessionEvent.QueryDetail} message QueryDetail + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDetail.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.queryId = ""; + object.queryText = ""; + object.engine = options.enums === String ? "ENGINE_UNSPECIFIED" : 0; + object.duration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resultSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resultSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataProcessedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataProcessedBytes = options.longs === String ? "0" : 0; + } + if (message.queryId != null && message.hasOwnProperty("queryId")) + object.queryId = message.queryId; + if (message.queryText != null && message.hasOwnProperty("queryText")) + object.queryText = message.queryText; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine[message.engine] : message.engine; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.resultSizeBytes != null && message.hasOwnProperty("resultSizeBytes")) + if (typeof message.resultSizeBytes === "number") + object.resultSizeBytes = options.longs === String ? String(message.resultSizeBytes) : message.resultSizeBytes; + else + object.resultSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.resultSizeBytes) : options.longs === Number ? new $util.LongBits(message.resultSizeBytes.low >>> 0, message.resultSizeBytes.high >>> 0).toNumber() : message.resultSizeBytes; + if (message.dataProcessedBytes != null && message.hasOwnProperty("dataProcessedBytes")) + if (typeof message.dataProcessedBytes === "number") + object.dataProcessedBytes = options.longs === String ? String(message.dataProcessedBytes) : message.dataProcessedBytes; + else + object.dataProcessedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.dataProcessedBytes) : options.longs === Number ? new $util.LongBits(message.dataProcessedBytes.low >>> 0, message.dataProcessedBytes.high >>> 0).toNumber() : message.dataProcessedBytes; + return object; + }; + + /** + * Converts this QueryDetail to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @instance + * @returns {Object.} JSON object + */ + QueryDetail.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryDetail + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.SessionEvent.QueryDetail + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.SessionEvent.QueryDetail"; + }; + + /** + * Engine enum. + * @name google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine + * @enum {number} + * @property {number} ENGINE_UNSPECIFIED=0 ENGINE_UNSPECIFIED value + * @property {number} SPARK_SQL=1 SPARK_SQL value + * @property {number} BIGQUERY=2 BIGQUERY value + */ + QueryDetail.Engine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENGINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPARK_SQL"] = 1; + values[valuesById[2] = "BIGQUERY"] = 2; + return values; + })(); + + return QueryDetail; + })(); + + return SessionEvent; + })(); + + v1.MetadataService = (function() { + + /** + * Constructs a new MetadataService service. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a MetadataService + * @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 MetadataService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MetadataService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetadataService; + + /** + * Creates new MetadataService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataplex.v1.MetadataService + * @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 {MetadataService} RPC service. Useful where requests and/or responses are streamed. + */ + MetadataService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|createEntity}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef CreateEntityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Entity} [response] Entity + */ + + /** + * Calls CreateEntity. + * @function createEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.ICreateEntityRequest} request CreateEntityRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.CreateEntityCallback} callback Node-style callback called with the error, if any, and Entity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.createEntity = function createEntity(request, callback) { + return this.rpcCall(createEntity, $root.google.cloud.dataplex.v1.CreateEntityRequest, $root.google.cloud.dataplex.v1.Entity, request, callback); + }, "name", { value: "CreateEntity" }); + + /** + * Calls CreateEntity. + * @function createEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.ICreateEntityRequest} request CreateEntityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|updateEntity}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef UpdateEntityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Entity} [response] Entity + */ + + /** + * Calls UpdateEntity. + * @function updateEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest} request UpdateEntityRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.UpdateEntityCallback} callback Node-style callback called with the error, if any, and Entity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.updateEntity = function updateEntity(request, callback) { + return this.rpcCall(updateEntity, $root.google.cloud.dataplex.v1.UpdateEntityRequest, $root.google.cloud.dataplex.v1.Entity, request, callback); + }, "name", { value: "UpdateEntity" }); + + /** + * Calls UpdateEntity. + * @function updateEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest} request UpdateEntityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|deleteEntity}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef DeleteEntityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEntity. + * @function deleteEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest} request DeleteEntityRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.DeleteEntityCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.deleteEntity = function deleteEntity(request, callback) { + return this.rpcCall(deleteEntity, $root.google.cloud.dataplex.v1.DeleteEntityRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEntity" }); + + /** + * Calls DeleteEntity. + * @function deleteEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest} request DeleteEntityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|getEntity}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef GetEntityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Entity} [response] Entity + */ + + /** + * Calls GetEntity. + * @function getEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IGetEntityRequest} request GetEntityRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.GetEntityCallback} callback Node-style callback called with the error, if any, and Entity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.getEntity = function getEntity(request, callback) { + return this.rpcCall(getEntity, $root.google.cloud.dataplex.v1.GetEntityRequest, $root.google.cloud.dataplex.v1.Entity, request, callback); + }, "name", { value: "GetEntity" }); + + /** + * Calls GetEntity. + * @function getEntity + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IGetEntityRequest} request GetEntityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|listEntities}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef ListEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListEntitiesResponse} [response] ListEntitiesResponse + */ + + /** + * Calls ListEntities. + * @function listEntities + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IListEntitiesRequest} request ListEntitiesRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.ListEntitiesCallback} callback Node-style callback called with the error, if any, and ListEntitiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.listEntities = function listEntities(request, callback) { + return this.rpcCall(listEntities, $root.google.cloud.dataplex.v1.ListEntitiesRequest, $root.google.cloud.dataplex.v1.ListEntitiesResponse, request, callback); + }, "name", { value: "ListEntities" }); + + /** + * Calls ListEntities. + * @function listEntities + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IListEntitiesRequest} request ListEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|createPartition}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef CreatePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Partition} [response] Partition + */ + + /** + * Calls CreatePartition. + * @function createPartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest} request CreatePartitionRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.CreatePartitionCallback} callback Node-style callback called with the error, if any, and Partition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.createPartition = function createPartition(request, callback) { + return this.rpcCall(createPartition, $root.google.cloud.dataplex.v1.CreatePartitionRequest, $root.google.cloud.dataplex.v1.Partition, request, callback); + }, "name", { value: "CreatePartition" }); + + /** + * Calls CreatePartition. + * @function createPartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest} request CreatePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|deletePartition}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef DeletePartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePartition. + * @function deletePartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest} request DeletePartitionRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.DeletePartitionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.deletePartition = function deletePartition(request, callback) { + return this.rpcCall(deletePartition, $root.google.cloud.dataplex.v1.DeletePartitionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePartition" }); + + /** + * Calls DeletePartition. + * @function deletePartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest} request DeletePartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|getPartition}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef GetPartitionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Partition} [response] Partition + */ + + /** + * Calls GetPartition. + * @function getPartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IGetPartitionRequest} request GetPartitionRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.GetPartitionCallback} callback Node-style callback called with the error, if any, and Partition + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.getPartition = function getPartition(request, callback) { + return this.rpcCall(getPartition, $root.google.cloud.dataplex.v1.GetPartitionRequest, $root.google.cloud.dataplex.v1.Partition, request, callback); + }, "name", { value: "GetPartition" }); + + /** + * Calls GetPartition. + * @function getPartition + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IGetPartitionRequest} request GetPartitionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.MetadataService|listPartitions}. + * @memberof google.cloud.dataplex.v1.MetadataService + * @typedef ListPartitionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListPartitionsResponse} [response] ListPartitionsResponse + */ + + /** + * Calls ListPartitions. + * @function listPartitions + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IListPartitionsRequest} request ListPartitionsRequest message or plain object + * @param {google.cloud.dataplex.v1.MetadataService.ListPartitionsCallback} callback Node-style callback called with the error, if any, and ListPartitionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetadataService.prototype.listPartitions = function listPartitions(request, callback) { + return this.rpcCall(listPartitions, $root.google.cloud.dataplex.v1.ListPartitionsRequest, $root.google.cloud.dataplex.v1.ListPartitionsResponse, request, callback); + }, "name", { value: "ListPartitions" }); + + /** + * Calls ListPartitions. + * @function listPartitions + * @memberof google.cloud.dataplex.v1.MetadataService + * @instance + * @param {google.cloud.dataplex.v1.IListPartitionsRequest} request ListPartitionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MetadataService; + })(); + + v1.CreateEntityRequest = (function() { + + /** + * Properties of a CreateEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateEntityRequest + * @property {string|null} [parent] CreateEntityRequest parent + * @property {google.cloud.dataplex.v1.IEntity|null} [entity] CreateEntityRequest entity + * @property {boolean|null} [validateOnly] CreateEntityRequest validateOnly + */ + + /** + * Constructs a new CreateEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateEntityRequest. + * @implements ICreateEntityRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateEntityRequest=} [properties] Properties to set + */ + function CreateEntityRequest(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]]; + } + + /** + * CreateEntityRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @instance + */ + CreateEntityRequest.prototype.parent = ""; + + /** + * CreateEntityRequest entity. + * @member {google.cloud.dataplex.v1.IEntity|null|undefined} entity + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @instance + */ + CreateEntityRequest.prototype.entity = null; + + /** + * CreateEntityRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @instance + */ + CreateEntityRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateEntityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEntityRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateEntityRequest} CreateEntityRequest instance + */ + CreateEntityRequest.create = function create(properties) { + return new CreateEntityRequest(properties); + }; + + /** + * Encodes the specified CreateEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateEntityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEntityRequest} message CreateEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityRequest.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.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.dataplex.v1.Entity.encode(message.entity, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateEntityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEntityRequest} message CreateEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateEntityRequest} CreateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateEntityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.entity = $root.google.cloud.dataplex.v1.Entity.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateEntityRequest} CreateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntityRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntityRequest.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.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.dataplex.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateEntityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateEntityRequest} CreateEntityRequest + */ + CreateEntityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateEntityRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateEntityRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateEntityRequest.entity: object expected"); + message.entity = $root.google.cloud.dataplex.v1.Entity.fromObject(object.entity); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateEntityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.CreateEntityRequest} message CreateEntityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.entity = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.dataplex.v1.Entity.toObject(message.entity, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateEntityRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEntityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntityRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateEntityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateEntityRequest"; + }; + + return CreateEntityRequest; + })(); + + v1.UpdateEntityRequest = (function() { + + /** + * Properties of an UpdateEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateEntityRequest + * @property {google.cloud.dataplex.v1.IEntity|null} [entity] UpdateEntityRequest entity + * @property {boolean|null} [validateOnly] UpdateEntityRequest validateOnly + */ + + /** + * Constructs a new UpdateEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateEntityRequest. + * @implements IUpdateEntityRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest=} [properties] Properties to set + */ + function UpdateEntityRequest(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]]; + } + + /** + * UpdateEntityRequest entity. + * @member {google.cloud.dataplex.v1.IEntity|null|undefined} entity + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @instance + */ + UpdateEntityRequest.prototype.entity = null; + + /** + * UpdateEntityRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @instance + */ + UpdateEntityRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateEntityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateEntityRequest} UpdateEntityRequest instance + */ + UpdateEntityRequest.create = function create(properties) { + return new UpdateEntityRequest(properties); + }; + + /** + * Encodes the specified UpdateEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEntityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest} message UpdateEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.dataplex.v1.Entity.encode(message.entity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEntityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEntityRequest} message UpdateEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEntityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateEntityRequest} UpdateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateEntityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.entity = $root.google.cloud.dataplex.v1.Entity.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEntityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateEntityRequest} UpdateEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEntityRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEntityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.dataplex.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateEntityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateEntityRequest} UpdateEntityRequest + */ + UpdateEntityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateEntityRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateEntityRequest(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateEntityRequest.entity: object expected"); + message.entity = $root.google.cloud.dataplex.v1.Entity.fromObject(object.entity); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateEntityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateEntityRequest} message UpdateEntityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEntityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entity = null; + object.validateOnly = false; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.dataplex.v1.Entity.toObject(message.entity, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateEntityRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEntityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEntityRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateEntityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEntityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateEntityRequest"; + }; + + return UpdateEntityRequest; + })(); + + v1.DeleteEntityRequest = (function() { + + /** + * Properties of a DeleteEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteEntityRequest + * @property {string|null} [name] DeleteEntityRequest name + * @property {string|null} [etag] DeleteEntityRequest etag + */ + + /** + * Constructs a new DeleteEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteEntityRequest. + * @implements IDeleteEntityRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest=} [properties] Properties to set + */ + function DeleteEntityRequest(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]]; + } + + /** + * DeleteEntityRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @instance + */ + DeleteEntityRequest.prototype.name = ""; + + /** + * DeleteEntityRequest etag. + * @member {string} etag + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @instance + */ + DeleteEntityRequest.prototype.etag = ""; + + /** + * Creates a new DeleteEntityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteEntityRequest} DeleteEntityRequest instance + */ + DeleteEntityRequest.create = function create(properties) { + return new DeleteEntityRequest(properties); + }; + + /** + * Encodes the specified DeleteEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEntityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest} message DeleteEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEntityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEntityRequest} message DeleteEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEntityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteEntityRequest} DeleteEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteEntityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEntityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteEntityRequest} DeleteEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEntityRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEntityRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteEntityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteEntityRequest} DeleteEntityRequest + */ + DeleteEntityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteEntityRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteEntityRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteEntityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteEntityRequest} message DeleteEntityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEntityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteEntityRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEntityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEntityRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteEntityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEntityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteEntityRequest"; + }; + + return DeleteEntityRequest; + })(); + + v1.ListEntitiesRequest = (function() { + + /** + * Properties of a ListEntitiesRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListEntitiesRequest + * @property {string|null} [parent] ListEntitiesRequest parent + * @property {google.cloud.dataplex.v1.ListEntitiesRequest.EntityView|null} [view] ListEntitiesRequest view + * @property {number|null} [pageSize] ListEntitiesRequest pageSize + * @property {string|null} [pageToken] ListEntitiesRequest pageToken + * @property {string|null} [filter] ListEntitiesRequest filter + */ + + /** + * Constructs a new ListEntitiesRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListEntitiesRequest. + * @implements IListEntitiesRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListEntitiesRequest=} [properties] Properties to set + */ + function ListEntitiesRequest(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]]; + } + + /** + * ListEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + */ + ListEntitiesRequest.prototype.parent = ""; + + /** + * ListEntitiesRequest view. + * @member {google.cloud.dataplex.v1.ListEntitiesRequest.EntityView} view + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + */ + ListEntitiesRequest.prototype.view = 0; + + /** + * ListEntitiesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + */ + ListEntitiesRequest.prototype.pageSize = 0; + + /** + * ListEntitiesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + */ + ListEntitiesRequest.prototype.pageToken = ""; + + /** + * ListEntitiesRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + */ + ListEntitiesRequest.prototype.filter = ""; + + /** + * Creates a new ListEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListEntitiesRequest} ListEntitiesRequest instance + */ + ListEntitiesRequest.create = function create(properties) { + return new ListEntitiesRequest(properties); + }; + + /** + * Encodes the specified ListEntitiesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesRequest} message ListEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitiesRequest.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); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesRequest} message ListEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListEntitiesRequest} ListEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListEntitiesRequest(); + 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; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListEntitiesRequest} ListEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntitiesRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntitiesRequest.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"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListEntitiesRequest} ListEntitiesRequest + */ + ListEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListEntitiesRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + case "ENTITY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "TABLES": + case 1: + message.view = 1; + break; + case "FILESETS": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {google.cloud.dataplex.v1.ListEntitiesRequest} message ListEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "ENTITY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.cloud.dataplex.v1.ListEntitiesRequest.EntityView[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; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntitiesRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListEntitiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListEntitiesRequest"; + }; + + /** + * EntityView enum. + * @name google.cloud.dataplex.v1.ListEntitiesRequest.EntityView + * @enum {number} + * @property {number} ENTITY_VIEW_UNSPECIFIED=0 ENTITY_VIEW_UNSPECIFIED value + * @property {number} TABLES=1 TABLES value + * @property {number} FILESETS=2 FILESETS value + */ + ListEntitiesRequest.EntityView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLES"] = 1; + values[valuesById[2] = "FILESETS"] = 2; + return values; + })(); + + return ListEntitiesRequest; + })(); + + v1.ListEntitiesResponse = (function() { + + /** + * Properties of a ListEntitiesResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListEntitiesResponse + * @property {Array.|null} [entities] ListEntitiesResponse entities + * @property {string|null} [nextPageToken] ListEntitiesResponse nextPageToken + */ + + /** + * Constructs a new ListEntitiesResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListEntitiesResponse. + * @implements IListEntitiesResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListEntitiesResponse=} [properties] Properties to set + */ + function ListEntitiesResponse(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntitiesResponse entities. + * @member {Array.} entities + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @instance + */ + ListEntitiesResponse.prototype.entities = $util.emptyArray; + + /** + * ListEntitiesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @instance + */ + ListEntitiesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListEntitiesResponse} ListEntitiesResponse instance + */ + ListEntitiesResponse.create = function create(properties) { + return new ListEntitiesResponse(properties); + }; + + /** + * Encodes the specified ListEntitiesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesResponse} message ListEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dataplex.v1.Entity.encode(message.entities[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 ListEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {google.cloud.dataplex.v1.IListEntitiesResponse} message ListEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListEntitiesResponse} ListEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dataplex.v1.Entity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListEntitiesResponse} ListEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntitiesResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListEntitiesResponse} ListEntitiesResponse + */ + ListEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListEntitiesResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListEntitiesResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dataplex.v1.ListEntitiesResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListEntitiesResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.dataplex.v1.Entity.fromObject(object.entities[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {google.cloud.dataplex.v1.ListEntitiesResponse} message ListEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dataplex.v1.Entity.toObject(message.entities[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEntitiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntitiesResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListEntitiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListEntitiesResponse"; + }; + + return ListEntitiesResponse; + })(); + + v1.GetEntityRequest = (function() { + + /** + * Properties of a GetEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetEntityRequest + * @property {string|null} [name] GetEntityRequest name + * @property {google.cloud.dataplex.v1.GetEntityRequest.EntityView|null} [view] GetEntityRequest view + */ + + /** + * Constructs a new GetEntityRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetEntityRequest. + * @implements IGetEntityRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetEntityRequest=} [properties] Properties to set + */ + function GetEntityRequest(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]]; + } + + /** + * GetEntityRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @instance + */ + GetEntityRequest.prototype.name = ""; + + /** + * GetEntityRequest view. + * @member {google.cloud.dataplex.v1.GetEntityRequest.EntityView} view + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @instance + */ + GetEntityRequest.prototype.view = 0; + + /** + * Creates a new GetEntityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEntityRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetEntityRequest} GetEntityRequest instance + */ + GetEntityRequest.create = function create(properties) { + return new GetEntityRequest(properties); + }; + + /** + * Encodes the specified GetEntityRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetEntityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEntityRequest} message GetEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityRequest.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 GetEntityRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetEntityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEntityRequest} message GetEntityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEntityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetEntityRequest} GetEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetEntityRequest(); + 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 GetEntityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetEntityRequest} GetEntityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEntityRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEntityRequest.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: + case 4: + break; + } + return null; + }; + + /** + * Creates a GetEntityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetEntityRequest} GetEntityRequest + */ + GetEntityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetEntityRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetEntityRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "ENTITY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "SCHEMA": + case 2: + message.view = 2; + break; + case "FULL": + case 4: + message.view = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetEntityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {google.cloud.dataplex.v1.GetEntityRequest} message GetEntityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEntityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "ENTITY_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.cloud.dataplex.v1.GetEntityRequest.EntityView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetEntityRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @instance + * @returns {Object.} JSON object + */ + GetEntityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEntityRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetEntityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEntityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetEntityRequest"; + }; + + /** + * EntityView enum. + * @name google.cloud.dataplex.v1.GetEntityRequest.EntityView + * @enum {number} + * @property {number} ENTITY_VIEW_UNSPECIFIED=0 ENTITY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} SCHEMA=2 SCHEMA value + * @property {number} FULL=4 FULL value + */ + GetEntityRequest.EntityView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "SCHEMA"] = 2; + values[valuesById[4] = "FULL"] = 4; + return values; + })(); + + return GetEntityRequest; + })(); + + v1.ListPartitionsRequest = (function() { + + /** + * Properties of a ListPartitionsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListPartitionsRequest + * @property {string|null} [parent] ListPartitionsRequest parent + * @property {number|null} [pageSize] ListPartitionsRequest pageSize + * @property {string|null} [pageToken] ListPartitionsRequest pageToken + * @property {string|null} [filter] ListPartitionsRequest filter + */ + + /** + * Constructs a new ListPartitionsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListPartitionsRequest. + * @implements IListPartitionsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListPartitionsRequest=} [properties] Properties to set + */ + function ListPartitionsRequest(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]]; + } + + /** + * ListPartitionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @instance + */ + ListPartitionsRequest.prototype.parent = ""; + + /** + * ListPartitionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @instance + */ + ListPartitionsRequest.prototype.pageSize = 0; + + /** + * ListPartitionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @instance + */ + ListPartitionsRequest.prototype.pageToken = ""; + + /** + * ListPartitionsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @instance + */ + ListPartitionsRequest.prototype.filter = ""; + + /** + * Creates a new ListPartitionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListPartitionsRequest} ListPartitionsRequest instance + */ + ListPartitionsRequest.create = function create(properties) { + return new ListPartitionsRequest(properties); + }; + + /** + * Encodes the specified ListPartitionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsRequest} message ListPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPartitionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListPartitionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsRequest} message ListPartitionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPartitionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListPartitionsRequest} ListPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPartitionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListPartitionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPartitionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListPartitionsRequest} ListPartitionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPartitionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPartitionsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPartitionsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListPartitionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListPartitionsRequest} ListPartitionsRequest + */ + ListPartitionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListPartitionsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListPartitionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListPartitionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {google.cloud.dataplex.v1.ListPartitionsRequest} message ListPartitionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPartitionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListPartitionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPartitionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPartitionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListPartitionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPartitionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListPartitionsRequest"; + }; + + return ListPartitionsRequest; + })(); + + v1.CreatePartitionRequest = (function() { + + /** + * Properties of a CreatePartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreatePartitionRequest + * @property {string|null} [parent] CreatePartitionRequest parent + * @property {google.cloud.dataplex.v1.IPartition|null} [partition] CreatePartitionRequest partition + * @property {boolean|null} [validateOnly] CreatePartitionRequest validateOnly + */ + + /** + * Constructs a new CreatePartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreatePartitionRequest. + * @implements ICreatePartitionRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest=} [properties] Properties to set + */ + function CreatePartitionRequest(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]]; + } + + /** + * CreatePartitionRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @instance + */ + CreatePartitionRequest.prototype.parent = ""; + + /** + * CreatePartitionRequest partition. + * @member {google.cloud.dataplex.v1.IPartition|null|undefined} partition + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @instance + */ + CreatePartitionRequest.prototype.partition = null; + + /** + * CreatePartitionRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @instance + */ + CreatePartitionRequest.prototype.validateOnly = false; + + /** + * Creates a new CreatePartitionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreatePartitionRequest} CreatePartitionRequest instance + */ + CreatePartitionRequest.create = function create(properties) { + return new CreatePartitionRequest(properties); + }; + + /** + * Encodes the specified CreatePartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreatePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest} message CreatePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePartitionRequest.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.partition != null && Object.hasOwnProperty.call(message, "partition")) + $root.google.cloud.dataplex.v1.Partition.encode(message.partition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreatePartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreatePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.ICreatePartitionRequest} message CreatePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreatePartitionRequest} CreatePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePartitionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreatePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.partition = $root.google.cloud.dataplex.v1.Partition.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreatePartitionRequest} CreatePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePartitionRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePartitionRequest.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.partition != null && message.hasOwnProperty("partition")) { + var error = $root.google.cloud.dataplex.v1.Partition.verify(message.partition); + if (error) + return "partition." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreatePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreatePartitionRequest} CreatePartitionRequest + */ + CreatePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreatePartitionRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreatePartitionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.partition != null) { + if (typeof object.partition !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreatePartitionRequest.partition: object expected"); + message.partition = $root.google.cloud.dataplex.v1.Partition.fromObject(object.partition); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreatePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.CreatePartitionRequest} message CreatePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.partition = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.partition != null && message.hasOwnProperty("partition")) + object.partition = $root.google.cloud.dataplex.v1.Partition.toObject(message.partition, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreatePartitionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePartitionRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreatePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreatePartitionRequest"; + }; + + return CreatePartitionRequest; + })(); + + v1.DeletePartitionRequest = (function() { + + /** + * Properties of a DeletePartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeletePartitionRequest + * @property {string|null} [name] DeletePartitionRequest name + * @property {string|null} [etag] DeletePartitionRequest etag + */ + + /** + * Constructs a new DeletePartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeletePartitionRequest. + * @implements IDeletePartitionRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest=} [properties] Properties to set + */ + function DeletePartitionRequest(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]]; + } + + /** + * DeletePartitionRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @instance + */ + DeletePartitionRequest.prototype.name = ""; + + /** + * DeletePartitionRequest etag. + * @member {string} etag + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @instance + */ + DeletePartitionRequest.prototype.etag = ""; + + /** + * Creates a new DeletePartitionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeletePartitionRequest} DeletePartitionRequest instance + */ + DeletePartitionRequest.create = function create(properties) { + return new DeletePartitionRequest(properties); + }; + + /** + * Encodes the specified DeletePartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeletePartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest} message DeletePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePartitionRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeletePartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeletePartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IDeletePartitionRequest} message DeletePartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeletePartitionRequest} DeletePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePartitionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeletePartitionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeletePartitionRequest} DeletePartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePartitionRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePartitionRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeletePartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeletePartitionRequest} DeletePartitionRequest + */ + DeletePartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeletePartitionRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeletePartitionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeletePartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {google.cloud.dataplex.v1.DeletePartitionRequest} message DeletePartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePartitionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeletePartitionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePartitionRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeletePartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeletePartitionRequest"; + }; + + return DeletePartitionRequest; + })(); + + v1.ListPartitionsResponse = (function() { + + /** + * Properties of a ListPartitionsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListPartitionsResponse + * @property {Array.|null} [partitions] ListPartitionsResponse partitions + * @property {string|null} [nextPageToken] ListPartitionsResponse nextPageToken + */ + + /** + * Constructs a new ListPartitionsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListPartitionsResponse. + * @implements IListPartitionsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListPartitionsResponse=} [properties] Properties to set + */ + function ListPartitionsResponse(properties) { + this.partitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPartitionsResponse partitions. + * @member {Array.} partitions + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @instance + */ + ListPartitionsResponse.prototype.partitions = $util.emptyArray; + + /** + * ListPartitionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @instance + */ + ListPartitionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPartitionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListPartitionsResponse} ListPartitionsResponse instance + */ + ListPartitionsResponse.create = function create(properties) { + return new ListPartitionsResponse(properties); + }; + + /** + * Encodes the specified ListPartitionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsResponse} message ListPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPartitionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitions != null && message.partitions.length) + for (var i = 0; i < message.partitions.length; ++i) + $root.google.cloud.dataplex.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPartitionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListPartitionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListPartitionsResponse} message ListPartitionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPartitionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListPartitionsResponse} ListPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPartitionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListPartitionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.partitions && message.partitions.length)) + message.partitions = []; + message.partitions.push($root.google.cloud.dataplex.v1.Partition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPartitionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListPartitionsResponse} ListPartitionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPartitionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPartitionsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPartitionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (!Array.isArray(message.partitions)) + return "partitions: array expected"; + for (var i = 0; i < message.partitions.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Partition.verify(message.partitions[i]); + if (error) + return "partitions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPartitionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListPartitionsResponse} ListPartitionsResponse + */ + ListPartitionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListPartitionsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListPartitionsResponse(); + if (object.partitions) { + if (!Array.isArray(object.partitions)) + throw TypeError(".google.cloud.dataplex.v1.ListPartitionsResponse.partitions: array expected"); + message.partitions = []; + for (var i = 0; i < object.partitions.length; ++i) { + if (typeof object.partitions[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListPartitionsResponse.partitions: object expected"); + message.partitions[i] = $root.google.cloud.dataplex.v1.Partition.fromObject(object.partitions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPartitionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {google.cloud.dataplex.v1.ListPartitionsResponse} message ListPartitionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPartitionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partitions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.partitions && message.partitions.length) { + object.partitions = []; + for (var j = 0; j < message.partitions.length; ++j) + object.partitions[j] = $root.google.cloud.dataplex.v1.Partition.toObject(message.partitions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPartitionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPartitionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPartitionsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListPartitionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPartitionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListPartitionsResponse"; + }; + + return ListPartitionsResponse; + })(); + + v1.GetPartitionRequest = (function() { + + /** + * Properties of a GetPartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetPartitionRequest + * @property {string|null} [name] GetPartitionRequest name + */ + + /** + * Constructs a new GetPartitionRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetPartitionRequest. + * @implements IGetPartitionRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetPartitionRequest=} [properties] Properties to set + */ + function GetPartitionRequest(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]]; + } + + /** + * GetPartitionRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @instance + */ + GetPartitionRequest.prototype.name = ""; + + /** + * Creates a new GetPartitionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IGetPartitionRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetPartitionRequest} GetPartitionRequest instance + */ + GetPartitionRequest.create = function create(properties) { + return new GetPartitionRequest(properties); + }; + + /** + * Encodes the specified GetPartitionRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetPartitionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IGetPartitionRequest} message GetPartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPartitionRequest.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 GetPartitionRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetPartitionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {google.cloud.dataplex.v1.IGetPartitionRequest} message GetPartitionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPartitionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetPartitionRequest} GetPartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPartitionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetPartitionRequest(); + 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 GetPartitionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetPartitionRequest} GetPartitionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPartitionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPartitionRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPartitionRequest.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 GetPartitionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetPartitionRequest} GetPartitionRequest + */ + GetPartitionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetPartitionRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetPartitionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPartitionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {google.cloud.dataplex.v1.GetPartitionRequest} message GetPartitionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPartitionRequest.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 GetPartitionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @instance + * @returns {Object.} JSON object + */ + GetPartitionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPartitionRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetPartitionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPartitionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetPartitionRequest"; + }; + + return GetPartitionRequest; + })(); + + v1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.dataplex.v1 + * @interface IEntity + * @property {string|null} [name] Entity name + * @property {string|null} [displayName] Entity displayName + * @property {string|null} [description] Entity description + * @property {google.protobuf.ITimestamp|null} [createTime] Entity createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Entity updateTime + * @property {string|null} [id] Entity id + * @property {string|null} [etag] Entity etag + * @property {google.cloud.dataplex.v1.Entity.Type|null} [type] Entity type + * @property {string|null} [asset] Entity asset + * @property {string|null} [dataPath] Entity dataPath + * @property {string|null} [dataPathPattern] Entity dataPathPattern + * @property {string|null} [catalogEntry] Entity catalogEntry + * @property {google.cloud.dataplex.v1.StorageSystem|null} [system] Entity system + * @property {google.cloud.dataplex.v1.IStorageFormat|null} [format] Entity format + * @property {google.cloud.dataplex.v1.Entity.ICompatibilityStatus|null} [compatibility] Entity compatibility + * @property {google.cloud.dataplex.v1.ISchema|null} [schema] Entity schema + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dataplex.v1.IEntity=} [properties] Properties to set + */ + function Entity(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]]; + } + + /** + * Entity name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.name = ""; + + /** + * Entity displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.displayName = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.createTime = null; + + /** + * Entity updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.updateTime = null; + + /** + * Entity id. + * @member {string} id + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.id = ""; + + /** + * Entity etag. + * @member {string} etag + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.etag = ""; + + /** + * Entity type. + * @member {google.cloud.dataplex.v1.Entity.Type} type + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.type = 0; + + /** + * Entity asset. + * @member {string} asset + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.asset = ""; + + /** + * Entity dataPath. + * @member {string} dataPath + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.dataPath = ""; + + /** + * Entity dataPathPattern. + * @member {string} dataPathPattern + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.dataPathPattern = ""; + + /** + * Entity catalogEntry. + * @member {string} catalogEntry + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.catalogEntry = ""; + + /** + * Entity system. + * @member {google.cloud.dataplex.v1.StorageSystem} system + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.system = 0; + + /** + * Entity format. + * @member {google.cloud.dataplex.v1.IStorageFormat|null|undefined} format + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.format = null; + + /** + * Entity compatibility. + * @member {google.cloud.dataplex.v1.Entity.ICompatibilityStatus|null|undefined} compatibility + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.compatibility = null; + + /** + * Entity schema. + * @member {google.cloud.dataplex.v1.ISchema|null|undefined} schema + * @memberof google.cloud.dataplex.v1.Entity + * @instance + */ + Entity.prototype.schema = null; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {google.cloud.dataplex.v1.IEntity=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {google.cloud.dataplex.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.id); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.asset); + if (message.dataPath != null && Object.hasOwnProperty.call(message, "dataPath")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.dataPath); + if (message.dataPathPattern != null && Object.hasOwnProperty.call(message, "dataPathPattern")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.dataPathPattern); + if (message.catalogEntry != null && Object.hasOwnProperty.call(message, "catalogEntry")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.catalogEntry); + if (message.system != null && Object.hasOwnProperty.call(message, "system")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.system); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + $root.google.cloud.dataplex.v1.StorageFormat.encode(message.format, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.compatibility != null && Object.hasOwnProperty.call(message, "compatibility")) + $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.encode(message.compatibility, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.dataplex.v1.Schema.encode(message.schema, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {google.cloud.dataplex.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.id = reader.string(); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + case 10: { + message.type = reader.int32(); + break; + } + case 11: { + message.asset = reader.string(); + break; + } + case 12: { + message.dataPath = reader.string(); + break; + } + case 13: { + message.dataPathPattern = reader.string(); + break; + } + case 14: { + message.catalogEntry = reader.string(); + break; + } + case 15: { + message.system = reader.int32(); + break; + } + case 16: { + message.format = $root.google.cloud.dataplex.v1.StorageFormat.decode(reader, reader.uint32()); + break; + } + case 19: { + message.compatibility = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.decode(reader, reader.uint32()); + break; + } + case 50: { + message.schema = $root.google.cloud.dataplex.v1.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.dataPath != null && message.hasOwnProperty("dataPath")) + if (!$util.isString(message.dataPath)) + return "dataPath: string expected"; + if (message.dataPathPattern != null && message.hasOwnProperty("dataPathPattern")) + if (!$util.isString(message.dataPathPattern)) + return "dataPathPattern: string expected"; + if (message.catalogEntry != null && message.hasOwnProperty("catalogEntry")) + if (!$util.isString(message.catalogEntry)) + return "catalogEntry: string expected"; + if (message.system != null && message.hasOwnProperty("system")) + switch (message.system) { + default: + return "system: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.format != null && message.hasOwnProperty("format")) { + var error = $root.google.cloud.dataplex.v1.StorageFormat.verify(message.format); + if (error) + return "format." + error; + } + if (message.compatibility != null && message.hasOwnProperty("compatibility")) { + var error = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.verify(message.compatibility); + if (error) + return "compatibility." + error; + } + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.dataplex.v1.Schema.verify(message.schema); + if (error) + return "schema." + error; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Entity) + return object; + var message = new $root.google.cloud.dataplex.v1.Entity(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.id != null) + message.id = String(object.id); + if (object.etag != null) + message.etag = String(object.etag); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TABLE": + case 1: + message.type = 1; + break; + case "FILESET": + case 2: + message.type = 2; + break; + } + if (object.asset != null) + message.asset = String(object.asset); + if (object.dataPath != null) + message.dataPath = String(object.dataPath); + if (object.dataPathPattern != null) + message.dataPathPattern = String(object.dataPathPattern); + if (object.catalogEntry != null) + message.catalogEntry = String(object.catalogEntry); + switch (object.system) { + case "STORAGE_SYSTEM_UNSPECIFIED": + case 0: + message.system = 0; + break; + case "CLOUD_STORAGE": + case 1: + message.system = 1; + break; + case "BIGQUERY": + case 2: + message.system = 2; + break; + } + if (object.format != null) { + if (typeof object.format !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.format: object expected"); + message.format = $root.google.cloud.dataplex.v1.StorageFormat.fromObject(object.format); + } + if (object.compatibility != null) { + if (typeof object.compatibility !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.compatibility: object expected"); + message.compatibility = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.fromObject(object.compatibility); + } + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.schema: object expected"); + message.schema = $root.google.cloud.dataplex.v1.Schema.fromObject(object.schema); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {google.cloud.dataplex.v1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.id = ""; + object.etag = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.asset = ""; + object.dataPath = ""; + object.dataPathPattern = ""; + object.catalogEntry = ""; + object.system = options.enums === String ? "STORAGE_SYSTEM_UNSPECIFIED" : 0; + object.format = null; + object.compatibility = null; + object.schema = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.Entity.Type[message.type] : message.type; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.dataPath != null && message.hasOwnProperty("dataPath")) + object.dataPath = message.dataPath; + if (message.dataPathPattern != null && message.hasOwnProperty("dataPathPattern")) + object.dataPathPattern = message.dataPathPattern; + if (message.catalogEntry != null && message.hasOwnProperty("catalogEntry")) + object.catalogEntry = message.catalogEntry; + if (message.system != null && message.hasOwnProperty("system")) + object.system = options.enums === String ? $root.google.cloud.dataplex.v1.StorageSystem[message.system] : message.system; + if (message.format != null && message.hasOwnProperty("format")) + object.format = $root.google.cloud.dataplex.v1.StorageFormat.toObject(message.format, options); + if (message.compatibility != null && message.hasOwnProperty("compatibility")) + object.compatibility = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.toObject(message.compatibility, options); + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.dataplex.v1.Schema.toObject(message.schema, options); + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Entity"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.Entity.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TABLE=1 TABLE value + * @property {number} FILESET=2 FILESET value + */ + Entity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE"] = 1; + values[valuesById[2] = "FILESET"] = 2; + return values; + })(); + + Entity.CompatibilityStatus = (function() { + + /** + * Properties of a CompatibilityStatus. + * @memberof google.cloud.dataplex.v1.Entity + * @interface ICompatibilityStatus + * @property {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null} [hiveMetastore] CompatibilityStatus hiveMetastore + * @property {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null} [bigquery] CompatibilityStatus bigquery + */ + + /** + * Constructs a new CompatibilityStatus. + * @memberof google.cloud.dataplex.v1.Entity + * @classdesc Represents a CompatibilityStatus. + * @implements ICompatibilityStatus + * @constructor + * @param {google.cloud.dataplex.v1.Entity.ICompatibilityStatus=} [properties] Properties to set + */ + function CompatibilityStatus(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]]; + } + + /** + * CompatibilityStatus hiveMetastore. + * @member {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null|undefined} hiveMetastore + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @instance + */ + CompatibilityStatus.prototype.hiveMetastore = null; + + /** + * CompatibilityStatus bigquery. + * @member {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility|null|undefined} bigquery + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @instance + */ + CompatibilityStatus.prototype.bigquery = null; + + /** + * Creates a new CompatibilityStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {google.cloud.dataplex.v1.Entity.ICompatibilityStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus} CompatibilityStatus instance + */ + CompatibilityStatus.create = function create(properties) { + return new CompatibilityStatus(properties); + }; + + /** + * Encodes the specified CompatibilityStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {google.cloud.dataplex.v1.Entity.ICompatibilityStatus} message CompatibilityStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompatibilityStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hiveMetastore != null && Object.hasOwnProperty.call(message, "hiveMetastore")) + $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.encode(message.hiveMetastore, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigquery != null && Object.hasOwnProperty.call(message, "bigquery")) + $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.encode(message.bigquery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompatibilityStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {google.cloud.dataplex.v1.Entity.ICompatibilityStatus} message CompatibilityStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompatibilityStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompatibilityStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus} CompatibilityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompatibilityStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hiveMetastore = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigquery = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompatibilityStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus} CompatibilityStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompatibilityStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompatibilityStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompatibilityStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hiveMetastore != null && message.hasOwnProperty("hiveMetastore")) { + var error = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify(message.hiveMetastore); + if (error) + return "hiveMetastore." + error; + } + if (message.bigquery != null && message.hasOwnProperty("bigquery")) { + var error = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify(message.bigquery); + if (error) + return "bigquery." + error; + } + return null; + }; + + /** + * Creates a CompatibilityStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus} CompatibilityStatus + */ + CompatibilityStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus(); + if (object.hiveMetastore != null) { + if (typeof object.hiveMetastore !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.CompatibilityStatus.hiveMetastore: object expected"); + message.hiveMetastore = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.fromObject(object.hiveMetastore); + } + if (object.bigquery != null) { + if (typeof object.bigquery !== "object") + throw TypeError(".google.cloud.dataplex.v1.Entity.CompatibilityStatus.bigquery: object expected"); + message.bigquery = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.fromObject(object.bigquery); + } + return message; + }; + + /** + * Creates a plain object from a CompatibilityStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus} message CompatibilityStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompatibilityStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hiveMetastore = null; + object.bigquery = null; + } + if (message.hiveMetastore != null && message.hasOwnProperty("hiveMetastore")) + object.hiveMetastore = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.toObject(message.hiveMetastore, options); + if (message.bigquery != null && message.hasOwnProperty("bigquery")) + object.bigquery = $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.toObject(message.bigquery, options); + return object; + }; + + /** + * Converts this CompatibilityStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @instance + * @returns {Object.} JSON object + */ + CompatibilityStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompatibilityStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompatibilityStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Entity.CompatibilityStatus"; + }; + + CompatibilityStatus.Compatibility = (function() { + + /** + * Properties of a Compatibility. + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @interface ICompatibility + * @property {boolean|null} [compatible] Compatibility compatible + * @property {string|null} [reason] Compatibility reason + */ + + /** + * Constructs a new Compatibility. + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus + * @classdesc Represents a Compatibility. + * @implements ICompatibility + * @constructor + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility=} [properties] Properties to set + */ + function Compatibility(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]]; + } + + /** + * Compatibility compatible. + * @member {boolean} compatible + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @instance + */ + Compatibility.prototype.compatible = false; + + /** + * Compatibility reason. + * @member {string} reason + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @instance + */ + Compatibility.prototype.reason = ""; + + /** + * Creates a new Compatibility instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility} Compatibility instance + */ + Compatibility.create = function create(properties) { + return new Compatibility(properties); + }; + + /** + * Encodes the specified Compatibility message. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility} message Compatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compatibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.compatible != null && Object.hasOwnProperty.call(message, "compatible")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.compatible); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + return writer; + }; + + /** + * Encodes the specified Compatibility message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus.ICompatibility} message Compatibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Compatibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Compatibility message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility} Compatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compatibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.compatible = reader.bool(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Compatibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility} Compatibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Compatibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Compatibility message. + * @function verify + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Compatibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.compatible != null && message.hasOwnProperty("compatible")) + if (typeof message.compatible !== "boolean") + return "compatible: boolean expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + return null; + }; + + /** + * Creates a Compatibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility} Compatibility + */ + Compatibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility) + return object; + var message = new $root.google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility(); + if (object.compatible != null) + message.compatible = Boolean(object.compatible); + if (object.reason != null) + message.reason = String(object.reason); + return message; + }; + + /** + * Creates a plain object from a Compatibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility} message Compatibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Compatibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.compatible = false; + object.reason = ""; + } + if (message.compatible != null && message.hasOwnProperty("compatible")) + object.compatible = message.compatible; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + return object; + }; + + /** + * Converts this Compatibility to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @instance + * @returns {Object.} JSON object + */ + Compatibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Compatibility + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Compatibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Entity.CompatibilityStatus.Compatibility"; + }; + + return Compatibility; + })(); + + return CompatibilityStatus; + })(); + + return Entity; + })(); + + v1.Partition = (function() { + + /** + * Properties of a Partition. + * @memberof google.cloud.dataplex.v1 + * @interface IPartition + * @property {string|null} [name] Partition name + * @property {Array.|null} [values] Partition values + * @property {string|null} [location] Partition location + * @property {string|null} [etag] Partition etag + */ + + /** + * Constructs a new Partition. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Partition. + * @implements IPartition + * @constructor + * @param {google.cloud.dataplex.v1.IPartition=} [properties] Properties to set + */ + function Partition(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Partition name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Partition + * @instance + */ + Partition.prototype.name = ""; + + /** + * Partition values. + * @member {Array.} values + * @memberof google.cloud.dataplex.v1.Partition + * @instance + */ + Partition.prototype.values = $util.emptyArray; + + /** + * Partition location. + * @member {string} location + * @memberof google.cloud.dataplex.v1.Partition + * @instance + */ + Partition.prototype.location = ""; + + /** + * Partition etag. + * @member {string} etag + * @memberof google.cloud.dataplex.v1.Partition + * @instance + */ + Partition.prototype.etag = ""; + + /** + * Creates a new Partition instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {google.cloud.dataplex.v1.IPartition=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Partition} Partition instance + */ + Partition.create = function create(properties) { + return new Partition(properties); + }; + + /** + * Encodes the specified Partition message. Does not implicitly {@link google.cloud.dataplex.v1.Partition.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {google.cloud.dataplex.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.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.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.values[i]); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Partition message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Partition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {google.cloud.dataplex.v1.IPartition} message Partition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Partition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Partition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Partition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Partition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Partition} Partition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Partition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Partition message. + * @function verify + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Partition.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.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Partition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Partition} Partition + */ + Partition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Partition) + return object; + var message = new $root.google.cloud.dataplex.v1.Partition(); + if (object.name != null) + message.name = String(object.name); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.dataplex.v1.Partition.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.location != null) + message.location = String(object.location); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Partition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {google.cloud.dataplex.v1.Partition} message Partition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Partition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.name = ""; + object.location = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Partition to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Partition + * @instance + * @returns {Object.} JSON object + */ + Partition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Partition + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Partition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Partition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Partition"; + }; + + return Partition; + })(); + + v1.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.cloud.dataplex.v1 + * @interface ISchema + * @property {boolean|null} [userManaged] Schema userManaged + * @property {Array.|null} [fields] Schema fields + * @property {Array.|null} [partitionFields] Schema partitionFields + * @property {google.cloud.dataplex.v1.Schema.PartitionStyle|null} [partitionStyle] Schema partitionStyle + */ + + /** + * Constructs a new Schema. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.cloud.dataplex.v1.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + this.fields = []; + this.partitionFields = []; + if (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 userManaged. + * @member {boolean} userManaged + * @memberof google.cloud.dataplex.v1.Schema + * @instance + */ + Schema.prototype.userManaged = false; + + /** + * Schema fields. + * @member {Array.} fields + * @memberof google.cloud.dataplex.v1.Schema + * @instance + */ + Schema.prototype.fields = $util.emptyArray; + + /** + * Schema partitionFields. + * @member {Array.} partitionFields + * @memberof google.cloud.dataplex.v1.Schema + * @instance + */ + Schema.prototype.partitionFields = $util.emptyArray; + + /** + * Schema partitionStyle. + * @member {google.cloud.dataplex.v1.Schema.PartitionStyle} partitionStyle + * @memberof google.cloud.dataplex.v1.Schema + * @instance + */ + Schema.prototype.partitionStyle = 0; + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Schema + * @static + * @param {google.cloud.dataplex.v1.ISchema=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.cloud.dataplex.v1.Schema.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Schema + * @static + * @param {google.cloud.dataplex.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.userManaged != null && Object.hasOwnProperty.call(message, "userManaged")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.userManaged); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.dataplex.v1.Schema.SchemaField.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partitionFields != null && message.partitionFields.length) + for (var i = 0; i < message.partitionFields.length; ++i) + $root.google.cloud.dataplex.v1.Schema.PartitionField.encode(message.partitionFields[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partitionStyle != null && Object.hasOwnProperty.call(message, "partitionStyle")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.partitionStyle); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Schema + * @static + * @param {google.cloud.dataplex.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.cloud.dataplex.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.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.cloud.dataplex.v1.Schema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userManaged = reader.bool(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.dataplex.v1.Schema.SchemaField.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.partitionFields && message.partitionFields.length)) + message.partitionFields = []; + message.partitionFields.push($root.google.cloud.dataplex.v1.Schema.PartitionField.decode(reader, reader.uint32())); + break; + } + case 4: { + message.partitionStyle = reader.int32(); + 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.cloud.dataplex.v1.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.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.cloud.dataplex.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.userManaged != null && message.hasOwnProperty("userManaged")) + if (typeof message.userManaged !== "boolean") + return "userManaged: boolean expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Schema.SchemaField.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.partitionFields != null && message.hasOwnProperty("partitionFields")) { + if (!Array.isArray(message.partitionFields)) + return "partitionFields: array expected"; + for (var i = 0; i < message.partitionFields.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Schema.PartitionField.verify(message.partitionFields[i]); + if (error) + return "partitionFields." + error; + } + } + if (message.partitionStyle != null && message.hasOwnProperty("partitionStyle")) + switch (message.partitionStyle) { + default: + return "partitionStyle: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Schema) + return object; + var message = new $root.google.cloud.dataplex.v1.Schema(); + if (object.userManaged != null) + message.userManaged = Boolean(object.userManaged); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.dataplex.v1.Schema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.Schema.fields: object expected"); + message.fields[i] = $root.google.cloud.dataplex.v1.Schema.SchemaField.fromObject(object.fields[i]); + } + } + if (object.partitionFields) { + if (!Array.isArray(object.partitionFields)) + throw TypeError(".google.cloud.dataplex.v1.Schema.partitionFields: array expected"); + message.partitionFields = []; + for (var i = 0; i < object.partitionFields.length; ++i) { + if (typeof object.partitionFields[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.Schema.partitionFields: object expected"); + message.partitionFields[i] = $root.google.cloud.dataplex.v1.Schema.PartitionField.fromObject(object.partitionFields[i]); + } + } + switch (object.partitionStyle) { + case "PARTITION_STYLE_UNSPECIFIED": + case 0: + message.partitionStyle = 0; + break; + case "HIVE_COMPATIBLE": + case 1: + message.partitionStyle = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Schema + * @static + * @param {google.cloud.dataplex.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.arrays || options.defaults) { + object.fields = []; + object.partitionFields = []; + } + if (options.defaults) { + object.userManaged = false; + object.partitionStyle = options.enums === String ? "PARTITION_STYLE_UNSPECIFIED" : 0; + } + if (message.userManaged != null && message.hasOwnProperty("userManaged")) + object.userManaged = message.userManaged; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.dataplex.v1.Schema.SchemaField.toObject(message.fields[j], options); + } + if (message.partitionFields && message.partitionFields.length) { + object.partitionFields = []; + for (var j = 0; j < message.partitionFields.length; ++j) + object.partitionFields[j] = $root.google.cloud.dataplex.v1.Schema.PartitionField.toObject(message.partitionFields[j], options); + } + if (message.partitionStyle != null && message.hasOwnProperty("partitionStyle")) + object.partitionStyle = options.enums === String ? $root.google.cloud.dataplex.v1.Schema.PartitionStyle[message.partitionStyle] : message.partitionStyle; + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.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.cloud.dataplex.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.cloud.dataplex.v1.Schema"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.Schema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} BOOLEAN=1 BOOLEAN value + * @property {number} BYTE=2 BYTE value + * @property {number} INT16=3 INT16 value + * @property {number} INT32=4 INT32 value + * @property {number} INT64=5 INT64 value + * @property {number} FLOAT=6 FLOAT value + * @property {number} DOUBLE=7 DOUBLE value + * @property {number} DECIMAL=8 DECIMAL value + * @property {number} STRING=9 STRING value + * @property {number} BINARY=10 BINARY value + * @property {number} TIMESTAMP=11 TIMESTAMP value + * @property {number} DATE=12 DATE value + * @property {number} TIME=13 TIME value + * @property {number} RECORD=14 RECORD value + * @property {number} NULL=100 NULL value + */ + Schema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BOOLEAN"] = 1; + values[valuesById[2] = "BYTE"] = 2; + values[valuesById[3] = "INT16"] = 3; + values[valuesById[4] = "INT32"] = 4; + values[valuesById[5] = "INT64"] = 5; + values[valuesById[6] = "FLOAT"] = 6; + values[valuesById[7] = "DOUBLE"] = 7; + values[valuesById[8] = "DECIMAL"] = 8; + values[valuesById[9] = "STRING"] = 9; + values[valuesById[10] = "BINARY"] = 10; + values[valuesById[11] = "TIMESTAMP"] = 11; + values[valuesById[12] = "DATE"] = 12; + values[valuesById[13] = "TIME"] = 13; + values[valuesById[14] = "RECORD"] = 14; + values[valuesById[100] = "NULL"] = 100; + return values; + })(); + + /** + * Mode enum. + * @name google.cloud.dataplex.v1.Schema.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} REQUIRED=1 REQUIRED value + * @property {number} NULLABLE=2 NULLABLE value + * @property {number} REPEATED=3 REPEATED value + */ + Schema.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUIRED"] = 1; + values[valuesById[2] = "NULLABLE"] = 2; + values[valuesById[3] = "REPEATED"] = 3; + return values; + })(); + + Schema.SchemaField = (function() { + + /** + * Properties of a SchemaField. + * @memberof google.cloud.dataplex.v1.Schema + * @interface ISchemaField + * @property {string|null} [name] SchemaField name + * @property {string|null} [description] SchemaField description + * @property {google.cloud.dataplex.v1.Schema.Type|null} [type] SchemaField type + * @property {google.cloud.dataplex.v1.Schema.Mode|null} [mode] SchemaField mode + * @property {Array.|null} [fields] SchemaField fields + */ + + /** + * Constructs a new SchemaField. + * @memberof google.cloud.dataplex.v1.Schema + * @classdesc Represents a SchemaField. + * @implements ISchemaField + * @constructor + * @param {google.cloud.dataplex.v1.Schema.ISchemaField=} [properties] Properties to set + */ + function SchemaField(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchemaField name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + */ + SchemaField.prototype.name = ""; + + /** + * SchemaField description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + */ + SchemaField.prototype.description = ""; + + /** + * SchemaField type. + * @member {google.cloud.dataplex.v1.Schema.Type} type + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + */ + SchemaField.prototype.type = 0; + + /** + * SchemaField mode. + * @member {google.cloud.dataplex.v1.Schema.Mode} mode + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + */ + SchemaField.prototype.mode = 0; + + /** + * SchemaField fields. + * @member {Array.} fields + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + */ + SchemaField.prototype.fields = $util.emptyArray; + + /** + * Creates a new SchemaField instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {google.cloud.dataplex.v1.Schema.ISchemaField=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Schema.SchemaField} SchemaField instance + */ + SchemaField.create = function create(properties) { + return new SchemaField(properties); + }; + + /** + * Encodes the specified SchemaField message. Does not implicitly {@link google.cloud.dataplex.v1.Schema.SchemaField.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {google.cloud.dataplex.v1.Schema.ISchemaField} message SchemaField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaField.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.mode); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.dataplex.v1.Schema.SchemaField.encode(message.fields[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SchemaField message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Schema.SchemaField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {google.cloud.dataplex.v1.Schema.ISchemaField} message SchemaField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Schema.SchemaField} SchemaField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaField.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Schema.SchemaField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.mode = reader.int32(); + break; + } + case 10: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.dataplex.v1.Schema.SchemaField.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Schema.SchemaField} SchemaField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaField message. + * @function verify + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaField.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 100: + break; + } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Schema.SchemaField.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a SchemaField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Schema.SchemaField} SchemaField + */ + SchemaField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Schema.SchemaField) + return object; + var message = new $root.google.cloud.dataplex.v1.Schema.SchemaField(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BOOLEAN": + case 1: + message.type = 1; + break; + case "BYTE": + case 2: + message.type = 2; + break; + case "INT16": + case 3: + message.type = 3; + break; + case "INT32": + case 4: + message.type = 4; + break; + case "INT64": + case 5: + message.type = 5; + break; + case "FLOAT": + case 6: + message.type = 6; + break; + case "DOUBLE": + case 7: + message.type = 7; + break; + case "DECIMAL": + case 8: + message.type = 8; + break; + case "STRING": + case 9: + message.type = 9; + break; + case "BINARY": + case 10: + message.type = 10; + break; + case "TIMESTAMP": + case 11: + message.type = 11; + break; + case "DATE": + case 12: + message.type = 12; + break; + case "TIME": + case 13: + message.type = 13; + break; + case "RECORD": + case 14: + message.type = 14; + break; + case "NULL": + case 100: + message.type = 100; + break; + } + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "REQUIRED": + case 1: + message.mode = 1; + break; + case "NULLABLE": + case 2: + message.mode = 2; + break; + case "REPEATED": + case 3: + message.mode = 3; + break; + } + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.dataplex.v1.Schema.SchemaField.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.Schema.SchemaField.fields: object expected"); + message.fields[i] = $root.google.cloud.dataplex.v1.Schema.SchemaField.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SchemaField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {google.cloud.dataplex.v1.Schema.SchemaField} message SchemaField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.Schema.Type[message.type] : message.type; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.dataplex.v1.Schema.Mode[message.mode] : message.mode; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.dataplex.v1.Schema.SchemaField.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this SchemaField to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @instance + * @returns {Object.} JSON object + */ + SchemaField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaField + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Schema.SchemaField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Schema.SchemaField"; + }; + + return SchemaField; + })(); + + Schema.PartitionField = (function() { + + /** + * Properties of a PartitionField. + * @memberof google.cloud.dataplex.v1.Schema + * @interface IPartitionField + * @property {string|null} [name] PartitionField name + * @property {google.cloud.dataplex.v1.Schema.Type|null} [type] PartitionField type + */ + + /** + * Constructs a new PartitionField. + * @memberof google.cloud.dataplex.v1.Schema + * @classdesc Represents a PartitionField. + * @implements IPartitionField + * @constructor + * @param {google.cloud.dataplex.v1.Schema.IPartitionField=} [properties] Properties to set + */ + function PartitionField(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]]; + } + + /** + * PartitionField name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @instance + */ + PartitionField.prototype.name = ""; + + /** + * PartitionField type. + * @member {google.cloud.dataplex.v1.Schema.Type} type + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @instance + */ + PartitionField.prototype.type = 0; + + /** + * Creates a new PartitionField instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {google.cloud.dataplex.v1.Schema.IPartitionField=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Schema.PartitionField} PartitionField instance + */ + PartitionField.create = function create(properties) { + return new PartitionField(properties); + }; + + /** + * Encodes the specified PartitionField message. Does not implicitly {@link google.cloud.dataplex.v1.Schema.PartitionField.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {google.cloud.dataplex.v1.Schema.IPartitionField} message PartitionField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionField.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); + return writer; + }; + + /** + * Encodes the specified PartitionField message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Schema.PartitionField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {google.cloud.dataplex.v1.Schema.IPartitionField} message PartitionField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Schema.PartitionField} PartitionField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionField.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Schema.PartitionField(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Schema.PartitionField} PartitionField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionField message. + * @function verify + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionField.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: + 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 100: + break; + } + return null; + }; + + /** + * Creates a PartitionField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Schema.PartitionField} PartitionField + */ + PartitionField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Schema.PartitionField) + return object; + var message = new $root.google.cloud.dataplex.v1.Schema.PartitionField(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BOOLEAN": + case 1: + message.type = 1; + break; + case "BYTE": + case 2: + message.type = 2; + break; + case "INT16": + case 3: + message.type = 3; + break; + case "INT32": + case 4: + message.type = 4; + break; + case "INT64": + case 5: + message.type = 5; + break; + case "FLOAT": + case 6: + message.type = 6; + break; + case "DOUBLE": + case 7: + message.type = 7; + break; + case "DECIMAL": + case 8: + message.type = 8; + break; + case "STRING": + case 9: + message.type = 9; + break; + case "BINARY": + case 10: + message.type = 10; + break; + case "TIMESTAMP": + case 11: + message.type = 11; + break; + case "DATE": + case 12: + message.type = 12; + break; + case "TIME": + case 13: + message.type = 13; + break; + case "RECORD": + case 14: + message.type = 14; + break; + case "NULL": + case 100: + message.type = 100; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartitionField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {google.cloud.dataplex.v1.Schema.PartitionField} message PartitionField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + 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.cloud.dataplex.v1.Schema.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this PartitionField to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @instance + * @returns {Object.} JSON object + */ + PartitionField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionField + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Schema.PartitionField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Schema.PartitionField"; + }; + + return PartitionField; + })(); + + /** + * PartitionStyle enum. + * @name google.cloud.dataplex.v1.Schema.PartitionStyle + * @enum {number} + * @property {number} PARTITION_STYLE_UNSPECIFIED=0 PARTITION_STYLE_UNSPECIFIED value + * @property {number} HIVE_COMPATIBLE=1 HIVE_COMPATIBLE value + */ + Schema.PartitionStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIVE_COMPATIBLE"] = 1; + return values; + })(); + + return Schema; + })(); + + v1.StorageFormat = (function() { + + /** + * Properties of a StorageFormat. + * @memberof google.cloud.dataplex.v1 + * @interface IStorageFormat + * @property {google.cloud.dataplex.v1.StorageFormat.Format|null} [format] StorageFormat format + * @property {google.cloud.dataplex.v1.StorageFormat.CompressionFormat|null} [compressionFormat] StorageFormat compressionFormat + * @property {string|null} [mimeType] StorageFormat mimeType + * @property {google.cloud.dataplex.v1.StorageFormat.ICsvOptions|null} [csv] StorageFormat csv + * @property {google.cloud.dataplex.v1.StorageFormat.IJsonOptions|null} [json] StorageFormat json + */ + + /** + * Constructs a new StorageFormat. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a StorageFormat. + * @implements IStorageFormat + * @constructor + * @param {google.cloud.dataplex.v1.IStorageFormat=} [properties] Properties to set + */ + function StorageFormat(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]]; + } + + /** + * StorageFormat format. + * @member {google.cloud.dataplex.v1.StorageFormat.Format} format + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + StorageFormat.prototype.format = 0; + + /** + * StorageFormat compressionFormat. + * @member {google.cloud.dataplex.v1.StorageFormat.CompressionFormat} compressionFormat + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + StorageFormat.prototype.compressionFormat = 0; + + /** + * StorageFormat mimeType. + * @member {string} mimeType + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + StorageFormat.prototype.mimeType = ""; + + /** + * StorageFormat csv. + * @member {google.cloud.dataplex.v1.StorageFormat.ICsvOptions|null|undefined} csv + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + StorageFormat.prototype.csv = null; + + /** + * StorageFormat json. + * @member {google.cloud.dataplex.v1.StorageFormat.IJsonOptions|null|undefined} json + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + StorageFormat.prototype.json = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StorageFormat options. + * @member {"csv"|"json"|undefined} options + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + */ + Object.defineProperty(StorageFormat.prototype, "options", { + get: $util.oneOfGetter($oneOfFields = ["csv", "json"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StorageFormat instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {google.cloud.dataplex.v1.IStorageFormat=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.StorageFormat} StorageFormat instance + */ + StorageFormat.create = function create(properties) { + return new StorageFormat(properties); + }; + + /** + * Encodes the specified StorageFormat message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {google.cloud.dataplex.v1.IStorageFormat} message StorageFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + if (message.compressionFormat != null && Object.hasOwnProperty.call(message, "compressionFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.compressionFormat); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.csv != null && Object.hasOwnProperty.call(message, "csv")) + $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions.encode(message.csv, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.json != null && Object.hasOwnProperty.call(message, "json")) + $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions.encode(message.json, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StorageFormat message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {google.cloud.dataplex.v1.IStorageFormat} message StorageFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageFormat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.StorageFormat} StorageFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageFormat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.StorageFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + case 2: { + message.compressionFormat = reader.int32(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 10: { + message.csv = $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions.decode(reader, reader.uint32()); + break; + } + case 11: { + message.json = $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.StorageFormat} StorageFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageFormat message. + * @function verify + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 100: + case 101: + case 200: + case 201: + case 202: + case 203: + case 204: + case 1000: + case 1001: + break; + } + if (message.compressionFormat != null && message.hasOwnProperty("compressionFormat")) + switch (message.compressionFormat) { + default: + return "compressionFormat: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.csv != null && message.hasOwnProperty("csv")) { + properties.options = 1; + { + var error = $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions.verify(message.csv); + if (error) + return "csv." + error; + } + } + if (message.json != null && message.hasOwnProperty("json")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions.verify(message.json); + if (error) + return "json." + error; + } + } + return null; + }; + + /** + * Creates a StorageFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.StorageFormat} StorageFormat + */ + StorageFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.StorageFormat) + return object; + var message = new $root.google.cloud.dataplex.v1.StorageFormat(); + switch (object.format) { + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "PARQUET": + case 1: + message.format = 1; + break; + case "AVRO": + case 2: + message.format = 2; + break; + case "ORC": + case 3: + message.format = 3; + break; + case "CSV": + case 100: + message.format = 100; + break; + case "JSON": + case 101: + message.format = 101; + break; + case "IMAGE": + case 200: + message.format = 200; + break; + case "AUDIO": + case 201: + message.format = 201; + break; + case "VIDEO": + case 202: + message.format = 202; + break; + case "TEXT": + case 203: + message.format = 203; + break; + case "TFRECORD": + case 204: + message.format = 204; + break; + case "OTHER": + case 1000: + message.format = 1000; + break; + case "UNKNOWN": + case 1001: + message.format = 1001; + break; + } + switch (object.compressionFormat) { + case "COMPRESSION_FORMAT_UNSPECIFIED": + case 0: + message.compressionFormat = 0; + break; + case "GZIP": + case 2: + message.compressionFormat = 2; + break; + case "BZIP2": + case 3: + message.compressionFormat = 3; + break; + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.csv != null) { + if (typeof object.csv !== "object") + throw TypeError(".google.cloud.dataplex.v1.StorageFormat.csv: object expected"); + message.csv = $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions.fromObject(object.csv); + } + if (object.json != null) { + if (typeof object.json !== "object") + throw TypeError(".google.cloud.dataplex.v1.StorageFormat.json: object expected"); + message.json = $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions.fromObject(object.json); + } + return message; + }; + + /** + * Creates a plain object from a StorageFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {google.cloud.dataplex.v1.StorageFormat} message StorageFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageFormat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + object.compressionFormat = options.enums === String ? "COMPRESSION_FORMAT_UNSPECIFIED" : 0; + object.mimeType = ""; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.dataplex.v1.StorageFormat.Format[message.format] : message.format; + if (message.compressionFormat != null && message.hasOwnProperty("compressionFormat")) + object.compressionFormat = options.enums === String ? $root.google.cloud.dataplex.v1.StorageFormat.CompressionFormat[message.compressionFormat] : message.compressionFormat; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.csv != null && message.hasOwnProperty("csv")) { + object.csv = $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions.toObject(message.csv, options); + if (options.oneofs) + object.options = "csv"; + } + if (message.json != null && message.hasOwnProperty("json")) { + object.json = $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions.toObject(message.json, options); + if (options.oneofs) + object.options = "json"; + } + return object; + }; + + /** + * Converts this StorageFormat to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.StorageFormat + * @instance + * @returns {Object.} JSON object + */ + StorageFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageFormat + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.StorageFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.StorageFormat"; + }; + + StorageFormat.CsvOptions = (function() { + + /** + * Properties of a CsvOptions. + * @memberof google.cloud.dataplex.v1.StorageFormat + * @interface ICsvOptions + * @property {string|null} [encoding] CsvOptions encoding + * @property {number|null} [headerRows] CsvOptions headerRows + * @property {string|null} [delimiter] CsvOptions delimiter + * @property {string|null} [quote] CsvOptions quote + */ + + /** + * Constructs a new CsvOptions. + * @memberof google.cloud.dataplex.v1.StorageFormat + * @classdesc Represents a CsvOptions. + * @implements ICsvOptions + * @constructor + * @param {google.cloud.dataplex.v1.StorageFormat.ICsvOptions=} [properties] Properties to set + */ + function CsvOptions(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]]; + } + + /** + * CsvOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @instance + */ + CsvOptions.prototype.encoding = ""; + + /** + * CsvOptions headerRows. + * @member {number} headerRows + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @instance + */ + CsvOptions.prototype.headerRows = 0; + + /** + * CsvOptions delimiter. + * @member {string} delimiter + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @instance + */ + CsvOptions.prototype.delimiter = ""; + + /** + * CsvOptions quote. + * @member {string} quote + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @instance + */ + CsvOptions.prototype.quote = ""; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.ICsvOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.StorageFormat.CsvOptions} CsvOptions instance + */ + CsvOptions.create = function create(properties) { + return new CsvOptions(properties); + }; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.CsvOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encoding); + if (message.headerRows != null && Object.hasOwnProperty.call(message, "headerRows")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.headerRows); + if (message.delimiter != null && Object.hasOwnProperty.call(message, "delimiter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.delimiter); + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.quote); + return writer; + }; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.CsvOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.StorageFormat.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encoding = reader.string(); + break; + } + case 2: { + message.headerRows = reader.int32(); + break; + } + case 3: { + message.delimiter = reader.string(); + break; + } + case 4: { + message.quote = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.StorageFormat.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + if (!$util.isInteger(message.headerRows)) + return "headerRows: integer expected"; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + if (!$util.isString(message.delimiter)) + return "delimiter: string expected"; + if (message.quote != null && message.hasOwnProperty("quote")) + if (!$util.isString(message.quote)) + return "quote: string expected"; + return null; + }; + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.StorageFormat.CsvOptions} CsvOptions + */ + CsvOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.StorageFormat.CsvOptions(); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.headerRows != null) + message.headerRows = object.headerRows | 0; + if (object.delimiter != null) + message.delimiter = String(object.delimiter); + if (object.quote != null) + message.quote = String(object.quote); + return message; + }; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.CsvOptions} message CsvOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.encoding = ""; + object.headerRows = 0; + object.delimiter = ""; + object.quote = ""; + } + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + if (message.headerRows != null && message.hasOwnProperty("headerRows")) + object.headerRows = message.headerRows; + if (message.delimiter != null && message.hasOwnProperty("delimiter")) + object.delimiter = message.delimiter; + if (message.quote != null && message.hasOwnProperty("quote")) + object.quote = message.quote; + return object; + }; + + /** + * Converts this CsvOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @instance + * @returns {Object.} JSON object + */ + CsvOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.StorageFormat.CsvOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.StorageFormat.CsvOptions"; + }; + + return CsvOptions; + })(); + + StorageFormat.JsonOptions = (function() { + + /** + * Properties of a JsonOptions. + * @memberof google.cloud.dataplex.v1.StorageFormat + * @interface IJsonOptions + * @property {string|null} [encoding] JsonOptions encoding + */ + + /** + * Constructs a new JsonOptions. + * @memberof google.cloud.dataplex.v1.StorageFormat + * @classdesc Represents a JsonOptions. + * @implements IJsonOptions + * @constructor + * @param {google.cloud.dataplex.v1.StorageFormat.IJsonOptions=} [properties] Properties to set + */ + function JsonOptions(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]]; + } + + /** + * JsonOptions encoding. + * @member {string} encoding + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @instance + */ + JsonOptions.prototype.encoding = ""; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.IJsonOptions=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.StorageFormat.JsonOptions} JsonOptions instance + */ + JsonOptions.create = function create(properties) { + return new JsonOptions(properties); + }; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.JsonOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encoding); + return writer; + }; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.StorageFormat.JsonOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.StorageFormat.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encoding = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.StorageFormat.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JsonOptions message. + * @function verify + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JsonOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.encoding != null && message.hasOwnProperty("encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + return null; + }; + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.StorageFormat.JsonOptions} JsonOptions + */ + JsonOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions) + return object; + var message = new $root.google.cloud.dataplex.v1.StorageFormat.JsonOptions(); + if (object.encoding != null) + message.encoding = String(object.encoding); + return message; + }; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {google.cloud.dataplex.v1.StorageFormat.JsonOptions} message JsonOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JsonOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.encoding = ""; + if (message.encoding != null && message.hasOwnProperty("encoding")) + object.encoding = message.encoding; + return object; + }; + + /** + * Converts this JsonOptions to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @instance + * @returns {Object.} JSON object + */ + JsonOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JsonOptions + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.StorageFormat.JsonOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JsonOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.StorageFormat.JsonOptions"; + }; + + return JsonOptions; + })(); + + /** + * Format enum. + * @name google.cloud.dataplex.v1.StorageFormat.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} PARQUET=1 PARQUET value + * @property {number} AVRO=2 AVRO value + * @property {number} ORC=3 ORC value + * @property {number} CSV=100 CSV value + * @property {number} JSON=101 JSON value + * @property {number} IMAGE=200 IMAGE value + * @property {number} AUDIO=201 AUDIO value + * @property {number} VIDEO=202 VIDEO value + * @property {number} TEXT=203 TEXT value + * @property {number} TFRECORD=204 TFRECORD value + * @property {number} OTHER=1000 OTHER value + * @property {number} UNKNOWN=1001 UNKNOWN value + */ + StorageFormat.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARQUET"] = 1; + values[valuesById[2] = "AVRO"] = 2; + values[valuesById[3] = "ORC"] = 3; + values[valuesById[100] = "CSV"] = 100; + values[valuesById[101] = "JSON"] = 101; + values[valuesById[200] = "IMAGE"] = 200; + values[valuesById[201] = "AUDIO"] = 201; + values[valuesById[202] = "VIDEO"] = 202; + values[valuesById[203] = "TEXT"] = 203; + values[valuesById[204] = "TFRECORD"] = 204; + values[valuesById[1000] = "OTHER"] = 1000; + values[valuesById[1001] = "UNKNOWN"] = 1001; + return values; + })(); + + /** + * CompressionFormat enum. + * @name google.cloud.dataplex.v1.StorageFormat.CompressionFormat + * @enum {number} + * @property {number} COMPRESSION_FORMAT_UNSPECIFIED=0 COMPRESSION_FORMAT_UNSPECIFIED value + * @property {number} GZIP=2 GZIP value + * @property {number} BZIP2=3 BZIP2 value + */ + StorageFormat.CompressionFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPRESSION_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[2] = "GZIP"] = 2; + values[valuesById[3] = "BZIP2"] = 3; + return values; + })(); + + return StorageFormat; + })(); + + /** + * StorageSystem enum. + * @name google.cloud.dataplex.v1.StorageSystem + * @enum {number} + * @property {number} STORAGE_SYSTEM_UNSPECIFIED=0 STORAGE_SYSTEM_UNSPECIFIED value + * @property {number} CLOUD_STORAGE=1 CLOUD_STORAGE value + * @property {number} BIGQUERY=2 BIGQUERY value + */ + v1.StorageSystem = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_SYSTEM_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_STORAGE"] = 1; + values[valuesById[2] = "BIGQUERY"] = 2; + return values; + })(); + + v1.DataplexService = (function() { + + /** + * Constructs a new DataplexService service. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DataplexService + * @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 DataplexService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataplexService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataplexService; + + /** + * Creates new DataplexService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataplex.v1.DataplexService + * @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 {DataplexService} RPC service. Useful where requests and/or responses are streamed. + */ + DataplexService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createLake}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CreateLakeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateLake. + * @function createLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateLakeRequest} request CreateLakeRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CreateLakeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.createLake = function createLake(request, callback) { + return this.rpcCall(createLake, $root.google.cloud.dataplex.v1.CreateLakeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateLake" }); + + /** + * Calls CreateLake. + * @function createLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateLakeRequest} request CreateLakeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateLake}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef UpdateLakeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateLake. + * @function updateLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest} request UpdateLakeRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.UpdateLakeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.updateLake = function updateLake(request, callback) { + return this.rpcCall(updateLake, $root.google.cloud.dataplex.v1.UpdateLakeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateLake" }); + + /** + * Calls UpdateLake. + * @function updateLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest} request UpdateLakeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteLake}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef DeleteLakeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteLake. + * @function deleteLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest} request DeleteLakeRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.DeleteLakeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.deleteLake = function deleteLake(request, callback) { + return this.rpcCall(deleteLake, $root.google.cloud.dataplex.v1.DeleteLakeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteLake" }); + + /** + * Calls DeleteLake. + * @function deleteLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest} request DeleteLakeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listLakes}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListLakesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListLakesResponse} [response] ListLakesResponse + */ + + /** + * Calls ListLakes. + * @function listLakes + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListLakesRequest} request ListLakesRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListLakesCallback} callback Node-style callback called with the error, if any, and ListLakesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listLakes = function listLakes(request, callback) { + return this.rpcCall(listLakes, $root.google.cloud.dataplex.v1.ListLakesRequest, $root.google.cloud.dataplex.v1.ListLakesResponse, request, callback); + }, "name", { value: "ListLakes" }); + + /** + * Calls ListLakes. + * @function listLakes + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListLakesRequest} request ListLakesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getLake}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetLakeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Lake} [response] Lake + */ + + /** + * Calls GetLake. + * @function getLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetLakeRequest} request GetLakeRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetLakeCallback} callback Node-style callback called with the error, if any, and Lake + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getLake = function getLake(request, callback) { + return this.rpcCall(getLake, $root.google.cloud.dataplex.v1.GetLakeRequest, $root.google.cloud.dataplex.v1.Lake, request, callback); + }, "name", { value: "GetLake" }); + + /** + * Calls GetLake. + * @function getLake + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetLakeRequest} request GetLakeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listLakeActions}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListLakeActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListActionsResponse} [response] ListActionsResponse + */ + + /** + * Calls ListLakeActions. + * @function listLakeActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest} request ListLakeActionsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListLakeActionsCallback} callback Node-style callback called with the error, if any, and ListActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listLakeActions = function listLakeActions(request, callback) { + return this.rpcCall(listLakeActions, $root.google.cloud.dataplex.v1.ListLakeActionsRequest, $root.google.cloud.dataplex.v1.ListActionsResponse, request, callback); + }, "name", { value: "ListLakeActions" }); + + /** + * Calls ListLakeActions. + * @function listLakeActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest} request ListLakeActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createZone}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CreateZoneCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateZone. + * @function createZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateZoneRequest} request CreateZoneRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CreateZoneCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.createZone = function createZone(request, callback) { + return this.rpcCall(createZone, $root.google.cloud.dataplex.v1.CreateZoneRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateZone" }); + + /** + * Calls CreateZone. + * @function createZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateZoneRequest} request CreateZoneRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateZone}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef UpdateZoneCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateZone. + * @function updateZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest} request UpdateZoneRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.UpdateZoneCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.updateZone = function updateZone(request, callback) { + return this.rpcCall(updateZone, $root.google.cloud.dataplex.v1.UpdateZoneRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateZone" }); + + /** + * Calls UpdateZone. + * @function updateZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest} request UpdateZoneRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteZone}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef DeleteZoneCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteZone. + * @function deleteZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest} request DeleteZoneRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.DeleteZoneCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.deleteZone = function deleteZone(request, callback) { + return this.rpcCall(deleteZone, $root.google.cloud.dataplex.v1.DeleteZoneRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteZone" }); + + /** + * Calls DeleteZone. + * @function deleteZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest} request DeleteZoneRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listZones}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListZonesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListZonesResponse} [response] ListZonesResponse + */ + + /** + * Calls ListZones. + * @function listZones + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListZonesRequest} request ListZonesRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListZonesCallback} callback Node-style callback called with the error, if any, and ListZonesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listZones = function listZones(request, callback) { + return this.rpcCall(listZones, $root.google.cloud.dataplex.v1.ListZonesRequest, $root.google.cloud.dataplex.v1.ListZonesResponse, request, callback); + }, "name", { value: "ListZones" }); + + /** + * Calls ListZones. + * @function listZones + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListZonesRequest} request ListZonesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getZone}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetZoneCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Zone} [response] Zone + */ + + /** + * Calls GetZone. + * @function getZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetZoneRequest} request GetZoneRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetZoneCallback} callback Node-style callback called with the error, if any, and Zone + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getZone = function getZone(request, callback) { + return this.rpcCall(getZone, $root.google.cloud.dataplex.v1.GetZoneRequest, $root.google.cloud.dataplex.v1.Zone, request, callback); + }, "name", { value: "GetZone" }); + + /** + * Calls GetZone. + * @function getZone + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetZoneRequest} request GetZoneRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listZoneActions}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListZoneActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListActionsResponse} [response] ListActionsResponse + */ + + /** + * Calls ListZoneActions. + * @function listZoneActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest} request ListZoneActionsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListZoneActionsCallback} callback Node-style callback called with the error, if any, and ListActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listZoneActions = function listZoneActions(request, callback) { + return this.rpcCall(listZoneActions, $root.google.cloud.dataplex.v1.ListZoneActionsRequest, $root.google.cloud.dataplex.v1.ListActionsResponse, request, callback); + }, "name", { value: "ListZoneActions" }); + + /** + * Calls ListZoneActions. + * @function listZoneActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest} request ListZoneActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createAsset}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CreateAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAsset. + * @function createAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateAssetRequest} request CreateAssetRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CreateAssetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.createAsset = function createAsset(request, callback) { + return this.rpcCall(createAsset, $root.google.cloud.dataplex.v1.CreateAssetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAsset" }); + + /** + * Calls CreateAsset. + * @function createAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateAssetRequest} request CreateAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateAsset}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef UpdateAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAsset. + * @function updateAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest} request UpdateAssetRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.UpdateAssetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.updateAsset = function updateAsset(request, callback) { + return this.rpcCall(updateAsset, $root.google.cloud.dataplex.v1.UpdateAssetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAsset" }); + + /** + * Calls UpdateAsset. + * @function updateAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest} request UpdateAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteAsset}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef DeleteAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteAsset. + * @function deleteAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest} request DeleteAssetRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.DeleteAssetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.deleteAsset = function deleteAsset(request, callback) { + return this.rpcCall(deleteAsset, $root.google.cloud.dataplex.v1.DeleteAssetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteAsset" }); + + /** + * Calls DeleteAsset. + * @function deleteAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest} request DeleteAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listAssets}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.dataplex.v1.ListAssetsRequest, $root.google.cloud.dataplex.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getAsset}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetAssetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Asset} [response] Asset + */ + + /** + * Calls GetAsset. + * @function getAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetAssetRequest} request GetAssetRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetAssetCallback} callback Node-style callback called with the error, if any, and Asset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getAsset = function getAsset(request, callback) { + return this.rpcCall(getAsset, $root.google.cloud.dataplex.v1.GetAssetRequest, $root.google.cloud.dataplex.v1.Asset, request, callback); + }, "name", { value: "GetAsset" }); + + /** + * Calls GetAsset. + * @function getAsset + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetAssetRequest} request GetAssetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listAssetActions}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListAssetActionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListActionsResponse} [response] ListActionsResponse + */ + + /** + * Calls ListAssetActions. + * @function listAssetActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest} request ListAssetActionsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListAssetActionsCallback} callback Node-style callback called with the error, if any, and ListActionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listAssetActions = function listAssetActions(request, callback) { + return this.rpcCall(listAssetActions, $root.google.cloud.dataplex.v1.ListAssetActionsRequest, $root.google.cloud.dataplex.v1.ListActionsResponse, request, callback); + }, "name", { value: "ListAssetActions" }); + + /** + * Calls ListAssetActions. + * @function listAssetActions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest} request ListAssetActionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createTask}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CreateTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTask. + * @function createTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateTaskRequest} request CreateTaskRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CreateTaskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.createTask = function createTask(request, callback) { + return this.rpcCall(createTask, $root.google.cloud.dataplex.v1.CreateTaskRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTask" }); + + /** + * Calls CreateTask. + * @function createTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateTaskRequest} request CreateTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateTask}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef UpdateTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTask. + * @function updateTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest} request UpdateTaskRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.UpdateTaskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.updateTask = function updateTask(request, callback) { + return this.rpcCall(updateTask, $root.google.cloud.dataplex.v1.UpdateTaskRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTask" }); + + /** + * Calls UpdateTask. + * @function updateTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest} request UpdateTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteTask}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef DeleteTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTask. + * @function deleteTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest} request DeleteTaskRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.DeleteTaskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.deleteTask = function deleteTask(request, callback) { + return this.rpcCall(deleteTask, $root.google.cloud.dataplex.v1.DeleteTaskRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTask" }); + + /** + * Calls DeleteTask. + * @function deleteTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest} request DeleteTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listTasks}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.dataplex.v1.ListTasksRequest, $root.google.cloud.dataplex.v1.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getTask}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.dataplex.v1.GetTaskRequest, $root.google.cloud.dataplex.v1.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listJobs}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.dataplex.v1.ListJobsRequest, $root.google.cloud.dataplex.v1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getJob}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.dataplex.v1.GetJobRequest, $root.google.cloud.dataplex.v1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|cancelJob}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CancelJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.cancelJob = function cancelJob(request, callback) { + return this.rpcCall(cancelJob, $root.google.cloud.dataplex.v1.CancelJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|createEnvironment}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef CreateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.createEnvironment = function createEnvironment(request, callback) { + return this.rpcCall(createEnvironment, $root.google.cloud.dataplex.v1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEnvironment" }); + + /** + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|updateEnvironment}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef UpdateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.updateEnvironment = function updateEnvironment(request, callback) { + return this.rpcCall(updateEnvironment, $root.google.cloud.dataplex.v1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEnvironment" }); + + /** + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|deleteEnvironment}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef DeleteEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { + return this.rpcCall(deleteEnvironment, $root.google.cloud.dataplex.v1.DeleteEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEnvironment" }); + + /** + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listEnvironments}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.dataplex.v1.ListEnvironmentsRequest, $root.google.cloud.dataplex.v1.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|getEnvironment}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.Environment} [response] Environment + */ + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.dataplex.v1.GetEnvironmentRequest, $root.google.cloud.dataplex.v1.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataplex.v1.DataplexService|listSessions}. + * @memberof google.cloud.dataplex.v1.DataplexService + * @typedef ListSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataplex.v1.ListSessionsResponse} [response] ListSessionsResponse + */ + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @param {google.cloud.dataplex.v1.DataplexService.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataplexService.prototype.listSessions = function listSessions(request, callback) { + return this.rpcCall(listSessions, $root.google.cloud.dataplex.v1.ListSessionsRequest, $root.google.cloud.dataplex.v1.ListSessionsResponse, request, callback); + }, "name", { value: "ListSessions" }); + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.cloud.dataplex.v1.DataplexService + * @instance + * @param {google.cloud.dataplex.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataplexService; + })(); + + v1.CreateLakeRequest = (function() { + + /** + * Properties of a CreateLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateLakeRequest + * @property {string|null} [parent] CreateLakeRequest parent + * @property {string|null} [lakeId] CreateLakeRequest lakeId + * @property {google.cloud.dataplex.v1.ILake|null} [lake] CreateLakeRequest lake + * @property {boolean|null} [validateOnly] CreateLakeRequest validateOnly + */ + + /** + * Constructs a new CreateLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateLakeRequest. + * @implements ICreateLakeRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateLakeRequest=} [properties] Properties to set + */ + function CreateLakeRequest(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]]; + } + + /** + * CreateLakeRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @instance + */ + CreateLakeRequest.prototype.parent = ""; + + /** + * CreateLakeRequest lakeId. + * @member {string} lakeId + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @instance + */ + CreateLakeRequest.prototype.lakeId = ""; + + /** + * CreateLakeRequest lake. + * @member {google.cloud.dataplex.v1.ILake|null|undefined} lake + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @instance + */ + CreateLakeRequest.prototype.lake = null; + + /** + * CreateLakeRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @instance + */ + CreateLakeRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateLakeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateLakeRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateLakeRequest} CreateLakeRequest instance + */ + CreateLakeRequest.create = function create(properties) { + return new CreateLakeRequest(properties); + }; + + /** + * Encodes the specified CreateLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateLakeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateLakeRequest} message CreateLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLakeRequest.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.lakeId != null && Object.hasOwnProperty.call(message, "lakeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.lakeId); + if (message.lake != null && Object.hasOwnProperty.call(message, "lake")) + $root.google.cloud.dataplex.v1.Lake.encode(message.lake, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateLakeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateLakeRequest} message CreateLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLakeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateLakeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateLakeRequest} CreateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLakeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateLakeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.lakeId = reader.string(); + break; + } + case 3: { + message.lake = $root.google.cloud.dataplex.v1.Lake.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLakeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateLakeRequest} CreateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLakeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLakeRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLakeRequest.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.lakeId != null && message.hasOwnProperty("lakeId")) + if (!$util.isString(message.lakeId)) + return "lakeId: string expected"; + if (message.lake != null && message.hasOwnProperty("lake")) { + var error = $root.google.cloud.dataplex.v1.Lake.verify(message.lake); + if (error) + return "lake." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateLakeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateLakeRequest} CreateLakeRequest + */ + CreateLakeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateLakeRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateLakeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.lakeId != null) + message.lakeId = String(object.lakeId); + if (object.lake != null) { + if (typeof object.lake !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateLakeRequest.lake: object expected"); + message.lake = $root.google.cloud.dataplex.v1.Lake.fromObject(object.lake); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateLakeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.CreateLakeRequest} message CreateLakeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLakeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.lakeId = ""; + object.lake = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.lakeId != null && message.hasOwnProperty("lakeId")) + object.lakeId = message.lakeId; + if (message.lake != null && message.hasOwnProperty("lake")) + object.lake = $root.google.cloud.dataplex.v1.Lake.toObject(message.lake, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateLakeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLakeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLakeRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateLakeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateLakeRequest"; + }; + + return CreateLakeRequest; + })(); + + v1.UpdateLakeRequest = (function() { + + /** + * Properties of an UpdateLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateLakeRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateLakeRequest updateMask + * @property {google.cloud.dataplex.v1.ILake|null} [lake] UpdateLakeRequest lake + * @property {boolean|null} [validateOnly] UpdateLakeRequest validateOnly + */ + + /** + * Constructs a new UpdateLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateLakeRequest. + * @implements IUpdateLakeRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest=} [properties] Properties to set + */ + function UpdateLakeRequest(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]]; + } + + /** + * UpdateLakeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @instance + */ + UpdateLakeRequest.prototype.updateMask = null; + + /** + * UpdateLakeRequest lake. + * @member {google.cloud.dataplex.v1.ILake|null|undefined} lake + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @instance + */ + UpdateLakeRequest.prototype.lake = null; + + /** + * UpdateLakeRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @instance + */ + UpdateLakeRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateLakeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateLakeRequest} UpdateLakeRequest instance + */ + UpdateLakeRequest.create = function create(properties) { + return new UpdateLakeRequest(properties); + }; + + /** + * Encodes the specified UpdateLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateLakeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest} message UpdateLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLakeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lake != null && Object.hasOwnProperty.call(message, "lake")) + $root.google.cloud.dataplex.v1.Lake.encode(message.lake, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateLakeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateLakeRequest} message UpdateLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateLakeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateLakeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateLakeRequest} UpdateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLakeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateLakeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.lake = $root.google.cloud.dataplex.v1.Lake.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateLakeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateLakeRequest} UpdateLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateLakeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateLakeRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateLakeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.lake != null && message.hasOwnProperty("lake")) { + var error = $root.google.cloud.dataplex.v1.Lake.verify(message.lake); + if (error) + return "lake." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateLakeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateLakeRequest} UpdateLakeRequest + */ + UpdateLakeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateLakeRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateLakeRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateLakeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.lake != null) { + if (typeof object.lake !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateLakeRequest.lake: object expected"); + message.lake = $root.google.cloud.dataplex.v1.Lake.fromObject(object.lake); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateLakeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateLakeRequest} message UpdateLakeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateLakeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.lake = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.lake != null && message.hasOwnProperty("lake")) + object.lake = $root.google.cloud.dataplex.v1.Lake.toObject(message.lake, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateLakeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateLakeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateLakeRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateLakeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateLakeRequest"; + }; + + return UpdateLakeRequest; + })(); + + v1.DeleteLakeRequest = (function() { + + /** + * Properties of a DeleteLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteLakeRequest + * @property {string|null} [name] DeleteLakeRequest name + */ + + /** + * Constructs a new DeleteLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteLakeRequest. + * @implements IDeleteLakeRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest=} [properties] Properties to set + */ + function DeleteLakeRequest(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]]; + } + + /** + * DeleteLakeRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @instance + */ + DeleteLakeRequest.prototype.name = ""; + + /** + * Creates a new DeleteLakeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteLakeRequest} DeleteLakeRequest instance + */ + DeleteLakeRequest.create = function create(properties) { + return new DeleteLakeRequest(properties); + }; + + /** + * Encodes the specified DeleteLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteLakeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest} message DeleteLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLakeRequest.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 DeleteLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteLakeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteLakeRequest} message DeleteLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLakeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteLakeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteLakeRequest} DeleteLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLakeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteLakeRequest(); + 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 DeleteLakeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteLakeRequest} DeleteLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLakeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLakeRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLakeRequest.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 DeleteLakeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteLakeRequest} DeleteLakeRequest + */ + DeleteLakeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteLakeRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteLakeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteLakeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteLakeRequest} message DeleteLakeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLakeRequest.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 DeleteLakeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLakeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLakeRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteLakeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteLakeRequest"; + }; + + return DeleteLakeRequest; + })(); + + v1.ListLakesRequest = (function() { + + /** + * Properties of a ListLakesRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListLakesRequest + * @property {string|null} [parent] ListLakesRequest parent + * @property {number|null} [pageSize] ListLakesRequest pageSize + * @property {string|null} [pageToken] ListLakesRequest pageToken + * @property {string|null} [filter] ListLakesRequest filter + * @property {string|null} [orderBy] ListLakesRequest orderBy + */ + + /** + * Constructs a new ListLakesRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListLakesRequest. + * @implements IListLakesRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListLakesRequest=} [properties] Properties to set + */ + function ListLakesRequest(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]]; + } + + /** + * ListLakesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + */ + ListLakesRequest.prototype.parent = ""; + + /** + * ListLakesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + */ + ListLakesRequest.prototype.pageSize = 0; + + /** + * ListLakesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + */ + ListLakesRequest.prototype.pageToken = ""; + + /** + * ListLakesRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + */ + ListLakesRequest.prototype.filter = ""; + + /** + * ListLakesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + */ + ListLakesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListLakesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakesRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListLakesRequest} ListLakesRequest instance + */ + ListLakesRequest.create = function create(properties) { + return new ListLakesRequest(properties); + }; + + /** + * Encodes the specified ListLakesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakesRequest} message ListLakesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListLakesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakesRequest} message ListLakesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLakesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListLakesRequest} ListLakesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListLakesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLakesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListLakesRequest} ListLakesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLakesRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLakesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListLakesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListLakesRequest} ListLakesRequest + */ + ListLakesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListLakesRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListLakesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListLakesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {google.cloud.dataplex.v1.ListLakesRequest} message ListLakesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLakesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListLakesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @instance + * @returns {Object.} JSON object + */ + ListLakesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLakesRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListLakesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLakesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListLakesRequest"; + }; + + return ListLakesRequest; + })(); + + v1.ListLakesResponse = (function() { + + /** + * Properties of a ListLakesResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListLakesResponse + * @property {Array.|null} [lakes] ListLakesResponse lakes + * @property {string|null} [nextPageToken] ListLakesResponse nextPageToken + * @property {Array.|null} [unreachableLocations] ListLakesResponse unreachableLocations + */ + + /** + * Constructs a new ListLakesResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListLakesResponse. + * @implements IListLakesResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListLakesResponse=} [properties] Properties to set + */ + function ListLakesResponse(properties) { + this.lakes = []; + this.unreachableLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLakesResponse lakes. + * @member {Array.} lakes + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @instance + */ + ListLakesResponse.prototype.lakes = $util.emptyArray; + + /** + * ListLakesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @instance + */ + ListLakesResponse.prototype.nextPageToken = ""; + + /** + * ListLakesResponse unreachableLocations. + * @member {Array.} unreachableLocations + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @instance + */ + ListLakesResponse.prototype.unreachableLocations = $util.emptyArray; + + /** + * Creates a new ListLakesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {google.cloud.dataplex.v1.IListLakesResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListLakesResponse} ListLakesResponse instance + */ + ListLakesResponse.create = function create(properties) { + return new ListLakesResponse(properties); + }; + + /** + * Encodes the specified ListLakesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {google.cloud.dataplex.v1.IListLakesResponse} message ListLakesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lakes != null && message.lakes.length) + for (var i = 0; i < message.lakes.length; ++i) + $root.google.cloud.dataplex.v1.Lake.encode(message.lakes[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); + if (message.unreachableLocations != null && message.unreachableLocations.length) + for (var i = 0; i < message.unreachableLocations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableLocations[i]); + return writer; + }; + + /** + * Encodes the specified ListLakesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {google.cloud.dataplex.v1.IListLakesResponse} message ListLakesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLakesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListLakesResponse} ListLakesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListLakesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.lakes && message.lakes.length)) + message.lakes = []; + message.lakes.push($root.google.cloud.dataplex.v1.Lake.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachableLocations && message.unreachableLocations.length)) + message.unreachableLocations = []; + message.unreachableLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLakesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListLakesResponse} ListLakesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLakesResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLakesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lakes != null && message.hasOwnProperty("lakes")) { + if (!Array.isArray(message.lakes)) + return "lakes: array expected"; + for (var i = 0; i < message.lakes.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Lake.verify(message.lakes[i]); + if (error) + return "lakes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachableLocations != null && message.hasOwnProperty("unreachableLocations")) { + if (!Array.isArray(message.unreachableLocations)) + return "unreachableLocations: array expected"; + for (var i = 0; i < message.unreachableLocations.length; ++i) + if (!$util.isString(message.unreachableLocations[i])) + return "unreachableLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ListLakesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListLakesResponse} ListLakesResponse + */ + ListLakesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListLakesResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListLakesResponse(); + if (object.lakes) { + if (!Array.isArray(object.lakes)) + throw TypeError(".google.cloud.dataplex.v1.ListLakesResponse.lakes: array expected"); + message.lakes = []; + for (var i = 0; i < object.lakes.length; ++i) { + if (typeof object.lakes[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListLakesResponse.lakes: object expected"); + message.lakes[i] = $root.google.cloud.dataplex.v1.Lake.fromObject(object.lakes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachableLocations) { + if (!Array.isArray(object.unreachableLocations)) + throw TypeError(".google.cloud.dataplex.v1.ListLakesResponse.unreachableLocations: array expected"); + message.unreachableLocations = []; + for (var i = 0; i < object.unreachableLocations.length; ++i) + message.unreachableLocations[i] = String(object.unreachableLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListLakesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {google.cloud.dataplex.v1.ListLakesResponse} message ListLakesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLakesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.lakes = []; + object.unreachableLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.lakes && message.lakes.length) { + object.lakes = []; + for (var j = 0; j < message.lakes.length; ++j) + object.lakes[j] = $root.google.cloud.dataplex.v1.Lake.toObject(message.lakes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachableLocations && message.unreachableLocations.length) { + object.unreachableLocations = []; + for (var j = 0; j < message.unreachableLocations.length; ++j) + object.unreachableLocations[j] = message.unreachableLocations[j]; + } + return object; + }; + + /** + * Converts this ListLakesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @instance + * @returns {Object.} JSON object + */ + ListLakesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLakesResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListLakesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLakesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListLakesResponse"; + }; + + return ListLakesResponse; + })(); + + v1.ListLakeActionsRequest = (function() { + + /** + * Properties of a ListLakeActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListLakeActionsRequest + * @property {string|null} [parent] ListLakeActionsRequest parent + * @property {number|null} [pageSize] ListLakeActionsRequest pageSize + * @property {string|null} [pageToken] ListLakeActionsRequest pageToken + */ + + /** + * Constructs a new ListLakeActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListLakeActionsRequest. + * @implements IListLakeActionsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest=} [properties] Properties to set + */ + function ListLakeActionsRequest(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]]; + } + + /** + * ListLakeActionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @instance + */ + ListLakeActionsRequest.prototype.parent = ""; + + /** + * ListLakeActionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @instance + */ + ListLakeActionsRequest.prototype.pageSize = 0; + + /** + * ListLakeActionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @instance + */ + ListLakeActionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLakeActionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListLakeActionsRequest} ListLakeActionsRequest instance + */ + ListLakeActionsRequest.create = function create(properties) { + return new ListLakeActionsRequest(properties); + }; + + /** + * Encodes the specified ListLakeActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListLakeActionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest} message ListLakeActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakeActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListLakeActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListLakeActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListLakeActionsRequest} message ListLakeActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLakeActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLakeActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListLakeActionsRequest} ListLakeActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakeActionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListLakeActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLakeActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListLakeActionsRequest} ListLakeActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLakeActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLakeActionsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLakeActionsRequest.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.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 ListLakeActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListLakeActionsRequest} ListLakeActionsRequest + */ + ListLakeActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListLakeActionsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListLakeActionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListLakeActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {google.cloud.dataplex.v1.ListLakeActionsRequest} message ListLakeActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLakeActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListLakeActionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLakeActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLakeActionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListLakeActionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLakeActionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListLakeActionsRequest"; + }; + + return ListLakeActionsRequest; + })(); + + v1.ListActionsResponse = (function() { + + /** + * Properties of a ListActionsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListActionsResponse + * @property {Array.|null} [actions] ListActionsResponse actions + * @property {string|null} [nextPageToken] ListActionsResponse nextPageToken + */ + + /** + * Constructs a new ListActionsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListActionsResponse. + * @implements IListActionsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListActionsResponse=} [properties] Properties to set + */ + function ListActionsResponse(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListActionsResponse actions. + * @member {Array.} actions + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @instance + */ + ListActionsResponse.prototype.actions = $util.emptyArray; + + /** + * ListActionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @instance + */ + ListActionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListActionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListActionsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListActionsResponse} ListActionsResponse instance + */ + ListActionsResponse.create = function create(properties) { + return new ListActionsResponse(properties); + }; + + /** + * Encodes the specified ListActionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListActionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListActionsResponse} message ListActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListActionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.google.cloud.dataplex.v1.Action.encode(message.actions[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 ListActionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListActionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListActionsResponse} message ListActionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListActionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListActionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListActionsResponse} ListActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListActionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListActionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.google.cloud.dataplex.v1.Action.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListActionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListActionsResponse} ListActionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListActionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListActionsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListActionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Action.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListActionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListActionsResponse} ListActionsResponse + */ + ListActionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListActionsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListActionsResponse(); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.dataplex.v1.ListActionsResponse.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListActionsResponse.actions: object expected"); + message.actions[i] = $root.google.cloud.dataplex.v1.Action.fromObject(object.actions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListActionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {google.cloud.dataplex.v1.ListActionsResponse} message ListActionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListActionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.google.cloud.dataplex.v1.Action.toObject(message.actions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListActionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListActionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListActionsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListActionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListActionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListActionsResponse"; + }; + + return ListActionsResponse; + })(); + + v1.GetLakeRequest = (function() { + + /** + * Properties of a GetLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetLakeRequest + * @property {string|null} [name] GetLakeRequest name + */ + + /** + * Constructs a new GetLakeRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetLakeRequest. + * @implements IGetLakeRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetLakeRequest=} [properties] Properties to set + */ + function GetLakeRequest(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]]; + } + + /** + * GetLakeRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @instance + */ + GetLakeRequest.prototype.name = ""; + + /** + * Creates a new GetLakeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IGetLakeRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetLakeRequest} GetLakeRequest instance + */ + GetLakeRequest.create = function create(properties) { + return new GetLakeRequest(properties); + }; + + /** + * Encodes the specified GetLakeRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetLakeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IGetLakeRequest} message GetLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLakeRequest.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 GetLakeRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetLakeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {google.cloud.dataplex.v1.IGetLakeRequest} message GetLakeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLakeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLakeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetLakeRequest} GetLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLakeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetLakeRequest(); + 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 GetLakeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetLakeRequest} GetLakeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLakeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLakeRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLakeRequest.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 GetLakeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetLakeRequest} GetLakeRequest + */ + GetLakeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetLakeRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetLakeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLakeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {google.cloud.dataplex.v1.GetLakeRequest} message GetLakeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLakeRequest.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 GetLakeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @instance + * @returns {Object.} JSON object + */ + GetLakeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLakeRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetLakeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetLakeRequest"; + }; + + return GetLakeRequest; + })(); + + v1.CreateZoneRequest = (function() { + + /** + * Properties of a CreateZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateZoneRequest + * @property {string|null} [parent] CreateZoneRequest parent + * @property {string|null} [zoneId] CreateZoneRequest zoneId + * @property {google.cloud.dataplex.v1.IZone|null} [zone] CreateZoneRequest zone + * @property {boolean|null} [validateOnly] CreateZoneRequest validateOnly + */ + + /** + * Constructs a new CreateZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateZoneRequest. + * @implements ICreateZoneRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateZoneRequest=} [properties] Properties to set + */ + function CreateZoneRequest(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]]; + } + + /** + * CreateZoneRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @instance + */ + CreateZoneRequest.prototype.parent = ""; + + /** + * CreateZoneRequest zoneId. + * @member {string} zoneId + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @instance + */ + CreateZoneRequest.prototype.zoneId = ""; + + /** + * CreateZoneRequest zone. + * @member {google.cloud.dataplex.v1.IZone|null|undefined} zone + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @instance + */ + CreateZoneRequest.prototype.zone = null; + + /** + * CreateZoneRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @instance + */ + CreateZoneRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateZoneRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateZoneRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateZoneRequest} CreateZoneRequest instance + */ + CreateZoneRequest.create = function create(properties) { + return new CreateZoneRequest(properties); + }; + + /** + * Encodes the specified CreateZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateZoneRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateZoneRequest} message CreateZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateZoneRequest.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.zoneId != null && Object.hasOwnProperty.call(message, "zoneId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zoneId); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + $root.google.cloud.dataplex.v1.Zone.encode(message.zone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateZoneRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateZoneRequest} message CreateZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateZoneRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateZoneRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateZoneRequest} CreateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateZoneRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateZoneRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.zoneId = reader.string(); + break; + } + case 3: { + message.zone = $root.google.cloud.dataplex.v1.Zone.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateZoneRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateZoneRequest} CreateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateZoneRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateZoneRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateZoneRequest.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.zoneId != null && message.hasOwnProperty("zoneId")) + if (!$util.isString(message.zoneId)) + return "zoneId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) { + var error = $root.google.cloud.dataplex.v1.Zone.verify(message.zone); + if (error) + return "zone." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateZoneRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateZoneRequest} CreateZoneRequest + */ + CreateZoneRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateZoneRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateZoneRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.zoneId != null) + message.zoneId = String(object.zoneId); + if (object.zone != null) { + if (typeof object.zone !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateZoneRequest.zone: object expected"); + message.zone = $root.google.cloud.dataplex.v1.Zone.fromObject(object.zone); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateZoneRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.CreateZoneRequest} message CreateZoneRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateZoneRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.zoneId = ""; + object.zone = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.zoneId != null && message.hasOwnProperty("zoneId")) + object.zoneId = message.zoneId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = $root.google.cloud.dataplex.v1.Zone.toObject(message.zone, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateZoneRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @instance + * @returns {Object.} JSON object + */ + CreateZoneRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateZoneRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateZoneRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateZoneRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateZoneRequest"; + }; + + return CreateZoneRequest; + })(); + + v1.UpdateZoneRequest = (function() { + + /** + * Properties of an UpdateZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateZoneRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateZoneRequest updateMask + * @property {google.cloud.dataplex.v1.IZone|null} [zone] UpdateZoneRequest zone + * @property {boolean|null} [validateOnly] UpdateZoneRequest validateOnly + */ + + /** + * Constructs a new UpdateZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateZoneRequest. + * @implements IUpdateZoneRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest=} [properties] Properties to set + */ + function UpdateZoneRequest(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]]; + } + + /** + * UpdateZoneRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @instance + */ + UpdateZoneRequest.prototype.updateMask = null; + + /** + * UpdateZoneRequest zone. + * @member {google.cloud.dataplex.v1.IZone|null|undefined} zone + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @instance + */ + UpdateZoneRequest.prototype.zone = null; + + /** + * UpdateZoneRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @instance + */ + UpdateZoneRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateZoneRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateZoneRequest} UpdateZoneRequest instance + */ + UpdateZoneRequest.create = function create(properties) { + return new UpdateZoneRequest(properties); + }; + + /** + * Encodes the specified UpdateZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateZoneRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest} message UpdateZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateZoneRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + $root.google.cloud.dataplex.v1.Zone.encode(message.zone, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateZoneRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateZoneRequest} message UpdateZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateZoneRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateZoneRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateZoneRequest} UpdateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateZoneRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateZoneRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.zone = $root.google.cloud.dataplex.v1.Zone.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateZoneRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateZoneRequest} UpdateZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateZoneRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateZoneRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateZoneRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + var error = $root.google.cloud.dataplex.v1.Zone.verify(message.zone); + if (error) + return "zone." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateZoneRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateZoneRequest} UpdateZoneRequest + */ + UpdateZoneRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateZoneRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateZoneRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateZoneRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.zone != null) { + if (typeof object.zone !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateZoneRequest.zone: object expected"); + message.zone = $root.google.cloud.dataplex.v1.Zone.fromObject(object.zone); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateZoneRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateZoneRequest} message UpdateZoneRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateZoneRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.zone = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = $root.google.cloud.dataplex.v1.Zone.toObject(message.zone, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateZoneRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateZoneRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateZoneRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateZoneRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateZoneRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateZoneRequest"; + }; + + return UpdateZoneRequest; + })(); + + v1.DeleteZoneRequest = (function() { + + /** + * Properties of a DeleteZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteZoneRequest + * @property {string|null} [name] DeleteZoneRequest name + */ + + /** + * Constructs a new DeleteZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteZoneRequest. + * @implements IDeleteZoneRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest=} [properties] Properties to set + */ + function DeleteZoneRequest(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]]; + } + + /** + * DeleteZoneRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @instance + */ + DeleteZoneRequest.prototype.name = ""; + + /** + * Creates a new DeleteZoneRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteZoneRequest} DeleteZoneRequest instance + */ + DeleteZoneRequest.create = function create(properties) { + return new DeleteZoneRequest(properties); + }; + + /** + * Encodes the specified DeleteZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteZoneRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest} message DeleteZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneRequest.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 DeleteZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteZoneRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteZoneRequest} message DeleteZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteZoneRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteZoneRequest} DeleteZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteZoneRequest(); + 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 DeleteZoneRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteZoneRequest} DeleteZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteZoneRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteZoneRequest.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 DeleteZoneRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteZoneRequest} DeleteZoneRequest + */ + DeleteZoneRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteZoneRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteZoneRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteZoneRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteZoneRequest} message DeleteZoneRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteZoneRequest.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 DeleteZoneRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteZoneRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteZoneRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteZoneRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteZoneRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteZoneRequest"; + }; + + return DeleteZoneRequest; + })(); + + v1.ListZonesRequest = (function() { + + /** + * Properties of a ListZonesRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListZonesRequest + * @property {string|null} [parent] ListZonesRequest parent + * @property {number|null} [pageSize] ListZonesRequest pageSize + * @property {string|null} [pageToken] ListZonesRequest pageToken + * @property {string|null} [filter] ListZonesRequest filter + * @property {string|null} [orderBy] ListZonesRequest orderBy + */ + + /** + * Constructs a new ListZonesRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListZonesRequest. + * @implements IListZonesRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListZonesRequest=} [properties] Properties to set + */ + function ListZonesRequest(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]]; + } + + /** + * ListZonesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.parent = ""; + + /** + * ListZonesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.pageSize = 0; + + /** + * ListZonesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.pageToken = ""; + + /** + * ListZonesRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.filter = ""; + + /** + * ListZonesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListZonesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {google.cloud.dataplex.v1.IListZonesRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListZonesRequest} ListZonesRequest instance + */ + ListZonesRequest.create = function create(properties) { + return new ListZonesRequest(properties); + }; + + /** + * Encodes the specified ListZonesRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {google.cloud.dataplex.v1.IListZonesRequest} message ListZonesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZonesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListZonesRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {google.cloud.dataplex.v1.IListZonesRequest} message ListZonesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZonesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListZonesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListZonesRequest} ListZonesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZonesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListZonesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListZonesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListZonesRequest} ListZonesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZonesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListZonesRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListZonesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListZonesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListZonesRequest} ListZonesRequest + */ + ListZonesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListZonesRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListZonesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListZonesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {google.cloud.dataplex.v1.ListZonesRequest} message ListZonesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListZonesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListZonesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @instance + * @returns {Object.} JSON object + */ + ListZonesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListZonesRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListZonesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListZonesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListZonesRequest"; + }; + + return ListZonesRequest; + })(); + + v1.ListZonesResponse = (function() { + + /** + * Properties of a ListZonesResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListZonesResponse + * @property {Array.|null} [zones] ListZonesResponse zones + * @property {string|null} [nextPageToken] ListZonesResponse nextPageToken + */ + + /** + * Constructs a new ListZonesResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListZonesResponse. + * @implements IListZonesResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListZonesResponse=} [properties] Properties to set + */ + function ListZonesResponse(properties) { + this.zones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListZonesResponse zones. + * @member {Array.} zones + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @instance + */ + ListZonesResponse.prototype.zones = $util.emptyArray; + + /** + * ListZonesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @instance + */ + ListZonesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListZonesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {google.cloud.dataplex.v1.IListZonesResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListZonesResponse} ListZonesResponse instance + */ + ListZonesResponse.create = function create(properties) { + return new ListZonesResponse(properties); + }; + + /** + * Encodes the specified ListZonesResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {google.cloud.dataplex.v1.IListZonesResponse} message ListZonesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZonesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + $root.google.cloud.dataplex.v1.Zone.encode(message.zones[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 ListZonesResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZonesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {google.cloud.dataplex.v1.IListZonesResponse} message ListZonesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZonesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListZonesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListZonesResponse} ListZonesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZonesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListZonesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push($root.google.cloud.dataplex.v1.Zone.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListZonesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListZonesResponse} ListZonesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZonesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListZonesResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListZonesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Zone.verify(message.zones[i]); + if (error) + return "zones." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListZonesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListZonesResponse} ListZonesResponse + */ + ListZonesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListZonesResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListZonesResponse(); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.dataplex.v1.ListZonesResponse.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) { + if (typeof object.zones[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListZonesResponse.zones: object expected"); + message.zones[i] = $root.google.cloud.dataplex.v1.Zone.fromObject(object.zones[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListZonesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {google.cloud.dataplex.v1.ListZonesResponse} message ListZonesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListZonesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.zones = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = $root.google.cloud.dataplex.v1.Zone.toObject(message.zones[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListZonesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @instance + * @returns {Object.} JSON object + */ + ListZonesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListZonesResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListZonesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListZonesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListZonesResponse"; + }; + + return ListZonesResponse; + })(); + + v1.ListZoneActionsRequest = (function() { + + /** + * Properties of a ListZoneActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListZoneActionsRequest + * @property {string|null} [parent] ListZoneActionsRequest parent + * @property {number|null} [pageSize] ListZoneActionsRequest pageSize + * @property {string|null} [pageToken] ListZoneActionsRequest pageToken + */ + + /** + * Constructs a new ListZoneActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListZoneActionsRequest. + * @implements IListZoneActionsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest=} [properties] Properties to set + */ + function ListZoneActionsRequest(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]]; + } + + /** + * ListZoneActionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @instance + */ + ListZoneActionsRequest.prototype.parent = ""; + + /** + * ListZoneActionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @instance + */ + ListZoneActionsRequest.prototype.pageSize = 0; + + /** + * ListZoneActionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @instance + */ + ListZoneActionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListZoneActionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListZoneActionsRequest} ListZoneActionsRequest instance + */ + ListZoneActionsRequest.create = function create(properties) { + return new ListZoneActionsRequest(properties); + }; + + /** + * Encodes the specified ListZoneActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListZoneActionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest} message ListZoneActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZoneActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListZoneActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListZoneActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListZoneActionsRequest} message ListZoneActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZoneActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListZoneActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListZoneActionsRequest} ListZoneActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZoneActionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListZoneActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListZoneActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListZoneActionsRequest} ListZoneActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZoneActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListZoneActionsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListZoneActionsRequest.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.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 ListZoneActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListZoneActionsRequest} ListZoneActionsRequest + */ + ListZoneActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListZoneActionsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListZoneActionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListZoneActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {google.cloud.dataplex.v1.ListZoneActionsRequest} message ListZoneActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListZoneActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListZoneActionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListZoneActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListZoneActionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListZoneActionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListZoneActionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListZoneActionsRequest"; + }; + + return ListZoneActionsRequest; + })(); + + v1.GetZoneRequest = (function() { + + /** + * Properties of a GetZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetZoneRequest + * @property {string|null} [name] GetZoneRequest name + */ + + /** + * Constructs a new GetZoneRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetZoneRequest. + * @implements IGetZoneRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetZoneRequest=} [properties] Properties to set + */ + function GetZoneRequest(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]]; + } + + /** + * GetZoneRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @instance + */ + GetZoneRequest.prototype.name = ""; + + /** + * Creates a new GetZoneRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IGetZoneRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetZoneRequest} GetZoneRequest instance + */ + GetZoneRequest.create = function create(properties) { + return new GetZoneRequest(properties); + }; + + /** + * Encodes the specified GetZoneRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetZoneRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IGetZoneRequest} message GetZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetZoneRequest.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 GetZoneRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetZoneRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {google.cloud.dataplex.v1.IGetZoneRequest} message GetZoneRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetZoneRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetZoneRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetZoneRequest} GetZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetZoneRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetZoneRequest(); + 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 GetZoneRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetZoneRequest} GetZoneRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetZoneRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetZoneRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetZoneRequest.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 GetZoneRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetZoneRequest} GetZoneRequest + */ + GetZoneRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetZoneRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetZoneRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetZoneRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {google.cloud.dataplex.v1.GetZoneRequest} message GetZoneRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetZoneRequest.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 GetZoneRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @instance + * @returns {Object.} JSON object + */ + GetZoneRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetZoneRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetZoneRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetZoneRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetZoneRequest"; + }; + + return GetZoneRequest; + })(); + + v1.CreateAssetRequest = (function() { + + /** + * Properties of a CreateAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateAssetRequest + * @property {string|null} [parent] CreateAssetRequest parent + * @property {string|null} [assetId] CreateAssetRequest assetId + * @property {google.cloud.dataplex.v1.IAsset|null} [asset] CreateAssetRequest asset + * @property {boolean|null} [validateOnly] CreateAssetRequest validateOnly + */ + + /** + * Constructs a new CreateAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateAssetRequest. + * @implements ICreateAssetRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateAssetRequest=} [properties] Properties to set + */ + function CreateAssetRequest(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]]; + } + + /** + * CreateAssetRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.parent = ""; + + /** + * CreateAssetRequest assetId. + * @member {string} assetId + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.assetId = ""; + + /** + * CreateAssetRequest asset. + * @member {google.cloud.dataplex.v1.IAsset|null|undefined} asset + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.asset = null; + + /** + * CreateAssetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @instance + */ + CreateAssetRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateAssetRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateAssetRequest} CreateAssetRequest instance + */ + CreateAssetRequest.create = function create(properties) { + return new CreateAssetRequest(properties); + }; + + /** + * Encodes the specified CreateAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateAssetRequest} message CreateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssetRequest.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.assetId != null && Object.hasOwnProperty.call(message, "assetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetId); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.dataplex.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateAssetRequest} message CreateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateAssetRequest} CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.assetId = reader.string(); + break; + } + case 3: { + message.asset = $root.google.cloud.dataplex.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateAssetRequest} CreateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssetRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssetRequest.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.assetId != null && message.hasOwnProperty("assetId")) + if (!$util.isString(message.assetId)) + return "assetId: string expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.dataplex.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateAssetRequest} CreateAssetRequest + */ + CreateAssetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateAssetRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateAssetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetId != null) + message.assetId = String(object.assetId); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateAssetRequest.asset: object expected"); + message.asset = $root.google.cloud.dataplex.v1.Asset.fromObject(object.asset); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.CreateAssetRequest} message CreateAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.assetId = ""; + object.asset = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetId != null && message.hasOwnProperty("assetId")) + object.assetId = message.assetId; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.dataplex.v1.Asset.toObject(message.asset, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAssetRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateAssetRequest"; + }; + + return CreateAssetRequest; + })(); + + v1.UpdateAssetRequest = (function() { + + /** + * Properties of an UpdateAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateAssetRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAssetRequest updateMask + * @property {google.cloud.dataplex.v1.IAsset|null} [asset] UpdateAssetRequest asset + * @property {boolean|null} [validateOnly] UpdateAssetRequest validateOnly + */ + + /** + * Constructs a new UpdateAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateAssetRequest. + * @implements IUpdateAssetRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest=} [properties] Properties to set + */ + function UpdateAssetRequest(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]]; + } + + /** + * UpdateAssetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @instance + */ + UpdateAssetRequest.prototype.updateMask = null; + + /** + * UpdateAssetRequest asset. + * @member {google.cloud.dataplex.v1.IAsset|null|undefined} asset + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @instance + */ + UpdateAssetRequest.prototype.asset = null; + + /** + * UpdateAssetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @instance + */ + UpdateAssetRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateAssetRequest} UpdateAssetRequest instance + */ + UpdateAssetRequest.create = function create(properties) { + return new UpdateAssetRequest(properties); + }; + + /** + * Encodes the specified UpdateAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest} message UpdateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.dataplex.v1.Asset.encode(message.asset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateAssetRequest} message UpdateAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateAssetRequest} UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateAssetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.asset = $root.google.cloud.dataplex.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateAssetRequest} UpdateAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAssetRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAssetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.dataplex.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateAssetRequest} UpdateAssetRequest + */ + UpdateAssetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateAssetRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateAssetRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateAssetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateAssetRequest.asset: object expected"); + message.asset = $root.google.cloud.dataplex.v1.Asset.fromObject(object.asset); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateAssetRequest} message UpdateAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAssetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.asset = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.dataplex.v1.Asset.toObject(message.asset, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAssetRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateAssetRequest"; + }; + + return UpdateAssetRequest; + })(); + + v1.DeleteAssetRequest = (function() { + + /** + * Properties of a DeleteAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteAssetRequest + * @property {string|null} [name] DeleteAssetRequest name + */ + + /** + * Constructs a new DeleteAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteAssetRequest. + * @implements IDeleteAssetRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest=} [properties] Properties to set + */ + function DeleteAssetRequest(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]]; + } + + /** + * DeleteAssetRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @instance + */ + DeleteAssetRequest.prototype.name = ""; + + /** + * Creates a new DeleteAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteAssetRequest} DeleteAssetRequest instance + */ + DeleteAssetRequest.create = function create(properties) { + return new DeleteAssetRequest(properties); + }; + + /** + * Encodes the specified DeleteAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest} message DeleteAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetRequest.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 DeleteAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteAssetRequest} message DeleteAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteAssetRequest} DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteAssetRequest(); + 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 DeleteAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteAssetRequest} DeleteAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAssetRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAssetRequest.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 DeleteAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteAssetRequest} DeleteAssetRequest + */ + DeleteAssetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteAssetRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteAssetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteAssetRequest} message DeleteAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAssetRequest.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 DeleteAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAssetRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteAssetRequest"; + }; + + return DeleteAssetRequest; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {string|null} [filter] ListAssetsRequest filter + * @property {string|null} [orderBy] ListAssetsRequest orderBy + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.filter = ""; + + /** + * ListAssetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {google.cloud.dataplex.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListAssetsResponse + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {google.cloud.dataplex.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {google.cloud.dataplex.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.dataplex.v1.Asset.encode(message.assets[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 ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {google.cloud.dataplex.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.dataplex.v1.Asset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Asset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListAssetsResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.dataplex.v1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.dataplex.v1.Asset.fromObject(object.assets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {google.cloud.dataplex.v1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.dataplex.v1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListAssetsResponse"; + }; + + return ListAssetsResponse; + })(); + + v1.ListAssetActionsRequest = (function() { + + /** + * Properties of a ListAssetActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListAssetActionsRequest + * @property {string|null} [parent] ListAssetActionsRequest parent + * @property {number|null} [pageSize] ListAssetActionsRequest pageSize + * @property {string|null} [pageToken] ListAssetActionsRequest pageToken + */ + + /** + * Constructs a new ListAssetActionsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListAssetActionsRequest. + * @implements IListAssetActionsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest=} [properties] Properties to set + */ + function ListAssetActionsRequest(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]]; + } + + /** + * ListAssetActionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @instance + */ + ListAssetActionsRequest.prototype.parent = ""; + + /** + * ListAssetActionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @instance + */ + ListAssetActionsRequest.prototype.pageSize = 0; + + /** + * ListAssetActionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @instance + */ + ListAssetActionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssetActionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListAssetActionsRequest} ListAssetActionsRequest instance + */ + ListAssetActionsRequest.create = function create(properties) { + return new ListAssetActionsRequest(properties); + }; + + /** + * Encodes the specified ListAssetActionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetActionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest} message ListAssetActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetActionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetActionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListAssetActionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListAssetActionsRequest} message ListAssetActionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetActionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetActionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListAssetActionsRequest} ListAssetActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetActionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListAssetActionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetActionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListAssetActionsRequest} ListAssetActionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetActionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetActionsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetActionsRequest.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.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 ListAssetActionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListAssetActionsRequest} ListAssetActionsRequest + */ + ListAssetActionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListAssetActionsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListAssetActionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListAssetActionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {google.cloud.dataplex.v1.ListAssetActionsRequest} message ListAssetActionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetActionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListAssetActionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetActionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetActionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListAssetActionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetActionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListAssetActionsRequest"; + }; + + return ListAssetActionsRequest; + })(); + + v1.GetAssetRequest = (function() { + + /** + * Properties of a GetAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetAssetRequest + * @property {string|null} [name] GetAssetRequest name + */ + + /** + * Constructs a new GetAssetRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetAssetRequest. + * @implements IGetAssetRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetAssetRequest=} [properties] Properties to set + */ + function GetAssetRequest(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]]; + } + + /** + * GetAssetRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @instance + */ + GetAssetRequest.prototype.name = ""; + + /** + * Creates a new GetAssetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IGetAssetRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetAssetRequest} GetAssetRequest instance + */ + GetAssetRequest.create = function create(properties) { + return new GetAssetRequest(properties); + }; + + /** + * Encodes the specified GetAssetRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetAssetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IGetAssetRequest} message GetAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssetRequest.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 GetAssetRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetAssetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {google.cloud.dataplex.v1.IGetAssetRequest} message GetAssetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAssetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetAssetRequest} GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetAssetRequest(); + 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 GetAssetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetAssetRequest} GetAssetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAssetRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAssetRequest.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 GetAssetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetAssetRequest} GetAssetRequest + */ + GetAssetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetAssetRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetAssetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAssetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {google.cloud.dataplex.v1.GetAssetRequest} message GetAssetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAssetRequest.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 GetAssetRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @instance + * @returns {Object.} JSON object + */ + GetAssetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAssetRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetAssetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAssetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetAssetRequest"; + }; + + return GetAssetRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.dataplex.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.dataplex.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {google.cloud.dataplex.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.dataplex.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {google.cloud.dataplex.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {google.cloud.dataplex.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.dataplex.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {google.cloud.dataplex.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.CreateTaskRequest = (function() { + + /** + * Properties of a CreateTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateTaskRequest + * @property {string|null} [parent] CreateTaskRequest parent + * @property {string|null} [taskId] CreateTaskRequest taskId + * @property {google.cloud.dataplex.v1.ITask|null} [task] CreateTaskRequest task + * @property {boolean|null} [validateOnly] CreateTaskRequest validateOnly + */ + + /** + * Constructs a new CreateTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateTaskRequest. + * @implements ICreateTaskRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateTaskRequest=} [properties] Properties to set + */ + function CreateTaskRequest(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]]; + } + + /** + * CreateTaskRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @instance + */ + CreateTaskRequest.prototype.parent = ""; + + /** + * CreateTaskRequest taskId. + * @member {string} taskId + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @instance + */ + CreateTaskRequest.prototype.taskId = ""; + + /** + * CreateTaskRequest task. + * @member {google.cloud.dataplex.v1.ITask|null|undefined} task + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @instance + */ + CreateTaskRequest.prototype.task = null; + + /** + * CreateTaskRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @instance + */ + CreateTaskRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateTaskRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateTaskRequest} CreateTaskRequest instance + */ + CreateTaskRequest.create = function create(properties) { + return new CreateTaskRequest(properties); + }; + + /** + * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTaskRequest.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.taskId != null && Object.hasOwnProperty.call(message, "taskId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.taskId); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + $root.google.cloud.dataplex.v1.Task.encode(message.task, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateTaskRequest} CreateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.taskId = reader.string(); + break; + } + case 3: { + message.task = $root.google.cloud.dataplex.v1.Task.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateTaskRequest} CreateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTaskRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTaskRequest.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.taskId != null && message.hasOwnProperty("taskId")) + if (!$util.isString(message.taskId)) + return "taskId: string expected"; + if (message.task != null && message.hasOwnProperty("task")) { + var error = $root.google.cloud.dataplex.v1.Task.verify(message.task); + if (error) + return "task." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateTaskRequest} CreateTaskRequest + */ + CreateTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateTaskRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateTaskRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.taskId != null) + message.taskId = String(object.taskId); + if (object.task != null) { + if (typeof object.task !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateTaskRequest.task: object expected"); + message.task = $root.google.cloud.dataplex.v1.Task.fromObject(object.task); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.CreateTaskRequest} message CreateTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTaskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.taskId = ""; + object.task = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.taskId != null && message.hasOwnProperty("taskId")) + object.taskId = message.taskId; + if (message.task != null && message.hasOwnProperty("task")) + object.task = $root.google.cloud.dataplex.v1.Task.toObject(message.task, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTaskRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateTaskRequest"; + }; + + return CreateTaskRequest; + })(); + + v1.UpdateTaskRequest = (function() { + + /** + * Properties of an UpdateTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateTaskRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTaskRequest updateMask + * @property {google.cloud.dataplex.v1.ITask|null} [task] UpdateTaskRequest task + * @property {boolean|null} [validateOnly] UpdateTaskRequest validateOnly + */ + + /** + * Constructs a new UpdateTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateTaskRequest. + * @implements IUpdateTaskRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest=} [properties] Properties to set + */ + function UpdateTaskRequest(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]]; + } + + /** + * UpdateTaskRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @instance + */ + UpdateTaskRequest.prototype.updateMask = null; + + /** + * UpdateTaskRequest task. + * @member {google.cloud.dataplex.v1.ITask|null|undefined} task + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @instance + */ + UpdateTaskRequest.prototype.task = null; + + /** + * UpdateTaskRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @instance + */ + UpdateTaskRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateTaskRequest} UpdateTaskRequest instance + */ + UpdateTaskRequest.create = function create(properties) { + return new UpdateTaskRequest(properties); + }; + + /** + * Encodes the specified UpdateTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest} message UpdateTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTaskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.task != null && Object.hasOwnProperty.call(message, "task")) + $root.google.cloud.dataplex.v1.Task.encode(message.task, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateTaskRequest} message UpdateTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateTaskRequest} UpdateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.task = $root.google.cloud.dataplex.v1.Task.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateTaskRequest} UpdateTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTaskRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTaskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.task != null && message.hasOwnProperty("task")) { + var error = $root.google.cloud.dataplex.v1.Task.verify(message.task); + if (error) + return "task." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateTaskRequest} UpdateTaskRequest + */ + UpdateTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateTaskRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateTaskRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateTaskRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.task != null) { + if (typeof object.task !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateTaskRequest.task: object expected"); + message.task = $root.google.cloud.dataplex.v1.Task.fromObject(object.task); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateTaskRequest} message UpdateTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTaskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.task = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.task != null && message.hasOwnProperty("task")) + object.task = $root.google.cloud.dataplex.v1.Task.toObject(message.task, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTaskRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateTaskRequest"; + }; + + return UpdateTaskRequest; + })(); + + v1.DeleteTaskRequest = (function() { + + /** + * Properties of a DeleteTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteTaskRequest + * @property {string|null} [name] DeleteTaskRequest name + */ + + /** + * Constructs a new DeleteTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteTaskRequest. + * @implements IDeleteTaskRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest=} [properties] Properties to set + */ + function DeleteTaskRequest(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]]; + } + + /** + * DeleteTaskRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @instance + */ + DeleteTaskRequest.prototype.name = ""; + + /** + * Creates a new DeleteTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteTaskRequest} DeleteTaskRequest instance + */ + DeleteTaskRequest.create = function create(properties) { + return new DeleteTaskRequest(properties); + }; + + /** + * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTaskRequest.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 DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteTaskRequest} DeleteTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteTaskRequest(); + 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 DeleteTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteTaskRequest} DeleteTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTaskRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTaskRequest.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 DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteTaskRequest} DeleteTaskRequest + */ + DeleteTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteTaskRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteTaskRequest} message DeleteTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTaskRequest.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 DeleteTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTaskRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteTaskRequest"; + }; + + return DeleteTaskRequest; + })(); + + v1.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + * @property {string|null} [filter] ListTasksRequest filter + * @property {string|null} [orderBy] ListTasksRequest orderBy + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListTasksRequest=} [properties] Properties to set + */ + function ListTasksRequest(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]]; + } + + /** + * ListTasksRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * ListTasksRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.filter = ""; + + /** + * ListTasksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.orderBy = ""; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {google.cloud.dataplex.v1.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {google.cloud.dataplex.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {google.cloud.dataplex.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListTasksRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {google.cloud.dataplex.v1.ListTasksRequest} message ListTasksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @instance + * @returns {Object.} JSON object + */ + ListTasksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListTasksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v1.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + * @property {Array.|null} [unreachableLocations] ListTasksResponse unreachableLocations + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + this.unreachableLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksResponse tasks. + * @member {Array.} tasks + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * ListTasksResponse unreachableLocations. + * @member {Array.} unreachableLocations + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.unreachableLocations = $util.emptyArray; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {google.cloud.dataplex.v1.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {google.cloud.dataplex.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tasks != null && message.tasks.length) + for (var i = 0; i < message.tasks.length; ++i) + $root.google.cloud.dataplex.v1.Task.encode(message.tasks[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); + if (message.unreachableLocations != null && message.unreachableLocations.length) + for (var i = 0; i < message.unreachableLocations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachableLocations[i]); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {google.cloud.dataplex.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.dataplex.v1.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachableLocations && message.unreachableLocations.length)) + message.unreachableLocations = []; + message.unreachableLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tasks != null && message.hasOwnProperty("tasks")) { + if (!Array.isArray(message.tasks)) + return "tasks: array expected"; + for (var i = 0; i < message.tasks.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Task.verify(message.tasks[i]); + if (error) + return "tasks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachableLocations != null && message.hasOwnProperty("unreachableLocations")) { + if (!Array.isArray(message.unreachableLocations)) + return "unreachableLocations: array expected"; + for (var i = 0; i < message.unreachableLocations.length; ++i) + if (!$util.isString(message.unreachableLocations[i])) + return "unreachableLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListTasksResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.dataplex.v1.ListTasksResponse.tasks: array expected"); + message.tasks = []; + for (var i = 0; i < object.tasks.length; ++i) { + if (typeof object.tasks[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.dataplex.v1.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachableLocations) { + if (!Array.isArray(object.unreachableLocations)) + throw TypeError(".google.cloud.dataplex.v1.ListTasksResponse.unreachableLocations: array expected"); + message.unreachableLocations = []; + for (var i = 0; i < object.unreachableLocations.length; ++i) + message.unreachableLocations[i] = String(object.unreachableLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {google.cloud.dataplex.v1.ListTasksResponse} message ListTasksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tasks = []; + object.unreachableLocations = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tasks && message.tasks.length) { + object.tasks = []; + for (var j = 0; j < message.tasks.length; ++j) + object.tasks[j] = $root.google.cloud.dataplex.v1.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachableLocations && message.unreachableLocations.length) { + object.unreachableLocations = []; + for (var j = 0; j < message.unreachableLocations.length; ++j) + object.unreachableLocations[j] = message.unreachableLocations[j]; + } + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @instance + * @returns {Object.} JSON object + */ + ListTasksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListTasksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v1.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetTaskRequest=} [properties] Properties to set + */ + function GetTaskRequest(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]]; + } + + /** + * GetTaskRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {google.cloud.dataplex.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetTaskRequest(); + 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 GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaskRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaskRequest.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 GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetTaskRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {google.cloud.dataplex.v1.GetTaskRequest} message GetTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaskRequest.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 GetTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTaskRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(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]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {google.cloud.dataplex.v1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {google.cloud.dataplex.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {google.cloud.dataplex.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetJobRequest(); + 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 GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.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 GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetJobRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {google.cloud.dataplex.v1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(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]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {google.cloud.dataplex.v1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {google.cloud.dataplex.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {google.cloud.dataplex.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.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.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 ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListJobsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {google.cloud.dataplex.v1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {google.cloud.dataplex.v1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {google.cloud.dataplex.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.dataplex.v1.Job.encode(message.jobs[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 ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {google.cloud.dataplex.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.dataplex.v1.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListJobsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.dataplex.v1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.dataplex.v1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {google.cloud.dataplex.v1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.dataplex.v1.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICancelJobRequest + * @property {string|null} [name] CancelJobRequest name + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(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]]; + } + + /** + * CancelJobRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.name = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {google.cloud.dataplex.v1.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {google.cloud.dataplex.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.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 CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {google.cloud.dataplex.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CancelJobRequest(); + 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 CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.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 CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CancelJobRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CancelJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {google.cloud.dataplex.v1.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.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 CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v1.CreateEnvironmentRequest = (function() { + + /** + * Properties of a CreateEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface ICreateEnvironmentRequest + * @property {string|null} [parent] CreateEnvironmentRequest parent + * @property {string|null} [environmentId] CreateEnvironmentRequest environmentId + * @property {google.cloud.dataplex.v1.IEnvironment|null} [environment] CreateEnvironmentRequest environment + * @property {boolean|null} [validateOnly] CreateEnvironmentRequest validateOnly + */ + + /** + * Constructs a new CreateEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a CreateEnvironmentRequest. + * @implements ICreateEnvironmentRequest + * @constructor + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest=} [properties] Properties to set + */ + function CreateEnvironmentRequest(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]]; + } + + /** + * CreateEnvironmentRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.parent = ""; + + /** + * CreateEnvironmentRequest environmentId. + * @member {string} environmentId + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.environmentId = ""; + + /** + * CreateEnvironmentRequest environment. + * @member {google.cloud.dataplex.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.environment = null; + + /** + * CreateEnvironmentRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.CreateEnvironmentRequest} CreateEnvironmentRequest instance + */ + CreateEnvironmentRequest.create = function create(properties) { + return new CreateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.CreateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.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.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environmentId); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dataplex.v1.Environment.encode(message.environment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.CreateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.CreateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.environmentId = reader.string(); + break; + } + case 3: { + message.environment = $root.google.cloud.dataplex.v1.Environment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnvironmentRequest.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.environmentId != null && message.hasOwnProperty("environmentId")) + if (!$util.isString(message.environmentId)) + return "environmentId: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dataplex.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.CreateEnvironmentRequest} CreateEnvironmentRequest + */ + CreateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.CreateEnvironmentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.CreateEnvironmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environmentId != null) + message.environmentId = String(object.environmentId); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dataplex.v1.CreateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dataplex.v1.Environment.fromObject(object.environment); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.CreateEnvironmentRequest} message CreateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.environmentId = ""; + object.environment = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + object.environmentId = message.environmentId; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dataplex.v1.Environment.toObject(message.environment, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.CreateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.CreateEnvironmentRequest"; + }; + + return CreateEnvironmentRequest; + })(); + + v1.UpdateEnvironmentRequest = (function() { + + /** + * Properties of an UpdateEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IUpdateEnvironmentRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + * @property {google.cloud.dataplex.v1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment + * @property {boolean|null} [validateOnly] UpdateEnvironmentRequest validateOnly + */ + + /** + * Constructs a new UpdateEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents an UpdateEnvironmentRequest. + * @implements IUpdateEnvironmentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest=} [properties] Properties to set + */ + function UpdateEnvironmentRequest(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]]; + } + + /** + * UpdateEnvironmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.updateMask = null; + + /** + * UpdateEnvironmentRequest environment. + * @member {google.cloud.dataplex.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.environment = null; + + /** + * UpdateEnvironmentRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + */ + UpdateEnvironmentRequest.create = function create(properties) { + return new UpdateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.dataplex.v1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.UpdateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.environment = $root.google.cloud.dataplex.v1.Environment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEnvironmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.dataplex.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + */ + UpdateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.UpdateEnvironmentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.UpdateEnvironmentRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateEnvironmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.dataplex.v1.UpdateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.dataplex.v1.Environment.fromObject(object.environment); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.environment = null; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.dataplex.v1.Environment.toObject(message.environment, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.UpdateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.UpdateEnvironmentRequest"; + }; + + return UpdateEnvironmentRequest; + })(); + + v1.DeleteEnvironmentRequest = (function() { + + /** + * Properties of a DeleteEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IDeleteEnvironmentRequest + * @property {string|null} [name] DeleteEnvironmentRequest name + */ + + /** + * Constructs a new DeleteEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a DeleteEnvironmentRequest. + * @implements IDeleteEnvironmentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest=} [properties] Properties to set + */ + function DeleteEnvironmentRequest(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]]; + } + + /** + * DeleteEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @instance + */ + DeleteEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance + */ + DeleteEnvironmentRequest.create = function create(properties) { + return new DeleteEnvironmentRequest(properties); + }; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.DeleteEnvironmentRequest(); + 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 DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + */ + DeleteEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.DeleteEnvironmentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.DeleteEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.DeleteEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.DeleteEnvironmentRequest"; + }; + + return DeleteEnvironmentRequest; + })(); + + v1.ListEnvironmentsRequest = (function() { + + /** + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + * @property {string|null} [filter] ListEnvironmentsRequest filter + * @property {string|null} [orderBy] ListEnvironmentsRequest orderBy + */ + + /** + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest=} [properties] Properties to set + */ + function ListEnvironmentsRequest(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]]; + } + + /** + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.parent = ""; + + /** + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * ListEnvironmentsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.filter = ""; + + /** + * ListEnvironmentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); + }; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListEnvironmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListEnvironmentsRequest} ListEnvironmentsRequest + */ + ListEnvironmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListEnvironmentsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListEnvironmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dataplex.v1.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListEnvironmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListEnvironmentsRequest"; + }; + + return ListEnvironmentsRequest; + })(); + + v1.ListEnvironmentsResponse = (function() { + + /** + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + */ + + /** + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListEnvironmentsResponse=} [properties] Properties to set + */ + function ListEnvironmentsResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + + /** + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListEnvironmentsResponse} ListEnvironmentsResponse instance + */ + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); + }; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dataplex.v1.Environment.encode(message.environments[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 ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListEnvironmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dataplex.v1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListEnvironmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dataplex.v1.Environment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Environment.verify(message.environments[i]); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListEnvironmentsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dataplex.v1.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dataplex.v1.Environment.fromObject(object.environments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dataplex.v1.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dataplex.v1.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListEnvironmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListEnvironmentsResponse"; + }; + + return ListEnvironmentsResponse; + })(); + + v1.GetEnvironmentRequest = (function() { + + /** + * Properties of a GetEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name + */ + + /** + * Constructs a new GetEnvironmentRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest + * @constructor + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest=} [properties] Properties to set + */ + function GetEnvironmentRequest(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]]; + } + + /** + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @instance + */ + GetEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GetEnvironmentRequest} GetEnvironmentRequest instance + */ + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); + }; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.dataplex.v1.GetEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GetEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GetEnvironmentRequest(); + 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 GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEnvironmentRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GetEnvironmentRequest} GetEnvironmentRequest + */ + GetEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GetEnvironmentRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.dataplex.v1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEnvironmentRequest.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 GetEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GetEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GetEnvironmentRequest"; + }; + + return GetEnvironmentRequest; + })(); + + v1.ListSessionsRequest = (function() { + + /** + * Properties of a ListSessionsRequest. + * @memberof google.cloud.dataplex.v1 + * @interface IListSessionsRequest + * @property {string|null} [parent] ListSessionsRequest parent + * @property {number|null} [pageSize] ListSessionsRequest pageSize + * @property {string|null} [pageToken] ListSessionsRequest pageToken + * @property {string|null} [filter] ListSessionsRequest filter + */ + + /** + * Constructs a new ListSessionsRequest. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListSessionsRequest. + * @implements IListSessionsRequest + * @constructor + * @param {google.cloud.dataplex.v1.IListSessionsRequest=} [properties] Properties to set + */ + function ListSessionsRequest(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]]; + } + + /** + * ListSessionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.parent = ""; + + /** + * ListSessionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageSize = 0; + + /** + * ListSessionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageToken = ""; + + /** + * ListSessionsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListSessionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListSessionsRequest} ListSessionsRequest instance + */ + ListSessionsRequest.create = function create(properties) { + return new ListSessionsRequest(properties); + }; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataplex.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsRequest message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListSessionsRequest} ListSessionsRequest + */ + ListSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListSessionsRequest) + return object; + var message = new $root.google.cloud.dataplex.v1.ListSessionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataplex.v1.ListSessionsRequest} message ListSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSessionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListSessionsRequest"; + }; + + return ListSessionsRequest; + })(); + + v1.ListSessionsResponse = (function() { + + /** + * Properties of a ListSessionsResponse. + * @memberof google.cloud.dataplex.v1 + * @interface IListSessionsResponse + * @property {Array.|null} [sessions] ListSessionsResponse sessions + * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken + */ + + /** + * Constructs a new ListSessionsResponse. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a ListSessionsResponse. + * @implements IListSessionsResponse + * @constructor + * @param {google.cloud.dataplex.v1.IListSessionsResponse=} [properties] Properties to set + */ + function ListSessionsResponse(properties) { + this.sessions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsResponse sessions. + * @member {Array.} sessions + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.sessions = $util.emptyArray; + + /** + * ListSessionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListSessionsResponse=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.ListSessionsResponse} ListSessionsResponse instance + */ + ListSessionsResponse.create = function create(properties) { + return new ListSessionsResponse(properties); + }; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessions != null && message.sessions.length) + for (var i = 0; i < message.sessions.length; ++i) + $root.google.cloud.dataplex.v1.Session.encode(message.sessions[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 ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.ListSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataplex.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.ListSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sessions && message.sessions.length)) + message.sessions = []; + message.sessions.push($root.google.cloud.dataplex.v1.Session.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsResponse message. + * @function verify + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessions != null && message.hasOwnProperty("sessions")) { + if (!Array.isArray(message.sessions)) + return "sessions: array expected"; + for (var i = 0; i < message.sessions.length; ++i) { + var error = $root.google.cloud.dataplex.v1.Session.verify(message.sessions[i]); + if (error) + return "sessions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.ListSessionsResponse} ListSessionsResponse + */ + ListSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.ListSessionsResponse) + return object; + var message = new $root.google.cloud.dataplex.v1.ListSessionsResponse(); + if (object.sessions) { + if (!Array.isArray(object.sessions)) + throw TypeError(".google.cloud.dataplex.v1.ListSessionsResponse.sessions: array expected"); + message.sessions = []; + for (var i = 0; i < object.sessions.length; ++i) { + if (typeof object.sessions[i] !== "object") + throw TypeError(".google.cloud.dataplex.v1.ListSessionsResponse.sessions: object expected"); + message.sessions[i] = $root.google.cloud.dataplex.v1.Session.fromObject(object.sessions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataplex.v1.ListSessionsResponse} message ListSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessions && message.sessions.length) { + object.sessions = []; + for (var j = 0; j < message.sessions.length; ++j) + object.sessions[j] = $root.google.cloud.dataplex.v1.Session.toObject(message.sessions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsResponse + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.ListSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.ListSessionsResponse"; + }; + + return ListSessionsResponse; + })(); + + v1.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.dataplex.v1 + * @interface ITask + * @property {string|null} [name] Task name + * @property {string|null} [uid] Task uid + * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Task updateTime + * @property {string|null} [description] Task description + * @property {string|null} [displayName] Task displayName + * @property {google.cloud.dataplex.v1.State|null} [state] Task state + * @property {Object.|null} [labels] Task labels + * @property {google.cloud.dataplex.v1.Task.ITriggerSpec|null} [triggerSpec] Task triggerSpec + * @property {google.cloud.dataplex.v1.Task.IExecutionSpec|null} [executionSpec] Task executionSpec + * @property {google.cloud.dataplex.v1.Task.IExecutionStatus|null} [executionStatus] Task executionStatus + * @property {google.cloud.dataplex.v1.Task.ISparkTaskConfig|null} [spark] Task spark + * @property {google.cloud.dataplex.v1.Task.INotebookTaskConfig|null} [notebook] Task notebook + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.dataplex.v1.ITask=} [properties] Properties to set + */ + function Task(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]]; + } + + /** + * Task name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.uid = ""; + + /** + * Task createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.createTime = null; + + /** + * Task updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.updateTime = null; + + /** + * Task description. + * @member {string} description + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.description = ""; + + /** + * Task displayName. + * @member {string} displayName + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.displayName = ""; + + /** + * Task state. + * @member {google.cloud.dataplex.v1.State} state + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.state = 0; + + /** + * Task labels. + * @member {Object.} labels + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.labels = $util.emptyObject; + + /** + * Task triggerSpec. + * @member {google.cloud.dataplex.v1.Task.ITriggerSpec|null|undefined} triggerSpec + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.triggerSpec = null; + + /** + * Task executionSpec. + * @member {google.cloud.dataplex.v1.Task.IExecutionSpec|null|undefined} executionSpec + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.executionSpec = null; + + /** + * Task executionStatus. + * @member {google.cloud.dataplex.v1.Task.IExecutionStatus|null|undefined} executionStatus + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.executionStatus = null; + + /** + * Task spark. + * @member {google.cloud.dataplex.v1.Task.ISparkTaskConfig|null|undefined} spark + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.spark = null; + + /** + * Task notebook. + * @member {google.cloud.dataplex.v1.Task.INotebookTaskConfig|null|undefined} notebook + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Task.prototype.notebook = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Task config. + * @member {"spark"|"notebook"|undefined} config + * @memberof google.cloud.dataplex.v1.Task + * @instance + */ + Object.defineProperty(Task.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["spark", "notebook"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {google.cloud.dataplex.v1.ITask=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.dataplex.v1.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {google.cloud.dataplex.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + 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 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.triggerSpec != null && Object.hasOwnProperty.call(message, "triggerSpec")) + $root.google.cloud.dataplex.v1.Task.TriggerSpec.encode(message.triggerSpec, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.executionSpec != null && Object.hasOwnProperty.call(message, "executionSpec")) + $root.google.cloud.dataplex.v1.Task.ExecutionSpec.encode(message.executionSpec, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.executionStatus != null && Object.hasOwnProperty.call(message, "executionStatus")) + $root.google.cloud.dataplex.v1.Task.ExecutionStatus.encode(message.executionStatus, writer.uint32(/* id 201, wireType 2 =*/1610).fork()).ldelim(); + if (message.spark != null && Object.hasOwnProperty.call(message, "spark")) + $root.google.cloud.dataplex.v1.Task.SparkTaskConfig.encode(message.spark, writer.uint32(/* id 300, wireType 2 =*/2402).fork()).ldelim(); + if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) + $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig.encode(message.notebook, writer.uint32(/* id 302, wireType 2 =*/2418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {google.cloud.dataplex.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Task message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + 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 100: { + message.triggerSpec = $root.google.cloud.dataplex.v1.Task.TriggerSpec.decode(reader, reader.uint32()); + break; + } + case 101: { + message.executionSpec = $root.google.cloud.dataplex.v1.Task.ExecutionSpec.decode(reader, reader.uint32()); + break; + } + case 201: { + message.executionStatus = $root.google.cloud.dataplex.v1.Task.ExecutionStatus.decode(reader, reader.uint32()); + break; + } + case 300: { + message.spark = $root.google.cloud.dataplex.v1.Task.SparkTaskConfig.decode(reader, reader.uint32()); + break; + } + case 302: { + message.notebook = $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Task message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Task.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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: + break; + } + 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.triggerSpec != null && message.hasOwnProperty("triggerSpec")) { + var error = $root.google.cloud.dataplex.v1.Task.TriggerSpec.verify(message.triggerSpec); + if (error) + return "triggerSpec." + error; + } + if (message.executionSpec != null && message.hasOwnProperty("executionSpec")) { + var error = $root.google.cloud.dataplex.v1.Task.ExecutionSpec.verify(message.executionSpec); + if (error) + return "executionSpec." + error; + } + if (message.executionStatus != null && message.hasOwnProperty("executionStatus")) { + var error = $root.google.cloud.dataplex.v1.Task.ExecutionStatus.verify(message.executionStatus); + if (error) + return "executionStatus." + error; + } + if (message.spark != null && message.hasOwnProperty("spark")) { + properties.config = 1; + { + var error = $root.google.cloud.dataplex.v1.Task.SparkTaskConfig.verify(message.spark); + if (error) + return "spark." + error; + } + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + if (properties.config === 1) + return "config: multiple values"; + properties.config = 1; + { + var error = $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig.verify(message.notebook); + if (error) + return "notebook." + error; + } + } + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task) + return object; + var message = new $root.google.cloud.dataplex.v1.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACTION_REQUIRED": + case 4: + message.state = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.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.triggerSpec != null) { + if (typeof object.triggerSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.triggerSpec: object expected"); + message.triggerSpec = $root.google.cloud.dataplex.v1.Task.TriggerSpec.fromObject(object.triggerSpec); + } + if (object.executionSpec != null) { + if (typeof object.executionSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.executionSpec: object expected"); + message.executionSpec = $root.google.cloud.dataplex.v1.Task.ExecutionSpec.fromObject(object.executionSpec); + } + if (object.executionStatus != null) { + if (typeof object.executionStatus !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.executionStatus: object expected"); + message.executionStatus = $root.google.cloud.dataplex.v1.Task.ExecutionStatus.fromObject(object.executionStatus); + } + if (object.spark != null) { + if (typeof object.spark !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.spark: object expected"); + message.spark = $root.google.cloud.dataplex.v1.Task.SparkTaskConfig.fromObject(object.spark); + } + if (object.notebook != null) { + if (typeof object.notebook !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.notebook: object expected"); + message.notebook = $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig.fromObject(object.notebook); + } + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {google.cloud.dataplex.v1.Task} message Task + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Task.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.triggerSpec = null; + object.executionSpec = null; + object.executionStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.State[message.state] : message.state; + 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.triggerSpec != null && message.hasOwnProperty("triggerSpec")) + object.triggerSpec = $root.google.cloud.dataplex.v1.Task.TriggerSpec.toObject(message.triggerSpec, options); + if (message.executionSpec != null && message.hasOwnProperty("executionSpec")) + object.executionSpec = $root.google.cloud.dataplex.v1.Task.ExecutionSpec.toObject(message.executionSpec, options); + if (message.executionStatus != null && message.hasOwnProperty("executionStatus")) + object.executionStatus = $root.google.cloud.dataplex.v1.Task.ExecutionStatus.toObject(message.executionStatus, options); + if (message.spark != null && message.hasOwnProperty("spark")) { + object.spark = $root.google.cloud.dataplex.v1.Task.SparkTaskConfig.toObject(message.spark, options); + if (options.oneofs) + object.config = "spark"; + } + if (message.notebook != null && message.hasOwnProperty("notebook")) { + object.notebook = $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig.toObject(message.notebook, options); + if (options.oneofs) + object.config = "notebook"; + } + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task + * @instance + * @returns {Object.} JSON object + */ + Task.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Task + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task"; + }; + + Task.InfrastructureSpec = (function() { + + /** + * Properties of an InfrastructureSpec. + * @memberof google.cloud.dataplex.v1.Task + * @interface IInfrastructureSpec + * @property {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources|null} [batch] InfrastructureSpec batch + * @property {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime|null} [containerImage] InfrastructureSpec containerImage + * @property {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork|null} [vpcNetwork] InfrastructureSpec vpcNetwork + */ + + /** + * Constructs a new InfrastructureSpec. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents an InfrastructureSpec. + * @implements IInfrastructureSpec + * @constructor + * @param {google.cloud.dataplex.v1.Task.IInfrastructureSpec=} [properties] Properties to set + */ + function InfrastructureSpec(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]]; + } + + /** + * InfrastructureSpec batch. + * @member {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources|null|undefined} batch + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + InfrastructureSpec.prototype.batch = null; + + /** + * InfrastructureSpec containerImage. + * @member {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime|null|undefined} containerImage + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + InfrastructureSpec.prototype.containerImage = null; + + /** + * InfrastructureSpec vpcNetwork. + * @member {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork|null|undefined} vpcNetwork + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + InfrastructureSpec.prototype.vpcNetwork = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InfrastructureSpec resources. + * @member {"batch"|undefined} resources + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + Object.defineProperty(InfrastructureSpec.prototype, "resources", { + get: $util.oneOfGetter($oneOfFields = ["batch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InfrastructureSpec runtime. + * @member {"containerImage"|undefined} runtime + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + Object.defineProperty(InfrastructureSpec.prototype, "runtime", { + get: $util.oneOfGetter($oneOfFields = ["containerImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InfrastructureSpec network. + * @member {"vpcNetwork"|undefined} network + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + */ + Object.defineProperty(InfrastructureSpec.prototype, "network", { + get: $util.oneOfGetter($oneOfFields = ["vpcNetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InfrastructureSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IInfrastructureSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec} InfrastructureSpec instance + */ + InfrastructureSpec.create = function create(properties) { + return new InfrastructureSpec(properties); + }; + + /** + * Encodes the specified InfrastructureSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IInfrastructureSpec} message InfrastructureSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfrastructureSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.encode(message.batch, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim(); + if (message.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.encode(message.containerImage, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) + $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.encode(message.vpcNetwork, writer.uint32(/* id 150, wireType 2 =*/1202).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InfrastructureSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IInfrastructureSpec} message InfrastructureSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InfrastructureSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec} InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfrastructureSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52: { + message.batch = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.decode(reader, reader.uint32()); + break; + } + case 101: { + message.containerImage = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.decode(reader, reader.uint32()); + break; + } + case 150: { + message.vpcNetwork = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InfrastructureSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec} InfrastructureSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InfrastructureSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InfrastructureSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InfrastructureSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.batch != null && message.hasOwnProperty("batch")) { + properties.resources = 1; + { + var error = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.verify(message.batch); + if (error) + return "batch." + error; + } + } + if (message.containerImage != null && message.hasOwnProperty("containerImage")) { + properties.runtime = 1; + { + var error = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.verify(message.containerImage); + if (error) + return "containerImage." + error; + } + } + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) { + properties.network = 1; + { + var error = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.verify(message.vpcNetwork); + if (error) + return "vpcNetwork." + error; + } + } + return null; + }; + + /** + * Creates an InfrastructureSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec} InfrastructureSpec + */ + InfrastructureSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.InfrastructureSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec(); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.batch: object expected"); + message.batch = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.fromObject(object.batch); + } + if (object.containerImage != null) { + if (typeof object.containerImage !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.containerImage: object expected"); + message.containerImage = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.fromObject(object.containerImage); + } + if (object.vpcNetwork != null) { + if (typeof object.vpcNetwork !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.vpcNetwork: object expected"); + message.vpcNetwork = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.fromObject(object.vpcNetwork); + } + return message; + }; + + /** + * Creates a plain object from an InfrastructureSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec} message InfrastructureSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InfrastructureSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.batch != null && message.hasOwnProperty("batch")) { + object.batch = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.toObject(message.batch, options); + if (options.oneofs) + object.resources = "batch"; + } + if (message.containerImage != null && message.hasOwnProperty("containerImage")) { + object.containerImage = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.toObject(message.containerImage, options); + if (options.oneofs) + object.runtime = "containerImage"; + } + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) { + object.vpcNetwork = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.toObject(message.vpcNetwork, options); + if (options.oneofs) + object.network = "vpcNetwork"; + } + return object; + }; + + /** + * Converts this InfrastructureSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @instance + * @returns {Object.} JSON object + */ + InfrastructureSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InfrastructureSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InfrastructureSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.InfrastructureSpec"; + }; + + InfrastructureSpec.BatchComputeResources = (function() { + + /** + * Properties of a BatchComputeResources. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @interface IBatchComputeResources + * @property {number|null} [executorsCount] BatchComputeResources executorsCount + * @property {number|null} [maxExecutorsCount] BatchComputeResources maxExecutorsCount + */ + + /** + * Constructs a new BatchComputeResources. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @classdesc Represents a BatchComputeResources. + * @implements IBatchComputeResources + * @constructor + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources=} [properties] Properties to set + */ + function BatchComputeResources(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]]; + } + + /** + * BatchComputeResources executorsCount. + * @member {number} executorsCount + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @instance + */ + BatchComputeResources.prototype.executorsCount = 0; + + /** + * BatchComputeResources maxExecutorsCount. + * @member {number} maxExecutorsCount + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @instance + */ + BatchComputeResources.prototype.maxExecutorsCount = 0; + + /** + * Creates a new BatchComputeResources instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources} BatchComputeResources instance + */ + BatchComputeResources.create = function create(properties) { + return new BatchComputeResources(properties); + }; + + /** + * Encodes the specified BatchComputeResources message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources} message BatchComputeResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchComputeResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executorsCount != null && Object.hasOwnProperty.call(message, "executorsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.executorsCount); + if (message.maxExecutorsCount != null && Object.hasOwnProperty.call(message, "maxExecutorsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxExecutorsCount); + return writer; + }; + + /** + * Encodes the specified BatchComputeResources message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IBatchComputeResources} message BatchComputeResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchComputeResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchComputeResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources} BatchComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchComputeResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.executorsCount = reader.int32(); + break; + } + case 2: { + message.maxExecutorsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchComputeResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources} BatchComputeResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchComputeResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchComputeResources message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchComputeResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executorsCount != null && message.hasOwnProperty("executorsCount")) + if (!$util.isInteger(message.executorsCount)) + return "executorsCount: integer expected"; + if (message.maxExecutorsCount != null && message.hasOwnProperty("maxExecutorsCount")) + if (!$util.isInteger(message.maxExecutorsCount)) + return "maxExecutorsCount: integer expected"; + return null; + }; + + /** + * Creates a BatchComputeResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources} BatchComputeResources + */ + BatchComputeResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources(); + if (object.executorsCount != null) + message.executorsCount = object.executorsCount | 0; + if (object.maxExecutorsCount != null) + message.maxExecutorsCount = object.maxExecutorsCount | 0; + return message; + }; + + /** + * Creates a plain object from a BatchComputeResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources} message BatchComputeResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchComputeResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executorsCount = 0; + object.maxExecutorsCount = 0; + } + if (message.executorsCount != null && message.hasOwnProperty("executorsCount")) + object.executorsCount = message.executorsCount; + if (message.maxExecutorsCount != null && message.hasOwnProperty("maxExecutorsCount")) + object.maxExecutorsCount = message.maxExecutorsCount; + return object; + }; + + /** + * Converts this BatchComputeResources to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @instance + * @returns {Object.} JSON object + */ + BatchComputeResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchComputeResources + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchComputeResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.InfrastructureSpec.BatchComputeResources"; + }; + + return BatchComputeResources; + })(); + + InfrastructureSpec.ContainerImageRuntime = (function() { + + /** + * Properties of a ContainerImageRuntime. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @interface IContainerImageRuntime + * @property {string|null} [image] ContainerImageRuntime image + * @property {Array.|null} [javaJars] ContainerImageRuntime javaJars + * @property {Array.|null} [pythonPackages] ContainerImageRuntime pythonPackages + * @property {Object.|null} [properties] ContainerImageRuntime properties + */ + + /** + * Constructs a new ContainerImageRuntime. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @classdesc Represents a ContainerImageRuntime. + * @implements IContainerImageRuntime + * @constructor + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime=} [properties] Properties to set + */ + function ContainerImageRuntime(properties) { + this.javaJars = []; + this.pythonPackages = []; + this.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]]; + } + + /** + * ContainerImageRuntime image. + * @member {string} image + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @instance + */ + ContainerImageRuntime.prototype.image = ""; + + /** + * ContainerImageRuntime javaJars. + * @member {Array.} javaJars + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @instance + */ + ContainerImageRuntime.prototype.javaJars = $util.emptyArray; + + /** + * ContainerImageRuntime pythonPackages. + * @member {Array.} pythonPackages + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @instance + */ + ContainerImageRuntime.prototype.pythonPackages = $util.emptyArray; + + /** + * ContainerImageRuntime properties. + * @member {Object.} properties + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @instance + */ + ContainerImageRuntime.prototype.properties = $util.emptyObject; + + /** + * Creates a new ContainerImageRuntime instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime} ContainerImageRuntime instance + */ + ContainerImageRuntime.create = function create(properties) { + return new ContainerImageRuntime(properties); + }; + + /** + * Encodes the specified ContainerImageRuntime message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime} message ContainerImageRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerImageRuntime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.image); + if (message.javaJars != null && message.javaJars.length) + for (var i = 0; i < message.javaJars.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.javaJars[i]); + if (message.pythonPackages != null && message.pythonPackages.length) + for (var i = 0; i < message.pythonPackages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonPackages[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.properties[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContainerImageRuntime message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IContainerImageRuntime} message ContainerImageRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerImageRuntime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerImageRuntime message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime} ContainerImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerImageRuntime.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = reader.string(); + break; + } + case 2: { + if (!(message.javaJars && message.javaJars.length)) + message.javaJars = []; + message.javaJars.push(reader.string()); + break; + } + case 3: { + if (!(message.pythonPackages && message.pythonPackages.length)) + message.pythonPackages = []; + message.pythonPackages.push(reader.string()); + break; + } + case 4: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerImageRuntime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime} ContainerImageRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerImageRuntime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerImageRuntime message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerImageRuntime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.javaJars != null && message.hasOwnProperty("javaJars")) { + if (!Array.isArray(message.javaJars)) + return "javaJars: array expected"; + for (var i = 0; i < message.javaJars.length; ++i) + if (!$util.isString(message.javaJars[i])) + return "javaJars: string[] expected"; + } + if (message.pythonPackages != null && message.hasOwnProperty("pythonPackages")) { + if (!Array.isArray(message.pythonPackages)) + return "pythonPackages: array expected"; + for (var i = 0; i < message.pythonPackages.length; ++i) + if (!$util.isString(message.pythonPackages[i])) + return "pythonPackages: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ContainerImageRuntime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime} ContainerImageRuntime + */ + ContainerImageRuntime.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime(); + if (object.image != null) + message.image = String(object.image); + if (object.javaJars) { + if (!Array.isArray(object.javaJars)) + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.javaJars: array expected"); + message.javaJars = []; + for (var i = 0; i < object.javaJars.length; ++i) + message.javaJars[i] = String(object.javaJars[i]); + } + if (object.pythonPackages) { + if (!Array.isArray(object.pythonPackages)) + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.pythonPackages: array expected"); + message.pythonPackages = []; + for (var i = 0; i < object.pythonPackages.length; ++i) + message.pythonPackages[i] = String(object.pythonPackages[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ContainerImageRuntime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime} message ContainerImageRuntime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerImageRuntime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.javaJars = []; + object.pythonPackages = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.image = ""; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.javaJars && message.javaJars.length) { + object.javaJars = []; + for (var j = 0; j < message.javaJars.length; ++j) + object.javaJars[j] = message.javaJars[j]; + } + if (message.pythonPackages && message.pythonPackages.length) { + object.pythonPackages = []; + for (var j = 0; j < message.pythonPackages.length; ++j) + object.pythonPackages[j] = message.pythonPackages[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + return object; + }; + + /** + * Converts this ContainerImageRuntime to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @instance + * @returns {Object.} JSON object + */ + ContainerImageRuntime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerImageRuntime + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerImageRuntime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.InfrastructureSpec.ContainerImageRuntime"; + }; + + return ContainerImageRuntime; + })(); + + InfrastructureSpec.VpcNetwork = (function() { + + /** + * Properties of a VpcNetwork. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @interface IVpcNetwork + * @property {string|null} [network] VpcNetwork network + * @property {string|null} [subNetwork] VpcNetwork subNetwork + * @property {Array.|null} [networkTags] VpcNetwork networkTags + */ + + /** + * Constructs a new VpcNetwork. + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec + * @classdesc Represents a VpcNetwork. + * @implements IVpcNetwork + * @constructor + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork=} [properties] Properties to set + */ + function VpcNetwork(properties) { + this.networkTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcNetwork network. + * @member {string|null|undefined} network + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @instance + */ + VpcNetwork.prototype.network = null; + + /** + * VpcNetwork subNetwork. + * @member {string|null|undefined} subNetwork + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @instance + */ + VpcNetwork.prototype.subNetwork = null; + + /** + * VpcNetwork networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @instance + */ + VpcNetwork.prototype.networkTags = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpcNetwork networkName. + * @member {"network"|"subNetwork"|undefined} networkName + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @instance + */ + Object.defineProperty(VpcNetwork.prototype, "networkName", { + get: $util.oneOfGetter($oneOfFields = ["network", "subNetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpcNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork} VpcNetwork instance + */ + VpcNetwork.create = function create(properties) { + return new VpcNetwork(properties); + }; + + /** + * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork} message VpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subNetwork != null && Object.hasOwnProperty.call(message, "subNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subNetwork); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.networkTags[i]); + return writer; + }; + + /** + * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.IVpcNetwork} message VpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork} VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetwork.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subNetwork = reader.string(); + break; + } + case 3: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork} VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcNetwork message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) { + properties.networkName = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.subNetwork != null && message.hasOwnProperty("subNetwork")) { + if (properties.networkName === 1) + return "networkName: multiple values"; + properties.networkName = 1; + if (!$util.isString(message.subNetwork)) + return "subNetwork: string expected"; + } + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork} VpcNetwork + */ + VpcNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork(); + if (object.network != null) + message.network = String(object.network); + if (object.subNetwork != null) + message.subNetwork = String(object.subNetwork); + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork} message VpcNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkTags = []; + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object.networkName = "network"; + } + if (message.subNetwork != null && message.hasOwnProperty("subNetwork")) { + object.subNetwork = message.subNetwork; + if (options.oneofs) + object.networkName = "subNetwork"; + } + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + return object; + }; + + /** + * Converts this VpcNetwork to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @instance + * @returns {Object.} JSON object + */ + VpcNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcNetwork + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.InfrastructureSpec.VpcNetwork"; + }; + + return VpcNetwork; + })(); + + return InfrastructureSpec; + })(); + + Task.TriggerSpec = (function() { + + /** + * Properties of a TriggerSpec. + * @memberof google.cloud.dataplex.v1.Task + * @interface ITriggerSpec + * @property {google.cloud.dataplex.v1.Task.TriggerSpec.Type|null} [type] TriggerSpec type + * @property {google.protobuf.ITimestamp|null} [startTime] TriggerSpec startTime + * @property {boolean|null} [disabled] TriggerSpec disabled + * @property {number|null} [maxRetries] TriggerSpec maxRetries + * @property {string|null} [schedule] TriggerSpec schedule + */ + + /** + * Constructs a new TriggerSpec. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents a TriggerSpec. + * @implements ITriggerSpec + * @constructor + * @param {google.cloud.dataplex.v1.Task.ITriggerSpec=} [properties] Properties to set + */ + function TriggerSpec(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]]; + } + + /** + * TriggerSpec type. + * @member {google.cloud.dataplex.v1.Task.TriggerSpec.Type} type + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + TriggerSpec.prototype.type = 0; + + /** + * TriggerSpec startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + TriggerSpec.prototype.startTime = null; + + /** + * TriggerSpec disabled. + * @member {boolean} disabled + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + TriggerSpec.prototype.disabled = false; + + /** + * TriggerSpec maxRetries. + * @member {number} maxRetries + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + TriggerSpec.prototype.maxRetries = 0; + + /** + * TriggerSpec schedule. + * @member {string|null|undefined} schedule + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + TriggerSpec.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TriggerSpec trigger. + * @member {"schedule"|undefined} trigger + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + */ + Object.defineProperty(TriggerSpec.prototype, "trigger", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TriggerSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {google.cloud.dataplex.v1.Task.ITriggerSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.TriggerSpec} TriggerSpec instance + */ + TriggerSpec.create = function create(properties) { + return new TriggerSpec(properties); + }; + + /** + * Encodes the specified TriggerSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.TriggerSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {google.cloud.dataplex.v1.Task.ITriggerSpec} message TriggerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disabled); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.maxRetries); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.schedule); + return writer; + }; + + /** + * Encodes the specified TriggerSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.TriggerSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {google.cloud.dataplex.v1.Task.ITriggerSpec} message TriggerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.TriggerSpec} TriggerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.TriggerSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.disabled = reader.bool(); + break; + } + case 7: { + message.maxRetries = reader.int32(); + break; + } + case 100: { + message.schedule = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.TriggerSpec} TriggerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) + if (!$util.isInteger(message.maxRetries)) + return "maxRetries: integer expected"; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties.trigger = 1; + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + } + return null; + }; + + /** + * Creates a TriggerSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.TriggerSpec} TriggerSpec + */ + TriggerSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.TriggerSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.TriggerSpec(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ON_DEMAND": + case 1: + message.type = 1; + break; + case "RECURRING": + case 2: + message.type = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.TriggerSpec.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.maxRetries != null) + message.maxRetries = object.maxRetries | 0; + if (object.schedule != null) + message.schedule = String(object.schedule); + return message; + }; + + /** + * Creates a plain object from a TriggerSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {google.cloud.dataplex.v1.Task.TriggerSpec} message TriggerSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disabled = false; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.startTime = null; + object.maxRetries = 0; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dataplex.v1.Task.TriggerSpec.Type[message.type] : message.type; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) + object.maxRetries = message.maxRetries; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = message.schedule; + if (options.oneofs) + object.trigger = "schedule"; + } + return object; + }; + + /** + * Converts this TriggerSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @instance + * @returns {Object.} JSON object + */ + TriggerSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.TriggerSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.TriggerSpec"; + }; + + /** + * Type enum. + * @name google.cloud.dataplex.v1.Task.TriggerSpec.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} RECURRING=2 RECURRING value + */ + TriggerSpec.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "RECURRING"] = 2; + return values; + })(); + + return TriggerSpec; + })(); + + Task.ExecutionSpec = (function() { + + /** + * Properties of an ExecutionSpec. + * @memberof google.cloud.dataplex.v1.Task + * @interface IExecutionSpec + * @property {Object.|null} [args] ExecutionSpec args + * @property {string|null} [serviceAccount] ExecutionSpec serviceAccount + * @property {string|null} [project] ExecutionSpec project + * @property {google.protobuf.IDuration|null} [maxJobExecutionLifetime] ExecutionSpec maxJobExecutionLifetime + * @property {string|null} [kmsKey] ExecutionSpec kmsKey + */ + + /** + * Constructs a new ExecutionSpec. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents an ExecutionSpec. + * @implements IExecutionSpec + * @constructor + * @param {google.cloud.dataplex.v1.Task.IExecutionSpec=} [properties] Properties to set + */ + function ExecutionSpec(properties) { + this.args = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionSpec args. + * @member {Object.} args + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + */ + ExecutionSpec.prototype.args = $util.emptyObject; + + /** + * ExecutionSpec serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + */ + ExecutionSpec.prototype.serviceAccount = ""; + + /** + * ExecutionSpec project. + * @member {string} project + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + */ + ExecutionSpec.prototype.project = ""; + + /** + * ExecutionSpec maxJobExecutionLifetime. + * @member {google.protobuf.IDuration|null|undefined} maxJobExecutionLifetime + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + */ + ExecutionSpec.prototype.maxJobExecutionLifetime = null; + + /** + * ExecutionSpec kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + */ + ExecutionSpec.prototype.kmsKey = ""; + + /** + * Creates a new ExecutionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionSpec=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.ExecutionSpec} ExecutionSpec instance + */ + ExecutionSpec.create = function create(properties) { + return new ExecutionSpec(properties); + }; + + /** + * Encodes the specified ExecutionSpec message. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionSpec} message ExecutionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.args != null && Object.hasOwnProperty.call(message, "args")) + for (var keys = Object.keys(message.args), 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.args[keys[i]]).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.project); + if (message.maxJobExecutionLifetime != null && Object.hasOwnProperty.call(message, "maxJobExecutionLifetime")) + $root.google.protobuf.Duration.encode(message.maxJobExecutionLifetime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.kmsKey); + return writer; + }; + + /** + * Encodes the specified ExecutionSpec message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionSpec} message ExecutionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.ExecutionSpec} ExecutionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.ExecutionSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + if (message.args === $util.emptyObject) + message.args = {}; + 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.args[key] = value; + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 7: { + message.project = reader.string(); + break; + } + case 8: { + message.maxJobExecutionLifetime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.kmsKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.ExecutionSpec} ExecutionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionSpec message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!$util.isObject(message.args)) + return "args: object expected"; + var key = Object.keys(message.args); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.args[key[i]])) + return "args: string{k:string} expected"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.maxJobExecutionLifetime != null && message.hasOwnProperty("maxJobExecutionLifetime")) { + var error = $root.google.protobuf.Duration.verify(message.maxJobExecutionLifetime); + if (error) + return "maxJobExecutionLifetime." + error; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + return null; + }; + + /** + * Creates an ExecutionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.ExecutionSpec} ExecutionSpec + */ + ExecutionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.ExecutionSpec) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.ExecutionSpec(); + if (object.args) { + if (typeof object.args !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.ExecutionSpec.args: object expected"); + message.args = {}; + for (var keys = Object.keys(object.args), i = 0; i < keys.length; ++i) + message.args[keys[i]] = String(object.args[keys[i]]); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.project != null) + message.project = String(object.project); + if (object.maxJobExecutionLifetime != null) { + if (typeof object.maxJobExecutionLifetime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.ExecutionSpec.maxJobExecutionLifetime: object expected"); + message.maxJobExecutionLifetime = $root.google.protobuf.Duration.fromObject(object.maxJobExecutionLifetime); + } + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + return message; + }; + + /** + * Creates a plain object from an ExecutionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {google.cloud.dataplex.v1.Task.ExecutionSpec} message ExecutionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.args = {}; + if (options.defaults) { + object.serviceAccount = ""; + object.project = ""; + object.maxJobExecutionLifetime = null; + object.kmsKey = ""; + } + var keys2; + if (message.args && (keys2 = Object.keys(message.args)).length) { + object.args = {}; + for (var j = 0; j < keys2.length; ++j) + object.args[keys2[j]] = message.args[keys2[j]]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.maxJobExecutionLifetime != null && message.hasOwnProperty("maxJobExecutionLifetime")) + object.maxJobExecutionLifetime = $root.google.protobuf.Duration.toObject(message.maxJobExecutionLifetime, options); + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + return object; + }; + + /** + * Converts this ExecutionSpec to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @instance + * @returns {Object.} JSON object + */ + ExecutionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionSpec + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.ExecutionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.ExecutionSpec"; + }; + + return ExecutionSpec; + })(); + + Task.SparkTaskConfig = (function() { + + /** + * Properties of a SparkTaskConfig. + * @memberof google.cloud.dataplex.v1.Task + * @interface ISparkTaskConfig + * @property {string|null} [mainJarFileUri] SparkTaskConfig mainJarFileUri + * @property {string|null} [mainClass] SparkTaskConfig mainClass + * @property {string|null} [pythonScriptFile] SparkTaskConfig pythonScriptFile + * @property {string|null} [sqlScriptFile] SparkTaskConfig sqlScriptFile + * @property {string|null} [sqlScript] SparkTaskConfig sqlScript + * @property {Array.|null} [fileUris] SparkTaskConfig fileUris + * @property {Array.|null} [archiveUris] SparkTaskConfig archiveUris + * @property {google.cloud.dataplex.v1.Task.IInfrastructureSpec|null} [infrastructureSpec] SparkTaskConfig infrastructureSpec + */ + + /** + * Constructs a new SparkTaskConfig. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents a SparkTaskConfig. + * @implements ISparkTaskConfig + * @constructor + * @param {google.cloud.dataplex.v1.Task.ISparkTaskConfig=} [properties] Properties to set + */ + function SparkTaskConfig(properties) { + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkTaskConfig mainJarFileUri. + * @member {string|null|undefined} mainJarFileUri + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.mainJarFileUri = null; + + /** + * SparkTaskConfig mainClass. + * @member {string|null|undefined} mainClass + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.mainClass = null; + + /** + * SparkTaskConfig pythonScriptFile. + * @member {string|null|undefined} pythonScriptFile + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.pythonScriptFile = null; + + /** + * SparkTaskConfig sqlScriptFile. + * @member {string|null|undefined} sqlScriptFile + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.sqlScriptFile = null; + + /** + * SparkTaskConfig sqlScript. + * @member {string|null|undefined} sqlScript + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.sqlScript = null; + + /** + * SparkTaskConfig fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.fileUris = $util.emptyArray; + + /** + * SparkTaskConfig archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.archiveUris = $util.emptyArray; + + /** + * SparkTaskConfig infrastructureSpec. + * @member {google.cloud.dataplex.v1.Task.IInfrastructureSpec|null|undefined} infrastructureSpec + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + SparkTaskConfig.prototype.infrastructureSpec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SparkTaskConfig driver. + * @member {"mainJarFileUri"|"mainClass"|"pythonScriptFile"|"sqlScriptFile"|"sqlScript"|undefined} driver + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + */ + Object.defineProperty(SparkTaskConfig.prototype, "driver", { + get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass", "pythonScriptFile", "sqlScriptFile", "sqlScript"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SparkTaskConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.ISparkTaskConfig=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.SparkTaskConfig} SparkTaskConfig instance + */ + SparkTaskConfig.create = function create(properties) { + return new SparkTaskConfig(properties); + }; + + /** + * Encodes the specified SparkTaskConfig message. Does not implicitly {@link google.cloud.dataplex.v1.Task.SparkTaskConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.ISparkTaskConfig} message SparkTaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkTaskConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.archiveUris[i]); + if (message.infrastructureSpec != null && Object.hasOwnProperty.call(message, "infrastructureSpec")) + $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.encode(message.infrastructureSpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.mainJarFileUri); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.mainClass); + if (message.pythonScriptFile != null && Object.hasOwnProperty.call(message, "pythonScriptFile")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.pythonScriptFile); + if (message.sqlScriptFile != null && Object.hasOwnProperty.call(message, "sqlScriptFile")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.sqlScriptFile); + if (message.sqlScript != null && Object.hasOwnProperty.call(message, "sqlScript")) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.sqlScript); + return writer; + }; + + /** + * Encodes the specified SparkTaskConfig message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.SparkTaskConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.ISparkTaskConfig} message SparkTaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkTaskConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkTaskConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.SparkTaskConfig} SparkTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkTaskConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.SparkTaskConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100: { + message.mainJarFileUri = reader.string(); + break; + } + case 101: { + message.mainClass = reader.string(); + break; + } + case 102: { + message.pythonScriptFile = reader.string(); + break; + } + case 104: { + message.sqlScriptFile = reader.string(); + break; + } + case 105: { + message.sqlScript = reader.string(); + break; + } + case 3: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 6: { + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkTaskConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.SparkTaskConfig} SparkTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkTaskConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkTaskConfig message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkTaskConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + properties.driver = 1; + if (!$util.isString(message.mainJarFileUri)) + return "mainJarFileUri: string expected"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.mainClass)) + return "mainClass: string expected"; + } + if (message.pythonScriptFile != null && message.hasOwnProperty("pythonScriptFile")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.pythonScriptFile)) + return "pythonScriptFile: string expected"; + } + if (message.sqlScriptFile != null && message.hasOwnProperty("sqlScriptFile")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.sqlScriptFile)) + return "sqlScriptFile: string expected"; + } + if (message.sqlScript != null && message.hasOwnProperty("sqlScript")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.sqlScript)) + return "sqlScript: string expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) { + var error = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.verify(message.infrastructureSpec); + if (error) + return "infrastructureSpec." + error; + } + return null; + }; + + /** + * Creates a SparkTaskConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.SparkTaskConfig} SparkTaskConfig + */ + SparkTaskConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.SparkTaskConfig) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.SparkTaskConfig(); + if (object.mainJarFileUri != null) + message.mainJarFileUri = String(object.mainJarFileUri); + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + if (object.pythonScriptFile != null) + message.pythonScriptFile = String(object.pythonScriptFile); + if (object.sqlScriptFile != null) + message.sqlScriptFile = String(object.sqlScriptFile); + if (object.sqlScript != null) + message.sqlScript = String(object.sqlScript); + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataplex.v1.Task.SparkTaskConfig.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataplex.v1.Task.SparkTaskConfig.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.infrastructureSpec != null) { + if (typeof object.infrastructureSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.SparkTaskConfig.infrastructureSpec: object expected"); + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.fromObject(object.infrastructureSpec); + } + return message; + }; + + /** + * Creates a plain object from a SparkTaskConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.SparkTaskConfig} message SparkTaskConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkTaskConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fileUris = []; + object.archiveUris = []; + } + if (options.defaults) + object.infrastructureSpec = null; + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) + object.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.toObject(message.infrastructureSpec, options); + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + object.mainJarFileUri = message.mainJarFileUri; + if (options.oneofs) + object.driver = "mainJarFileUri"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + object.mainClass = message.mainClass; + if (options.oneofs) + object.driver = "mainClass"; + } + if (message.pythonScriptFile != null && message.hasOwnProperty("pythonScriptFile")) { + object.pythonScriptFile = message.pythonScriptFile; + if (options.oneofs) + object.driver = "pythonScriptFile"; + } + if (message.sqlScriptFile != null && message.hasOwnProperty("sqlScriptFile")) { + object.sqlScriptFile = message.sqlScriptFile; + if (options.oneofs) + object.driver = "sqlScriptFile"; + } + if (message.sqlScript != null && message.hasOwnProperty("sqlScript")) { + object.sqlScript = message.sqlScript; + if (options.oneofs) + object.driver = "sqlScript"; + } + return object; + }; + + /** + * Converts this SparkTaskConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @instance + * @returns {Object.} JSON object + */ + SparkTaskConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkTaskConfig + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.SparkTaskConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkTaskConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.SparkTaskConfig"; + }; + + return SparkTaskConfig; + })(); + + Task.NotebookTaskConfig = (function() { + + /** + * Properties of a NotebookTaskConfig. + * @memberof google.cloud.dataplex.v1.Task + * @interface INotebookTaskConfig + * @property {string|null} [notebook] NotebookTaskConfig notebook + * @property {google.cloud.dataplex.v1.Task.IInfrastructureSpec|null} [infrastructureSpec] NotebookTaskConfig infrastructureSpec + * @property {Array.|null} [fileUris] NotebookTaskConfig fileUris + * @property {Array.|null} [archiveUris] NotebookTaskConfig archiveUris + */ + + /** + * Constructs a new NotebookTaskConfig. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents a NotebookTaskConfig. + * @implements INotebookTaskConfig + * @constructor + * @param {google.cloud.dataplex.v1.Task.INotebookTaskConfig=} [properties] Properties to set + */ + function NotebookTaskConfig(properties) { + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotebookTaskConfig notebook. + * @member {string} notebook + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @instance + */ + NotebookTaskConfig.prototype.notebook = ""; + + /** + * NotebookTaskConfig infrastructureSpec. + * @member {google.cloud.dataplex.v1.Task.IInfrastructureSpec|null|undefined} infrastructureSpec + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @instance + */ + NotebookTaskConfig.prototype.infrastructureSpec = null; + + /** + * NotebookTaskConfig fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @instance + */ + NotebookTaskConfig.prototype.fileUris = $util.emptyArray; + + /** + * NotebookTaskConfig archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @instance + */ + NotebookTaskConfig.prototype.archiveUris = $util.emptyArray; + + /** + * Creates a new NotebookTaskConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.INotebookTaskConfig=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.NotebookTaskConfig} NotebookTaskConfig instance + */ + NotebookTaskConfig.create = function create(properties) { + return new NotebookTaskConfig(properties); + }; + + /** + * Encodes the specified NotebookTaskConfig message. Does not implicitly {@link google.cloud.dataplex.v1.Task.NotebookTaskConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.INotebookTaskConfig} message NotebookTaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookTaskConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.infrastructureSpec != null && Object.hasOwnProperty.call(message, "infrastructureSpec")) + $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.encode(message.infrastructureSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.notebook); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified NotebookTaskConfig message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.NotebookTaskConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.INotebookTaskConfig} message NotebookTaskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookTaskConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotebookTaskConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.NotebookTaskConfig} NotebookTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookTaskConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.notebook = reader.string(); + break; + } + case 3: { + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotebookTaskConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.NotebookTaskConfig} NotebookTaskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookTaskConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotebookTaskConfig message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotebookTaskConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notebook != null && message.hasOwnProperty("notebook")) + if (!$util.isString(message.notebook)) + return "notebook: string expected"; + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) { + var error = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.verify(message.infrastructureSpec); + if (error) + return "infrastructureSpec." + error; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a NotebookTaskConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.NotebookTaskConfig} NotebookTaskConfig + */ + NotebookTaskConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.NotebookTaskConfig(); + if (object.notebook != null) + message.notebook = String(object.notebook); + if (object.infrastructureSpec != null) { + if (typeof object.infrastructureSpec !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.NotebookTaskConfig.infrastructureSpec: object expected"); + message.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.fromObject(object.infrastructureSpec); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataplex.v1.Task.NotebookTaskConfig.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataplex.v1.Task.NotebookTaskConfig.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a NotebookTaskConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {google.cloud.dataplex.v1.Task.NotebookTaskConfig} message NotebookTaskConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotebookTaskConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fileUris = []; + object.archiveUris = []; + } + if (options.defaults) { + object.infrastructureSpec = null; + object.notebook = ""; + } + if (message.infrastructureSpec != null && message.hasOwnProperty("infrastructureSpec")) + object.infrastructureSpec = $root.google.cloud.dataplex.v1.Task.InfrastructureSpec.toObject(message.infrastructureSpec, options); + if (message.notebook != null && message.hasOwnProperty("notebook")) + object.notebook = message.notebook; + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this NotebookTaskConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @instance + * @returns {Object.} JSON object + */ + NotebookTaskConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotebookTaskConfig + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.NotebookTaskConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotebookTaskConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.NotebookTaskConfig"; + }; + + return NotebookTaskConfig; + })(); + + Task.ExecutionStatus = (function() { + + /** + * Properties of an ExecutionStatus. + * @memberof google.cloud.dataplex.v1.Task + * @interface IExecutionStatus + * @property {google.protobuf.ITimestamp|null} [updateTime] ExecutionStatus updateTime + * @property {google.cloud.dataplex.v1.IJob|null} [latestJob] ExecutionStatus latestJob + */ + + /** + * Constructs a new ExecutionStatus. + * @memberof google.cloud.dataplex.v1.Task + * @classdesc Represents an ExecutionStatus. + * @implements IExecutionStatus + * @constructor + * @param {google.cloud.dataplex.v1.Task.IExecutionStatus=} [properties] Properties to set + */ + function ExecutionStatus(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]]; + } + + /** + * ExecutionStatus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @instance + */ + ExecutionStatus.prototype.updateTime = null; + + /** + * ExecutionStatus latestJob. + * @member {google.cloud.dataplex.v1.IJob|null|undefined} latestJob + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @instance + */ + ExecutionStatus.prototype.latestJob = null; + + /** + * Creates a new ExecutionStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionStatus=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Task.ExecutionStatus} ExecutionStatus instance + */ + ExecutionStatus.create = function create(properties) { + return new ExecutionStatus(properties); + }; + + /** + * Encodes the specified ExecutionStatus message. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionStatus} message ExecutionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.latestJob != null && Object.hasOwnProperty.call(message, "latestJob")) + $root.google.cloud.dataplex.v1.Job.encode(message.latestJob, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionStatus message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Task.ExecutionStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {google.cloud.dataplex.v1.Task.IExecutionStatus} message ExecutionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Task.ExecutionStatus} ExecutionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Task.ExecutionStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.latestJob = $root.google.cloud.dataplex.v1.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Task.ExecutionStatus} ExecutionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionStatus message. + * @function verify + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.latestJob != null && message.hasOwnProperty("latestJob")) { + var error = $root.google.cloud.dataplex.v1.Job.verify(message.latestJob); + if (error) + return "latestJob." + error; + } + return null; + }; + + /** + * Creates an ExecutionStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Task.ExecutionStatus} ExecutionStatus + */ + ExecutionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Task.ExecutionStatus) + return object; + var message = new $root.google.cloud.dataplex.v1.Task.ExecutionStatus(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.ExecutionStatus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.latestJob != null) { + if (typeof object.latestJob !== "object") + throw TypeError(".google.cloud.dataplex.v1.Task.ExecutionStatus.latestJob: object expected"); + message.latestJob = $root.google.cloud.dataplex.v1.Job.fromObject(object.latestJob); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {google.cloud.dataplex.v1.Task.ExecutionStatus} message ExecutionStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateTime = null; + object.latestJob = null; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.latestJob != null && message.hasOwnProperty("latestJob")) + object.latestJob = $root.google.cloud.dataplex.v1.Job.toObject(message.latestJob, options); + return object; + }; + + /** + * Converts this ExecutionStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @instance + * @returns {Object.} JSON object + */ + ExecutionStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionStatus + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Task.ExecutionStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Task.ExecutionStatus"; + }; + + return ExecutionStatus; + })(); + + return Task; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.dataplex.v1 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {google.protobuf.ITimestamp|null} [startTime] Job startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Job endTime + * @property {google.cloud.dataplex.v1.Job.State|null} [state] Job state + * @property {number|null} [retryCount] Job retryCount + * @property {google.cloud.dataplex.v1.Job.Service|null} [service] Job service + * @property {string|null} [serviceJob] Job serviceJob + * @property {string|null} [message] Job message + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.dataplex.v1.IJob=} [properties] Properties to set + */ + function Job(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]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.startTime = null; + + /** + * Job endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.endTime = null; + + /** + * Job state. + * @member {google.cloud.dataplex.v1.Job.State} state + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.state = 0; + + /** + * Job retryCount. + * @member {number} retryCount + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.retryCount = 0; + + /** + * Job service. + * @member {google.cloud.dataplex.v1.Job.Service} service + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.service = 0; + + /** + * Job serviceJob. + * @member {string} serviceJob + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.serviceJob = ""; + + /** + * Job message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.Job + * @instance + */ + Job.prototype.message = ""; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {google.cloud.dataplex.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataplex.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {google.cloud.dataplex.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.retryCount != null && Object.hasOwnProperty.call(message, "retryCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.retryCount); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.service); + if (message.serviceJob != null && Object.hasOwnProperty.call(message, "serviceJob")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceJob); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.message); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {google.cloud.dataplex.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.Job(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.retryCount = reader.uint32(); + break; + } + case 7: { + message.service = reader.int32(); + break; + } + case 8: { + message.serviceJob = reader.string(); + break; + } + case 9: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + 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: + case 6: + break; + } + if (message.retryCount != null && message.hasOwnProperty("retryCount")) + if (!$util.isInteger(message.retryCount)) + return "retryCount: integer expected"; + if (message.service != null && message.hasOwnProperty("service")) + switch (message.service) { + default: + return "service: enum value expected"; + case 0: + case 1: + break; + } + if (message.serviceJob != null && message.hasOwnProperty("serviceJob")) + if (!$util.isString(message.serviceJob)) + return "serviceJob: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.Job) + return object; + var message = new $root.google.cloud.dataplex.v1.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Job.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dataplex.v1.Job.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "CANCELLING": + case 2: + message.state = 2; + break; + case "CANCELLED": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ABORTED": + case 6: + message.state = 6; + break; + } + if (object.retryCount != null) + message.retryCount = object.retryCount >>> 0; + switch (object.service) { + case "SERVICE_UNSPECIFIED": + case 0: + message.service = 0; + break; + case "DATAPROC": + case 1: + message.service = 1; + break; + } + if (object.serviceJob != null) + message.serviceJob = String(object.serviceJob); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {google.cloud.dataplex.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.retryCount = 0; + object.service = options.enums === String ? "SERVICE_UNSPECIFIED" : 0; + object.serviceJob = ""; + object.message = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataplex.v1.Job.State[message.state] : message.state; + if (message.retryCount != null && message.hasOwnProperty("retryCount")) + object.retryCount = message.retryCount; + if (message.service != null && message.hasOwnProperty("service")) + object.service = options.enums === String ? $root.google.cloud.dataplex.v1.Job.Service[message.service] : message.service; + if (message.serviceJob != null && message.hasOwnProperty("serviceJob")) + object.serviceJob = message.serviceJob; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.Job"; + }; + + /** + * Service enum. + * @name google.cloud.dataplex.v1.Job.Service + * @enum {number} + * @property {number} SERVICE_UNSPECIFIED=0 SERVICE_UNSPECIFIED value + * @property {number} DATAPROC=1 DATAPROC value + */ + Job.Service = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATAPROC"] = 1; + return values; + })(); + + /** + * State enum. + * @name google.cloud.dataplex.v1.Job.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} ABORTED=6 ABORTED value + */ + Job.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ABORTED"] = 6; + return values; + })(); + + return Job; + })(); + + return v1; + })(); + + return dataplex; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.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; + })(); + + 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.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(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]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + 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 a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(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]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(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]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-dataplex/protos/protos.json b/packages/google-cloud-dataplex/protos/protos.json new file mode 100644 index 000000000000..bd794d657771 --- /dev/null +++ b/packages/google-cloud-dataplex/protos/protos.json @@ -0,0 +1,6812 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "dataplex": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/dataplex/v1;dataplex", + "java_multiple_files": true, + "java_outer_classname": "TasksProto", + "java_package": "com.google.cloud.dataplex.v1" + }, + "nested": { + "Environment": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Environment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Environment" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "infrastructureSpec": { + "type": "InfrastructureSpec", + "id": 100, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sessionSpec": { + "type": "SessionSpec", + "id": 101, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sessionStatus": { + "type": "SessionStatus", + "id": 102, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endpoints": { + "type": "Endpoints", + "id": 200, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InfrastructureSpec": { + "oneofs": { + "resources": { + "oneof": [ + "compute" + ] + }, + "runtime": { + "oneof": [ + "osImage" + ] + } + }, + "fields": { + "compute": { + "type": "ComputeResources", + "id": 50, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "osImage": { + "type": "OsImageRuntime", + "id": 100, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ComputeResources": { + "fields": { + "diskSizeGb": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxNodeCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OsImageRuntime": { + "fields": { + "imageVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "javaLibraries": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonPackages": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SessionSpec": { + "fields": { + "maxIdleDuration": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFastStartup": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SessionStatus": { + "fields": { + "active": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Endpoints": { + "fields": { + "notebooks": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sql": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Content": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Content", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/content/{content}" + }, + "oneofs": { + "data": { + "oneof": [ + "dataText" + ] + }, + "content": { + "oneof": [ + "sqlScript", + "notebook" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Content" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "path": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataText": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sqlScript": { + "type": "SqlScript", + "id": 100 + }, + "notebook": { + "type": "Notebook", + "id": 101 + } + }, + "nested": { + "SqlScript": { + "fields": { + "engine": { + "type": "QueryEngine", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "QueryEngine": { + "values": { + "QUERY_ENGINE_UNSPECIFIED": 0, + "SPARK": 2 + } + } + } + }, + "Notebook": { + "fields": { + "kernelType": { + "type": "KernelType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "KernelType": { + "values": { + "KERNEL_TYPE_UNSPECIFIED": 0, + "PYTHON3": 1 + } + } + } + } + } + }, + "Session": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Session", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Session" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Lake": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Lake", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metastore": { + "type": "Metastore", + "id": 102, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assetStatus": { + "type": "AssetStatus", + "id": 103, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metastoreStatus": { + "type": "MetastoreStatus", + "id": 104, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Metastore": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MetastoreStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endpoint": { + "type": "string", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NONE": 1, + "READY": 2, + "UPDATING": 3, + "ERROR": 4 + } + } + } + } + } + }, + "AssetStatus": { + "fields": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "activeAssets": { + "type": "int32", + "id": 2 + }, + "securityPolicyApplyingAssets": { + "type": "int32", + "id": 3 + } + } + }, + "Zone": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Zone", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "discoverySpec": { + "type": "DiscoverySpec", + "id": 103, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resourceSpec": { + "type": "ResourceSpec", + "id": 104, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetStatus": { + "type": "AssetStatus", + "id": 105, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "RAW": 1, + "CURATED": 2 + } + }, + "ResourceSpec": { + "fields": { + "locationType": { + "type": "LocationType", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "LocationType": { + "values": { + "LOCATION_TYPE_UNSPECIFIED": 0, + "SINGLE_REGION": 1, + "MULTI_REGION": 2 + } + } + } + }, + "DiscoverySpec": { + "oneofs": { + "trigger": { + "oneof": [ + "schedule" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "includePatterns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludePatterns": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "csvOptions": { + "type": "CsvOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jsonOptions": { + "type": "JsonOptions", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schedule": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CsvOptions": { + "fields": { + "headerRows": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delimiter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTypeInference": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JsonOptions": { + "fields": { + "encoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTypeInference": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "Action": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Action", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}" + }, + "oneofs": { + "details": { + "oneof": [ + "invalidDataFormat", + "incompatibleDataSchema", + "invalidDataPartition", + "missingData", + "missingResource", + "unauthorizedResource", + "failedSecurityPolicyApply", + "invalidDataOrganization" + ] + } + }, + "fields": { + "category": { + "type": "Category", + "id": 1 + }, + "issue": { + "type": "string", + "id": 2 + }, + "detectTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "name": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Action" + } + }, + "lake": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "zone": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "asset": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Asset" + } + }, + "dataLocations": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "invalidDataFormat": { + "type": "InvalidDataFormat", + "id": 10 + }, + "incompatibleDataSchema": { + "type": "IncompatibleDataSchema", + "id": 11 + }, + "invalidDataPartition": { + "type": "InvalidDataPartition", + "id": 12 + }, + "missingData": { + "type": "MissingData", + "id": 13 + }, + "missingResource": { + "type": "MissingResource", + "id": 14 + }, + "unauthorizedResource": { + "type": "UnauthorizedResource", + "id": 15 + }, + "failedSecurityPolicyApply": { + "type": "FailedSecurityPolicyApply", + "id": 21 + }, + "invalidDataOrganization": { + "type": "InvalidDataOrganization", + "id": 22 + } + }, + "nested": { + "Category": { + "values": { + "CATEGORY_UNSPECIFIED": 0, + "RESOURCE_MANAGEMENT": 1, + "SECURITY_POLICY": 2, + "DATA_DISCOVERY": 3 + } + }, + "MissingResource": { + "fields": {} + }, + "UnauthorizedResource": { + "fields": {} + }, + "FailedSecurityPolicyApply": { + "fields": { + "asset": { + "type": "string", + "id": 1 + } + } + }, + "InvalidDataFormat": { + "fields": { + "sampledDataLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "expectedFormat": { + "type": "string", + "id": 2 + }, + "newFormat": { + "type": "string", + "id": 3 + } + } + }, + "IncompatibleDataSchema": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "existingSchema": { + "type": "string", + "id": 2 + }, + "newSchema": { + "type": "string", + "id": 3 + }, + "sampledDataLocations": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "schemaChange": { + "type": "SchemaChange", + "id": 5 + } + }, + "nested": { + "SchemaChange": { + "values": { + "SCHEMA_CHANGE_UNSPECIFIED": 0, + "INCOMPATIBLE": 1, + "MODIFIED": 2 + } + } + } + }, + "InvalidDataPartition": { + "fields": { + "expectedStructure": { + "type": "PartitionStructure", + "id": 1 + } + }, + "nested": { + "PartitionStructure": { + "values": { + "PARTITION_STRUCTURE_UNSPECIFIED": 0, + "CONSISTENT_KEYS": 1, + "HIVE_STYLE_KEYS": 2 + } + } + } + }, + "MissingData": { + "fields": {} + }, + "InvalidDataOrganization": { + "fields": {} + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Asset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Asset" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceSpec": { + "type": "ResourceSpec", + "id": 100, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceStatus": { + "type": "ResourceStatus", + "id": 101, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "securityStatus": { + "type": "SecurityStatus", + "id": 103, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "discoverySpec": { + "type": "DiscoverySpec", + "id": 106, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "discoveryStatus": { + "type": "DiscoveryStatus", + "id": 107, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SecurityStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "APPLYING": 2, + "ERROR": 3 + } + } + } + }, + "DiscoverySpec": { + "oneofs": { + "trigger": { + "oneof": [ + "schedule" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includePatterns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludePatterns": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "csvOptions": { + "type": "CsvOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jsonOptions": { + "type": "JsonOptions", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schedule": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CsvOptions": { + "fields": { + "headerRows": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delimiter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTypeInference": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JsonOptions": { + "fields": { + "encoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disableTypeInference": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ResourceSpec": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STORAGE_BUCKET": 1, + "BIGQUERY_DATASET": 2 + } + } + } + }, + "ResourceStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "READY": 1, + "ERROR": 2 + } + } + } + }, + "DiscoveryStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "lastRunTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "stats": { + "type": "Stats", + "id": 6 + }, + "lastRunDuration": { + "type": "google.protobuf.Duration", + "id": 7 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "IN_PROGRESS": 2, + "PAUSED": 3, + "DISABLED": 5 + } + }, + "Stats": { + "fields": { + "dataItems": { + "type": "int64", + "id": 1 + }, + "dataSize": { + "type": "int64", + "id": 2 + }, + "tables": { + "type": "int64", + "id": 3 + }, + "filesets": { + "type": "int64", + "id": 4 + } + } + } + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3, + "ACTION_REQUIRED": 4 + } + }, + "ContentService": { + "options": { + "(google.api.default_host)": "dataplex.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateContent": { + "requestType": "CreateContentRequest", + "responseType": "Content", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + "(google.api.http).body": "content", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/lakes/*}/content", + "(google.api.http).additional_bindings.body": "content", + "(google.api.method_signature)": "parent,content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + "body": "content", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*}/content", + "body": "content" + } + } + }, + { + "(google.api.method_signature)": "parent,content" + } + ] + }, + "UpdateContent": { + "requestType": "UpdateContentRequest", + "responseType": "Content", + "options": { + "(google.api.http).patch": "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}", + "(google.api.http).body": "content", + "(google.api.http).additional_bindings.patch": "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}", + "(google.api.http).additional_bindings.body": "content", + "(google.api.method_signature)": "content,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{content.name=projects/*/locations/*/lakes/*/contentitems/**}", + "body": "content", + "additional_bindings": { + "patch": "/v1/{content.name=projects/*/locations/*/lakes/*/content/**}", + "body": "content" + } + } + }, + { + "(google.api.method_signature)": "content,update_mask" + } + ] + }, + "DeleteContent": { + "requestType": "DeleteContentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/lakes/*/content/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetContent": { + "requestType": "GetContentRequest", + "responseType": "Content", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/lakes/*/content/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/contentitems/**}", + "additional_bindings": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/content/**}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).get": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy", + "(google.api.http).additional_bindings.get": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:getIamPolicy", + "additional_bindings": { + "get": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:getIamPolicy" + } + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:setIamPolicy", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:setIamPolicy", + "body": "*" + } + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=projects/*/locations/*/lakes/*/contentitems/**}:testIamPermissions", + "body": "*", + "additional_bindings": { + "post": "/v1/{resource=projects/*/locations/*/lakes/*/content/**}:testIamPermissions", + "body": "*" + } + } + } + ] + }, + "ListContent": { + "requestType": "ListContentRequest", + "responseType": "ListContentResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/lakes/*}/content", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/contentitems", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/content" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "content": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateContentRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "content": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Content" + } + } + } + }, + "ListContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListContentResponse": { + "fields": { + "content": { + "rule": "repeated", + "type": "Content", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Content" + } + }, + "view": { + "type": "ContentView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ContentView": { + "values": { + "CONTENT_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + } + } + }, + "DiscoveryEvent": { + "oneofs": { + "details": { + "oneof": [ + "config", + "entity", + "partition", + "action" + ] + } + }, + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "lakeId": { + "type": "string", + "id": 2 + }, + "zoneId": { + "type": "string", + "id": 3 + }, + "assetId": { + "type": "string", + "id": 4 + }, + "dataLocation": { + "type": "string", + "id": 5 + }, + "type": { + "type": "EventType", + "id": 10 + }, + "config": { + "type": "ConfigDetails", + "id": 20 + }, + "entity": { + "type": "EntityDetails", + "id": 21 + }, + "partition": { + "type": "PartitionDetails", + "id": 22 + }, + "action": { + "type": "ActionDetails", + "id": 23 + } + }, + "nested": { + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "CONFIG": 1, + "ENTITY_CREATED": 2, + "ENTITY_UPDATED": 3, + "ENTITY_DELETED": 4, + "PARTITION_CREATED": 5, + "PARTITION_UPDATED": 6, + "PARTITION_DELETED": 7 + } + }, + "EntityType": { + "values": { + "ENTITY_TYPE_UNSPECIFIED": 0, + "TABLE": 1, + "FILESET": 2 + } + }, + "ConfigDetails": { + "fields": { + "parameters": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "EntityDetails": { + "fields": { + "entity": { + "type": "string", + "id": 1 + }, + "type": { + "type": "EntityType", + "id": 2 + } + } + }, + "PartitionDetails": { + "fields": { + "partition": { + "type": "string", + "id": 1 + }, + "entity": { + "type": "string", + "id": 2 + }, + "type": { + "type": "EntityType", + "id": 3 + }, + "sampledDataLocations": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "ActionDetails": { + "fields": { + "type": { + "type": "string", + "id": 1 + } + } + } + } + }, + "JobEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "state": { + "type": "State", + "id": 5 + }, + "retries": { + "type": "int32", + "id": 6 + }, + "type": { + "type": "Type", + "id": 7 + }, + "service": { + "type": "Service", + "id": 8 + }, + "serviceJob": { + "type": "string", + "id": 9 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SPARK": 1, + "NOTEBOOK": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "CANCELLED": 3, + "ABORTED": 4 + } + }, + "Service": { + "values": { + "SERVICE_UNSPECIFIED": 0, + "DATAPROC": 1 + } + } + } + }, + "SessionEvent": { + "oneofs": { + "detail": { + "oneof": [ + "query" + ] + } + }, + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "userId": { + "type": "string", + "id": 2 + }, + "sessionId": { + "type": "string", + "id": 3 + }, + "type": { + "type": "EventType", + "id": 4 + }, + "query": { + "type": "QueryDetail", + "id": 5 + }, + "eventSucceeded": { + "type": "bool", + "id": 6 + }, + "fastStartupEnabled": { + "type": "bool", + "id": 7 + }, + "unassignedDuration": { + "type": "google.protobuf.Duration", + "id": 8 + } + }, + "nested": { + "EventType": { + "values": { + "EVENT_TYPE_UNSPECIFIED": 0, + "START": 1, + "STOP": 2, + "QUERY": 3, + "CREATE": 4 + } + }, + "QueryDetail": { + "fields": { + "queryId": { + "type": "string", + "id": 1 + }, + "queryText": { + "type": "string", + "id": 2 + }, + "engine": { + "type": "Engine", + "id": 3 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "resultSizeBytes": { + "type": "int64", + "id": 5 + }, + "dataProcessedBytes": { + "type": "int64", + "id": 6 + } + }, + "nested": { + "Engine": { + "values": { + "ENGINE_UNSPECIFIED": 0, + "SPARK_SQL": 1, + "BIGQUERY": 2 + } + } + } + } + } + }, + "MetadataService": { + "options": { + "(google.api.default_host)": "dataplex.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateEntity": { + "requestType": "CreateEntityRequest", + "responseType": "Entity", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities", + "(google.api.http).body": "entity", + "(google.api.method_signature)": "parent,entity" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities", + "body": "entity" + } + }, + { + "(google.api.method_signature)": "parent,entity" + } + ] + }, + "UpdateEntity": { + "requestType": "UpdateEntityRequest", + "responseType": "Entity", + "options": { + "(google.api.http).put": "/v1/{entity.name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + "(google.api.http).body": "entity" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{entity.name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + "body": "entity" + } + } + ] + }, + "DeleteEntity": { + "requestType": "DeleteEntityRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetEntity": { + "requestType": "GetEntityRequest", + "responseType": "Entity", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEntities": { + "requestType": "ListEntitiesRequest", + "responseType": "ListEntitiesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/entities" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreatePartition": { + "requestType": "CreatePartitionRequest", + "responseType": "Partition", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions", + "(google.api.http).body": "partition", + "(google.api.method_signature)": "parent,partition" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions", + "body": "partition" + } + }, + { + "(google.api.method_signature)": "parent,partition" + } + ] + }, + "DeletePartition": { + "requestType": "DeletePartitionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetPartition": { + "requestType": "GetPartitionRequest", + "responseType": "Partition", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/entities/*/partitions/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPartitions": { + "requestType": "ListPartitionsRequest", + "responseType": "ListPartitionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/entities/*}/partitions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateEntityRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "entity": { + "type": "Entity", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEntityRequest": { + "fields": { + "entity": { + "type": "Entity", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEntityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "view": { + "type": "EntityView", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityView": { + "values": { + "ENTITY_VIEW_UNSPECIFIED": 0, + "TABLES": 1, + "FILESETS": 2 + } + } + } + }, + "ListEntitiesResponse": { + "fields": { + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEntityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "view": { + "type": "EntityView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityView": { + "values": { + "ENTITY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "SCHEMA": 2, + "FULL": 4 + } + } + } + }, + "ListPartitionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreatePartitionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "partition": { + "type": "Partition", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeletePartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Partition" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPartitionsResponse": { + "fields": { + "partitions": { + "rule": "repeated", + "type": "Partition", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetPartitionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Partition" + } + } + } + }, + "Entity": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Entity", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "Type", + "id": 10, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "asset": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "dataPath": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "dataPathPattern": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "catalogEntry": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "system": { + "type": "StorageSystem", + "id": 15, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "format": { + "type": "StorageFormat", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compatibility": { + "type": "CompatibilityStatus", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schema": { + "type": "Schema", + "id": 50, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TABLE": 1, + "FILESET": 2 + } + }, + "CompatibilityStatus": { + "fields": { + "hiveMetastore": { + "type": "Compatibility", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bigquery": { + "type": "Compatibility", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Compatibility": { + "fields": { + "compatible": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + }, + "Partition": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Partition", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Partition" + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "location": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Schema": { + "fields": { + "userManaged": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fields": { + "rule": "repeated", + "type": "SchemaField", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionFields": { + "rule": "repeated", + "type": "PartitionField", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionStyle": { + "type": "PartitionStyle", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "BOOLEAN": 1, + "BYTE": 2, + "INT16": 3, + "INT32": 4, + "INT64": 5, + "FLOAT": 6, + "DOUBLE": 7, + "DECIMAL": 8, + "STRING": 9, + "BINARY": 10, + "TIMESTAMP": 11, + "DATE": 12, + "TIME": 13, + "RECORD": 14, + "NULL": 100 + } + }, + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "REQUIRED": 1, + "NULLABLE": 2, + "REPEATED": 3 + } + }, + "SchemaField": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mode": { + "type": "Mode", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fields": { + "rule": "repeated", + "type": "SchemaField", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartitionField": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "PartitionStyle": { + "values": { + "PARTITION_STYLE_UNSPECIFIED": 0, + "HIVE_COMPATIBLE": 1 + } + } + } + }, + "StorageFormat": { + "oneofs": { + "options": { + "oneof": [ + "csv", + "json" + ] + } + }, + "fields": { + "format": { + "type": "Format", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "compressionFormat": { + "type": "CompressionFormat", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "csv": { + "type": "CsvOptions", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "json": { + "type": "JsonOptions", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CsvOptions": { + "fields": { + "encoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "headerRows": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delimiter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quote": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JsonOptions": { + "fields": { + "encoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "PARQUET": 1, + "AVRO": 2, + "ORC": 3, + "CSV": 100, + "JSON": 101, + "IMAGE": 200, + "AUDIO": 201, + "VIDEO": 202, + "TEXT": 203, + "TFRECORD": 204, + "OTHER": 1000, + "UNKNOWN": 1001 + } + }, + "CompressionFormat": { + "values": { + "COMPRESSION_FORMAT_UNSPECIFIED": 0, + "GZIP": 2, + "BZIP2": 3 + } + } + } + }, + "StorageSystem": { + "values": { + "STORAGE_SYSTEM_UNSPECIFIED": 0, + "CLOUD_STORAGE": 1, + "BIGQUERY": 2 + } + }, + "DataplexService": { + "options": { + "(google.api.default_host)": "dataplex.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateLake": { + "requestType": "CreateLakeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/lakes", + "(google.api.http).body": "lake", + "(google.api.method_signature)": "parent,lake,lake_id", + "(google.longrunning.operation_info).response_type": "Lake", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/lakes", + "body": "lake" + } + }, + { + "(google.api.method_signature)": "parent,lake,lake_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Lake", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateLake": { + "requestType": "UpdateLakeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{lake.name=projects/*/locations/*/lakes/*}", + "(google.api.http).body": "lake", + "(google.api.method_signature)": "lake,update_mask", + "(google.longrunning.operation_info).response_type": "Lake", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{lake.name=projects/*/locations/*/lakes/*}", + "body": "lake" + } + }, + { + "(google.api.method_signature)": "lake,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Lake", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteLake": { + "requestType": "DeleteLakeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListLakes": { + "requestType": "ListLakesRequest", + "responseType": "ListLakesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/lakes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/lakes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetLake": { + "requestType": "GetLakeRequest", + "responseType": "Lake", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListLakeActions": { + "requestType": "ListLakeActionsRequest", + "responseType": "ListActionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*}/actions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/actions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateZone": { + "requestType": "CreateZoneRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*}/zones", + "(google.api.http).body": "zone", + "(google.api.method_signature)": "parent,zone,zone_id", + "(google.longrunning.operation_info).response_type": "Zone", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*}/zones", + "body": "zone" + } + }, + { + "(google.api.method_signature)": "parent,zone,zone_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Zone", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateZone": { + "requestType": "UpdateZoneRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{zone.name=projects/*/locations/*/lakes/*/zones/*}", + "(google.api.http).body": "zone", + "(google.api.method_signature)": "zone,update_mask", + "(google.longrunning.operation_info).response_type": "Zone", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{zone.name=projects/*/locations/*/lakes/*/zones/*}", + "body": "zone" + } + }, + { + "(google.api.method_signature)": "zone,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Zone", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteZone": { + "requestType": "DeleteZoneRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListZones": { + "requestType": "ListZonesRequest", + "responseType": "ListZonesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*}/zones", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/zones" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetZone": { + "requestType": "GetZoneRequest", + "responseType": "Zone", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListZoneActions": { + "requestType": "ListZoneActionsRequest", + "responseType": "ListActionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/actions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/actions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateAsset": { + "requestType": "CreateAssetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets", + "(google.api.http).body": "asset", + "(google.api.method_signature)": "parent,asset,asset_id", + "(google.longrunning.operation_info).response_type": "Asset", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets", + "body": "asset" + } + }, + { + "(google.api.method_signature)": "parent,asset,asset_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Asset", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateAsset": { + "requestType": "UpdateAssetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{asset.name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + "(google.api.http).body": "asset", + "(google.api.method_signature)": "asset,update_mask", + "(google.longrunning.operation_info).response_type": "Asset", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{asset.name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + "body": "asset" + } + }, + { + "(google.api.method_signature)": "asset,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Asset", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteAsset": { + "requestType": "DeleteAssetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAsset": { + "requestType": "GetAssetRequest", + "responseType": "Asset", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/zones/*/assets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAssetActions": { + "requestType": "ListAssetActionsRequest", + "responseType": "ListActionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/assets/*}/actions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/zones/*/assets/*}/actions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateTask": { + "requestType": "CreateTaskRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*}/tasks", + "(google.api.http).body": "task", + "(google.api.method_signature)": "parent,task,task_id", + "(google.longrunning.operation_info).response_type": "Task", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*}/tasks", + "body": "task" + } + }, + { + "(google.api.method_signature)": "parent,task,task_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Task", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateTask": { + "requestType": "UpdateTaskRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{task.name=projects/*/locations/*/lakes/*/tasks/*}", + "(google.api.http).body": "task", + "(google.api.method_signature)": "task,update_mask", + "(google.longrunning.operation_info).response_type": "Task", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{task.name=projects/*/locations/*/lakes/*/tasks/*}", + "body": "task" + } + }, + { + "(google.api.method_signature)": "task,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Task", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteTask": { + "requestType": "DeleteTaskRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/tasks/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/tasks/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/lakes/*/tasks/*/jobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEnvironment": { + "requestType": "CreateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/lakes/*}/environments", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "parent,environment,environment_id", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/lakes/*}/environments", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "parent,environment,environment_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateEnvironment": { + "requestType": "UpdateEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{environment.name=projects/*/locations/*/lakes/*/environments/*}", + "(google.api.http).body": "environment", + "(google.api.method_signature)": "environment,update_mask", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{environment.name=projects/*/locations/*/lakes/*/environments/*}", + "body": "environment" + } + }, + { + "(google.api.method_signature)": "environment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteEnvironment": { + "requestType": "DeleteEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/lakes/*/environments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/lakes/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListEnvironments": { + "requestType": "ListEnvironmentsRequest", + "responseType": "ListEnvironmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*}/environments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*}/environments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEnvironment": { + "requestType": "GetEnvironmentRequest", + "responseType": "Environment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/lakes/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/lakes/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSessions": { + "requestType": "ListSessionsRequest", + "responseType": "ListSessionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/lakes/*/environments/*}/sessions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/lakes/*/environments/*}/sessions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateLakeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "lakeId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lake": { + "type": "Lake", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateLakeRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lake": { + "type": "Lake", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteLakeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + } + } + }, + "ListLakesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLakesResponse": { + "fields": { + "lakes": { + "rule": "repeated", + "type": "Lake", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachableLocations": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListLakeActionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListActionsResponse": { + "fields": { + "actions": { + "rule": "repeated", + "type": "Action", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetLakeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + } + } + }, + "CreateZoneRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "zoneId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "Zone", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateZoneRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "Zone", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteZoneRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + } + } + }, + "ListZonesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListZonesResponse": { + "fields": { + "zones": { + "rule": "repeated", + "type": "Zone", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListZoneActionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetZoneRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + } + } + }, + "CreateAssetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "assetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "asset": { + "type": "Asset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateAssetRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "asset": { + "type": "Asset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAssetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Asset" + } + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Zone" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAssetsResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListAssetActionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Asset" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetAssetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Asset" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateTaskRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "taskId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "task": { + "type": "Task", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTaskRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "task": { + "type": "Task", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Task" + } + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachableLocations": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Task" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Job" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Task" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Job" + } + } + } + }, + "CreateEnvironmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "environmentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "environment": { + "type": "Environment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEnvironmentRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "environment": { + "type": "Environment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Environment" + } + } + } + }, + "ListEnvironmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Lake" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEnvironmentsResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Environment" + } + } + } + }, + "ListSessionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSessionsResponse": { + "fields": { + "sessions": { + "rule": "repeated", + "type": "Session", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}" + }, + "oneofs": { + "config": { + "oneof": [ + "spark", + "notebook" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Task" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "triggerSpec": { + "type": "TriggerSpec", + "id": 100, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executionSpec": { + "type": "ExecutionSpec", + "id": 101, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executionStatus": { + "type": "ExecutionStatus", + "id": 201, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spark": { + "type": "SparkTaskConfig", + "id": 300 + }, + "notebook": { + "type": "NotebookTaskConfig", + "id": 302 + } + }, + "nested": { + "InfrastructureSpec": { + "oneofs": { + "resources": { + "oneof": [ + "batch" + ] + }, + "runtime": { + "oneof": [ + "containerImage" + ] + }, + "network": { + "oneof": [ + "vpcNetwork" + ] + } + }, + "fields": { + "batch": { + "type": "BatchComputeResources", + "id": 52 + }, + "containerImage": { + "type": "ContainerImageRuntime", + "id": 101 + }, + "vpcNetwork": { + "type": "VpcNetwork", + "id": 150 + } + }, + "nested": { + "BatchComputeResources": { + "fields": { + "executorsCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxExecutorsCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ContainerImageRuntime": { + "fields": { + "image": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "javaJars": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonPackages": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VpcNetwork": { + "oneofs": { + "networkName": { + "oneof": [ + "network", + "subNetwork" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subNetwork": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "TriggerSpec": { + "oneofs": { + "trigger": { + "oneof": [ + "schedule" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxRetries": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schedule": { + "type": "string", + "id": 100, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "RECURRING": 2 + } + } + } + }, + "ExecutionSpec": { + "fields": { + "args": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxJobExecutionLifetime": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKey": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkTaskConfig": { + "oneofs": { + "driver": { + "oneof": [ + "mainJarFileUri", + "mainClass", + "pythonScriptFile", + "sqlScriptFile", + "sqlScript" + ] + } + }, + "fields": { + "mainJarFileUri": { + "type": "string", + "id": 100 + }, + "mainClass": { + "type": "string", + "id": 101 + }, + "pythonScriptFile": { + "type": "string", + "id": 102 + }, + "sqlScriptFile": { + "type": "string", + "id": 104 + }, + "sqlScript": { + "type": "string", + "id": 105 + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "infrastructureSpec": { + "type": "InfrastructureSpec", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NotebookTaskConfig": { + "fields": { + "notebook": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "infrastructureSpec": { + "type": "InfrastructureSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecutionStatus": { + "fields": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestJob": { + "type": "Job", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "dataplex.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "dataplex.googleapis.com/Job" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retryCount": { + "type": "uint32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "service": { + "type": "Service", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceJob": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "message": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Service": { + "values": { + "SERVICE_UNSPECIFIED": 0, + "DATAPROC": 1 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "CANCELLING": 2, + "CANCELLED": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "ABORTED": 6 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-dataplex/samples/README.md b/packages/google-cloud-dataplex/samples/README.md new file mode 100644 index 000000000000..070b4ee4751c --- /dev/null +++ b/packages/google-cloud-dataplex/samples/README.md @@ -0,0 +1,950 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Dataplex: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Content_service.create_content](#content_service.create_content) + * [Content_service.delete_content](#content_service.delete_content) + * [Content_service.get_content](#content_service.get_content) + * [Content_service.get_iam_policy](#content_service.get_iam_policy) + * [Content_service.list_content](#content_service.list_content) + * [Content_service.set_iam_policy](#content_service.set_iam_policy) + * [Content_service.test_iam_permissions](#content_service.test_iam_permissions) + * [Content_service.update_content](#content_service.update_content) + * [Dataplex_service.cancel_job](#dataplex_service.cancel_job) + * [Dataplex_service.create_asset](#dataplex_service.create_asset) + * [Dataplex_service.create_environment](#dataplex_service.create_environment) + * [Dataplex_service.create_lake](#dataplex_service.create_lake) + * [Dataplex_service.create_task](#dataplex_service.create_task) + * [Dataplex_service.create_zone](#dataplex_service.create_zone) + * [Dataplex_service.delete_asset](#dataplex_service.delete_asset) + * [Dataplex_service.delete_environment](#dataplex_service.delete_environment) + * [Dataplex_service.delete_lake](#dataplex_service.delete_lake) + * [Dataplex_service.delete_task](#dataplex_service.delete_task) + * [Dataplex_service.delete_zone](#dataplex_service.delete_zone) + * [Dataplex_service.get_asset](#dataplex_service.get_asset) + * [Dataplex_service.get_environment](#dataplex_service.get_environment) + * [Dataplex_service.get_job](#dataplex_service.get_job) + * [Dataplex_service.get_lake](#dataplex_service.get_lake) + * [Dataplex_service.get_task](#dataplex_service.get_task) + * [Dataplex_service.get_zone](#dataplex_service.get_zone) + * [Dataplex_service.list_asset_actions](#dataplex_service.list_asset_actions) + * [Dataplex_service.list_assets](#dataplex_service.list_assets) + * [Dataplex_service.list_environments](#dataplex_service.list_environments) + * [Dataplex_service.list_jobs](#dataplex_service.list_jobs) + * [Dataplex_service.list_lake_actions](#dataplex_service.list_lake_actions) + * [Dataplex_service.list_lakes](#dataplex_service.list_lakes) + * [Dataplex_service.list_sessions](#dataplex_service.list_sessions) + * [Dataplex_service.list_tasks](#dataplex_service.list_tasks) + * [Dataplex_service.list_zone_actions](#dataplex_service.list_zone_actions) + * [Dataplex_service.list_zones](#dataplex_service.list_zones) + * [Dataplex_service.update_asset](#dataplex_service.update_asset) + * [Dataplex_service.update_environment](#dataplex_service.update_environment) + * [Dataplex_service.update_lake](#dataplex_service.update_lake) + * [Dataplex_service.update_task](#dataplex_service.update_task) + * [Dataplex_service.update_zone](#dataplex_service.update_zone) + * [Metadata_service.create_entity](#metadata_service.create_entity) + * [Metadata_service.create_partition](#metadata_service.create_partition) + * [Metadata_service.delete_entity](#metadata_service.delete_entity) + * [Metadata_service.delete_partition](#metadata_service.delete_partition) + * [Metadata_service.get_entity](#metadata_service.get_entity) + * [Metadata_service.get_partition](#metadata_service.get_partition) + * [Metadata_service.list_entities](#metadata_service.list_entities) + * [Metadata_service.list_partitions](#metadata_service.list_partitions) + * [Metadata_service.update_entity](#metadata_service.update_entity) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Content_service.create_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js` + + +----- + + + + +### Content_service.delete_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js` + + +----- + + + + +### Content_service.get_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js` + + +----- + + + + +### Content_service.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js` + + +----- + + + + +### Content_service.list_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js` + + +----- + + + + +### Content_service.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js` + + +----- + + + + +### Content_service.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js` + + +----- + + + + +### Content_service.update_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js` + + +----- + + + + +### Dataplex_service.cancel_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js` + + +----- + + + + +### Dataplex_service.create_asset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js` + + +----- + + + + +### Dataplex_service.create_environment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js` + + +----- + + + + +### Dataplex_service.create_lake + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js` + + +----- + + + + +### Dataplex_service.create_task + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js` + + +----- + + + + +### Dataplex_service.create_zone + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js` + + +----- + + + + +### Dataplex_service.delete_asset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js` + + +----- + + + + +### Dataplex_service.delete_environment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js` + + +----- + + + + +### Dataplex_service.delete_lake + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js` + + +----- + + + + +### Dataplex_service.delete_task + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js` + + +----- + + + + +### Dataplex_service.delete_zone + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js` + + +----- + + + + +### Dataplex_service.get_asset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js` + + +----- + + + + +### Dataplex_service.get_environment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js` + + +----- + + + + +### Dataplex_service.get_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js` + + +----- + + + + +### Dataplex_service.get_lake + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js` + + +----- + + + + +### Dataplex_service.get_task + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js` + + +----- + + + + +### Dataplex_service.get_zone + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js` + + +----- + + + + +### Dataplex_service.list_asset_actions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js` + + +----- + + + + +### Dataplex_service.list_assets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js` + + +----- + + + + +### Dataplex_service.list_environments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js` + + +----- + + + + +### Dataplex_service.list_jobs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js` + + +----- + + + + +### Dataplex_service.list_lake_actions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js` + + +----- + + + + +### Dataplex_service.list_lakes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js` + + +----- + + + + +### Dataplex_service.list_sessions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js` + + +----- + + + + +### Dataplex_service.list_tasks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js` + + +----- + + + + +### Dataplex_service.list_zone_actions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js` + + +----- + + + + +### Dataplex_service.list_zones + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js` + + +----- + + + + +### Dataplex_service.update_asset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js` + + +----- + + + + +### Dataplex_service.update_environment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js` + + +----- + + + + +### Dataplex_service.update_lake + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js` + + +----- + + + + +### Dataplex_service.update_task + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js` + + +----- + + + + +### Dataplex_service.update_zone + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js` + + +----- + + + + +### Metadata_service.create_entity + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js` + + +----- + + + + +### Metadata_service.create_partition + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js` + + +----- + + + + +### Metadata_service.delete_entity + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js` + + +----- + + + + +### Metadata_service.delete_partition + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js` + + +----- + + + + +### Metadata_service.get_entity + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js` + + +----- + + + + +### Metadata_service.get_partition + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js` + + +----- + + + + +### Metadata_service.list_entities + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js` + + +----- + + + + +### Metadata_service.list_partitions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js` + + +----- + + + + +### Metadata_service.update_entity + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataplex/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataplex/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-dataplex/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/dataplex/ diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js new file mode 100644 index 000000000000..ec4d206392bb --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.create_content.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent, content) { + // [START dataplex_v1_generated_ContentService_CreateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + */ + // const parent = 'abc123' + /** + * Required. Content resource. + */ + // const content = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callCreateContent() { + // Construct request + const request = { + parent, + content, + }; + + // Run request + const response = await dataplexClient.createContent(request); + console.log(response); + } + + callCreateContent(); + // [END dataplex_v1_generated_ContentService_CreateContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js new file mode 100644 index 000000000000..22db90573021 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.delete_content.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_ContentService_DeleteContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the content: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callDeleteContent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.deleteContent(request); + console.log(response); + } + + callDeleteContent(); + // [END dataplex_v1_generated_ContentService_DeleteContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js new file mode 100644 index 000000000000..d7612fab50c5 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_content.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_ContentService_GetContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the content: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + */ + // const name = 'abc123' + /** + * Optional. Specify content view to make a partial request. + */ + // const view = {} + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callGetContent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getContent(request); + console.log(response); + } + + callGetContent(); + // [END dataplex_v1_generated_ContentService_GetContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js new file mode 100644 index 000000000000..f538076d21a3 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START dataplex_v1_generated_ContentService_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await dataplexClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END dataplex_v1_generated_ContentService_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js new file mode 100644 index 000000000000..cb0300dbe05c --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.list_content.js @@ -0,0 +1,87 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_ContentService_ListContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of content to return. The service may return fewer than + * this value. If unspecified, at most 10 content will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListContent` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListContent` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. Filters are case-sensitive. + * The following formats are supported: + * labels.key1 = "value1" + * labels:key1 + * type = "NOTEBOOK" + * type = "SQL_SCRIPT" + * These restrictions can be coinjoined with AND, OR and NOT conjunctions. + */ + // const filter = 'abc123' + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callListContent() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listContentAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListContent(); + // [END dataplex_v1_generated_ContentService_ListContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js new file mode 100644 index 000000000000..f2421b864ad7 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START dataplex_v1_generated_ContentService_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await dataplexClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END dataplex_v1_generated_ContentService_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js new file mode 100644 index 000000000000..f4685074825b --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START dataplex_v1_generated_ContentService_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await dataplexClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END dataplex_v1_generated_ContentService_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js b/packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js new file mode 100644 index 000000000000..8107980f7c83 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/content_service.update_content.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(updateMask, content) { + // [START dataplex_v1_generated_ContentService_UpdateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const content = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {ContentServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new ContentServiceClient(); + + async function callUpdateContent() { + // Construct request + const request = { + updateMask, + content, + }; + + // Run request + const response = await dataplexClient.updateContent(request); + console.log(response); + } + + callUpdateContent(); + // [END dataplex_v1_generated_ContentService_UpdateContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js new file mode 100644 index 000000000000..8cffe5aed583 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.cancel_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCancelJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.cancelJob(request); + console.log(response); + } + + callCancelJob(); + // [END dataplex_v1_generated_DataplexService_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js new file mode 100644 index 000000000000..ea1fcce951b4 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_asset.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent, assetId, asset) { + // [START dataplex_v1_generated_DataplexService_CreateAsset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const parent = 'abc123' + /** + * Required. Asset identifier. + * This ID will be used to generate names such as table names when publishing + * metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique within the zone. + */ + // const assetId = 'abc123' + /** + * Required. Asset resource. + */ + // const asset = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCreateAsset() { + // Construct request + const request = { + parent, + assetId, + asset, + }; + + // Run request + const [operation] = await dataplexClient.createAsset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAsset(); + // [END dataplex_v1_generated_DataplexService_CreateAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js new file mode 100644 index 000000000000..4e99824a1652 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_environment.js @@ -0,0 +1,83 @@ +// Copyright 2022 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'; + +function main(parent, environmentId, environment) { + // [START dataplex_v1_generated_DataplexService_CreateEnvironment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Required. Environment identifier. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the lake. + */ + // const environmentId = 'abc123' + /** + * Required. Environment resource. + */ + // const environment = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCreateEnvironment() { + // Construct request + const request = { + parent, + environmentId, + environment, + }; + + // Run request + const [operation] = await dataplexClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEnvironment(); + // [END dataplex_v1_generated_DataplexService_CreateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js new file mode 100644 index 000000000000..1d1e9ca29104 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_lake.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main(parent, lakeId, lake) { + // [START dataplex_v1_generated_DataplexService_CreateLake_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the lake location, of the form: + * projects/{project_number}/locations/{location_id} + * where `location_id` refers to a GCP region. + */ + // const parent = 'abc123' + /** + * Required. Lake identifier. + * This ID will be used to generate names such as database and dataset names + * when publishing metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique within the customer project / location. + */ + // const lakeId = 'abc123' + /** + * Required. Lake resource + */ + // const lake = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCreateLake() { + // Construct request + const request = { + parent, + lakeId, + lake, + }; + + // Run request + const [operation] = await dataplexClient.createLake(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateLake(); + // [END dataplex_v1_generated_DataplexService_CreateLake_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js new file mode 100644 index 000000000000..5762e40649f8 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_task.js @@ -0,0 +1,78 @@ +// Copyright 2022 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'; + +function main(parent, taskId, task) { + // [START dataplex_v1_generated_DataplexService_CreateTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Required. Task identifier. + */ + // const taskId = 'abc123' + /** + * Required. Task resource. + */ + // const task = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCreateTask() { + // Construct request + const request = { + parent, + taskId, + task, + }; + + // Run request + const [operation] = await dataplexClient.createTask(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTask(); + // [END dataplex_v1_generated_DataplexService_CreateTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js new file mode 100644 index 000000000000..c97a98de7e5f --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.create_zone.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main(parent, zoneId, zone) { + // [START dataplex_v1_generated_DataplexService_CreateZone_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Required. Zone identifier. + * This ID will be used to generate names such as database and dataset names + * when publishing metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique across all lakes from all locations in a project. + * * Must not be one of the reserved IDs (i.e. "default", "global-temp") + */ + // const zoneId = 'abc123' + /** + * Required. Zone resource. + */ + // const zone = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callCreateZone() { + // Construct request + const request = { + parent, + zoneId, + zone, + }; + + // Run request + const [operation] = await dataplexClient.createZone(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateZone(); + // [END dataplex_v1_generated_DataplexService_CreateZone_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js new file mode 100644 index 000000000000..e64a56e07006 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_asset.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_DeleteAsset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callDeleteAsset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataplexClient.deleteAsset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteAsset(); + // [END dataplex_v1_generated_DataplexService_DeleteAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js new file mode 100644 index 000000000000..1b81c1673f29 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_environment.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_DeleteEnvironment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the environment: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callDeleteEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataplexClient.deleteEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEnvironment(); + // [END dataplex_v1_generated_DataplexService_DeleteEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js new file mode 100644 index 000000000000..500261f4ed2c --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_lake.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_DeleteLake_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callDeleteLake() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataplexClient.deleteLake(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteLake(); + // [END dataplex_v1_generated_DataplexService_DeleteLake_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js new file mode 100644 index 000000000000..cce7ae1a4430 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_task.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_DeleteTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the task: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callDeleteTask() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataplexClient.deleteTask(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTask(); + // [END dataplex_v1_generated_DataplexService_DeleteTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js new file mode 100644 index 000000000000..d95d8bde6950 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.delete_zone.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_DeleteZone_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callDeleteZone() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataplexClient.deleteZone(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteZone(); + // [END dataplex_v1_generated_DataplexService_DeleteZone_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js new file mode 100644 index 000000000000..e3516a03fa66 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_asset.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetAsset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetAsset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getAsset(request); + console.log(response); + } + + callGetAsset(); + // [END dataplex_v1_generated_DataplexService_GetAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js new file mode 100644 index 000000000000..7973b26944aa --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_environment.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetEnvironment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the environment: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetEnvironment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getEnvironment(request); + console.log(response); + } + + callGetEnvironment(); + // [END dataplex_v1_generated_DataplexService_GetEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js new file mode 100644 index 000000000000..53c41858fa3f --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the job: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END dataplex_v1_generated_DataplexService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js new file mode 100644 index 000000000000..51748ccc3840 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_lake.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetLake_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetLake() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getLake(request); + console.log(response); + } + + callGetLake(); + // [END dataplex_v1_generated_DataplexService_GetLake_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js new file mode 100644 index 000000000000..1273ace41702 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_task.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the task: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END dataplex_v1_generated_DataplexService_GetTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js new file mode 100644 index 000000000000..24eb38209277 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.get_zone.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_DataplexService_GetZone_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callGetZone() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getZone(request); + console.log(response); + } + + callGetZone(); + // [END dataplex_v1_generated_DataplexService_GetZone_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js new file mode 100644 index 000000000000..976c3c9b68df --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_asset_actions.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListAssetActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListAssetActions` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssetActions` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListAssetActions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listAssetActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssetActions(); + // [END dataplex_v1_generated_DataplexService_ListAssetActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js new file mode 100644 index 000000000000..fdccf0f02218 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_assets.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of asset to return. The service may return fewer than + * this value. If unspecified, at most 10 assets will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListAssets` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssets` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. + */ + // const filter = 'abc123' + /** + * Optional. Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END dataplex_v1_generated_DataplexService_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js new file mode 100644 index 000000000000..3535419f93c7 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_environments.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListEnvironments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of environments to return. The service may return fewer than + * this value. If unspecified, at most 10 environments will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListEnvironments` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEnvironments` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. + */ + // const filter = 'abc123' + /** + * Optional. Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListEnvironments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEnvironments(); + // [END dataplex_v1_generated_DataplexService_ListEnvironments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js new file mode 100644 index 000000000000..e5ecf3a696f7 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_jobs.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of jobs to return. The service may return fewer than + * this value. If unspecified, at most 10 jobs will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListJobs` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListJobs` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END dataplex_v1_generated_DataplexService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js new file mode 100644 index 000000000000..7a086e304109 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lake_actions.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListLakeActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListLakeActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakeActions` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListLakeActions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listLakeActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLakeActions(); + // [END dataplex_v1_generated_DataplexService_ListLakeActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js new file mode 100644 index 000000000000..bb74f9a9d85d --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_lakes.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListLakes_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the lake location, of the form: + * `projects/{project_number}/locations/{location_id}` + * where `location_id` refers to a GCP region. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of Lakes to return. The service may return fewer than this + * value. If unspecified, at most 10 lakes will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListLakes` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakes` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. + */ + // const filter = 'abc123' + /** + * Optional. Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListLakes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listLakesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLakes(); + // [END dataplex_v1_generated_DataplexService_ListLakes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js new file mode 100644 index 000000000000..6800957e1c34 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_sessions.js @@ -0,0 +1,88 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListSessions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of sessions to return. The service may return fewer than + * this value. If unspecified, at most 10 sessions will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListSessions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListSessions` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. The following `mode` filter is supported to return only the + * sessions belonging to the requester when the mode is USER and return + * sessions of all the users when the mode is ADMIN. When no filter is sent + * default to USER mode. + * NOTE: When the mode is ADMIN, the requester should have + * `dataplex.environments.listAllSessions` permission to list all sessions, + * in absence of the permission, the request fails. + * mode = ADMIN | USER + */ + // const filter = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListSessions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listSessionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSessions(); + // [END dataplex_v1_generated_DataplexService_ListSessions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js new file mode 100644 index 000000000000..61506b45db22 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_tasks.js @@ -0,0 +1,84 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListTasks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of tasks to return. The service may return fewer than this + * value. If unspecified, at most 10 tasks will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. + */ + // const filter = 'abc123' + /** + * Optional. Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END dataplex_v1_generated_DataplexService_ListTasks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js new file mode 100644 index 000000000000..d55fd4712ba3 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zone_actions.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListZoneActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListZoneActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZoneActions` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListZoneActions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listZoneActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListZoneActions(); + // [END dataplex_v1_generated_DataplexService_ListZoneActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js new file mode 100644 index 000000000000..4af5791ed2bd --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.list_zones.js @@ -0,0 +1,84 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_DataplexService_ListZones_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of zones to return. The service may return fewer than this + * value. If unspecified, at most 10 zones will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter request. + */ + // const filter = 'abc123' + /** + * Optional. Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callListZones() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listZonesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListZones(); + // [END dataplex_v1_generated_DataplexService_ListZones_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js new file mode 100644 index 000000000000..236e023a0839 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_asset.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(updateMask, asset) { + // [START dataplex_v1_generated_DataplexService_UpdateAsset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const asset = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callUpdateAsset() { + // Construct request + const request = { + updateMask, + asset, + }; + + // Run request + const [operation] = await dataplexClient.updateAsset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAsset(); + // [END dataplex_v1_generated_DataplexService_UpdateAsset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js new file mode 100644 index 000000000000..69dadebf3b21 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_environment.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(updateMask, environment) { + // [START dataplex_v1_generated_DataplexService_UpdateEnvironment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const environment = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callUpdateEnvironment() { + // Construct request + const request = { + updateMask, + environment, + }; + + // Run request + const [operation] = await dataplexClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEnvironment(); + // [END dataplex_v1_generated_DataplexService_UpdateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js new file mode 100644 index 000000000000..5f780c4ad140 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_lake.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(updateMask, lake) { + // [START dataplex_v1_generated_DataplexService_UpdateLake_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const lake = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callUpdateLake() { + // Construct request + const request = { + updateMask, + lake, + }; + + // Run request + const [operation] = await dataplexClient.updateLake(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateLake(); + // [END dataplex_v1_generated_DataplexService_UpdateLake_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js new file mode 100644 index 000000000000..201b61bbae17 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_task.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(updateMask, task) { + // [START dataplex_v1_generated_DataplexService_UpdateTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const task = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callUpdateTask() { + // Construct request + const request = { + updateMask, + task, + }; + + // Run request + const [operation] = await dataplexClient.updateTask(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTask(); + // [END dataplex_v1_generated_DataplexService_UpdateTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js new file mode 100644 index 000000000000..c52e94795a33 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/dataplex_service.update_zone.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(updateMask, zone) { + // [START dataplex_v1_generated_DataplexService_UpdateZone_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * Required. Update description. + * Only fields specified in `update_mask` are updated. + */ + // const zone = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {DataplexServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new DataplexServiceClient(); + + async function callUpdateZone() { + // Construct request + const request = { + updateMask, + zone, + }; + + // Run request + const [operation] = await dataplexClient.updateZone(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateZone(); + // [END dataplex_v1_generated_DataplexService_UpdateZone_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js new file mode 100644 index 000000000000..ba4ff6117da9 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_entity.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent, entity) { + // [START dataplex_v1_generated_MetadataService_CreateEntity_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const parent = 'abc123' + /** + * Required. Entity resource. + */ + // const entity = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callCreateEntity() { + // Construct request + const request = { + parent, + entity, + }; + + // Run request + const response = await dataplexClient.createEntity(request); + console.log(response); + } + + callCreateEntity(); + // [END dataplex_v1_generated_MetadataService_CreateEntity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js new file mode 100644 index 000000000000..9e0753beb53b --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.create_partition.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(parent, partition) { + // [START dataplex_v1_generated_MetadataService_CreatePartition_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + */ + // const parent = 'abc123' + /** + * Required. Partition resource. + */ + // const partition = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callCreatePartition() { + // Construct request + const request = { + parent, + partition, + }; + + // Run request + const response = await dataplexClient.createPartition(request); + console.log(response); + } + + callCreatePartition(); + // [END dataplex_v1_generated_MetadataService_CreatePartition_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js new file mode 100644 index 000000000000..90eddaa1cdde --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_entity.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(name, etag) { + // [START dataplex_v1_generated_MetadataService_DeleteEntity_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + */ + // const name = 'abc123' + /** + * Required. The etag associated with the entity, which can be retrieved with a + * GetEntity request. + */ + // const etag = 'abc123' + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callDeleteEntity() { + // Construct request + const request = { + name, + etag, + }; + + // Run request + const response = await dataplexClient.deleteEntity(request); + console.log(response); + } + + callDeleteEntity(); + // [END dataplex_v1_generated_MetadataService_DeleteEntity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js new file mode 100644 index 000000000000..51d605a85946 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.delete_partition.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_MetadataService_DeletePartition_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the partition. + * format: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + * The {partition_value_path} segment consists of an ordered sequence of + * partition values separated by "/". All values must be provided. + */ + // const name = 'abc123' + /** + * Optional. The etag associated with the partition. + */ + // const etag = 'abc123' + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callDeletePartition() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.deletePartition(request); + console.log(response); + } + + callDeletePartition(); + // [END dataplex_v1_generated_MetadataService_DeletePartition_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js new file mode 100644 index 000000000000..47c5db0d7857 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_entity.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_MetadataService_GetEntity_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.` + */ + // const name = 'abc123' + /** + * Optional. Used to select the subset of entity information to return. + * Defaults to `BASIC`. + */ + // const view = {} + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callGetEntity() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getEntity(request); + console.log(response); + } + + callGetEntity(); + // [END dataplex_v1_generated_MetadataService_GetEntity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js new file mode 100644 index 000000000000..f34e5bf8cedc --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.get_partition.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START dataplex_v1_generated_MetadataService_GetPartition_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the partition: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + * The {partition_value_path} segment consists of an ordered sequence of + * partition values separated by "/". All values must be provided. + */ + // const name = 'abc123' + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callGetPartition() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataplexClient.getPartition(request); + console.log(response); + } + + callGetPartition(); + // [END dataplex_v1_generated_MetadataService_GetPartition_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js new file mode 100644 index 000000000000..2f876cb7df04 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_entities.js @@ -0,0 +1,92 @@ +// Copyright 2022 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'; + +function main(parent, view) { + // [START dataplex_v1_generated_MetadataService_ListEntities_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + */ + // const parent = 'abc123' + /** + * Required. Specify the entity view to make a partial list request. + */ + // const view = {} + /** + * Optional. Maximum number of entities to return. The service may return fewer than + * this value. If unspecified, 100 entities will be returned by default. The + * maximum value is 500; larger values will will be truncated to 500. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListEntities` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEntities` must match the call that provided the + * page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The following filter parameters can be added to the URL to limit the + * entities returned by the API: + * - Entity ID: ?filter="id=entityID" + * - Asset ID: ?filter="asset=assetID" + * - Data path ?filter="data_path=gs://my-bucket" + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" + */ + // const filter = 'abc123' + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callListEntities() { + // Construct request + const request = { + parent, + view, + }; + + // Run request + const iterable = await dataplexClient.listEntitiesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEntities(); + // [END dataplex_v1_generated_MetadataService_ListEntities_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js new file mode 100644 index 000000000000..5ac9dda4d103 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.list_partitions.js @@ -0,0 +1,95 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START dataplex_v1_generated_MetadataService_ListPartitions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the parent entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of partitions to return. The service may return fewer than + * this value. If unspecified, 100 partitions will be returned by default. The + * maximum page size is 500; larger values will will be truncated to 500. + */ + // const pageSize = 1234 + /** + * Optional. Page token received from a previous `ListPartitions` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListPartitions` must match the call that provided the + * page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter the partitions returned to the caller using a key value pair + * expression. Supported operators and syntax: + * - logic operators: AND, OR + * - comparison operators: <, >, >=, <= ,=, != + * - LIKE operators: + * - The right hand of a LIKE operator supports "." and + * "*" for wildcard searches, for example "value1 LIKE ".*oo.*" + * - parenthetical grouping: ( ) + * Sample filter expression: `?filter="key1 < value1 OR key2 > value2" + * **Notes:** + * - Keys to the left of operators are case insensitive. + * - Partition results are sorted first by creation time, then by + * lexicographic order. + * - Up to 20 key value filter pairs are allowed, but due to performance + * considerations, only the first 10 will be used as a filter. + */ + // const filter = 'abc123' + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callListPartitions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataplexClient.listPartitionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPartitions(); + // [END dataplex_v1_generated_MetadataService_ListPartitions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js new file mode 100644 index 000000000000..d506f7527b4c --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/metadata_service.update_entity.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(entity) { + // [START dataplex_v1_generated_MetadataService_UpdateEntity_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Update description. + */ + // const entity = {} + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + */ + // const validateOnly = true + + // Imports the Dataplex library + const {MetadataServiceClient} = require('@google-cloud/dataplex').v1; + + // Instantiates a client + const dataplexClient = new MetadataServiceClient(); + + async function callUpdateEntity() { + // Construct request + const request = { + entity, + }; + + // Run request + const response = await dataplexClient.updateEntity(request); + console.log(response); + } + + callUpdateEntity(); + // [END dataplex_v1_generated_MetadataService_UpdateEntity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json new file mode 100644 index 000000000000..bd53a1c4ee42 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json @@ -0,0 +1,2307 @@ +{ + "clientLibrary": { + "name": "nodejs-dataplex", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataplex.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "dataplex_v1_generated_ContentService_CreateContent_async", + "title": "ContentService createContent Sample", + "origin": "API_DEFINITION", + "description": " Create a content.", + "canonical": true, + "file": "content_service.create_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateContent", + "fullName": "google.cloud.dataplex.v1.ContentService.CreateContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": ".google.cloud.dataplex.v1.Content" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.dataplex.v1.Content", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "CreateContent", + "fullName": "google.cloud.dataplex.v1.ContentService.CreateContent", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_UpdateContent_async", + "title": "ContentService updateContent Sample", + "origin": "API_DEFINITION", + "description": " Update a content. Only supports full resource update.", + "canonical": true, + "file": "content_service.update_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateContent", + "fullName": "google.cloud.dataplex.v1.ContentService.UpdateContent", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "content", + "type": ".google.cloud.dataplex.v1.Content" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.dataplex.v1.Content", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "UpdateContent", + "fullName": "google.cloud.dataplex.v1.ContentService.UpdateContent", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_DeleteContent_async", + "title": "ContentService deleteContent Sample", + "origin": "API_DEFINITION", + "description": " Delete a content.", + "canonical": true, + "file": "content_service.delete_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteContent", + "fullName": "google.cloud.dataplex.v1.ContentService.DeleteContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "DeleteContent", + "fullName": "google.cloud.dataplex.v1.ContentService.DeleteContent", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_GetContent_async", + "title": "ContentService getContent Sample", + "origin": "API_DEFINITION", + "description": " Get a content resource.", + "canonical": true, + "file": "content_service.get_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetContent", + "fullName": "google.cloud.dataplex.v1.ContentService.GetContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.dataplex.v1.GetContentRequest.ContentView" + } + ], + "resultType": ".google.cloud.dataplex.v1.Content", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "GetContent", + "fullName": "google.cloud.dataplex.v1.ContentService.GetContent", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_GetIamPolicy_async", + "title": "ContentService getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a contentitem resource. A `NOT_FOUND` error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it. Caller must have Google IAM `dataplex.content.getIamPolicy` permission on the resource.", + "canonical": true, + "file": "content_service.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.dataplex.v1.ContentService.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.dataplex.v1.ContentService.GetIamPolicy", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_SetIamPolicy_async", + "title": "ContentService setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on the specified contentitem resource. Replaces any existing policy. Caller must have Google IAM `dataplex.content.setIamPolicy` permission on the resource.", + "canonical": true, + "file": "content_service.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.dataplex.v1.ContentService.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.dataplex.v1.ContentService.SetIamPolicy", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_TestIamPermissions_async", + "title": "ContentService testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the caller's permissions on a resource. If the resource does not exist, an empty set of permissions is returned (a `NOT_FOUND` error is not returned). A caller is not required to have Google IAM permission to make this request. 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.", + "canonical": true, + "file": "content_service.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.dataplex.v1.ContentService.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.dataplex.v1.ContentService.TestIamPermissions", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_ContentService_ListContent_async", + "title": "ContentService listContent Sample", + "origin": "API_DEFINITION", + "description": " List content.", + "canonical": true, + "file": "content_service.list_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListContent", + "fullName": "google.cloud.dataplex.v1.ContentService.ListContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListContentResponse", + "client": { + "shortName": "ContentServiceClient", + "fullName": "google.cloud.dataplex.v1.ContentServiceClient" + }, + "method": { + "shortName": "ListContent", + "fullName": "google.cloud.dataplex.v1.ContentService.ListContent", + "service": { + "shortName": "ContentService", + "fullName": "google.cloud.dataplex.v1.ContentService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CreateLake_async", + "title": "ContentService createLake Sample", + "origin": "API_DEFINITION", + "description": " Creates a lake resource.", + "canonical": true, + "file": "dataplex_service.create_lake.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateLake", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "lake_id", + "type": "TYPE_STRING" + }, + { + "name": "lake", + "type": ".google.cloud.dataplex.v1.Lake" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CreateLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateLake", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_UpdateLake_async", + "title": "ContentService updateLake Sample", + "origin": "API_DEFINITION", + "description": " Updates a lake resource.", + "canonical": true, + "file": "dataplex_service.update_lake.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateLake", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "lake", + "type": ".google.cloud.dataplex.v1.Lake" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "UpdateLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateLake", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_DeleteLake_async", + "title": "ContentService deleteLake Sample", + "origin": "API_DEFINITION", + "description": " Deletes a lake resource. All zones within the lake must be deleted before the lake can be deleted.", + "canonical": true, + "file": "dataplex_service.delete_lake.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteLake", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "DeleteLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteLake", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListLakes_async", + "title": "ContentService listLakes Sample", + "origin": "API_DEFINITION", + "description": " Lists lake resources in a project and location.", + "canonical": true, + "file": "dataplex_service.list_lakes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLakes", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListLakes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListLakesResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListLakes", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListLakes", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetLake_async", + "title": "ContentService getLake Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a lake resource.", + "canonical": true, + "file": "dataplex_service.get_lake.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetLake", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Lake", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetLake", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetLake", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListLakeActions_async", + "title": "ContentService listLakeActions Sample", + "origin": "API_DEFINITION", + "description": " Lists action resources in a lake.", + "canonical": true, + "file": "dataplex_service.list_lake_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListLakeActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListLakeActions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListActionsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListLakeActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListLakeActions", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CreateZone_async", + "title": "ContentService createZone Sample", + "origin": "API_DEFINITION", + "description": " Creates a zone resource within a lake.", + "canonical": true, + "file": "dataplex_service.create_zone.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateZone", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "zone_id", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": ".google.cloud.dataplex.v1.Zone" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CreateZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateZone", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_UpdateZone_async", + "title": "ContentService updateZone Sample", + "origin": "API_DEFINITION", + "description": " Updates a zone resource.", + "canonical": true, + "file": "dataplex_service.update_zone.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateZone", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "zone", + "type": ".google.cloud.dataplex.v1.Zone" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "UpdateZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateZone", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_DeleteZone_async", + "title": "ContentService deleteZone Sample", + "origin": "API_DEFINITION", + "description": " Deletes a zone resource. All assets within a zone must be deleted before the zone can be deleted.", + "canonical": true, + "file": "dataplex_service.delete_zone.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteZone", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "DeleteZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteZone", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListZones_async", + "title": "ContentService listZones Sample", + "origin": "API_DEFINITION", + "description": " Lists zone resources in a lake.", + "canonical": true, + "file": "dataplex_service.list_zones.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListZones", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListZones", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListZonesResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListZones", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListZones", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetZone_async", + "title": "ContentService getZone Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a zone resource.", + "canonical": true, + "file": "dataplex_service.get_zone.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetZone", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Zone", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetZone", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetZone", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListZoneActions_async", + "title": "ContentService listZoneActions Sample", + "origin": "API_DEFINITION", + "description": " Lists action resources in a zone.", + "canonical": true, + "file": "dataplex_service.list_zone_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListZoneActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListZoneActions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListActionsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListZoneActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListZoneActions", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CreateAsset_async", + "title": "ContentService createAsset Sample", + "origin": "API_DEFINITION", + "description": " Creates an asset resource.", + "canonical": true, + "file": "dataplex_service.create_asset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateAsset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "asset_id", + "type": "TYPE_STRING" + }, + { + "name": "asset", + "type": ".google.cloud.dataplex.v1.Asset" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CreateAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateAsset", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_UpdateAsset_async", + "title": "ContentService updateAsset Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset resource.", + "canonical": true, + "file": "dataplex_service.update_asset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateAsset", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "asset", + "type": ".google.cloud.dataplex.v1.Asset" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "UpdateAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateAsset", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_DeleteAsset_async", + "title": "ContentService deleteAsset Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset resource. The referenced storage resource is detached (default) or deleted based on the associated Lifecycle policy.", + "canonical": true, + "file": "dataplex_service.delete_asset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteAsset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "DeleteAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteAsset", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListAssets_async", + "title": "ContentService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists asset resources in a zone.", + "canonical": true, + "file": "dataplex_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListAssetsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListAssets", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetAsset_async", + "title": "ContentService getAsset Sample", + "origin": "API_DEFINITION", + "description": " Retrieves an asset resource.", + "canonical": true, + "file": "dataplex_service.get_asset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetAsset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Asset", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetAsset", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetAsset", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListAssetActions_async", + "title": "ContentService listAssetActions Sample", + "origin": "API_DEFINITION", + "description": " Lists action resources in an asset.", + "canonical": true, + "file": "dataplex_service.list_asset_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssetActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListAssetActions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListActionsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListAssetActions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListAssetActions", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CreateTask_async", + "title": "ContentService createTask Sample", + "origin": "API_DEFINITION", + "description": " Creates a task resource within a lake.", + "canonical": true, + "file": "dataplex_service.create_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateTask", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "task_id", + "type": "TYPE_STRING" + }, + { + "name": "task", + "type": ".google.cloud.dataplex.v1.Task" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CreateTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateTask", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_UpdateTask_async", + "title": "ContentService updateTask Sample", + "origin": "API_DEFINITION", + "description": " Update the task resource.", + "canonical": true, + "file": "dataplex_service.update_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateTask", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "task", + "type": ".google.cloud.dataplex.v1.Task" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "UpdateTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateTask", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_DeleteTask_async", + "title": "ContentService deleteTask Sample", + "origin": "API_DEFINITION", + "description": " Delete the task resource.", + "canonical": true, + "file": "dataplex_service.delete_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "DeleteTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteTask", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListTasks_async", + "title": "ContentService listTasks Sample", + "origin": "API_DEFINITION", + "description": " Lists tasks under the given lake.", + "canonical": true, + "file": "dataplex_service.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListTasksResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListTasks", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetTask_async", + "title": "ContentService getTask Sample", + "origin": "API_DEFINITION", + "description": " Get task resource.", + "canonical": true, + "file": "dataplex_service.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Task", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetTask", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListJobs_async", + "title": "ContentService listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists Jobs under the given task.", + "canonical": true, + "file": "dataplex_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListJobsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListJobs", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetJob_async", + "title": "ContentService getJob Sample", + "origin": "API_DEFINITION", + "description": " Get job resource.", + "canonical": true, + "file": "dataplex_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Job", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetJob", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CancelJob_async", + "title": "ContentService cancelJob Sample", + "origin": "API_DEFINITION", + "description": " Cancel jobs running for the task resource.", + "canonical": true, + "file": "dataplex_service.cancel_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelJob", + "fullName": "google.cloud.dataplex.v1.DataplexService.CancelJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CancelJob", + "fullName": "google.cloud.dataplex.v1.DataplexService.CancelJob", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_CreateEnvironment_async", + "title": "ContentService createEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Create an environment resource.", + "canonical": true, + "file": "dataplex_service.create_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateEnvironment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "environment_id", + "type": "TYPE_STRING" + }, + { + "name": "environment", + "type": ".google.cloud.dataplex.v1.Environment" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.CreateEnvironment", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_UpdateEnvironment_async", + "title": "ContentService updateEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Update the environment resource.", + "canonical": true, + "file": "dataplex_service.update_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateEnvironment", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "environment", + "type": ".google.cloud.dataplex.v1.Environment" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.UpdateEnvironment", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_DeleteEnvironment_async", + "title": "ContentService deleteEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Delete the environment resource. All the child resources must have been deleted before environment deletion can be initiated.", + "canonical": true, + "file": "dataplex_service.delete_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.DeleteEnvironment", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListEnvironments_async", + "title": "ContentService listEnvironments Sample", + "origin": "API_DEFINITION", + "description": " Lists environments under the given lake.", + "canonical": true, + "file": "dataplex_service.list_environments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListEnvironments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListEnvironmentsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListEnvironments", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_GetEnvironment_async", + "title": "ContentService getEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Get environment resource.", + "canonical": true, + "file": "dataplex_service.get_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Environment", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.dataplex.v1.DataplexService.GetEnvironment", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_DataplexService_ListSessions_async", + "title": "ContentService listSessions Sample", + "origin": "API_DEFINITION", + "description": " Lists session resources in an environment.", + "canonical": true, + "file": "dataplex_service.list_sessions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSessions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListSessions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListSessionsResponse", + "client": { + "shortName": "DataplexServiceClient", + "fullName": "google.cloud.dataplex.v1.DataplexServiceClient" + }, + "method": { + "shortName": "ListSessions", + "fullName": "google.cloud.dataplex.v1.DataplexService.ListSessions", + "service": { + "shortName": "DataplexService", + "fullName": "google.cloud.dataplex.v1.DataplexService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_CreateEntity_async", + "title": "ContentService createEntity Sample", + "origin": "API_DEFINITION", + "description": " Create a metadata entity.", + "canonical": true, + "file": "metadata_service.create_entity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.CreateEntity", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "entity", + "type": ".google.cloud.dataplex.v1.Entity" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.dataplex.v1.Entity", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "CreateEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.CreateEntity", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_UpdateEntity_async", + "title": "ContentService updateEntity Sample", + "origin": "API_DEFINITION", + "description": " Update a metadata entity. Only supports full resource update.", + "canonical": true, + "file": "metadata_service.update_entity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.UpdateEntity", + "async": true, + "parameters": [ + { + "name": "entity", + "type": ".google.cloud.dataplex.v1.Entity" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.dataplex.v1.Entity", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "UpdateEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.UpdateEntity", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_DeleteEntity_async", + "title": "ContentService deleteEntity Sample", + "origin": "API_DEFINITION", + "description": " Delete a metadata entity.", + "canonical": true, + "file": "metadata_service.delete_entity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.DeleteEntity", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "DeleteEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.DeleteEntity", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_GetEntity_async", + "title": "ContentService getEntity Sample", + "origin": "API_DEFINITION", + "description": " Get a metadata entity.", + "canonical": true, + "file": "metadata_service.get_entity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.GetEntity", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.dataplex.v1.GetEntityRequest.EntityView" + } + ], + "resultType": ".google.cloud.dataplex.v1.Entity", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "GetEntity", + "fullName": "google.cloud.dataplex.v1.MetadataService.GetEntity", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_ListEntities_async", + "title": "ContentService listEntities Sample", + "origin": "API_DEFINITION", + "description": " List metadata entities in a zone.", + "canonical": true, + "file": "metadata_service.list_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEntities", + "fullName": "google.cloud.dataplex.v1.MetadataService.ListEntities", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.dataplex.v1.ListEntitiesRequest.EntityView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListEntitiesResponse", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "ListEntities", + "fullName": "google.cloud.dataplex.v1.MetadataService.ListEntities", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_CreatePartition_async", + "title": "ContentService createPartition Sample", + "origin": "API_DEFINITION", + "description": " Create a metadata partition.", + "canonical": true, + "file": "metadata_service.create_partition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.CreatePartition", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "partition", + "type": ".google.cloud.dataplex.v1.Partition" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.dataplex.v1.Partition", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "CreatePartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.CreatePartition", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_DeletePartition_async", + "title": "ContentService deletePartition Sample", + "origin": "API_DEFINITION", + "description": " Delete a metadata partition.", + "canonical": true, + "file": "metadata_service.delete_partition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.DeletePartition", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "DeletePartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.DeletePartition", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_GetPartition_async", + "title": "ContentService getPartition Sample", + "origin": "API_DEFINITION", + "description": " Get a metadata partition of an entity.", + "canonical": true, + "file": "metadata_service.get_partition.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.GetPartition", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.Partition", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "GetPartition", + "fullName": "google.cloud.dataplex.v1.MetadataService.GetPartition", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + }, + { + "regionTag": "dataplex_v1_generated_MetadataService_ListPartitions_async", + "title": "ContentService listPartitions Sample", + "origin": "API_DEFINITION", + "description": " List metadata partitions of an entity.", + "canonical": true, + "file": "metadata_service.list_partitions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPartitions", + "fullName": "google.cloud.dataplex.v1.MetadataService.ListPartitions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataplex.v1.ListPartitionsResponse", + "client": { + "shortName": "MetadataServiceClient", + "fullName": "google.cloud.dataplex.v1.MetadataServiceClient" + }, + "method": { + "shortName": "ListPartitions", + "fullName": "google.cloud.dataplex.v1.MetadataService.ListPartitions", + "service": { + "shortName": "MetadataService", + "fullName": "google.cloud.dataplex.v1.MetadataService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-dataplex/samples/package.json b/packages/google-cloud-dataplex/samples/package.json new file mode 100644 index 000000000000..6a1dc8e5646d --- /dev/null +++ b/packages/google-cloud-dataplex/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-dataplex", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/dataplex": "^2.2.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-dataplex/samples/quickstart.js b/packages/google-cloud-dataplex/samples/quickstart.js new file mode 100644 index 000000000000..a5440a474e17 --- /dev/null +++ b/packages/google-cloud-dataplex/samples/quickstart.js @@ -0,0 +1,49 @@ +// Copyright 2022 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. + +'use strict'; + +async function main(projectId, location) { + // [START nodejs_dataplex_quickstart] + // Imports the Google Cloud client library + + // eslint-disable-next-line node/no-missing-require + const {DataplexServiceClient} = require('@google-cloud/dataplex'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + // const location = 'my-location' + + // Creates a client1046198160504 + // eslint-disable-next-line no-unused-vars + const client = new DataplexServiceClient(); + + async function listLakes() { + const [lakes] = await client.listLakes({ + parent: `projects/${projectId}/locations/${location}`, + }); + console.info(lakes); + } + listLakes(); + // [END nodejs_dataplex_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-dataplex/samples/test/quickstart.js b/packages/google-cloud-dataplex/samples/test/quickstart.js new file mode 100644 index 000000000000..a47fe5d383df --- /dev/null +++ b/packages/google-cloud-dataplex/samples/test/quickstart.js @@ -0,0 +1,43 @@ +// Copyright 2022 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. + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {DataplexServiceClient} = require('@google-cloud/dataplex'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new DataplexServiceClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId} us-central1`, { + cwd, + }); + assert.match(stdout, /\[\]/); + }); +}); diff --git a/packages/google-cloud-dataplex/src/index.ts b/packages/google-cloud-dataplex/src/index.ts new file mode 100644 index 000000000000..f44a72d62375 --- /dev/null +++ b/packages/google-cloud-dataplex/src/index.ts @@ -0,0 +1,36 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ContentServiceClient = v1.ContentServiceClient; +type ContentServiceClient = v1.ContentServiceClient; +const DataplexServiceClient = v1.DataplexServiceClient; +type DataplexServiceClient = v1.DataplexServiceClient; +const MetadataServiceClient = v1.MetadataServiceClient; +type MetadataServiceClient = v1.MetadataServiceClient; + +export {v1, ContentServiceClient, DataplexServiceClient, MetadataServiceClient}; +export default { + v1, + ContentServiceClient, + DataplexServiceClient, + MetadataServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-dataplex/src/v1/content_service_client.ts b/packages/google-cloud-dataplex/src/v1/content_service_client.ts new file mode 100644 index 000000000000..4f4b95b45a57 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/content_service_client.ts @@ -0,0 +1,2682 @@ +// Copyright 2022 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, + GrpcClientOptions, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} 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/content_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './content_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * ContentService manages Notebook and SQL Scripts for Dataplex. + * @class + * @memberof v1 + */ +export class ContentServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + contentServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ContentServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 ContentServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ContentServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}' + ), + contentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/content/{content}' + ), + entityPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}' + ), + lakePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}' + ), + partitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}' + ), + projectLocationLakeActionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/actions/{action}' + ), + projectLocationLakeZoneActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}' + ), + projectLocationLakeZoneAssetActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}' + ), + zonePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}' + ), + }; + + // 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 = { + listContent: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'content' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/lakes/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataplex.v1.ContentService', + 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.contentServiceStub) { + return this.contentServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataplex.v1.ContentService. + this.contentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dataplex.v1.ContentService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataplex.v1.ContentService, + 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 contentServiceStubMethods = [ + 'createContent', + 'updateContent', + 'deleteContent', + 'getContent', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + 'listContent', + ]; + for (const methodName of contentServiceStubMethods) { + const callPromise = this.contentServiceStub.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.contentServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataplex.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataplex.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Create a content. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * @param {google.cloud.dataplex.v1.Content} request.content + * Required. Content resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 [Content]{@link google.cloud.dataplex.v1.Content}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.create_content.js + * region_tag:dataplex_v1_generated_ContentService_CreateContent_async + */ + createContent( + request?: protos.google.cloud.dataplex.v1.ICreateContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.ICreateContentRequest | undefined, + {} | undefined + ] + >; + createContent( + request: protos.google.cloud.dataplex.v1.ICreateContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.ICreateContentRequest | null | undefined, + {} | null | undefined + > + ): void; + createContent( + request: protos.google.cloud.dataplex.v1.ICreateContentRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.ICreateContentRequest | null | undefined, + {} | null | undefined + > + ): void; + createContent( + request?: protos.google.cloud.dataplex.v1.ICreateContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IContent, + | protos.google.cloud.dataplex.v1.ICreateContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.ICreateContentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.ICreateContentRequest | 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.createContent(request, options, callback); + } + /** + * Update a content. Only supports full resource update. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Content} request.content + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 [Content]{@link google.cloud.dataplex.v1.Content}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.update_content.js + * region_tag:dataplex_v1_generated_ContentService_UpdateContent_async + */ + updateContent( + request?: protos.google.cloud.dataplex.v1.IUpdateContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IUpdateContentRequest | undefined, + {} | undefined + ] + >; + updateContent( + request: protos.google.cloud.dataplex.v1.IUpdateContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IUpdateContentRequest | null | undefined, + {} | null | undefined + > + ): void; + updateContent( + request: protos.google.cloud.dataplex.v1.IUpdateContentRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IUpdateContentRequest | null | undefined, + {} | null | undefined + > + ): void; + updateContent( + request?: protos.google.cloud.dataplex.v1.IUpdateContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IContent, + | protos.google.cloud.dataplex.v1.IUpdateContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IUpdateContentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IUpdateContentRequest | 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({ + 'content.name': request.content!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateContent(request, options, callback); + } + /** + * Delete a content. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the content: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.delete_content.js + * region_tag:dataplex_v1_generated_ContentService_DeleteContent_async + */ + deleteContent( + request?: protos.google.cloud.dataplex.v1.IDeleteContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteContentRequest | undefined, + {} | undefined + ] + >; + deleteContent( + request: protos.google.cloud.dataplex.v1.IDeleteContentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteContentRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteContent( + request: protos.google.cloud.dataplex.v1.IDeleteContentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteContentRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteContent( + request?: protos.google.cloud.dataplex.v1.IDeleteContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeleteContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteContentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteContentRequest | 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.deleteContent(request, options, callback); + } + /** + * Get a content resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the content: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id} + * @param {google.cloud.dataplex.v1.GetContentRequest.ContentView} [request.view] + * Optional. Specify content view to make a partial request. + * @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 [Content]{@link google.cloud.dataplex.v1.Content}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.get_content.js + * region_tag:dataplex_v1_generated_ContentService_GetContent_async + */ + getContent( + request?: protos.google.cloud.dataplex.v1.IGetContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | undefined, + {} | undefined + ] + >; + getContent( + request: protos.google.cloud.dataplex.v1.IGetContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | null | undefined, + {} | null | undefined + > + ): void; + getContent( + request: protos.google.cloud.dataplex.v1.IGetContentRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | null | undefined, + {} | null | undefined + > + ): void; + getContent( + request?: protos.google.cloud.dataplex.v1.IGetContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent, + protos.google.cloud.dataplex.v1.IGetContentRequest | 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.getContent(request, options, callback); + } + /** + * Gets the access control policy for a contentitem resource. A `NOT_FOUND` + * error is returned if the resource does not exist. An empty policy is + * returned if the resource exists but does not have a policy set on it. + * + * Caller must have Google IAM `dataplex.content.getIamPolicy` permission + * on the resource. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.get_iam_policy.js + * region_tag:dataplex_v1_generated_ContentService_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the access control policy on the specified contentitem resource. + * Replaces any existing policy. + * + * Caller must have Google IAM `dataplex.content.setIamPolicy` permission + * on the resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.set_iam_policy.js + * region_tag:dataplex_v1_generated_ContentService_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the caller's permissions on a resource. + * If the resource does not exist, an empty set of + * permissions is returned (a `NOT_FOUND` error is not returned). + * + * A caller is not required to have Google IAM permission to make this + * request. + * + * 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/content_service.test_iam_permissions.js + * region_tag:dataplex_v1_generated_ContentService_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * List content. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * @param {number} [request.pageSize] + * Optional. Maximum number of content to return. The service may return fewer than + * this value. If unspecified, at most 10 content will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListContent` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListContent` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. Filters are case-sensitive. + * The following formats are supported: + * + * labels.key1 = "value1" + * labels:key1 + * type = "NOTEBOOK" + * type = "SQL_SCRIPT" + * + * These restrictions can be coinjoined with AND, OR and NOT conjunctions. + * @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 [Content]{@link google.cloud.dataplex.v1.Content}. + * 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 `listContentAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContent( + request?: protos.google.cloud.dataplex.v1.IListContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent[], + protos.google.cloud.dataplex.v1.IListContentRequest | null, + protos.google.cloud.dataplex.v1.IListContentResponse + ] + >; + listContent( + request: protos.google.cloud.dataplex.v1.IListContentRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListContentRequest, + protos.google.cloud.dataplex.v1.IListContentResponse | null | undefined, + protos.google.cloud.dataplex.v1.IContent + > + ): void; + listContent( + request: protos.google.cloud.dataplex.v1.IListContentRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListContentRequest, + protos.google.cloud.dataplex.v1.IListContentResponse | null | undefined, + protos.google.cloud.dataplex.v1.IContent + > + ): void; + listContent( + request?: protos.google.cloud.dataplex.v1.IListContentRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListContentRequest, + | protos.google.cloud.dataplex.v1.IListContentResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IContent + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListContentRequest, + protos.google.cloud.dataplex.v1.IListContentResponse | null | undefined, + protos.google.cloud.dataplex.v1.IContent + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IContent[], + protos.google.cloud.dataplex.v1.IListContentRequest | null, + protos.google.cloud.dataplex.v1.IListContentResponse + ] + > | 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.listContent(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 resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * @param {number} [request.pageSize] + * Optional. Maximum number of content to return. The service may return fewer than + * this value. If unspecified, at most 10 content will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListContent` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListContent` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. Filters are case-sensitive. + * The following formats are supported: + * + * labels.key1 = "value1" + * labels:key1 + * type = "NOTEBOOK" + * type = "SQL_SCRIPT" + * + * These restrictions can be coinjoined with AND, OR and NOT conjunctions. + * @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 [Content]{@link google.cloud.dataplex.v1.Content} 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 `listContentAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listContentStream( + request?: protos.google.cloud.dataplex.v1.IListContentRequest, + 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['listContent']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContent.createStream( + this.innerApiCalls.listContent as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listContent`, 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 resource name of the parent lake: + * projects/{project_id}/locations/{location_id}/lakes/{lake_id} + * @param {number} [request.pageSize] + * Optional. Maximum number of content to return. The service may return fewer than + * this value. If unspecified, at most 10 content will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListContent` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListContent` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. Filters are case-sensitive. + * The following formats are supported: + * + * labels.key1 = "value1" + * labels:key1 + * type = "NOTEBOOK" + * type = "SQL_SCRIPT" + * + * These restrictions can be coinjoined with AND, OR and NOT conjunctions. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Content]{@link google.cloud.dataplex.v1.Content}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/content_service.list_content.js + * region_tag:dataplex_v1_generated_ContentService_ListContent_async + */ + listContentAsync( + request?: protos.google.cloud.dataplex.v1.IListContentRequest, + 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['listContent']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listContent.asyncIterate( + this.innerApiCalls['listContent'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string + ) { + return this.pathTemplates.assetPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + }); + } + + /** + * Parse the project from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the lake from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).lake; + } + + /** + * Parse the zone from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).zone; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified content resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} content + * @returns {string} Resource name string. + */ + contentPath( + project: string, + location: string, + lake: string, + content: string + ) { + return this.pathTemplates.contentPathTemplate.render({ + project: project, + location: location, + lake: lake, + content: content, + }); + } + + /** + * Parse the project from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).project; + } + + /** + * Parse the location from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).location; + } + + /** + * Parse the lake from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).lake; + } + + /** + * Parse the content from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the content. + */ + matchContentFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).content; + } + + /** + * Return a fully-qualified entity resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @returns {string} Resource name string. + */ + entityPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string + ) { + return this.pathTemplates.entityPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + }); + } + + /** + * Parse the project from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).project; + } + + /** + * Parse the location from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).location; + } + + /** + * Parse the lake from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).lake; + } + + /** + * Parse the zone from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).zone; + } + + /** + * Parse the entity from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).entity; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + lake: string, + environment: string + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the lake from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .lake; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath( + project: string, + location: string, + lake: string, + task: string, + job: string + ) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the lake from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).lake; + } + + /** + * Parse the task from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the task. + */ + matchTaskFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).task; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified lake resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @returns {string} Resource name string. + */ + lakePath(project: string, location: string, lake: string) { + return this.pathTemplates.lakePathTemplate.render({ + project: project, + location: location, + lake: lake, + }); + } + + /** + * Parse the project from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).project; + } + + /** + * Parse the location from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).location; + } + + /** + * Parse the lake from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).lake; + } + + /** + * Return a fully-qualified partition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @param {string} partition + * @returns {string} Resource name string. + */ + partitionPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string, + partition: string + ) { + return this.pathTemplates.partitionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + partition: partition, + }); + } + + /** + * Parse the project from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .project; + } + + /** + * Parse the location from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .location; + } + + /** + * Parse the lake from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).lake; + } + + /** + * Parse the zone from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).zone; + } + + /** + * Parse the entity from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).entity; + } + + /** + * Parse the partition from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the partition. + */ + matchPartitionFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .partition; + } + + /** + * Return a fully-qualified projectLocationLakeAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeActionPath( + project: string, + location: string, + lake: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).lake; + } + + /** + * Parse the action from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneActionPath( + project: string, + location: string, + lake: string, + zone: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).zone; + } + + /** + * Parse the action from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAssetAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneAssetActionPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render( + { + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + action: action, + } + ); + } + + /** + * Parse the project from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).zone; + } + + /** + * Parse the asset from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).asset; + } + + /** + * Parse the action from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).action; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath( + project: string, + location: string, + lake: string, + environment: string, + session: string + ) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the lake from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).lake; + } + + /** + * Parse the environment from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName) + .environment; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project: string, location: string, lake: string, task: string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the lake from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).lake; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified zone resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @returns {string} Resource name string. + */ + zonePath(project: string, location: string, lake: string, zone: string) { + return this.pathTemplates.zonePathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + }); + } + + /** + * Parse the project from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the project. + */ + matchProjectFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).project; + } + + /** + * Parse the location from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the location. + */ + matchLocationFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).location; + } + + /** + * Parse the lake from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).lake; + } + + /** + * Parse the zone from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).zone; + } + + /** + * 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.contentServiceStub && !this._terminated) { + return this.contentServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dataplex/src/v1/content_service_client_config.json b/packages/google-cloud-dataplex/src/v1/content_service_client_config.json new file mode 100644 index 000000000000..2f8dc65d04f8 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/content_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.dataplex.v1.ContentService": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateContent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateContent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteContent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetContent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListContent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-dataplex/src/v1/content_service_proto_list.json b/packages/google-cloud-dataplex/src/v1/content_service_proto_list.json new file mode 100644 index 000000000000..37d1b3510856 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/content_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/dataplex/v1/analyze.proto", + "../../protos/google/cloud/dataplex/v1/content.proto", + "../../protos/google/cloud/dataplex/v1/logs.proto", + "../../protos/google/cloud/dataplex/v1/metadata.proto", + "../../protos/google/cloud/dataplex/v1/resources.proto", + "../../protos/google/cloud/dataplex/v1/service.proto", + "../../protos/google/cloud/dataplex/v1/tasks.proto" +] diff --git a/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts b/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts new file mode 100644 index 000000000000..9740d49eed1e --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts @@ -0,0 +1,6949 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} 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/dataplex_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dataplex_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Dataplex service provides data lakes as a service. The primary resources + * offered by this service are Lakes, Zones and Assets which collectively allow + * a data administrator to organize, manage, secure and catalog data across + * their organization located across cloud projects in a variety of storage + * systems including Cloud Storage and BigQuery. + * @class + * @memberof v1 + */ +export class DataplexServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataplexServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataplexServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 DataplexServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataplexServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}' + ), + contentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/content/{content}' + ), + entityPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}' + ), + lakePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + partitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}' + ), + projectLocationLakeActionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/actions/{action}' + ), + projectLocationLakeZoneActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}' + ), + projectLocationLakeZoneAssetActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}' + ), + zonePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}' + ), + }; + + // 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 = { + listLakes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'lakes' + ), + listLakeActions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'actions' + ), + listZones: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'zones' + ), + listZoneActions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'actions' + ), + listAssets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assets' + ), + listAssetActions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'actions' + ), + listTasks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tasks' + ), + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + listEnvironments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'environments' + ), + listSessions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sessions' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/lakes/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createLakeResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Lake' + ) as gax.protobuf.Type; + const createLakeMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateLakeResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Lake' + ) as gax.protobuf.Type; + const updateLakeMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteLakeResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteLakeMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createZoneResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Zone' + ) as gax.protobuf.Type; + const createZoneMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateZoneResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Zone' + ) as gax.protobuf.Type; + const updateZoneMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteZoneResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteZoneMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createAssetResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Asset' + ) as gax.protobuf.Type; + const createAssetMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateAssetResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Asset' + ) as gax.protobuf.Type; + const updateAssetMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteAssetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteAssetMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTaskResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Task' + ) as gax.protobuf.Type; + const createTaskMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTaskResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Task' + ) as gax.protobuf.Type; + const updateTaskMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTaskResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTaskMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Environment' + ) as gax.protobuf.Type; + const createEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.Environment' + ) as gax.protobuf.Type; + const updateEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteEnvironmentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.dataplex.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createLake: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createLakeResponse.decode.bind(createLakeResponse), + createLakeMetadata.decode.bind(createLakeMetadata) + ), + updateLake: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateLakeResponse.decode.bind(updateLakeResponse), + updateLakeMetadata.decode.bind(updateLakeMetadata) + ), + deleteLake: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteLakeResponse.decode.bind(deleteLakeResponse), + deleteLakeMetadata.decode.bind(deleteLakeMetadata) + ), + createZone: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createZoneResponse.decode.bind(createZoneResponse), + createZoneMetadata.decode.bind(createZoneMetadata) + ), + updateZone: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateZoneResponse.decode.bind(updateZoneResponse), + updateZoneMetadata.decode.bind(updateZoneMetadata) + ), + deleteZone: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteZoneResponse.decode.bind(deleteZoneResponse), + deleteZoneMetadata.decode.bind(deleteZoneMetadata) + ), + createAsset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAssetResponse.decode.bind(createAssetResponse), + createAssetMetadata.decode.bind(createAssetMetadata) + ), + updateAsset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAssetResponse.decode.bind(updateAssetResponse), + updateAssetMetadata.decode.bind(updateAssetMetadata) + ), + deleteAsset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAssetResponse.decode.bind(deleteAssetResponse), + deleteAssetMetadata.decode.bind(deleteAssetMetadata) + ), + createTask: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTaskResponse.decode.bind(createTaskResponse), + createTaskMetadata.decode.bind(createTaskMetadata) + ), + updateTask: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTaskResponse.decode.bind(updateTaskResponse), + updateTaskMetadata.decode.bind(updateTaskMetadata) + ), + deleteTask: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTaskResponse.decode.bind(deleteTaskResponse), + deleteTaskMetadata.decode.bind(deleteTaskMetadata) + ), + createEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEnvironmentResponse.decode.bind(createEnvironmentResponse), + createEnvironmentMetadata.decode.bind(createEnvironmentMetadata) + ), + updateEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), + updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata) + ), + deleteEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), + deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataplex.v1.DataplexService', + 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.dataplexServiceStub) { + return this.dataplexServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataplex.v1.DataplexService. + this.dataplexServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dataplex.v1.DataplexService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataplex.v1.DataplexService, + 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 dataplexServiceStubMethods = [ + 'createLake', + 'updateLake', + 'deleteLake', + 'listLakes', + 'getLake', + 'listLakeActions', + 'createZone', + 'updateZone', + 'deleteZone', + 'listZones', + 'getZone', + 'listZoneActions', + 'createAsset', + 'updateAsset', + 'deleteAsset', + 'listAssets', + 'getAsset', + 'listAssetActions', + 'createTask', + 'updateTask', + 'deleteTask', + 'listTasks', + 'getTask', + 'listJobs', + 'getJob', + 'cancelJob', + 'createEnvironment', + 'updateEnvironment', + 'deleteEnvironment', + 'listEnvironments', + 'getEnvironment', + 'listSessions', + ]; + for (const methodName of dataplexServiceStubMethods) { + const callPromise = this.dataplexServiceStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataplexServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataplex.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataplex.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Retrieves a lake resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @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 [Lake]{@link google.cloud.dataplex.v1.Lake}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_lake.js + * region_tag:dataplex_v1_generated_DataplexService_GetLake_async + */ + getLake( + request?: protos.google.cloud.dataplex.v1.IGetLakeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | undefined, + {} | undefined + ] + >; + getLake( + request: protos.google.cloud.dataplex.v1.IGetLakeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | null | undefined, + {} | null | undefined + > + ): void; + getLake( + request: protos.google.cloud.dataplex.v1.IGetLakeRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | null | undefined, + {} | null | undefined + > + ): void; + getLake( + request?: protos.google.cloud.dataplex.v1.IGetLakeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IGetLakeRequest | 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.getLake(request, options, callback); + } + /** + * Retrieves a zone resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @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 [Zone]{@link google.cloud.dataplex.v1.Zone}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_zone.js + * region_tag:dataplex_v1_generated_DataplexService_GetZone_async + */ + getZone( + request?: protos.google.cloud.dataplex.v1.IGetZoneRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | undefined, + {} | undefined + ] + >; + getZone( + request: protos.google.cloud.dataplex.v1.IGetZoneRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): void; + getZone( + request: protos.google.cloud.dataplex.v1.IGetZoneRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): void; + getZone( + request?: protos.google.cloud.dataplex.v1.IGetZoneRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IGetZoneRequest | 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.getZone(request, options, callback); + } + /** + * Retrieves an asset resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + * @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 [Asset]{@link google.cloud.dataplex.v1.Asset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_asset.js + * region_tag:dataplex_v1_generated_DataplexService_GetAsset_async + */ + getAsset( + request?: protos.google.cloud.dataplex.v1.IGetAssetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | undefined, + {} | undefined + ] + >; + getAsset( + request: protos.google.cloud.dataplex.v1.IGetAssetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | null | undefined, + {} | null | undefined + > + ): void; + getAsset( + request: protos.google.cloud.dataplex.v1.IGetAssetRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | null | undefined, + {} | null | undefined + > + ): void; + getAsset( + request?: protos.google.cloud.dataplex.v1.IGetAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IGetAssetRequest | 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.getAsset(request, options, callback); + } + /** + * Get task resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the task: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{tasks_id}`. + * @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 [Task]{@link google.cloud.dataplex.v1.Task}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_task.js + * region_tag:dataplex_v1_generated_DataplexService_GetTask_async + */ + getTask( + request?: protos.google.cloud.dataplex.v1.IGetTaskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | undefined, + {} | undefined + ] + >; + getTask( + request: protos.google.cloud.dataplex.v1.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + getTask( + request: protos.google.cloud.dataplex.v1.IGetTaskRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): void; + getTask( + request?: protos.google.cloud.dataplex.v1.IGetTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IGetTaskRequest | 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.getTask(request, options, callback); + } + /** + * Get job resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`. + * @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 [Job]{@link google.cloud.dataplex.v1.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_job.js + * region_tag:dataplex_v1_generated_DataplexService_GetJob_async + */ + getJob( + request?: protos.google.cloud.dataplex.v1.IGetJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | undefined, + {} | undefined + ] + >; + getJob( + request: protos.google.cloud.dataplex.v1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request: protos.google.cloud.dataplex.v1.IGetJobRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request?: protos.google.cloud.dataplex.v1.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IJob, + protos.google.cloud.dataplex.v1.IGetJobRequest | 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.getJob(request, options, callback); + } + /** + * Cancel jobs running for the task resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the job: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}/job/{job_id}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.cancel_job.js + * region_tag:dataplex_v1_generated_DataplexService_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.dataplex.v1.ICancelJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | undefined, + {} | undefined + ] + >; + cancelJob( + request: protos.google.cloud.dataplex.v1.ICancelJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | null | undefined, + {} | null | undefined + > + ): void; + cancelJob( + request: protos.google.cloud.dataplex.v1.ICancelJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | null | undefined, + {} | null | undefined + > + ): void; + cancelJob( + request?: protos.google.cloud.dataplex.v1.ICancelJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.ICancelJobRequest | 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.cancelJob(request, options, callback); + } + /** + * Get environment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the environment: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + * @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 [Environment]{@link google.cloud.dataplex.v1.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.get_environment.js + * region_tag:dataplex_v1_generated_DataplexService_GetEnvironment_async + */ + getEnvironment( + request?: protos.google.cloud.dataplex.v1.IGetEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IGetEnvironmentRequest | undefined, + {} | undefined + ] + >; + getEnvironment( + request: protos.google.cloud.dataplex.v1.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): void; + getEnvironment( + request: protos.google.cloud.dataplex.v1.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): void; + getEnvironment( + request?: protos.google.cloud.dataplex.v1.IGetEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IEnvironment, + | protos.google.cloud.dataplex.v1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IGetEnvironmentRequest | 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.getEnvironment(request, options, callback); + } + + /** + * Creates a lake resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the lake location, of the form: + * projects/{project_number}/locations/{location_id} + * where `location_id` refers to a GCP region. + * @param {string} request.lakeId + * Required. Lake identifier. + * This ID will be used to generate names such as database and dataset names + * when publishing metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique within the customer project / location. + * @param {google.cloud.dataplex.v1.Lake} request.lake + * Required. Lake resource + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_lake.js + * region_tag:dataplex_v1_generated_DataplexService_CreateLake_async + */ + createLake( + request?: protos.google.cloud.dataplex.v1.ICreateLakeRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createLake( + request: protos.google.cloud.dataplex.v1.ICreateLakeRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createLake( + request: protos.google.cloud.dataplex.v1.ICreateLakeRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createLake( + request?: protos.google.cloud.dataplex.v1.ICreateLakeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createLake(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createLake()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_lake.js + * region_tag:dataplex_v1_generated_DataplexService_CreateLake_async + */ + async checkCreateLakeProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Lake, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createLake, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Lake, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Updates a lake resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Lake} request.lake + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_lake.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateLake_async + */ + updateLake( + request?: protos.google.cloud.dataplex.v1.IUpdateLakeRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateLake( + request: protos.google.cloud.dataplex.v1.IUpdateLakeRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateLake( + request: protos.google.cloud.dataplex.v1.IUpdateLakeRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateLake( + request?: protos.google.cloud.dataplex.v1.IUpdateLakeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'lake.name': request.lake!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateLake(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateLake()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_lake.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateLake_async + */ + async checkUpdateLakeProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Lake, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateLake, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Lake, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Deletes a lake resource. All zones within the lake must be deleted before + * the lake can be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_lake.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteLake_async + */ + deleteLake( + request?: protos.google.cloud.dataplex.v1.IDeleteLakeRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteLake( + request: protos.google.cloud.dataplex.v1.IDeleteLakeRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteLake( + request: protos.google.cloud.dataplex.v1.IDeleteLakeRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteLake( + request?: protos.google.cloud.dataplex.v1.IDeleteLakeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteLake(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteLake()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_lake.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteLake_async + */ + async checkDeleteLakeProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteLake, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Creates a zone resource within a lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {string} request.zoneId + * Required. Zone identifier. + * This ID will be used to generate names such as database and dataset names + * when publishing metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique across all lakes from all locations in a project. + * * Must not be one of the reserved IDs (i.e. "default", "global-temp") + * @param {google.cloud.dataplex.v1.Zone} request.zone + * Required. Zone resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_zone.js + * region_tag:dataplex_v1_generated_DataplexService_CreateZone_async + */ + createZone( + request?: protos.google.cloud.dataplex.v1.ICreateZoneRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createZone( + request: protos.google.cloud.dataplex.v1.ICreateZoneRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createZone( + request: protos.google.cloud.dataplex.v1.ICreateZoneRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createZone( + request?: protos.google.cloud.dataplex.v1.ICreateZoneRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createZone(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createZone()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_zone.js + * region_tag:dataplex_v1_generated_DataplexService_CreateZone_async + */ + async checkCreateZoneProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Zone, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createZone, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Zone, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Updates a zone resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Zone} request.zone + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_zone.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateZone_async + */ + updateZone( + request?: protos.google.cloud.dataplex.v1.IUpdateZoneRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateZone( + request: protos.google.cloud.dataplex.v1.IUpdateZoneRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateZone( + request: protos.google.cloud.dataplex.v1.IUpdateZoneRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateZone( + request?: protos.google.cloud.dataplex.v1.IUpdateZoneRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'zone.name': request.zone!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateZone(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateZone()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_zone.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateZone_async + */ + async checkUpdateZoneProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Zone, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateZone, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Zone, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Deletes a zone resource. All assets within a zone must be deleted before + * the zone can be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_zone.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteZone_async + */ + deleteZone( + request?: protos.google.cloud.dataplex.v1.IDeleteZoneRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteZone( + request: protos.google.cloud.dataplex.v1.IDeleteZoneRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteZone( + request: protos.google.cloud.dataplex.v1.IDeleteZoneRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteZone( + request?: protos.google.cloud.dataplex.v1.IDeleteZoneRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteZone(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteZone()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_zone.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteZone_async + */ + async checkDeleteZoneProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteZone, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Creates an asset resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {string} request.assetId + * Required. Asset identifier. + * This ID will be used to generate names such as table names when publishing + * metadata to Hive Metastore and BigQuery. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must end with a number or a letter. + * * Must be between 1-63 characters. + * * Must be unique within the zone. + * @param {google.cloud.dataplex.v1.Asset} request.asset + * Required. Asset resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_asset.js + * region_tag:dataplex_v1_generated_DataplexService_CreateAsset_async + */ + createAsset( + request?: protos.google.cloud.dataplex.v1.ICreateAssetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createAsset( + request: protos.google.cloud.dataplex.v1.ICreateAssetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAsset( + request: protos.google.cloud.dataplex.v1.ICreateAssetRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createAsset( + request?: protos.google.cloud.dataplex.v1.ICreateAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createAsset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createAsset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_asset.js + * region_tag:dataplex_v1_generated_DataplexService_CreateAsset_async + */ + async checkCreateAssetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Asset, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createAsset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Asset, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Updates an asset resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Asset} request.asset + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_asset.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateAsset_async + */ + updateAsset( + request?: protos.google.cloud.dataplex.v1.IUpdateAssetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateAsset( + request: protos.google.cloud.dataplex.v1.IUpdateAssetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateAsset( + request: protos.google.cloud.dataplex.v1.IUpdateAssetRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateAsset( + request?: protos.google.cloud.dataplex.v1.IUpdateAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'asset.name': request.asset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAsset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateAsset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_asset.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateAsset_async + */ + async checkUpdateAssetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Asset, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateAsset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Asset, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Deletes an asset resource. The referenced storage resource is detached + * (default) or deleted based on the associated Lifecycle policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_asset.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteAsset_async + */ + deleteAsset( + request?: protos.google.cloud.dataplex.v1.IDeleteAssetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteAsset( + request: protos.google.cloud.dataplex.v1.IDeleteAssetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteAsset( + request: protos.google.cloud.dataplex.v1.IDeleteAssetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteAsset( + request?: protos.google.cloud.dataplex.v1.IDeleteAssetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteAsset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteAsset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_asset.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteAsset_async + */ + async checkDeleteAssetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteAsset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Creates a task resource within a lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {string} request.taskId + * Required. Task identifier. + * @param {google.cloud.dataplex.v1.Task} request.task + * Required. Task resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_task.js + * region_tag:dataplex_v1_generated_DataplexService_CreateTask_async + */ + createTask( + request?: protos.google.cloud.dataplex.v1.ICreateTaskRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTask( + request: protos.google.cloud.dataplex.v1.ICreateTaskRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTask( + request: protos.google.cloud.dataplex.v1.ICreateTaskRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTask( + request?: protos.google.cloud.dataplex.v1.ICreateTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createTask(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTask()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_task.js + * region_tag:dataplex_v1_generated_DataplexService_CreateTask_async + */ + async checkCreateTaskProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Task, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTask, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Task, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Update the task resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Task} request.task + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_task.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateTask_async + */ + updateTask( + request?: protos.google.cloud.dataplex.v1.IUpdateTaskRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTask( + request: protos.google.cloud.dataplex.v1.IUpdateTaskRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTask( + request: protos.google.cloud.dataplex.v1.IUpdateTaskRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTask( + request?: protos.google.cloud.dataplex.v1.IUpdateTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'task.name': request.task!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTask(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTask()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_task.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateTask_async + */ + async checkUpdateTaskProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Task, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateTask, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Task, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Delete the task resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the task: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/task/{task_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_task.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteTask_async + */ + deleteTask( + request?: protos.google.cloud.dataplex.v1.IDeleteTaskRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTask( + request: protos.google.cloud.dataplex.v1.IDeleteTaskRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTask( + request: protos.google.cloud.dataplex.v1.IDeleteTaskRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTask( + request?: protos.google.cloud.dataplex.v1.IDeleteTaskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteTask(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTask()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_task.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteTask_async + */ + async checkDeleteTaskProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteTask, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Create an environment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + * @param {string} request.environmentId + * Required. Environment identifier. + * * Must contain only lowercase letters, numbers and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the lake. + * @param {google.cloud.dataplex.v1.Environment} request.environment + * Required. Environment resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_environment.js + * region_tag:dataplex_v1_generated_DataplexService_CreateEnvironment_async + */ + createEnvironment( + request?: protos.google.cloud.dataplex.v1.ICreateEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createEnvironment( + request: protos.google.cloud.dataplex.v1.ICreateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEnvironment( + request: protos.google.cloud.dataplex.v1.ICreateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEnvironment( + request?: protos.google.cloud.dataplex.v1.ICreateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createEnvironment(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createEnvironment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.create_environment.js + * region_tag:dataplex_v1_generated_DataplexService_CreateEnvironment_async + */ + async checkCreateEnvironmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Environment, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createEnvironment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Environment, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Update the environment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.dataplex.v1.Environment} request.environment + * Required. Update description. + * Only fields specified in `update_mask` are updated. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_environment.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateEnvironment_async + */ + updateEnvironment( + request?: protos.google.cloud.dataplex.v1.IUpdateEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateEnvironment( + request: protos.google.cloud.dataplex.v1.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEnvironment( + request: protos.google.cloud.dataplex.v1.IUpdateEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEnvironment( + request?: protos.google.cloud.dataplex.v1.IUpdateEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'environment.name': request.environment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEnvironment(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateEnvironment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.update_environment.js + * region_tag:dataplex_v1_generated_DataplexService_UpdateEnvironment_async + */ + async checkUpdateEnvironmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dataplex.v1.Environment, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateEnvironment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dataplex.v1.Environment, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Delete the environment resource. All the child resources must have been + * deleted before environment deletion can be initiated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the environment: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}/environments/{environment_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_environment.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteEnvironment_async + */ + deleteEnvironment( + request?: protos.google.cloud.dataplex.v1.IDeleteEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteEnvironment( + request: protos.google.cloud.dataplex.v1.IDeleteEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEnvironment( + request: protos.google.cloud.dataplex.v1.IDeleteEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEnvironment( + request?: protos.google.cloud.dataplex.v1.IDeleteEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteEnvironment(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteEnvironment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.delete_environment.js + * region_tag:dataplex_v1_generated_DataplexService_DeleteEnvironment_async + */ + async checkDeleteEnvironmentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteEnvironment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dataplex.v1.OperationMetadata + >; + } + /** + * Lists lake resources in a project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the lake location, of the form: + * `projects/{project_number}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @param {number} [request.pageSize] + * Optional. Maximum number of Lakes to return. The service may return fewer than this + * value. If unspecified, at most 10 lakes will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakes` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakes` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Lake]{@link google.cloud.dataplex.v1.Lake}. + * 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 `listLakesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLakes( + request?: protos.google.cloud.dataplex.v1.IListLakesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.ILake[], + protos.google.cloud.dataplex.v1.IListLakesRequest | null, + protos.google.cloud.dataplex.v1.IListLakesResponse + ] + >; + listLakes( + request: protos.google.cloud.dataplex.v1.IListLakesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakesRequest, + protos.google.cloud.dataplex.v1.IListLakesResponse | null | undefined, + protos.google.cloud.dataplex.v1.ILake + > + ): void; + listLakes( + request: protos.google.cloud.dataplex.v1.IListLakesRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakesRequest, + protos.google.cloud.dataplex.v1.IListLakesResponse | null | undefined, + protos.google.cloud.dataplex.v1.ILake + > + ): void; + listLakes( + request?: protos.google.cloud.dataplex.v1.IListLakesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakesRequest, + protos.google.cloud.dataplex.v1.IListLakesResponse | null | undefined, + protos.google.cloud.dataplex.v1.ILake + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakesRequest, + protos.google.cloud.dataplex.v1.IListLakesResponse | null | undefined, + protos.google.cloud.dataplex.v1.ILake + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.ILake[], + protos.google.cloud.dataplex.v1.IListLakesRequest | null, + protos.google.cloud.dataplex.v1.IListLakesResponse + ] + > | 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.listLakes(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 resource name of the lake location, of the form: + * `projects/{project_number}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @param {number} [request.pageSize] + * Optional. Maximum number of Lakes to return. The service may return fewer than this + * value. If unspecified, at most 10 lakes will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakes` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakes` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Lake]{@link google.cloud.dataplex.v1.Lake} 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 `listLakesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLakesStream( + request?: protos.google.cloud.dataplex.v1.IListLakesRequest, + 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['listLakes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLakes.createStream( + this.innerApiCalls.listLakes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listLakes`, 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 resource name of the lake location, of the form: + * `projects/{project_number}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @param {number} [request.pageSize] + * Optional. Maximum number of Lakes to return. The service may return fewer than this + * value. If unspecified, at most 10 lakes will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakes` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakes` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Lake]{@link google.cloud.dataplex.v1.Lake}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_lakes.js + * region_tag:dataplex_v1_generated_DataplexService_ListLakes_async + */ + listLakesAsync( + request?: protos.google.cloud.dataplex.v1.IListLakesRequest, + 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['listLakes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLakes.asyncIterate( + this.innerApiCalls['listLakes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists action resources in a lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakeActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakeActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action}. + * 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 `listLakeActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLakeActions( + request?: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListLakeActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + >; + listLakeActions( + request: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listLakeActions( + request: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listLakeActions( + request?: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + | protos.google.cloud.dataplex.v1.IListActionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IAction + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListLakeActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + > | 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.listLakeActions(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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakeActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakeActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action} 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 `listLakeActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listLakeActionsStream( + request?: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + 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['listLakeActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLakeActions.createStream( + this.innerApiCalls.listLakeActions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listLakeActions`, 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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListLakeActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListLakeActions` must match the call that provided the page + * token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Action]{@link google.cloud.dataplex.v1.Action}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_lake_actions.js + * region_tag:dataplex_v1_generated_DataplexService_ListLakeActions_async + */ + listLakeActionsAsync( + request?: protos.google.cloud.dataplex.v1.IListLakeActionsRequest, + 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['listLakeActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listLakeActions.asyncIterate( + this.innerApiCalls['listLakeActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists zone resources in a lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of zones to return. The service may return fewer than this + * value. If unspecified, at most 10 zones will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Zone]{@link google.cloud.dataplex.v1.Zone}. + * 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 `listZonesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listZones( + request?: protos.google.cloud.dataplex.v1.IListZonesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IZone[], + protos.google.cloud.dataplex.v1.IListZonesRequest | null, + protos.google.cloud.dataplex.v1.IListZonesResponse + ] + >; + listZones( + request: protos.google.cloud.dataplex.v1.IListZonesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZonesRequest, + protos.google.cloud.dataplex.v1.IListZonesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IZone + > + ): void; + listZones( + request: protos.google.cloud.dataplex.v1.IListZonesRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZonesRequest, + protos.google.cloud.dataplex.v1.IListZonesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IZone + > + ): void; + listZones( + request?: protos.google.cloud.dataplex.v1.IListZonesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListZonesRequest, + protos.google.cloud.dataplex.v1.IListZonesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IZone + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZonesRequest, + protos.google.cloud.dataplex.v1.IListZonesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IZone + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IZone[], + protos.google.cloud.dataplex.v1.IListZonesRequest | null, + protos.google.cloud.dataplex.v1.IListZonesResponse + ] + > | 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.listZones(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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of zones to return. The service may return fewer than this + * value. If unspecified, at most 10 zones will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Zone]{@link google.cloud.dataplex.v1.Zone} 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 `listZonesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listZonesStream( + request?: protos.google.cloud.dataplex.v1.IListZonesRequest, + 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['listZones']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listZones.createStream( + this.innerApiCalls.listZones as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listZones`, 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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of zones to return. The service may return fewer than this + * value. If unspecified, at most 10 zones will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Zone]{@link google.cloud.dataplex.v1.Zone}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_zones.js + * region_tag:dataplex_v1_generated_DataplexService_ListZones_async + */ + listZonesAsync( + request?: protos.google.cloud.dataplex.v1.IListZonesRequest, + 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['listZones']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listZones.asyncIterate( + this.innerApiCalls['listZones'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists action resources in a zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZoneActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZoneActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action}. + * 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 `listZoneActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listZoneActions( + request?: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListZoneActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + >; + listZoneActions( + request: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listZoneActions( + request: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listZoneActions( + request?: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + | protos.google.cloud.dataplex.v1.IListActionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IAction + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListZoneActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + > | 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.listZoneActions(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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZoneActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZoneActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action} 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 `listZoneActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listZoneActionsStream( + request?: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + 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['listZoneActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listZoneActions.createStream( + this.innerApiCalls.listZoneActions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listZoneActions`, 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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZoneActions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZoneActions` must match the call that provided the page + * token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Action]{@link google.cloud.dataplex.v1.Action}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_zone_actions.js + * region_tag:dataplex_v1_generated_DataplexService_ListZoneActions_async + */ + listZoneActionsAsync( + request?: protos.google.cloud.dataplex.v1.IListZoneActionsRequest, + 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['listZoneActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listZoneActions.asyncIterate( + this.innerApiCalls['listZoneActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists asset resources in a zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of asset to return. The service may return fewer than + * this value. If unspecified, at most 10 assets will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssets` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssets` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Asset]{@link google.cloud.dataplex.v1.Asset}. + * 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 `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssets( + request?: protos.google.cloud.dataplex.v1.IListAssetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAsset[], + protos.google.cloud.dataplex.v1.IListAssetsRequest | null, + protos.google.cloud.dataplex.v1.IListAssetsResponse + ] + >; + listAssets( + request: protos.google.cloud.dataplex.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetsRequest, + protos.google.cloud.dataplex.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAsset + > + ): void; + listAssets( + request: protos.google.cloud.dataplex.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetsRequest, + protos.google.cloud.dataplex.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAsset + > + ): void; + listAssets( + request?: protos.google.cloud.dataplex.v1.IListAssetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetsRequest, + | protos.google.cloud.dataplex.v1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IAsset + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetsRequest, + protos.google.cloud.dataplex.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAsset + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAsset[], + protos.google.cloud.dataplex.v1.IListAssetsRequest | null, + protos.google.cloud.dataplex.v1.IListAssetsResponse + ] + > | 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.listAssets(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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of asset to return. The service may return fewer than + * this value. If unspecified, at most 10 assets will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssets` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssets` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Asset]{@link google.cloud.dataplex.v1.Asset} 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 `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.dataplex.v1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssets`, 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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of asset to return. The service may return fewer than + * this value. If unspecified, at most 10 assets will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssets` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssets` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Asset]{@link google.cloud.dataplex.v1.Asset}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_assets.js + * region_tag:dataplex_v1_generated_DataplexService_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.dataplex.v1.IListAssetsRequest, + 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['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists action resources in an asset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssetActions` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssetActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action}. + * 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 `listAssetActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssetActions( + request?: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListAssetActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + >; + listAssetActions( + request: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listAssetActions( + request: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): void; + listAssetActions( + request?: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + | protos.google.cloud.dataplex.v1.IListActionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IAction + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + protos.google.cloud.dataplex.v1.IListActionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IAction + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IAction[], + protos.google.cloud.dataplex.v1.IListAssetActionsRequest | null, + protos.google.cloud.dataplex.v1.IListActionsResponse + ] + > | 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.listAssetActions(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 resource name of the parent asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssetActions` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssetActions` must match the call that provided the page + * token. + * @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 [Action]{@link google.cloud.dataplex.v1.Action} 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 `listAssetActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAssetActionsStream( + request?: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + 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['listAssetActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssetActions.createStream( + this.innerApiCalls.listAssetActions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAssetActions`, 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 resource name of the parent asset: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/assets/{asset_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of actions to return. The service may return fewer than this + * value. If unspecified, at most 10 actions will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListAssetActions` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListAssetActions` must match the call that provided the page + * token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Action]{@link google.cloud.dataplex.v1.Action}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_asset_actions.js + * region_tag:dataplex_v1_generated_DataplexService_ListAssetActions_async + */ + listAssetActionsAsync( + request?: protos.google.cloud.dataplex.v1.IListAssetActionsRequest, + 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['listAssetActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssetActions.asyncIterate( + this.innerApiCalls['listAssetActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists tasks under the given lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of tasks to return. The service may return fewer than this + * value. If unspecified, at most 10 tasks will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Task]{@link google.cloud.dataplex.v1.Task}. + * 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 `listTasksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTasks( + request?: protos.google.cloud.dataplex.v1.IListTasksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.ITask[], + protos.google.cloud.dataplex.v1.IListTasksRequest | null, + protos.google.cloud.dataplex.v1.IListTasksResponse + ] + >; + listTasks( + request: protos.google.cloud.dataplex.v1.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListTasksRequest, + protos.google.cloud.dataplex.v1.IListTasksResponse | null | undefined, + protos.google.cloud.dataplex.v1.ITask + > + ): void; + listTasks( + request: protos.google.cloud.dataplex.v1.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListTasksRequest, + protos.google.cloud.dataplex.v1.IListTasksResponse | null | undefined, + protos.google.cloud.dataplex.v1.ITask + > + ): void; + listTasks( + request?: protos.google.cloud.dataplex.v1.IListTasksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListTasksRequest, + protos.google.cloud.dataplex.v1.IListTasksResponse | null | undefined, + protos.google.cloud.dataplex.v1.ITask + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListTasksRequest, + protos.google.cloud.dataplex.v1.IListTasksResponse | null | undefined, + protos.google.cloud.dataplex.v1.ITask + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.ITask[], + protos.google.cloud.dataplex.v1.IListTasksRequest | null, + protos.google.cloud.dataplex.v1.IListTasksResponse + ] + > | 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.listTasks(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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of tasks to return. The service may return fewer than this + * value. If unspecified, at most 10 tasks will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Task]{@link google.cloud.dataplex.v1.Task} 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 `listTasksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTasksStream( + request?: protos.google.cloud.dataplex.v1.IListTasksRequest, + 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['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.createStream( + this.innerApiCalls.listTasks as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTasks`, 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 resource name of the parent lake: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of tasks to return. The service may return fewer than this + * value. If unspecified, at most 10 tasks will be returned. The maximum + * value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListZones` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListZones` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Task]{@link google.cloud.dataplex.v1.Task}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_tasks.js + * region_tag:dataplex_v1_generated_DataplexService_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.dataplex.v1.IListTasksRequest, + 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['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.asyncIterate( + this.innerApiCalls['listTasks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Jobs under the given task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of jobs to return. The service may return fewer than + * this value. If unspecified, at most 10 jobs will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListJobs` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListJobs` must match the call that provided the page + * token. + * @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 [Job]{@link google.cloud.dataplex.v1.Job}. + * 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 `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobs( + request?: protos.google.cloud.dataplex.v1.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IJob[], + protos.google.cloud.dataplex.v1.IListJobsRequest | null, + protos.google.cloud.dataplex.v1.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.dataplex.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListJobsRequest, + protos.google.cloud.dataplex.v1.IListJobsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IJob + > + ): void; + listJobs( + request: protos.google.cloud.dataplex.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListJobsRequest, + protos.google.cloud.dataplex.v1.IListJobsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IJob + > + ): void; + listJobs( + request?: protos.google.cloud.dataplex.v1.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListJobsRequest, + protos.google.cloud.dataplex.v1.IListJobsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IJob + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListJobsRequest, + protos.google.cloud.dataplex.v1.IListJobsResponse | null | undefined, + protos.google.cloud.dataplex.v1.IJob + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IJob[], + protos.google.cloud.dataplex.v1.IListJobsRequest | null, + protos.google.cloud.dataplex.v1.IListJobsResponse + ] + > | 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.listJobs(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 resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of jobs to return. The service may return fewer than + * this value. If unspecified, at most 10 jobs will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListJobs` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListJobs` must match the call that provided the page + * token. + * @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 [Job]{@link google.cloud.dataplex.v1.Job} 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 `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobsStream( + request?: protos.google.cloud.dataplex.v1.IListJobsRequest, + 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['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobs`, 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 resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of jobs to return. The service may return fewer than + * this value. If unspecified, at most 10 jobs will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListJobs` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListJobs` must match the call that provided the page + * token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Job]{@link google.cloud.dataplex.v1.Job}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_jobs.js + * region_tag:dataplex_v1_generated_DataplexService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.dataplex.v1.IListJobsRequest, + 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['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists environments under the given lake. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of environments to return. The service may return fewer than + * this value. If unspecified, at most 10 environments will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEnvironments` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEnvironments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Environment]{@link google.cloud.dataplex.v1.Environment}. + * 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEnvironments( + request?: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEnvironment[], + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest | null, + protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + ] + >; + listEnvironments( + request: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + | protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IEnvironment + > + ): void; + listEnvironments( + request: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + | protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IEnvironment + > + ): void; + listEnvironments( + request?: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + | protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IEnvironment + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + | protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IEnvironment + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEnvironment[], + protos.google.cloud.dataplex.v1.IListEnvironmentsRequest | null, + protos.google.cloud.dataplex.v1.IListEnvironmentsResponse + ] + > | 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.listEnvironments(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 resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of environments to return. The service may return fewer than + * this value. If unspecified, at most 10 environments will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEnvironments` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEnvironments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [Environment]{@link google.cloud.dataplex.v1.Environment} 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 `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEnvironmentsStream( + request?: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.createStream( + this.innerApiCalls.listEnvironments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEnvironments`, 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 resource name of the parent lake: + * `projects/{project_id}/locations/{location_id}/lakes/{lake_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of environments to return. The service may return fewer than + * this value. If unspecified, at most 10 environments will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEnvironments` call. Provide this + * to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEnvironments` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. + * @param {string} [request.orderBy] + * Optional. Order by fields for the result. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Environment]{@link google.cloud.dataplex.v1.Environment}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_environments.js + * region_tag:dataplex_v1_generated_DataplexService_ListEnvironments_async + */ + listEnvironmentsAsync( + request?: protos.google.cloud.dataplex.v1.IListEnvironmentsRequest, + 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['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.asyncIterate( + this.innerApiCalls['listEnvironments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists session resources in an environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of sessions to return. The service may return fewer than + * this value. If unspecified, at most 10 sessions will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListSessions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListSessions` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. The following `mode` filter is supported to return only the + * sessions belonging to the requester when the mode is USER and return + * sessions of all the users when the mode is ADMIN. When no filter is sent + * default to USER mode. + * NOTE: When the mode is ADMIN, the requester should have + * `dataplex.environments.listAllSessions` permission to list all sessions, + * in absence of the permission, the request fails. + * + * mode = ADMIN | USER + * @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 [Session]{@link google.cloud.dataplex.v1.Session}. + * 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 `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSessions( + request?: protos.google.cloud.dataplex.v1.IListSessionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.ISession[], + protos.google.cloud.dataplex.v1.IListSessionsRequest | null, + protos.google.cloud.dataplex.v1.IListSessionsResponse + ] + >; + listSessions( + request: protos.google.cloud.dataplex.v1.IListSessionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListSessionsRequest, + protos.google.cloud.dataplex.v1.IListSessionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.ISession + > + ): void; + listSessions( + request: protos.google.cloud.dataplex.v1.IListSessionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListSessionsRequest, + protos.google.cloud.dataplex.v1.IListSessionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.ISession + > + ): void; + listSessions( + request?: protos.google.cloud.dataplex.v1.IListSessionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListSessionsRequest, + | protos.google.cloud.dataplex.v1.IListSessionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.ISession + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListSessionsRequest, + protos.google.cloud.dataplex.v1.IListSessionsResponse | null | undefined, + protos.google.cloud.dataplex.v1.ISession + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.ISession[], + protos.google.cloud.dataplex.v1.IListSessionsRequest | null, + protos.google.cloud.dataplex.v1.IListSessionsResponse + ] + > | 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.listSessions(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 resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of sessions to return. The service may return fewer than + * this value. If unspecified, at most 10 sessions will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListSessions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListSessions` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. The following `mode` filter is supported to return only the + * sessions belonging to the requester when the mode is USER and return + * sessions of all the users when the mode is ADMIN. When no filter is sent + * default to USER mode. + * NOTE: When the mode is ADMIN, the requester should have + * `dataplex.environments.listAllSessions` permission to list all sessions, + * in absence of the permission, the request fails. + * + * mode = ADMIN | USER + * @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 [Session]{@link google.cloud.dataplex.v1.Session} 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 `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSessionsStream( + request?: protos.google.cloud.dataplex.v1.IListSessionsRequest, + 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['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSessions.createStream( + this.innerApiCalls.listSessions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSessions`, 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 resource name of the parent environment: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/environment/{environment_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of sessions to return. The service may return fewer than + * this value. If unspecified, at most 10 sessions will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListSessions` call. Provide this to + * retrieve the subsequent page. When paginating, all other parameters + * provided to `ListSessions` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. Filter request. The following `mode` filter is supported to return only the + * sessions belonging to the requester when the mode is USER and return + * sessions of all the users when the mode is ADMIN. When no filter is sent + * default to USER mode. + * NOTE: When the mode is ADMIN, the requester should have + * `dataplex.environments.listAllSessions` permission to list all sessions, + * in absence of the permission, the request fails. + * + * mode = ADMIN | USER + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Session]{@link google.cloud.dataplex.v1.Session}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dataplex_service.list_sessions.js + * region_tag:dataplex_v1_generated_DataplexService_ListSessions_async + */ + listSessionsAsync( + request?: protos.google.cloud.dataplex.v1.IListSessionsRequest, + 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['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSessions.asyncIterate( + this.innerApiCalls['listSessions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string + ) { + return this.pathTemplates.assetPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + }); + } + + /** + * Parse the project from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the lake from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).lake; + } + + /** + * Parse the zone from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).zone; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified content resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} content + * @returns {string} Resource name string. + */ + contentPath( + project: string, + location: string, + lake: string, + content: string + ) { + return this.pathTemplates.contentPathTemplate.render({ + project: project, + location: location, + lake: lake, + content: content, + }); + } + + /** + * Parse the project from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).project; + } + + /** + * Parse the location from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).location; + } + + /** + * Parse the lake from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).lake; + } + + /** + * Parse the content from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the content. + */ + matchContentFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).content; + } + + /** + * Return a fully-qualified entity resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @returns {string} Resource name string. + */ + entityPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string + ) { + return this.pathTemplates.entityPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + }); + } + + /** + * Parse the project from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).project; + } + + /** + * Parse the location from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).location; + } + + /** + * Parse the lake from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).lake; + } + + /** + * Parse the zone from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).zone; + } + + /** + * Parse the entity from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).entity; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + lake: string, + environment: string + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the lake from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .lake; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath( + project: string, + location: string, + lake: string, + task: string, + job: string + ) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the lake from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).lake; + } + + /** + * Parse the task from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the task. + */ + matchTaskFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).task; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified lake resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @returns {string} Resource name string. + */ + lakePath(project: string, location: string, lake: string) { + return this.pathTemplates.lakePathTemplate.render({ + project: project, + location: location, + lake: lake, + }); + } + + /** + * Parse the project from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).project; + } + + /** + * Parse the location from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).location; + } + + /** + * Parse the lake from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).lake; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified partition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @param {string} partition + * @returns {string} Resource name string. + */ + partitionPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string, + partition: string + ) { + return this.pathTemplates.partitionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + partition: partition, + }); + } + + /** + * Parse the project from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .project; + } + + /** + * Parse the location from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .location; + } + + /** + * Parse the lake from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).lake; + } + + /** + * Parse the zone from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).zone; + } + + /** + * Parse the entity from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).entity; + } + + /** + * Parse the partition from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the partition. + */ + matchPartitionFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .partition; + } + + /** + * Return a fully-qualified projectLocationLakeAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeActionPath( + project: string, + location: string, + lake: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).lake; + } + + /** + * Parse the action from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneActionPath( + project: string, + location: string, + lake: string, + zone: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).zone; + } + + /** + * Parse the action from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAssetAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneAssetActionPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render( + { + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + action: action, + } + ); + } + + /** + * Parse the project from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).zone; + } + + /** + * Parse the asset from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).asset; + } + + /** + * Parse the action from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).action; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath( + project: string, + location: string, + lake: string, + environment: string, + session: string + ) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the lake from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).lake; + } + + /** + * Parse the environment from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName) + .environment; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project: string, location: string, lake: string, task: string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the lake from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).lake; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified zone resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @returns {string} Resource name string. + */ + zonePath(project: string, location: string, lake: string, zone: string) { + return this.pathTemplates.zonePathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + }); + } + + /** + * Parse the project from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the project. + */ + matchProjectFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).project; + } + + /** + * Parse the location from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the location. + */ + matchLocationFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).location; + } + + /** + * Parse the lake from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).lake; + } + + /** + * Parse the zone from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).zone; + } + + /** + * 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.dataplexServiceStub && !this._terminated) { + return this.dataplexServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dataplex/src/v1/dataplex_service_client_config.json b/packages/google-cloud-dataplex/src/v1/dataplex_service_client_config.json new file mode 100644 index 000000000000..232a178a7cc3 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/dataplex_service_client_config.json @@ -0,0 +1,197 @@ +{ + "interfaces": { + "google.cloud.dataplex.v1.DataplexService": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateLake": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateLake": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteLake": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLakes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetLake": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListLakeActions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateZone": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateZone": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteZone": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListZones": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetZone": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListZoneActions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateAsset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAsset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAsset": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetAsset": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListAssetActions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateTask": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTask": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTask": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CancelJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEnvironments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSessions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dataplex/src/v1/dataplex_service_proto_list.json b/packages/google-cloud-dataplex/src/v1/dataplex_service_proto_list.json new file mode 100644 index 000000000000..37d1b3510856 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/dataplex_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/dataplex/v1/analyze.proto", + "../../protos/google/cloud/dataplex/v1/content.proto", + "../../protos/google/cloud/dataplex/v1/logs.proto", + "../../protos/google/cloud/dataplex/v1/metadata.proto", + "../../protos/google/cloud/dataplex/v1/resources.proto", + "../../protos/google/cloud/dataplex/v1/service.proto", + "../../protos/google/cloud/dataplex/v1/tasks.proto" +] diff --git a/packages/google-cloud-dataplex/src/v1/gapic_metadata.json b/packages/google-cloud-dataplex/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..85d7970d52ba --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/gapic_metadata.json @@ -0,0 +1,593 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dataplex.v1", + "libraryPackage": "@google-cloud/dataplex", + "services": { + "ContentService": { + "clients": { + "grpc": { + "libraryClient": "ContentServiceClient", + "rpcs": { + "CreateContent": { + "methods": [ + "createContent" + ] + }, + "UpdateContent": { + "methods": [ + "updateContent" + ] + }, + "DeleteContent": { + "methods": [ + "deleteContent" + ] + }, + "GetContent": { + "methods": [ + "getContent" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListContent": { + "methods": [ + "listContent", + "listContentStream", + "listContentAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ContentServiceClient", + "rpcs": { + "CreateContent": { + "methods": [ + "createContent" + ] + }, + "UpdateContent": { + "methods": [ + "updateContent" + ] + }, + "DeleteContent": { + "methods": [ + "deleteContent" + ] + }, + "GetContent": { + "methods": [ + "getContent" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "ListContent": { + "methods": [ + "listContent", + "listContentStream", + "listContentAsync" + ] + } + } + } + } + }, + "DataplexService": { + "clients": { + "grpc": { + "libraryClient": "DataplexServiceClient", + "rpcs": { + "GetLake": { + "methods": [ + "getLake" + ] + }, + "GetZone": { + "methods": [ + "getZone" + ] + }, + "GetAsset": { + "methods": [ + "getAsset" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateLake": { + "methods": [ + "createLake" + ] + }, + "UpdateLake": { + "methods": [ + "updateLake" + ] + }, + "DeleteLake": { + "methods": [ + "deleteLake" + ] + }, + "CreateZone": { + "methods": [ + "createZone" + ] + }, + "UpdateZone": { + "methods": [ + "updateZone" + ] + }, + "DeleteZone": { + "methods": [ + "deleteZone" + ] + }, + "CreateAsset": { + "methods": [ + "createAsset" + ] + }, + "UpdateAsset": { + "methods": [ + "updateAsset" + ] + }, + "DeleteAsset": { + "methods": [ + "deleteAsset" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "UpdateTask": { + "methods": [ + "updateTask" + ] + }, + "DeleteTask": { + "methods": [ + "deleteTask" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "ListLakes": { + "methods": [ + "listLakes", + "listLakesStream", + "listLakesAsync" + ] + }, + "ListLakeActions": { + "methods": [ + "listLakeActions", + "listLakeActionsStream", + "listLakeActionsAsync" + ] + }, + "ListZones": { + "methods": [ + "listZones", + "listZonesStream", + "listZonesAsync" + ] + }, + "ListZoneActions": { + "methods": [ + "listZoneActions", + "listZoneActionsStream", + "listZoneActionsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListAssetActions": { + "methods": [ + "listAssetActions", + "listAssetActionsStream", + "listAssetActionsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataplexServiceClient", + "rpcs": { + "GetLake": { + "methods": [ + "getLake" + ] + }, + "GetZone": { + "methods": [ + "getZone" + ] + }, + "GetAsset": { + "methods": [ + "getAsset" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateLake": { + "methods": [ + "createLake" + ] + }, + "UpdateLake": { + "methods": [ + "updateLake" + ] + }, + "DeleteLake": { + "methods": [ + "deleteLake" + ] + }, + "CreateZone": { + "methods": [ + "createZone" + ] + }, + "UpdateZone": { + "methods": [ + "updateZone" + ] + }, + "DeleteZone": { + "methods": [ + "deleteZone" + ] + }, + "CreateAsset": { + "methods": [ + "createAsset" + ] + }, + "UpdateAsset": { + "methods": [ + "updateAsset" + ] + }, + "DeleteAsset": { + "methods": [ + "deleteAsset" + ] + }, + "CreateTask": { + "methods": [ + "createTask" + ] + }, + "UpdateTask": { + "methods": [ + "updateTask" + ] + }, + "DeleteTask": { + "methods": [ + "deleteTask" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "ListLakes": { + "methods": [ + "listLakes", + "listLakesStream", + "listLakesAsync" + ] + }, + "ListLakeActions": { + "methods": [ + "listLakeActions", + "listLakeActionsStream", + "listLakeActionsAsync" + ] + }, + "ListZones": { + "methods": [ + "listZones", + "listZonesStream", + "listZonesAsync" + ] + }, + "ListZoneActions": { + "methods": [ + "listZoneActions", + "listZoneActionsStream", + "listZoneActionsAsync" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "ListAssetActions": { + "methods": [ + "listAssetActions", + "listAssetActionsStream", + "listAssetActionsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + } + } + }, + "MetadataService": { + "clients": { + "grpc": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "CreateEntity": { + "methods": [ + "createEntity" + ] + }, + "UpdateEntity": { + "methods": [ + "updateEntity" + ] + }, + "DeleteEntity": { + "methods": [ + "deleteEntity" + ] + }, + "GetEntity": { + "methods": [ + "getEntity" + ] + }, + "CreatePartition": { + "methods": [ + "createPartition" + ] + }, + "DeletePartition": { + "methods": [ + "deletePartition" + ] + }, + "GetPartition": { + "methods": [ + "getPartition" + ] + }, + "ListEntities": { + "methods": [ + "listEntities", + "listEntitiesStream", + "listEntitiesAsync" + ] + }, + "ListPartitions": { + "methods": [ + "listPartitions", + "listPartitionsStream", + "listPartitionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MetadataServiceClient", + "rpcs": { + "CreateEntity": { + "methods": [ + "createEntity" + ] + }, + "UpdateEntity": { + "methods": [ + "updateEntity" + ] + }, + "DeleteEntity": { + "methods": [ + "deleteEntity" + ] + }, + "GetEntity": { + "methods": [ + "getEntity" + ] + }, + "CreatePartition": { + "methods": [ + "createPartition" + ] + }, + "DeletePartition": { + "methods": [ + "deletePartition" + ] + }, + "GetPartition": { + "methods": [ + "getPartition" + ] + }, + "ListEntities": { + "methods": [ + "listEntities", + "listEntitiesStream", + "listEntitiesAsync" + ] + }, + "ListPartitions": { + "methods": [ + "listPartitions", + "listPartitionsStream", + "listPartitionsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-dataplex/src/v1/index.ts b/packages/google-cloud-dataplex/src/v1/index.ts new file mode 100644 index 000000000000..3806c719115f --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/index.ts @@ -0,0 +1,21 @@ +// Copyright 2022 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 {ContentServiceClient} from './content_service_client'; +export {DataplexServiceClient} from './dataplex_service_client'; +export {MetadataServiceClient} from './metadata_service_client'; diff --git a/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts b/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts new file mode 100644 index 000000000000..df7a6cbe2064 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts @@ -0,0 +1,2953 @@ +// Copyright 2022 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, + GrpcClientOptions, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} 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/metadata_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './metadata_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Metadata service manages metadata resources such as tables, filesets and + * partitions. + * @class + * @memberof v1 + */ +export class MetadataServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + metadataServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MetadataServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 MetadataServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MetadataServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + assetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}' + ), + contentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/content/{content}' + ), + entityPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}/jobs/{job}' + ), + lakePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}' + ), + partitionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity}/partitions/{partition}' + ), + projectLocationLakeActionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/actions/{action}' + ), + projectLocationLakeZoneActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/actions/{action}' + ), + projectLocationLakeZoneAssetActionPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/assets/{asset}/actions/{action}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/environments/{environment}/sessions/{session}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/tasks/{task}' + ), + zonePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}' + ), + }; + + // 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 = { + listEntities: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'entities' + ), + listPartitions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'partitions' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/lakes/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/lakes/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/zones/*/assets/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/tasks/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/lakes/*/environments/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataplex.v1.MetadataService', + 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.metadataServiceStub) { + return this.metadataServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataplex.v1.MetadataService. + this.metadataServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dataplex.v1.MetadataService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataplex.v1.MetadataService, + 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 metadataServiceStubMethods = [ + 'createEntity', + 'updateEntity', + 'deleteEntity', + 'getEntity', + 'listEntities', + 'createPartition', + 'deletePartition', + 'getPartition', + 'listPartitions', + ]; + for (const methodName of metadataServiceStubMethods) { + const callPromise = this.metadataServiceStub.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.metadataServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataplex.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataplex.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Create a metadata entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {google.cloud.dataplex.v1.Entity} request.entity + * Required. Entity resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 [Entity]{@link google.cloud.dataplex.v1.Entity}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.create_entity.js + * region_tag:dataplex_v1_generated_MetadataService_CreateEntity_async + */ + createEntity( + request?: protos.google.cloud.dataplex.v1.ICreateEntityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.ICreateEntityRequest | undefined, + {} | undefined + ] + >; + createEntity( + request: protos.google.cloud.dataplex.v1.ICreateEntityRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.ICreateEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + createEntity( + request: protos.google.cloud.dataplex.v1.ICreateEntityRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.ICreateEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + createEntity( + request?: protos.google.cloud.dataplex.v1.ICreateEntityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IEntity, + | protos.google.cloud.dataplex.v1.ICreateEntityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.ICreateEntityRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.ICreateEntityRequest | 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.createEntity(request, options, callback); + } + /** + * Update a metadata entity. Only supports full resource update. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataplex.v1.Entity} request.entity + * Required. Update description. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 [Entity]{@link google.cloud.dataplex.v1.Entity}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.update_entity.js + * region_tag:dataplex_v1_generated_MetadataService_UpdateEntity_async + */ + updateEntity( + request?: protos.google.cloud.dataplex.v1.IUpdateEntityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IUpdateEntityRequest | undefined, + {} | undefined + ] + >; + updateEntity( + request: protos.google.cloud.dataplex.v1.IUpdateEntityRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IUpdateEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + updateEntity( + request: protos.google.cloud.dataplex.v1.IUpdateEntityRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IUpdateEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + updateEntity( + request?: protos.google.cloud.dataplex.v1.IUpdateEntityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IEntity, + | protos.google.cloud.dataplex.v1.IUpdateEntityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IUpdateEntityRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IUpdateEntityRequest | 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({ + 'entity.name': request.entity!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEntity(request, options, callback); + } + /** + * Delete a metadata entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + * @param {string} request.etag + * Required. The etag associated with the entity, which can be retrieved with a + * {@link |GetEntity} request. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.delete_entity.js + * region_tag:dataplex_v1_generated_MetadataService_DeleteEntity_async + */ + deleteEntity( + request?: protos.google.cloud.dataplex.v1.IDeleteEntityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteEntityRequest | undefined, + {} | undefined + ] + >; + deleteEntity( + request: protos.google.cloud.dataplex.v1.IDeleteEntityRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteEntity( + request: protos.google.cloud.dataplex.v1.IDeleteEntityRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteEntity( + request?: protos.google.cloud.dataplex.v1.IDeleteEntityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeleteEntityRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteEntityRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeleteEntityRequest | 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.deleteEntity(request, options, callback); + } + /** + * Get a metadata entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.` + * @param {google.cloud.dataplex.v1.GetEntityRequest.EntityView} [request.view] + * Optional. Used to select the subset of entity information to return. + * Defaults to `BASIC`. + * @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 [Entity]{@link google.cloud.dataplex.v1.Entity}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.get_entity.js + * region_tag:dataplex_v1_generated_MetadataService_GetEntity_async + */ + getEntity( + request?: protos.google.cloud.dataplex.v1.IGetEntityRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | undefined, + {} | undefined + ] + >; + getEntity( + request: protos.google.cloud.dataplex.v1.IGetEntityRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + getEntity( + request: protos.google.cloud.dataplex.v1.IGetEntityRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | null | undefined, + {} | null | undefined + > + ): void; + getEntity( + request?: protos.google.cloud.dataplex.v1.IGetEntityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity, + protos.google.cloud.dataplex.v1.IGetEntityRequest | 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.getEntity(request, options, callback); + } + /** + * Create a metadata partition. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + * @param {google.cloud.dataplex.v1.Partition} request.partition + * Required. Partition resource. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is false. + * @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 [Partition]{@link google.cloud.dataplex.v1.Partition}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.create_partition.js + * region_tag:dataplex_v1_generated_MetadataService_CreatePartition_async + */ + createPartition( + request?: protos.google.cloud.dataplex.v1.ICreatePartitionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.ICreatePartitionRequest | undefined, + {} | undefined + ] + >; + createPartition( + request: protos.google.cloud.dataplex.v1.ICreatePartitionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IPartition, + | protos.google.cloud.dataplex.v1.ICreatePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPartition( + request: protos.google.cloud.dataplex.v1.ICreatePartitionRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IPartition, + | protos.google.cloud.dataplex.v1.ICreatePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPartition( + request?: protos.google.cloud.dataplex.v1.ICreatePartitionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IPartition, + | protos.google.cloud.dataplex.v1.ICreatePartitionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IPartition, + | protos.google.cloud.dataplex.v1.ICreatePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.ICreatePartitionRequest | 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.createPartition(request, options, callback); + } + /** + * Delete a metadata partition. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the partition. + * format: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + * The {partition_value_path} segment consists of an ordered sequence of + * partition values separated by "/". All values must be provided. + * @param {string} [request.etag] + * Optional. The etag associated with the partition. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.delete_partition.js + * region_tag:dataplex_v1_generated_MetadataService_DeletePartition_async + */ + deletePartition( + request?: protos.google.cloud.dataplex.v1.IDeletePartitionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeletePartitionRequest | undefined, + {} | undefined + ] + >; + deletePartition( + request: protos.google.cloud.dataplex.v1.IDeletePartitionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeletePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePartition( + request: protos.google.cloud.dataplex.v1.IDeletePartitionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeletePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePartition( + request?: protos.google.cloud.dataplex.v1.IDeletePartitionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeletePartitionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dataplex.v1.IDeletePartitionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IDeletePartitionRequest | 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.deletePartition(request, options, callback); + } + /** + * Get a metadata partition of an entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the partition: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_value_path}`. + * The {partition_value_path} segment consists of an ordered sequence of + * partition values separated by "/". All values must be provided. + * @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 [Partition]{@link google.cloud.dataplex.v1.Partition}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.get_partition.js + * region_tag:dataplex_v1_generated_MetadataService_GetPartition_async + */ + getPartition( + request?: protos.google.cloud.dataplex.v1.IGetPartitionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.IGetPartitionRequest | undefined, + {} | undefined + ] + >; + getPartition( + request: protos.google.cloud.dataplex.v1.IGetPartitionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.IGetPartitionRequest | null | undefined, + {} | null | undefined + > + ): void; + getPartition( + request: protos.google.cloud.dataplex.v1.IGetPartitionRequest, + callback: Callback< + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.IGetPartitionRequest | null | undefined, + {} | null | undefined + > + ): void; + getPartition( + request?: protos.google.cloud.dataplex.v1.IGetPartitionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dataplex.v1.IPartition, + | protos.google.cloud.dataplex.v1.IGetPartitionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.IGetPartitionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition, + protos.google.cloud.dataplex.v1.IGetPartitionRequest | 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.getPartition(request, options, callback); + } + + /** + * List metadata entities in a zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {google.cloud.dataplex.v1.ListEntitiesRequest.EntityView} request.view + * Required. Specify the entity view to make a partial list request. + * @param {number} [request.pageSize] + * Optional. Maximum number of entities to return. The service may return fewer than + * this value. If unspecified, 100 entities will be returned by default. The + * maximum value is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEntities` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEntities` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. The following filter parameters can be added to the URL to limit the + * entities returned by the API: + * + * - Entity ID: ?filter="id=entityID" + * - Asset ID: ?filter="asset=assetID" + * - Data path ?filter="data_path=gs://my-bucket" + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" + * @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 [Entity]{@link google.cloud.dataplex.v1.Entity}. + * 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 `listEntitiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntities( + request?: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity[], + protos.google.cloud.dataplex.v1.IListEntitiesRequest | null, + protos.google.cloud.dataplex.v1.IListEntitiesResponse + ] + >; + listEntities( + request: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEntitiesRequest, + protos.google.cloud.dataplex.v1.IListEntitiesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IEntity + > + ): void; + listEntities( + request: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEntitiesRequest, + protos.google.cloud.dataplex.v1.IListEntitiesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IEntity + > + ): void; + listEntities( + request?: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListEntitiesRequest, + | protos.google.cloud.dataplex.v1.IListEntitiesResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IEntity + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListEntitiesRequest, + protos.google.cloud.dataplex.v1.IListEntitiesResponse | null | undefined, + protos.google.cloud.dataplex.v1.IEntity + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IEntity[], + protos.google.cloud.dataplex.v1.IListEntitiesRequest | null, + protos.google.cloud.dataplex.v1.IListEntitiesResponse + ] + > | 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.listEntities(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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {google.cloud.dataplex.v1.ListEntitiesRequest.EntityView} request.view + * Required. Specify the entity view to make a partial list request. + * @param {number} [request.pageSize] + * Optional. Maximum number of entities to return. The service may return fewer than + * this value. If unspecified, 100 entities will be returned by default. The + * maximum value is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEntities` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEntities` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. The following filter parameters can be added to the URL to limit the + * entities returned by the API: + * + * - Entity ID: ?filter="id=entityID" + * - Asset ID: ?filter="asset=assetID" + * - Data path ?filter="data_path=gs://my-bucket" + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" + * @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 [Entity]{@link google.cloud.dataplex.v1.Entity} 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 `listEntitiesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listEntitiesStream( + request?: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + 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['listEntities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntities.createStream( + this.innerApiCalls.listEntities as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEntities`, 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 resource name of the parent zone: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`. + * @param {google.cloud.dataplex.v1.ListEntitiesRequest.EntityView} request.view + * Required. Specify the entity view to make a partial list request. + * @param {number} [request.pageSize] + * Optional. Maximum number of entities to return. The service may return fewer than + * this value. If unspecified, 100 entities will be returned by default. The + * maximum value is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListEntities` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListEntities` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. The following filter parameters can be added to the URL to limit the + * entities returned by the API: + * + * - Entity ID: ?filter="id=entityID" + * - Asset ID: ?filter="asset=assetID" + * - Data path ?filter="data_path=gs://my-bucket" + * - Is HIVE compatible: ?filter="hive_compatible=true" + * - Is BigQuery compatible: ?filter="bigquery_compatible=true" + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Entity]{@link google.cloud.dataplex.v1.Entity}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.list_entities.js + * region_tag:dataplex_v1_generated_MetadataService_ListEntities_async + */ + listEntitiesAsync( + request?: protos.google.cloud.dataplex.v1.IListEntitiesRequest, + 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['listEntities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntities.asyncIterate( + this.innerApiCalls['listEntities'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List metadata partitions of an entity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the parent entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of partitions to return. The service may return fewer than + * this value. If unspecified, 100 partitions will be returned by default. The + * maximum page size is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListPartitions` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListPartitions` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. Filter the partitions returned to the caller using a key value pair + * expression. Supported operators and syntax: + * + * - logic operators: AND, OR + * - comparison operators: <, >, >=, <= ,=, != + * - LIKE operators: + * - The right hand of a LIKE operator supports "." and + * "*" for wildcard searches, for example "value1 LIKE ".*oo.*" + * - parenthetical grouping: ( ) + * + * Sample filter expression: `?filter="key1 < value1 OR key2 > value2" + * + * **Notes:** + * + * - Keys to the left of operators are case insensitive. + * - Partition results are sorted first by creation time, then by + * lexicographic order. + * - Up to 20 key value filter pairs are allowed, but due to performance + * considerations, only the first 10 will be used as a filter. + * @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 [Partition]{@link google.cloud.dataplex.v1.Partition}. + * 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 `listPartitionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPartitions( + request?: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition[], + protos.google.cloud.dataplex.v1.IListPartitionsRequest | null, + protos.google.cloud.dataplex.v1.IListPartitionsResponse + ] + >; + listPartitions( + request: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListPartitionsRequest, + | protos.google.cloud.dataplex.v1.IListPartitionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IPartition + > + ): void; + listPartitions( + request: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataplex.v1.IListPartitionsRequest, + | protos.google.cloud.dataplex.v1.IListPartitionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IPartition + > + ): void; + listPartitions( + request?: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dataplex.v1.IListPartitionsRequest, + | protos.google.cloud.dataplex.v1.IListPartitionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IPartition + >, + callback?: PaginationCallback< + protos.google.cloud.dataplex.v1.IListPartitionsRequest, + | protos.google.cloud.dataplex.v1.IListPartitionsResponse + | null + | undefined, + protos.google.cloud.dataplex.v1.IPartition + > + ): Promise< + [ + protos.google.cloud.dataplex.v1.IPartition[], + protos.google.cloud.dataplex.v1.IListPartitionsRequest | null, + protos.google.cloud.dataplex.v1.IListPartitionsResponse + ] + > | 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.listPartitions(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 resource name of the parent entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of partitions to return. The service may return fewer than + * this value. If unspecified, 100 partitions will be returned by default. The + * maximum page size is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListPartitions` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListPartitions` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. Filter the partitions returned to the caller using a key value pair + * expression. Supported operators and syntax: + * + * - logic operators: AND, OR + * - comparison operators: <, >, >=, <= ,=, != + * - LIKE operators: + * - The right hand of a LIKE operator supports "." and + * "*" for wildcard searches, for example "value1 LIKE ".*oo.*" + * - parenthetical grouping: ( ) + * + * Sample filter expression: `?filter="key1 < value1 OR key2 > value2" + * + * **Notes:** + * + * - Keys to the left of operators are case insensitive. + * - Partition results are sorted first by creation time, then by + * lexicographic order. + * - Up to 20 key value filter pairs are allowed, but due to performance + * considerations, only the first 10 will be used as a filter. + * @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 [Partition]{@link google.cloud.dataplex.v1.Partition} 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 `listPartitionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPartitionsStream( + request?: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + 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['listPartitions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPartitions.createStream( + this.innerApiCalls.listPartitions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPartitions`, 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 resource name of the parent entity: + * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of partitions to return. The service may return fewer than + * this value. If unspecified, 100 partitions will be returned by default. The + * maximum page size is 500; larger values will will be truncated to 500. + * @param {string} [request.pageToken] + * Optional. Page token received from a previous `ListPartitions` call. Provide + * this to retrieve the subsequent page. When paginating, all other parameters + * provided to `ListPartitions` must match the call that provided the + * page token. + * @param {string} [request.filter] + * Optional. Filter the partitions returned to the caller using a key value pair + * expression. Supported operators and syntax: + * + * - logic operators: AND, OR + * - comparison operators: <, >, >=, <= ,=, != + * - LIKE operators: + * - The right hand of a LIKE operator supports "." and + * "*" for wildcard searches, for example "value1 LIKE ".*oo.*" + * - parenthetical grouping: ( ) + * + * Sample filter expression: `?filter="key1 < value1 OR key2 > value2" + * + * **Notes:** + * + * - Keys to the left of operators are case insensitive. + * - Partition results are sorted first by creation time, then by + * lexicographic order. + * - Up to 20 key value filter pairs are allowed, but due to performance + * considerations, only the first 10 will be used as a filter. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Partition]{@link google.cloud.dataplex.v1.Partition}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/metadata_service.list_partitions.js + * region_tag:dataplex_v1_generated_MetadataService_ListPartitions_async + */ + listPartitionsAsync( + request?: protos.google.cloud.dataplex.v1.IListPartitionsRequest, + 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['listPartitions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPartitions.asyncIterate( + this.innerApiCalls['listPartitions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified asset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @returns {string} Resource name string. + */ + assetPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string + ) { + return this.pathTemplates.assetPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + }); + } + + /** + * Parse the project from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).project; + } + + /** + * Parse the location from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).location; + } + + /** + * Parse the lake from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).lake; + } + + /** + * Parse the zone from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).zone; + } + + /** + * Parse the asset from Asset resource. + * + * @param {string} assetName + * A fully-qualified path representing Asset resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromAssetName(assetName: string) { + return this.pathTemplates.assetPathTemplate.match(assetName).asset; + } + + /** + * Return a fully-qualified content resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} content + * @returns {string} Resource name string. + */ + contentPath( + project: string, + location: string, + lake: string, + content: string + ) { + return this.pathTemplates.contentPathTemplate.render({ + project: project, + location: location, + lake: lake, + content: content, + }); + } + + /** + * Parse the project from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).project; + } + + /** + * Parse the location from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).location; + } + + /** + * Parse the lake from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).lake; + } + + /** + * Parse the content from Content resource. + * + * @param {string} contentName + * A fully-qualified path representing Content resource. + * @returns {string} A string representing the content. + */ + matchContentFromContentName(contentName: string) { + return this.pathTemplates.contentPathTemplate.match(contentName).content; + } + + /** + * Return a fully-qualified entity resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @returns {string} Resource name string. + */ + entityPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string + ) { + return this.pathTemplates.entityPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + }); + } + + /** + * Parse the project from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).project; + } + + /** + * Parse the location from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).location; + } + + /** + * Parse the lake from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).lake; + } + + /** + * Parse the zone from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).zone; + } + + /** + * Parse the entity from Entity resource. + * + * @param {string} entityName + * A fully-qualified path representing Entity resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromEntityName(entityName: string) { + return this.pathTemplates.entityPathTemplate.match(entityName).entity; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + lake: string, + environment: string + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the lake from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .lake; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath( + project: string, + location: string, + lake: string, + task: string, + job: string + ) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the lake from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).lake; + } + + /** + * Parse the task from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the task. + */ + matchTaskFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).task; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified lake resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @returns {string} Resource name string. + */ + lakePath(project: string, location: string, lake: string) { + return this.pathTemplates.lakePathTemplate.render({ + project: project, + location: location, + lake: lake, + }); + } + + /** + * Parse the project from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).project; + } + + /** + * Parse the location from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).location; + } + + /** + * Parse the lake from Lake resource. + * + * @param {string} lakeName + * A fully-qualified path representing Lake resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromLakeName(lakeName: string) { + return this.pathTemplates.lakePathTemplate.match(lakeName).lake; + } + + /** + * Return a fully-qualified partition resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} entity + * @param {string} partition + * @returns {string} Resource name string. + */ + partitionPath( + project: string, + location: string, + lake: string, + zone: string, + entity: string, + partition: string + ) { + return this.pathTemplates.partitionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + entity: entity, + partition: partition, + }); + } + + /** + * Parse the project from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .project; + } + + /** + * Parse the location from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .location; + } + + /** + * Parse the lake from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).lake; + } + + /** + * Parse the zone from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).zone; + } + + /** + * Parse the entity from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the entity. + */ + matchEntityFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName).entity; + } + + /** + * Parse the partition from Partition resource. + * + * @param {string} partitionName + * A fully-qualified path representing Partition resource. + * @returns {string} A string representing the partition. + */ + matchPartitionFromPartitionName(partitionName: string) { + return this.pathTemplates.partitionPathTemplate.match(partitionName) + .partition; + } + + /** + * Return a fully-qualified projectLocationLakeAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeActionPath( + project: string, + location: string, + lake: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).lake; + } + + /** + * Parse the action from ProjectLocationLakeAction resource. + * + * @param {string} projectLocationLakeActionName + * A fully-qualified path representing project_location_lake_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeActionName( + projectLocationLakeActionName: string + ) { + return this.pathTemplates.projectLocationLakeActionPathTemplate.match( + projectLocationLakeActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneActionPath( + project: string, + location: string, + lake: string, + zone: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + action: action, + }); + } + + /** + * Parse the project from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).zone; + } + + /** + * Parse the action from ProjectLocationLakeZoneAction resource. + * + * @param {string} projectLocationLakeZoneActionName + * A fully-qualified path representing project_location_lake_zone_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneActionName( + projectLocationLakeZoneActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneActionPathTemplate.match( + projectLocationLakeZoneActionName + ).action; + } + + /** + * Return a fully-qualified projectLocationLakeZoneAssetAction resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @param {string} asset + * @param {string} action + * @returns {string} Resource name string. + */ + projectLocationLakeZoneAssetActionPath( + project: string, + location: string, + lake: string, + zone: string, + asset: string, + action: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render( + { + project: project, + location: location, + lake: lake, + zone: zone, + asset: asset, + action: action, + } + ); + } + + /** + * Parse the project from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).project; + } + + /** + * Parse the location from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).location; + } + + /** + * Parse the lake from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).lake; + } + + /** + * Parse the zone from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).zone; + } + + /** + * Parse the asset from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the asset. + */ + matchAssetFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).asset; + } + + /** + * Parse the action from ProjectLocationLakeZoneAssetAction resource. + * + * @param {string} projectLocationLakeZoneAssetActionName + * A fully-qualified path representing project_location_lake_zone_asset_action resource. + * @returns {string} A string representing the action. + */ + matchActionFromProjectLocationLakeZoneAssetActionName( + projectLocationLakeZoneAssetActionName: string + ) { + return this.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match( + projectLocationLakeZoneAssetActionName + ).action; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} environment + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath( + project: string, + location: string, + lake: string, + environment: string, + session: string + ) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + lake: lake, + environment: environment, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the lake from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).lake; + } + + /** + * Parse the environment from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName) + .environment; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project: string, location: string, lake: string, task: string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + lake: lake, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the lake from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).lake; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified zone resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} lake + * @param {string} zone + * @returns {string} Resource name string. + */ + zonePath(project: string, location: string, lake: string, zone: string) { + return this.pathTemplates.zonePathTemplate.render({ + project: project, + location: location, + lake: lake, + zone: zone, + }); + } + + /** + * Parse the project from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the project. + */ + matchProjectFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).project; + } + + /** + * Parse the location from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the location. + */ + matchLocationFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).location; + } + + /** + * Parse the lake from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the lake. + */ + matchLakeFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).lake; + } + + /** + * Parse the zone from Zone resource. + * + * @param {string} zoneName + * A fully-qualified path representing Zone resource. + * @returns {string} A string representing the zone. + */ + matchZoneFromZoneName(zoneName: string) { + return this.pathTemplates.zonePathTemplate.match(zoneName).zone; + } + + /** + * 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.metadataServiceStub && !this._terminated) { + return this.metadataServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dataplex/src/v1/metadata_service_client_config.json b/packages/google-cloud-dataplex/src/v1/metadata_service_client_config.json new file mode 100644 index 000000000000..f588dd54b21b --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/metadata_service_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.cloud.dataplex.v1.MetadataService": { + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateEntity": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEntity": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEntity": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEntity": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListEntities": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreatePartition": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePartition": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPartition": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPartitions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-dataplex/src/v1/metadata_service_proto_list.json b/packages/google-cloud-dataplex/src/v1/metadata_service_proto_list.json new file mode 100644 index 000000000000..37d1b3510856 --- /dev/null +++ b/packages/google-cloud-dataplex/src/v1/metadata_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/dataplex/v1/analyze.proto", + "../../protos/google/cloud/dataplex/v1/content.proto", + "../../protos/google/cloud/dataplex/v1/logs.proto", + "../../protos/google/cloud/dataplex/v1/metadata.proto", + "../../protos/google/cloud/dataplex/v1/resources.proto", + "../../protos/google/cloud/dataplex/v1/service.proto", + "../../protos/google/cloud/dataplex/v1/tasks.proto" +] diff --git a/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.js b/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..a52c6d6d8670 --- /dev/null +++ b/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dataplex = require('@google-cloud/dataplex'); + +function main() { + const contentServiceClient = new dataplex.ContentServiceClient(); + const dataplexServiceClient = new dataplex.DataplexServiceClient(); + const metadataServiceClient = new dataplex.MetadataServiceClient(); +} + +main(); diff --git a/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..c2dc9e474ac8 --- /dev/null +++ b/packages/google-cloud-dataplex/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,48 @@ +// Copyright 2022 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 { + ContentServiceClient, + DataplexServiceClient, + MetadataServiceClient, +} from '@google-cloud/dataplex'; + +// check that the client class type name can be used +function doStuffWithContentServiceClient(client: ContentServiceClient) { + client.close(); +} +function doStuffWithDataplexServiceClient(client: DataplexServiceClient) { + client.close(); +} +function doStuffWithMetadataServiceClient(client: MetadataServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const contentServiceClient = new ContentServiceClient(); + doStuffWithContentServiceClient(contentServiceClient); + // check that the client instance can be created + const dataplexServiceClient = new DataplexServiceClient(); + doStuffWithDataplexServiceClient(dataplexServiceClient); + // check that the client instance can be created + const metadataServiceClient = new MetadataServiceClient(); + doStuffWithMetadataServiceClient(metadataServiceClient); +} + +main(); diff --git a/packages/google-cloud-dataplex/system-test/install.ts b/packages/google-cloud-dataplex/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-dataplex/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-dataplex/test/gapic_content_service_v1.ts b/packages/google-cloud-dataplex/test/gapic_content_service_v1.ts new file mode 100644 index 000000000000..0d2c6ad2576d --- /dev/null +++ b/packages/google-cloud-dataplex/test/gapic_content_service_v1.ts @@ -0,0 +1,3109 @@ +// Copyright 2022 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 contentserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, operationsProtos, LocationProtos} 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.ContentServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + contentserviceModule.v1.ContentServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + contentserviceModule.v1.ContentServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = contentserviceModule.v1.ContentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new contentserviceModule.v1.ContentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.contentServiceStub, undefined); + await client.initialize(); + assert(client.contentServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.contentServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.contentServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new contentserviceModule.v1.ContentServiceClient({ + 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 contentserviceModule.v1.ContentServiceClient({ + 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('createContent', () => { + it('invokes createContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.createContent = stubSimpleCall(expectedResponse); + const [response] = await client.createContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createContent without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.createContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createContent with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createContent(request), expectedError); + }); + }); + + describe('updateContent', () => { + it('invokes updateContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateContentRequest() + ); + request.content ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateContentRequest', + ['content', 'name'] + ); + request.content.name = defaultValue1; + const expectedHeaderRequestParams = `content.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.updateContent = stubSimpleCall(expectedResponse); + const [response] = await client.updateContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateContent without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateContentRequest() + ); + request.content ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateContentRequest', + ['content', 'name'] + ); + request.content.name = defaultValue1; + const expectedHeaderRequestParams = `content.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.updateContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateContentRequest() + ); + request.content ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateContentRequest', + ['content', 'name'] + ); + request.content.name = defaultValue1; + const expectedHeaderRequestParams = `content.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateContent with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateContentRequest() + ); + request.content ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateContentRequest', + ['content', 'name'] + ); + request.content.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateContent(request), expectedError); + }); + }); + + describe('deleteContent', () => { + it('invokes deleteContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteContent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteContent without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteContent( + 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.deleteContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteContent with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteContent(request), expectedError); + }); + }); + + describe('getContent', () => { + it('invokes getContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.getContent = stubSimpleCall(expectedResponse); + const [response] = await client.getContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getContent without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Content() + ); + client.innerApiCalls.getContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getContent with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getContent(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('listContent', () => { + it('invokes listContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + ]; + client.innerApiCalls.listContent = stubSimpleCall(expectedResponse); + const [response] = await client.listContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContent without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + ]; + client.innerApiCalls.listContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IContent[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listContentStream without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + ]; + client.descriptors.page.listContent.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listContentStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Content[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Content) => { + 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.listContent.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listContent, request) + ); + assert( + (client.descriptors.page.listContent.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listContentStream with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContent.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listContentStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Content[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Content) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listContent.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listContent, request) + ); + assert( + (client.descriptors.page.listContent.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listContent without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Content()), + ]; + client.descriptors.page.listContent.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IContent[] = []; + const iterable = client.listContentAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listContent.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listContent.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listContent with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listContent.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listContentAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IContent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listContent.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listContent.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssetName', () => { + const result = client.matchProjectFromAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromAssetName', () => { + const result = client.matchLakeFromAssetName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromAssetName', () => { + const result = client.matchZoneFromAssetName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('content', () => { + const fakePath = '/rendered/path/content'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + content: 'contentValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contentPath', () => { + const result = client.contentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'contentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContentName', () => { + const result = client.matchProjectFromContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContentName', () => { + const result = client.matchLocationFromContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromContentName', () => { + const result = client.matchLakeFromContentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContentFromContentName', () => { + const result = client.matchContentFromContentName(fakePath); + assert.strictEqual(result, 'contentValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entity', () => { + const fakePath = '/rendered/path/entity'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityPath', () => { + const result = client.entityPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityName', () => { + const result = client.matchProjectFromEntityName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityName', () => { + const result = client.matchLocationFromEntityName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEntityName', () => { + const result = client.matchLakeFromEntityName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromEntityName', () => { + const result = client.matchZoneFromEntityName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromEntityName', () => { + const result = client.matchEntityFromEntityName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEnvironmentName', () => { + const result = client.matchLakeFromEnvironmentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + job: 'jobValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromJobName', () => { + const result = client.matchLakeFromJobName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromJobName', () => { + const result = client.matchTaskFromJobName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('lake', () => { + const fakePath = '/rendered/path/lake'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.lakePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.lakePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('lakePath', () => { + const result = client.lakePath( + 'projectValue', + 'locationValue', + 'lakeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.lakePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLakeName', () => { + const result = client.matchProjectFromLakeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLakeName', () => { + const result = client.matchLocationFromLakeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromLakeName', () => { + const result = client.matchLakeFromLakeName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('partition', () => { + const fakePath = '/rendered/path/partition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + partition: 'partitionValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.partitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.partitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('partitionPath', () => { + const result = client.partitionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue', + 'partitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.partitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPartitionName', () => { + const result = client.matchProjectFromPartitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPartitionName', () => { + const result = client.matchLocationFromPartitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromPartitionName', () => { + const result = client.matchLakeFromPartitionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromPartitionName', () => { + const result = client.matchZoneFromPartitionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromPartitionName', () => { + const result = client.matchEntityFromPartitionName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPartitionFromPartitionName', () => { + const result = client.matchPartitionFromPartitionName(fakePath); + assert.strictEqual(result, 'partitionValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeAction', () => { + const fakePath = '/rendered/path/projectLocationLakeAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + action: 'actionValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeActionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationLakeActionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationLakeActionPath', () => { + const result = client.projectLocationLakeActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeActionName', () => { + const result = + client.matchActionFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + action: 'actionValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneActionPath', () => { + const result = client.projectLocationLakeZoneActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAssetAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAssetAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + action: 'actionValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneAssetActionPath', () => { + const result = client.projectLocationLakeZoneAssetActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchAssetFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('session', () => { + const fakePath = '/rendered/path/session'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromSessionName', () => { + const result = client.matchLakeFromSessionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromSessionName', () => { + const result = client.matchEnvironmentFromSessionName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('task', () => { + const fakePath = '/rendered/path/task'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taskPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromTaskName', () => { + const result = client.matchLakeFromTaskName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('zone', () => { + const fakePath = '/rendered/path/zone'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + }; + const client = new contentserviceModule.v1.ContentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.zonePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.zonePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('zonePath', () => { + const result = client.zonePath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.zonePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromZoneName', () => { + const result = client.matchProjectFromZoneName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromZoneName', () => { + const result = client.matchLocationFromZoneName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromZoneName', () => { + const result = client.matchLakeFromZoneName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromZoneName', () => { + const result = client.matchZoneFromZoneName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dataplex/test/gapic_dataplex_service_v1.ts b/packages/google-cloud-dataplex/test/gapic_dataplex_service_v1.ts new file mode 100644 index 000000000000..ee85b6ded009 --- /dev/null +++ b/packages/google-cloud-dataplex/test/gapic_dataplex_service_v1.ts @@ -0,0 +1,8755 @@ +// Copyright 2022 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 dataplexserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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.DataplexServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + dataplexserviceModule.v1.DataplexServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + dataplexserviceModule.v1.DataplexServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = dataplexserviceModule.v1.DataplexServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataplexServiceStub, undefined); + await client.initialize(); + assert(client.dataplexServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataplexServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataplexServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + 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 dataplexserviceModule.v1.DataplexServiceClient({ + 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('getLake', () => { + it('invokes getLake without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Lake() + ); + client.innerApiCalls.getLake = stubSimpleCall(expectedResponse); + const [response] = await client.getLake(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getLake as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLake without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Lake() + ); + client.innerApiCalls.getLake = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLake( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.ILake | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getLake as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLake with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLake = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLake(request), expectedError); + const actualRequest = (client.innerApiCalls.getLake as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLake with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getLake(request), expectedError); + }); + }); + + describe('getZone', () => { + it('invokes getZone without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Zone() + ); + client.innerApiCalls.getZone = stubSimpleCall(expectedResponse); + const [response] = await client.getZone(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getZone as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getZone without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Zone() + ); + client.innerApiCalls.getZone = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getZone( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IZone | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getZone as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getZone with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getZone = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getZone(request), expectedError); + const actualRequest = (client.innerApiCalls.getZone as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getZone with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getZone(request), expectedError); + }); + }); + + describe('getAsset', () => { + it('invokes getAsset without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Asset() + ); + client.innerApiCalls.getAsset = stubSimpleCall(expectedResponse); + const [response] = await client.getAsset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Asset() + ); + client.innerApiCalls.getAsset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAsset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IAsset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAsset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAsset with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAsset(request), expectedError); + }); + }); + + describe('getTask', () => { + it('invokes getTask without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Task() + ); + client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); + const [response] = await client.getTask(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Task() + ); + client.innerApiCalls.getTask = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.ITask | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTask(request), expectedError); + const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Job() + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + 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.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelJob(request), expectedError); + }); + }); + + describe('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ); + client.innerApiCalls.getEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEnvironment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with closed client', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEnvironment(request), expectedError); + }); + }); + + describe('createLake', () => { + it('invokes createLake without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateLakeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createLake = stubLongRunningCall(expectedResponse); + const [operation] = await client.createLake(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLake without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateLakeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createLake = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createLake( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLake with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateLakeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLake = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createLake(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLake with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateLakeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLake = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createLake(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateLakeProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateLakeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateLakeProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateLakeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateLake', () => { + it('invokes updateLake without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateLakeRequest() + ); + request.lake ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateLakeRequest', + ['lake', 'name'] + ); + request.lake.name = defaultValue1; + const expectedHeaderRequestParams = `lake.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateLake = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateLake(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLake without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateLakeRequest() + ); + request.lake ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateLakeRequest', + ['lake', 'name'] + ); + request.lake.name = defaultValue1; + const expectedHeaderRequestParams = `lake.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateLake = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateLake( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.ILake, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLake with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateLakeRequest() + ); + request.lake ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateLakeRequest', + ['lake', 'name'] + ); + request.lake.name = defaultValue1; + const expectedHeaderRequestParams = `lake.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLake = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateLake(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLake with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateLakeRequest() + ); + request.lake ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateLakeRequest', + ['lake', 'name'] + ); + request.lake.name = defaultValue1; + const expectedHeaderRequestParams = `lake.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLake = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateLake(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateLakeProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateLakeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateLakeProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateLakeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteLake', () => { + it('invokes deleteLake without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteLake = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteLake(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLake without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteLake = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLake( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLake with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLake = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteLake(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLake with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteLakeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteLakeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLake = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteLake(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLake as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteLakeProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteLakeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteLakeProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteLakeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createZone', () => { + it('invokes createZone without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateZoneRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createZone = stubLongRunningCall(expectedResponse); + const [operation] = await client.createZone(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createZone without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateZoneRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createZone = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createZone( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createZone with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateZoneRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createZone = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createZone(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createZone with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateZoneRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createZone = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createZone(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateZoneProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateZoneProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateZoneProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateZoneProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateZone', () => { + it('invokes updateZone without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateZoneRequest() + ); + request.zone ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateZoneRequest', + ['zone', 'name'] + ); + request.zone.name = defaultValue1; + const expectedHeaderRequestParams = `zone.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateZone = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateZone(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateZone without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateZoneRequest() + ); + request.zone ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateZoneRequest', + ['zone', 'name'] + ); + request.zone.name = defaultValue1; + const expectedHeaderRequestParams = `zone.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateZone = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateZone( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IZone, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateZone with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateZoneRequest() + ); + request.zone ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateZoneRequest', + ['zone', 'name'] + ); + request.zone.name = defaultValue1; + const expectedHeaderRequestParams = `zone.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateZone = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateZone(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateZone with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateZoneRequest() + ); + request.zone ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateZoneRequest', + ['zone', 'name'] + ); + request.zone.name = defaultValue1; + const expectedHeaderRequestParams = `zone.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateZone = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateZone(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateZoneProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateZoneProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateZoneProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateZoneProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteZone', () => { + it('invokes deleteZone without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteZone = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteZone(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteZone without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteZone = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteZone( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteZone with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteZone = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteZone(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteZone with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteZoneRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteZoneRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteZone = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteZone(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteZone as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteZoneProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteZoneProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteZoneProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteZoneProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createAsset', () => { + it('invokes createAsset without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateAssetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAsset = stubLongRunningCall(expectedResponse); + const [operation] = await client.createAsset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateAssetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAsset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAsset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateAssetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAsset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAsset with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateAssetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAsset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createAsset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAssetProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAssetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAssetProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateAssetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateAsset', () => { + it('invokes updateAsset without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateAssetRequest() + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateAssetRequest', + ['asset', 'name'] + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAsset = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAsset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateAssetRequest() + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateAssetRequest', + ['asset', 'name'] + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAsset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAsset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IAsset, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateAssetRequest() + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateAssetRequest', + ['asset', 'name'] + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAsset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAsset with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateAssetRequest() + ); + request.asset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateAssetRequest', + ['asset', 'name'] + ); + request.asset.name = defaultValue1; + const expectedHeaderRequestParams = `asset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAsset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateAsset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAssetProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAssetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAssetProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateAssetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteAsset', () => { + it('invokes deleteAsset without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAsset = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAsset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAsset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAsset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAsset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAsset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAsset with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteAssetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteAssetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAsset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteAsset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAsset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAssetProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAssetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAssetProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteAssetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTask', () => { + it('invokes createTask without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateTaskRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTask = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTask(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTask without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateTaskRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTask = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTask( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTask with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateTaskRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTask = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTask(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTask with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateTaskRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTask = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTask(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTaskProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTaskProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTaskProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateTaskProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTask', () => { + it('invokes updateTask without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateTaskRequest() + ); + request.task ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateTaskRequest', + ['task', 'name'] + ); + request.task.name = defaultValue1; + const expectedHeaderRequestParams = `task.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTask = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTask(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTask without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateTaskRequest() + ); + request.task ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateTaskRequest', + ['task', 'name'] + ); + request.task.name = defaultValue1; + const expectedHeaderRequestParams = `task.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTask = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTask( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.ITask, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTask with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateTaskRequest() + ); + request.task ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateTaskRequest', + ['task', 'name'] + ); + request.task.name = defaultValue1; + const expectedHeaderRequestParams = `task.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTask = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTask(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTask with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateTaskRequest() + ); + request.task ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateTaskRequest', + ['task', 'name'] + ); + request.task.name = defaultValue1; + const expectedHeaderRequestParams = `task.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTask = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTask(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTaskProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTaskProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTaskProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateTaskProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTask', () => { + it('invokes deleteTask without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTask = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTask(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTask without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTask = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTask( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTask with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTask = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTask(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTask with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteTaskRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteTaskRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTask = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTask(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTask as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTaskProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTaskProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTaskProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteTaskProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createEnvironment', () => { + it('invokes createEnvironment without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEnvironmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEnvironmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEnvironmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEnvironmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEnvironmentProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateEnvironmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEnvironmentProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateEnvironmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEnvironment', () => { + it('invokes updateEnvironment without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEnvironmentRequest() + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEnvironmentRequest', + ['environment', 'name'] + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEnvironmentRequest() + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEnvironmentRequest', + ['environment', 'name'] + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dataplex.v1.IEnvironment, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEnvironmentRequest() + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEnvironmentRequest', + ['environment', 'name'] + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEnvironmentRequest() + ); + request.environment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEnvironmentRequest', + ['environment', 'name'] + ); + request.environment.name = defaultValue1; + const expectedHeaderRequestParams = `environment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEnvironmentProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateEnvironmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEnvironmentProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateEnvironmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteEnvironment', () => { + it('invokes deleteEnvironment without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataplex.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with call error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEnvironment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with LRO error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEnvironmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEnvironment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEnvironmentProgress without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteEnvironmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEnvironmentProgress with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteEnvironmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listLakes', () => { + it('invokes listLakes without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + ]; + client.innerApiCalls.listLakes = stubSimpleCall(expectedResponse); + const [response] = await client.listLakes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakes without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + ]; + client.innerApiCalls.listLakes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLakes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.ILake[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakes with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLakes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLakes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakesStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + ]; + client.descriptors.page.listLakes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLakesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Lake[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Lake) => { + 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.listLakes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLakes, request) + ); + assert( + (client.descriptors.page.listLakes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listLakesStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLakes.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listLakesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Lake[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Lake) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLakes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLakes, request) + ); + assert( + (client.descriptors.page.listLakes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLakes without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Lake()), + ]; + client.descriptors.page.listLakes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.ILake[] = []; + const iterable = client.listLakesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listLakes.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listLakes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLakes with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLakes.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listLakesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.ILake[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listLakes.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listLakes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listLakeActions', () => { + it('invokes listLakeActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listLakeActions = stubSimpleCall(expectedResponse); + const [response] = await client.listLakeActions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakeActions without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listLakeActions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLakeActions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IAction[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakeActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLakeActions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listLakeActions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLakeActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLakeActionsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listLakeActions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLakeActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + 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.listLakeActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLakeActions, request) + ); + assert( + (client.descriptors.page.listLakeActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listLakeActionsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLakeActions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listLakeActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLakeActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLakeActions, request) + ); + assert( + (client.descriptors.page.listLakeActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLakeActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listLakeActions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + const iterable = client.listLakeActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listLakeActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listLakeActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listLakeActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListLakeActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListLakeActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLakeActions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLakeActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listLakeActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listLakeActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listZones', () => { + it('invokes listZones without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + ]; + client.innerApiCalls.listZones = stubSimpleCall(expectedResponse); + const [response] = await client.listZones(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZones without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + ]; + client.innerApiCalls.listZones = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listZones( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IZone[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZones with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listZones = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listZones(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZones as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZonesStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + ]; + client.descriptors.page.listZones.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listZonesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Zone[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Zone) => { + 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.listZones.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listZones, request) + ); + assert( + (client.descriptors.page.listZones.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listZonesStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listZones.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listZonesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Zone[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Zone) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listZones.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listZones, request) + ); + assert( + (client.descriptors.page.listZones.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listZones without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Zone()), + ]; + client.descriptors.page.listZones.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IZone[] = []; + const iterable = client.listZonesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listZones.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listZones.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listZones with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZonesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZonesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listZones.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listZonesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IZone[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listZones.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listZones.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listZoneActions', () => { + it('invokes listZoneActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listZoneActions = stubSimpleCall(expectedResponse); + const [response] = await client.listZoneActions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZoneActions without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listZoneActions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listZoneActions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IAction[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZoneActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listZoneActions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listZoneActions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listZoneActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listZoneActionsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listZoneActions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listZoneActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + 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.listZoneActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listZoneActions, request) + ); + assert( + (client.descriptors.page.listZoneActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listZoneActionsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listZoneActions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listZoneActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listZoneActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listZoneActions, request) + ); + assert( + (client.descriptors.page.listZoneActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listZoneActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listZoneActions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + const iterable = client.listZoneActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listZoneActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listZoneActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listZoneActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListZoneActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListZoneActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listZoneActions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listZoneActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listZoneActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listZoneActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + ]; + client.innerApiCalls.listAssets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IAsset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Asset) => { + 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.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssets, request) + ); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Asset()), + ]; + client.descriptors.page.listAssets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAssetActions', () => { + it('invokes listAssetActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listAssetActions = stubSimpleCall(expectedResponse); + const [response] = await client.listAssetActions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetActions without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.innerApiCalls.listAssetActions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssetActions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IAction[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssetActions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssetActions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssetActions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetActionsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listAssetActions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAssetActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + 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.listAssetActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssetActions, request) + ); + assert( + (client.descriptors.page.listAssetActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetActionsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssetActions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAssetActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Action[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Action) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssetActions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssetActions, request) + ); + assert( + (client.descriptors.page.listAssetActions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssetActions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Action()), + ]; + client.descriptors.page.listAssetActions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + const iterable = client.listAssetActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAssetActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAssetActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssetActions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListAssetActionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListAssetActionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssetActions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAssetActions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listAssetActions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); + const [response] = await client.listTasks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + ]; + client.innerApiCalls.listTasks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.ITask[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTasks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTasks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasksStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + ]; + client.descriptors.page.listTasks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Task) => { + 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.listTasks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTasks, request) + ); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTasksStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Task) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTasks, request) + ); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.ITask[] = []; + const iterable = client.listTasksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListTasksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListTasksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTasksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.ITask[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.dataplex.v1.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEnvironments', () => { + it('invokes listEnvironments without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); + const [response] = await client.listEnvironments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + ]; + client.innerApiCalls.listEnvironments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnvironments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEnvironment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnvironments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEnvironments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnvironments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironmentsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + ]; + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Environment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Environment) => { + 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.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request) + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEnvironmentsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Environment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Environment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEnvironments, request) + ); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + generateSampleMessage( + new protos.google.cloud.dataplex.v1.Environment() + ), + ]; + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IEnvironment[] = []; + const iterable = client.listEnvironmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEnvironmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEnvironmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IEnvironment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEnvironments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSessions', () => { + it('invokes listSessions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + ]; + client.innerApiCalls.listSessions = stubSimpleCall(expectedResponse); + const [response] = await client.listSessions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + ]; + client.innerApiCalls.listSessions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.ISession[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSessions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSessions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionsStream without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + ]; + client.descriptors.page.listSessions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Session[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Session) => { + 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.listSessions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSessions, request) + ); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSessionsStream with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Session[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Session) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSessions, request) + ); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Session()), + ]; + client.descriptors.page.listSessions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.ISession[] = []; + const iterable = client.listSessionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListSessionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListSessionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.ISession[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSessions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssetName', () => { + const result = client.matchProjectFromAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromAssetName', () => { + const result = client.matchLakeFromAssetName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromAssetName', () => { + const result = client.matchZoneFromAssetName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('content', () => { + const fakePath = '/rendered/path/content'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + content: 'contentValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contentPath', () => { + const result = client.contentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'contentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContentName', () => { + const result = client.matchProjectFromContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContentName', () => { + const result = client.matchLocationFromContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromContentName', () => { + const result = client.matchLakeFromContentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContentFromContentName', () => { + const result = client.matchContentFromContentName(fakePath); + assert.strictEqual(result, 'contentValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entity', () => { + const fakePath = '/rendered/path/entity'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityPath', () => { + const result = client.entityPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityName', () => { + const result = client.matchProjectFromEntityName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityName', () => { + const result = client.matchLocationFromEntityName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEntityName', () => { + const result = client.matchLakeFromEntityName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromEntityName', () => { + const result = client.matchZoneFromEntityName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromEntityName', () => { + const result = client.matchEntityFromEntityName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEnvironmentName', () => { + const result = client.matchLakeFromEnvironmentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + job: 'jobValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromJobName', () => { + const result = client.matchLakeFromJobName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromJobName', () => { + const result = client.matchTaskFromJobName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('lake', () => { + const fakePath = '/rendered/path/lake'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.lakePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.lakePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('lakePath', () => { + const result = client.lakePath( + 'projectValue', + 'locationValue', + 'lakeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.lakePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLakeName', () => { + const result = client.matchProjectFromLakeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLakeName', () => { + const result = client.matchLocationFromLakeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromLakeName', () => { + const result = client.matchLakeFromLakeName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('partition', () => { + const fakePath = '/rendered/path/partition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + partition: 'partitionValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.partitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.partitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('partitionPath', () => { + const result = client.partitionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue', + 'partitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.partitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPartitionName', () => { + const result = client.matchProjectFromPartitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPartitionName', () => { + const result = client.matchLocationFromPartitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromPartitionName', () => { + const result = client.matchLakeFromPartitionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromPartitionName', () => { + const result = client.matchZoneFromPartitionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromPartitionName', () => { + const result = client.matchEntityFromPartitionName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPartitionFromPartitionName', () => { + const result = client.matchPartitionFromPartitionName(fakePath); + assert.strictEqual(result, 'partitionValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeAction', () => { + const fakePath = '/rendered/path/projectLocationLakeAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + action: 'actionValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeActionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationLakeActionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationLakeActionPath', () => { + const result = client.projectLocationLakeActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeActionName', () => { + const result = + client.matchActionFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + action: 'actionValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneActionPath', () => { + const result = client.projectLocationLakeZoneActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAssetAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAssetAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + action: 'actionValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneAssetActionPath', () => { + const result = client.projectLocationLakeZoneAssetActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchAssetFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('session', () => { + const fakePath = '/rendered/path/session'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromSessionName', () => { + const result = client.matchLakeFromSessionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromSessionName', () => { + const result = client.matchEnvironmentFromSessionName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('task', () => { + const fakePath = '/rendered/path/task'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taskPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromTaskName', () => { + const result = client.matchLakeFromTaskName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('zone', () => { + const fakePath = '/rendered/path/zone'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + }; + const client = new dataplexserviceModule.v1.DataplexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.zonePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.zonePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('zonePath', () => { + const result = client.zonePath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.zonePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromZoneName', () => { + const result = client.matchProjectFromZoneName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromZoneName', () => { + const result = client.matchLocationFromZoneName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromZoneName', () => { + const result = client.matchLakeFromZoneName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromZoneName', () => { + const result = client.matchZoneFromZoneName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dataplex/test/gapic_metadata_service_v1.ts b/packages/google-cloud-dataplex/test/gapic_metadata_service_v1.ts new file mode 100644 index 000000000000..7a63943c87ff --- /dev/null +++ b/packages/google-cloud-dataplex/test/gapic_metadata_service_v1.ts @@ -0,0 +1,3404 @@ +// Copyright 2022 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 metadataserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, operationsProtos, LocationProtos} 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.MetadataServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + metadataserviceModule.v1.MetadataServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + metadataserviceModule.v1.MetadataServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = metadataserviceModule.v1.MetadataServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new metadataserviceModule.v1.MetadataServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + await client.initialize(); + assert(client.metadataServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.metadataServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metadataServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + 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 metadataserviceModule.v1.MetadataServiceClient({ + 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('createEntity', () => { + it('invokes createEntity without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEntityRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.createEntity = stubSimpleCall(expectedResponse); + const [response] = await client.createEntity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntity without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEntityRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.createEntity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntity( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEntity | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntity with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEntityRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntity = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createEntity(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntity with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreateEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreateEntityRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createEntity(request), expectedError); + }); + }); + + describe('updateEntity', () => { + it('invokes updateEntity without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEntityRequest() + ); + request.entity ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEntityRequest', + ['entity', 'name'] + ); + request.entity.name = defaultValue1; + const expectedHeaderRequestParams = `entity.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.updateEntity = stubSimpleCall(expectedResponse); + const [response] = await client.updateEntity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntity without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEntityRequest() + ); + request.entity ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEntityRequest', + ['entity', 'name'] + ); + request.entity.name = defaultValue1; + const expectedHeaderRequestParams = `entity.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.updateEntity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEntity( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEntity | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntity with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEntityRequest() + ); + request.entity ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEntityRequest', + ['entity', 'name'] + ); + request.entity.name = defaultValue1; + const expectedHeaderRequestParams = `entity.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntity = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEntity(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEntity with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.UpdateEntityRequest() + ); + request.entity ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.UpdateEntityRequest', + ['entity', 'name'] + ); + request.entity.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEntity(request), expectedError); + }); + }); + + describe('deleteEntity', () => { + it('invokes deleteEntity without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEntity = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEntity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntity without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEntity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEntity( + 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.deleteEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntity with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntity = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEntity(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEntity with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeleteEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeleteEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteEntity(request), expectedError); + }); + }); + + describe('getEntity', () => { + it('invokes getEntity without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.getEntity = stubSimpleCall(expectedResponse); + const [response] = await client.getEntity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntity without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Entity() + ); + client.innerApiCalls.getEntity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntity( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEntity | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntity with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntity = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEntity(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntity with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetEntityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetEntityRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEntity(request), expectedError); + }); + }); + + describe('createPartition', () => { + it('invokes createPartition without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreatePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreatePartitionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Partition() + ); + client.innerApiCalls.createPartition = stubSimpleCall(expectedResponse); + const [response] = await client.createPartition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartition without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreatePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreatePartitionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Partition() + ); + client.innerApiCalls.createPartition = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPartition( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IPartition | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartition with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreatePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreatePartitionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPartition = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createPartition(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPartition with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.CreatePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.CreatePartitionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPartition(request), expectedError); + }); + }); + + describe('deletePartition', () => { + it('invokes deletePartition without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeletePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeletePartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePartition = stubSimpleCall(expectedResponse); + const [response] = await client.deletePartition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartition without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeletePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeletePartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePartition = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePartition( + 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.deletePartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartition with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeletePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeletePartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePartition = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePartition(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePartition with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.DeletePartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.DeletePartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePartition(request), expectedError); + }); + }); + + describe('getPartition', () => { + it('invokes getPartition without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetPartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetPartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Partition() + ); + client.innerApiCalls.getPartition = stubSimpleCall(expectedResponse); + const [response] = await client.getPartition(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPartition without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetPartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetPartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataplex.v1.Partition() + ); + client.innerApiCalls.getPartition = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPartition( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IPartition | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPartition with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetPartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetPartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPartition = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPartition(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPartition as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPartition with closed client', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.GetPartitionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.GetPartitionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPartition(request), expectedError); + }); + }); + + describe('listEntities', () => { + it('invokes listEntities without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + ]; + client.innerApiCalls.listEntities = stubSimpleCall(expectedResponse); + const [response] = await client.listEntities(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntities without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + ]; + client.innerApiCalls.listEntities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntities( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IEntity[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntities with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntities = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEntities(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntitiesStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + ]; + client.descriptors.page.listEntities.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Entity[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Entity) => { + 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.listEntities.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntities, request) + ); + assert( + (client.descriptors.page.listEntities.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEntitiesStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntities.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Entity[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Entity) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEntities.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntities, request) + ); + assert( + (client.descriptors.page.listEntities.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEntities without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Entity()), + ]; + client.descriptors.page.listEntities.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IEntity[] = []; + const iterable = client.listEntitiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntities.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEntities.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEntities with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListEntitiesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntities.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntitiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IEntity[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntities.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEntities.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPartitions', () => { + it('invokes listPartitions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + ]; + client.innerApiCalls.listPartitions = stubSimpleCall(expectedResponse); + const [response] = await client.listPartitions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPartitions without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + ]; + client.innerApiCalls.listPartitions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPartitions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dataplex.v1.IPartition[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPartitions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPartitions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPartitions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPartitions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPartitionsStream without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + ]; + client.descriptors.page.listPartitions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPartitionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Partition[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Partition) => { + 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.listPartitions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPartitions, request) + ); + assert( + (client.descriptors.page.listPartitions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPartitionsStream with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPartitions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPartitionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataplex.v1.Partition[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dataplex.v1.Partition) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPartitions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPartitions, request) + ); + assert( + (client.descriptors.page.listPartitions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPartitions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + generateSampleMessage(new protos.google.cloud.dataplex.v1.Partition()), + ]; + client.descriptors.page.listPartitions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataplex.v1.IPartition[] = []; + const iterable = client.listPartitionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPartitions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPartitions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPartitions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataplex.v1.ListPartitionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.dataplex.v1.ListPartitionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPartitions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPartitionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataplex.v1.IPartition[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPartitions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPartitions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('asset', () => { + const fakePath = '/rendered/path/asset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assetPath', () => { + const result = client.assetPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssetName', () => { + const result = client.matchProjectFromAssetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAssetName', () => { + const result = client.matchLocationFromAssetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromAssetName', () => { + const result = client.matchLakeFromAssetName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromAssetName', () => { + const result = client.matchZoneFromAssetName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromAssetName', () => { + const result = client.matchAssetFromAssetName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + (client.pathTemplates.assetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('content', () => { + const fakePath = '/rendered/path/content'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + content: 'contentValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contentPath', () => { + const result = client.contentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'contentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContentName', () => { + const result = client.matchProjectFromContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContentName', () => { + const result = client.matchLocationFromContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromContentName', () => { + const result = client.matchLakeFromContentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContentFromContentName', () => { + const result = client.matchContentFromContentName(fakePath); + assert.strictEqual(result, 'contentValue'); + assert( + (client.pathTemplates.contentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entity', () => { + const fakePath = '/rendered/path/entity'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityPath', () => { + const result = client.entityPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityName', () => { + const result = client.matchProjectFromEntityName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityName', () => { + const result = client.matchLocationFromEntityName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEntityName', () => { + const result = client.matchLakeFromEntityName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromEntityName', () => { + const result = client.matchZoneFromEntityName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromEntityName', () => { + const result = client.matchEntityFromEntityName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.entityPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromEnvironmentName', () => { + const result = client.matchLakeFromEnvironmentName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + job: 'jobValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromJobName', () => { + const result = client.matchLakeFromJobName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromJobName', () => { + const result = client.matchTaskFromJobName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('lake', () => { + const fakePath = '/rendered/path/lake'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.lakePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.lakePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('lakePath', () => { + const result = client.lakePath( + 'projectValue', + 'locationValue', + 'lakeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.lakePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLakeName', () => { + const result = client.matchProjectFromLakeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLakeName', () => { + const result = client.matchLocationFromLakeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromLakeName', () => { + const result = client.matchLakeFromLakeName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.lakePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('partition', () => { + const fakePath = '/rendered/path/partition'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + entity: 'entityValue', + partition: 'partitionValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.partitionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.partitionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('partitionPath', () => { + const result = client.partitionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'entityValue', + 'partitionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.partitionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPartitionName', () => { + const result = client.matchProjectFromPartitionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPartitionName', () => { + const result = client.matchLocationFromPartitionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromPartitionName', () => { + const result = client.matchLakeFromPartitionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromPartitionName', () => { + const result = client.matchZoneFromPartitionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityFromPartitionName', () => { + const result = client.matchEntityFromPartitionName(fakePath); + assert.strictEqual(result, 'entityValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPartitionFromPartitionName', () => { + const result = client.matchPartitionFromPartitionName(fakePath); + assert.strictEqual(result, 'partitionValue'); + assert( + (client.pathTemplates.partitionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeAction', () => { + const fakePath = '/rendered/path/projectLocationLakeAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + action: 'actionValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeActionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationLakeActionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationLakeActionPath', () => { + const result = client.projectLocationLakeActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeActionName', () => { + const result = + client.matchActionFromProjectLocationLakeActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + action: 'actionValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneActionPath', () => { + const result = client.projectLocationLakeZoneActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneActionName(fakePath); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationLakeZoneAssetAction', () => { + const fakePath = '/rendered/path/projectLocationLakeZoneAssetAction'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + asset: 'assetValue', + action: 'actionValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationLakeZoneAssetActionPath', () => { + const result = client.projectLocationLakeZoneAssetActionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue', + 'assetValue', + 'actionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchProjectFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLocationFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchLakeFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchZoneFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssetFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchAssetFromProjectLocationLakeZoneAssetActionName(fakePath); + assert.strictEqual(result, 'assetValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchActionFromProjectLocationLakeZoneAssetActionName', () => { + const result = + client.matchActionFromProjectLocationLakeZoneAssetActionName( + fakePath + ); + assert.strictEqual(result, 'actionValue'); + assert( + ( + client.pathTemplates.projectLocationLakeZoneAssetActionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('session', () => { + const fakePath = '/rendered/path/session'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + environment: 'environmentValue', + session: 'sessionValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'environmentValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromSessionName', () => { + const result = client.matchLakeFromSessionName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromSessionName', () => { + const result = client.matchEnvironmentFromSessionName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('task', () => { + const fakePath = '/rendered/path/task'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + task: 'taskValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.taskPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'taskValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromTaskName', () => { + const result = client.matchLakeFromTaskName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, 'taskValue'); + assert( + (client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('zone', () => { + const fakePath = '/rendered/path/zone'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + lake: 'lakeValue', + zone: 'zoneValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.zonePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.zonePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('zonePath', () => { + const result = client.zonePath( + 'projectValue', + 'locationValue', + 'lakeValue', + 'zoneValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.zonePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromZoneName', () => { + const result = client.matchProjectFromZoneName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromZoneName', () => { + const result = client.matchLocationFromZoneName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLakeFromZoneName', () => { + const result = client.matchLakeFromZoneName(fakePath); + assert.strictEqual(result, 'lakeValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchZoneFromZoneName', () => { + const result = client.matchZoneFromZoneName(fakePath); + assert.strictEqual(result, 'zoneValue'); + assert( + (client.pathTemplates.zonePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dataplex/tsconfig.json b/packages/google-cloud-dataplex/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-dataplex/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/packages/google-cloud-dataplex/webpack.config.js b/packages/google-cloud-dataplex/webpack.config.js new file mode 100644 index 000000000000..becf895bc793 --- /dev/null +++ b/packages/google-cloud-dataplex/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: 'ContentService', + filename: './content-service.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/packages/google-cloud-deploy/.OwlBot.yaml b/packages/google-cloud-deploy/.OwlBot.yaml new file mode 100644 index 000000000000..c7c8d263f941 --- /dev/null +++ b/packages/google-cloud-deploy/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/deploy/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-deploy/$1 diff --git a/packages/google-cloud-deploy/.eslintignore b/packages/google-cloud-deploy/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-deploy/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-deploy/.eslintrc.json b/packages/google-cloud-deploy/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-deploy/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-deploy/.gitattributes b/packages/google-cloud-deploy/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-deploy/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-deploy/.gitignore b/packages/google-cloud-deploy/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-deploy/.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/packages/google-cloud-deploy/.jsdoc.js b/packages/google-cloud-deploy/.jsdoc.js new file mode 100644 index 000000000000..1ad417e7a8e0 --- /dev/null +++ b/packages/google-cloud-deploy/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/deploy', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-deploy/.mocharc.js b/packages/google-cloud-deploy/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-deploy/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-deploy/.nycrc b/packages/google-cloud-deploy/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-deploy/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-deploy/.prettierignore b/packages/google-cloud-deploy/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-deploy/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-deploy/.prettierrc.js b/packages/google-cloud-deploy/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-deploy/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-deploy/.repo-metadata.json b/packages/google-cloud-deploy/.repo-metadata.json new file mode 100644 index 000000000000..f2a4830c7ee8 --- /dev/null +++ b/packages/google-cloud-deploy/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "clouddeploy", + "name_pretty": "Google Cloud Deploy", + "product_documentation": "https://cloud.google.com/deploy/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/deploy/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/deploy", + "api_id": "clouddeploy.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "clouddeploy", + "library_type": "GAPIC_AUTO", + "codeowner_team": "@googleapis/aap-dpes" +} diff --git a/packages/google-cloud-deploy/CHANGELOG.md b/packages/google-cloud-deploy/CHANGELOG.md new file mode 100644 index 000000000000..dbc84ff1f595 --- /dev/null +++ b/packages/google-cloud-deploy/CHANGELOG.md @@ -0,0 +1,65 @@ +# Changelog + +## [2.2.0](https://github.com/googleapis/nodejs-deploy/compare/v2.1.2...v2.2.0) (2022-09-29) + + +### Features + +* Publish new JobRun resource and associated methods for Google Cloud Deploy ([8183015](https://github.com/googleapis/nodejs-deploy/commit/8183015c907f932346fde8c3b6dc981a3e561efe)) + +## [2.1.2](https://github.com/googleapis/nodejs-deploy/compare/v2.1.1...v2.1.2) (2022-09-21) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#64](https://github.com/googleapis/nodejs-deploy/issues/64)) ([286143f](https://github.com/googleapis/nodejs-deploy/commit/286143f2e7aff409f57b57f58239c21fa16dc230)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-deploy/issues/1553)) ([#63](https://github.com/googleapis/nodejs-deploy/issues/63)) ([024a0e4](https://github.com/googleapis/nodejs-deploy/commit/024a0e4e4902950fc9b40bfed77f2c2ceacf2fce)) +* Preserve default values in x-goog-request-params header ([#66](https://github.com/googleapis/nodejs-deploy/issues/66)) ([be84a26](https://github.com/googleapis/nodejs-deploy/commit/be84a262c1292cd804d7c3b4e0690e21ff122460)) +* use google-gax v3.3.0 ([024a0e4](https://github.com/googleapis/nodejs-deploy/commit/024a0e4e4902950fc9b40bfed77f2c2ceacf2fce)) + +## [2.1.1](https://github.com/googleapis/nodejs-deploy/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#59](https://github.com/googleapis/nodejs-deploy/issues/59)) ([21bd8f3](https://github.com/googleapis/nodejs-deploy/commit/21bd8f318612224884e01504e949d59f9f9c5615)) +* change import long to require ([#60](https://github.com/googleapis/nodejs-deploy/issues/60)) ([682372a](https://github.com/googleapis/nodejs-deploy/commit/682372af2f6758cb797743ad08ad474837024219)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-deploy/issues/1546)) ([#62](https://github.com/googleapis/nodejs-deploy/issues/62)) ([d70fc8b](https://github.com/googleapis/nodejs-deploy/commit/d70fc8b1f161cd908385001eb433fb0a1bdae561)) + +## [2.1.0](https://github.com/googleapis/nodejs-deploy/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#55](https://github.com/googleapis/nodejs-deploy/issues/55)) ([5c7ba12](https://github.com/googleapis/nodejs-deploy/commit/5c7ba1270c9f7b386614a1efa4ef4e752b591fda)) + +## [2.0.0](https://github.com/googleapis/nodejs-deploy/compare/v1.0.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#50) + +### Build System + +* update library to use Node 12 ([#50](https://github.com/googleapis/nodejs-deploy/issues/50)) ([a688caf](https://github.com/googleapis/nodejs-deploy/commit/a688caf817f5f760d951ad6e9570ee0f4a4c0c5f)) + +## [1.0.0](https://github.com/googleapis/nodejs-deploy/compare/v0.2.0...v1.0.0) (2022-03-23) + + +### Features + +* promote to stable ([#36](https://github.com/googleapis/nodejs-deploy/issues/36)) ([00960ff](https://github.com/googleapis/nodejs-deploy/commit/00960ff75a3d40e9f4a81efb868e56642937e49f)) + +## 0.2.0 (2021-10-07) + + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-deploy/issues/1)) ([c22e971](https://www.github.com/googleapis/nodejs-deploy/commit/c22e9711390855c0c992d3f89ac47360c7e47daf)) +* initial stub of library ([7b1cddd](https://www.github.com/googleapis/nodejs-deploy/commit/7b1cdddd39f236838bba28d70ab9b24ba66a8aa5)) + + +### Miscellaneous Chores + +* force minor version bump ([ec4abc9](https://www.github.com/googleapis/nodejs-deploy/commit/ec4abc940641181946ae5c27079c9e72b26774cf)) diff --git a/packages/google-cloud-deploy/CODE_OF_CONDUCT.md b/packages/google-cloud-deploy/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-deploy/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-deploy/CONTRIBUTING.md b/packages/google-cloud-deploy/CONTRIBUTING.md new file mode 100644 index 000000000000..94de8fe2a329 --- /dev/null +++ b/packages/google-cloud-deploy/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Deploy API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=clouddeploy.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-deploy/LICENSE b/packages/google-cloud-deploy/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-deploy/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-deploy/README.md b/packages/google-cloud-deploy/README.md new file mode 100644 index 000000000000..7bc3e533d884 --- /dev/null +++ b/packages/google-cloud-deploy/README.md @@ -0,0 +1,216 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Deploy: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/deploy.svg)](https://www.npmjs.org/package/@google-cloud/deploy) + + + + +clouddeploy client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google Cloud Deploy Node.js Client API Reference][client-docs] +* [Google Cloud Deploy Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Deploy API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/deploy +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ +// const parent = 'abc123' +/** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ +// const pageSize = 1234 +/** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ +// const pageToken = 'abc123' +/** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + */ +// const filter = 'abc123' +/** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ +// const orderBy = 'abc123' + +// Imports the Deploy library +const {CloudDeployClient} = require('@google-cloud/deploy').v1; + +// Instantiates a client +const deployClient = new CloudDeployClient(); + +async function listDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +listDeliveryPipelines(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Cloud_deploy.abandon_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,samples/README.md) | +| Cloud_deploy.approve_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,samples/README.md) | +| Cloud_deploy.create_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.create_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js,samples/README.md) | +| Cloud_deploy.create_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,samples/README.md) | +| Cloud_deploy.create_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js,samples/README.md) | +| Cloud_deploy.delete_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.delete_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js,samples/README.md) | +| Cloud_deploy.get_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,samples/README.md) | +| Cloud_deploy.get_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.get_job_run | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,samples/README.md) | +| Cloud_deploy.get_release | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js,samples/README.md) | +| Cloud_deploy.get_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,samples/README.md) | +| Cloud_deploy.get_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js,samples/README.md) | +| Cloud_deploy.list_delivery_pipelines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,samples/README.md) | +| Cloud_deploy.list_job_runs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,samples/README.md) | +| Cloud_deploy.list_releases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js,samples/README.md) | +| Cloud_deploy.list_rollouts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,samples/README.md) | +| Cloud_deploy.list_targets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js,samples/README.md) | +| Cloud_deploy.retry_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js,samples/README.md) | +| Cloud_deploy.update_delivery_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,samples/README.md) | +| Cloud_deploy.update_target | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/test/quickstart.js,samples/README.md) | + + + +The [Google Cloud Deploy Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/deploy@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/deploy/latest +[product-docs]: https://cloud.google.com/deploy/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=clouddeploy.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-deploy/linkinator.config.json b/packages/google-cloud-deploy/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-deploy/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-deploy/package.json b/packages/google-cloud-deploy/package.json new file mode 100644 index 000000000000..68390f871d9d --- /dev/null +++ b/packages/google-cloud-deploy/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/deploy", + "version": "2.2.0", + "description": "clouddeploy client for Node.js", + "repository": "googleapis/nodejs-deploy", + "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 clouddeploy", + "clouddeploy", + "clouddeploy service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto new file mode 100644 index 000000000000..69f8d522208e --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto @@ -0,0 +1,1986 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "CloudDeployProto"; +option java_package = "com.google.cloud.deploy.v1"; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; +option (google.api.resource_definition) = { + type: "container.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" +}; +option (google.api.resource_definition) = { + type: "clouddeploy.googleapis.com/Operation" + pattern: "projects/{project}/locations/{location}/operations/{operation}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; +option (google.api.resource_definition) = { + type: "gkehub.googleapis.com/Membership" + pattern: "projects/{project}/locations/{location}/memberships/{membership}" +}; + +// CloudDeploy service creates and manages Continuous Delivery operations +// on Google Cloud Platform via Skaffold (https://skaffold.dev). +service CloudDeploy { + option (google.api.default_host) = "clouddeploy.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists DeliveryPipelines in a given project and location. + rpc ListDeliveryPipelines(ListDeliveryPipelinesRequest) returns (ListDeliveryPipelinesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single DeliveryPipeline. + rpc GetDeliveryPipeline(GetDeliveryPipelineRequest) returns (DeliveryPipeline) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new DeliveryPipeline in a given project and location. + rpc CreateDeliveryPipeline(CreateDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + body: "delivery_pipeline" + }; + option (google.api.method_signature) = "parent,delivery_pipeline,delivery_pipeline_id"; + option (google.longrunning.operation_info) = { + response_type: "DeliveryPipeline" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single DeliveryPipeline. + rpc UpdateDeliveryPipeline(UpdateDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}" + body: "delivery_pipeline" + }; + option (google.api.method_signature) = "delivery_pipeline,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DeliveryPipeline" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single DeliveryPipeline. + rpc DeleteDeliveryPipeline(DeleteDeliveryPipelineRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Targets in a given project and location. + rpc ListTargets(ListTargetsRequest) returns (ListTargetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/targets" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Target. + rpc GetTarget(GetTargetRequest) returns (Target) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/targets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Target in a given project and location. + rpc CreateTarget(CreateTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/targets" + body: "target" + }; + option (google.api.method_signature) = "parent,target,target_id"; + option (google.longrunning.operation_info) = { + response_type: "Target" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Target. + rpc UpdateTarget(UpdateTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{target.name=projects/*/locations/*/targets/*}" + body: "target" + }; + option (google.api.method_signature) = "target,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Target" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Target. + rpc DeleteTarget(DeleteTargetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/targets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Releases in a given project and location. + rpc ListReleases(ListReleasesRequest) returns (ListReleasesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Release. + rpc GetRelease(GetReleaseRequest) returns (Release) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Release in a given project and location. + rpc CreateRelease(CreateReleaseRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + body: "release" + }; + option (google.api.method_signature) = "parent,release,release_id"; + option (google.longrunning.operation_info) = { + response_type: "Release" + metadata_type: "OperationMetadata" + }; + } + + // Abandons a Release in the Delivery Pipeline. + rpc AbandonRelease(AbandonReleaseRequest) returns (AbandonReleaseResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Approves a Rollout. + rpc ApproveRollout(ApproveRolloutRequest) returns (ApproveRolloutResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Rollouts in a given project and location. + rpc ListRollouts(ListRolloutsRequest) returns (ListRolloutsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Rollout. + rpc GetRollout(GetRolloutRequest) returns (Rollout) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Rollout in a given project and location. + rpc CreateRollout(CreateRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + body: "rollout" + }; + option (google.api.method_signature) = "parent,rollout,rollout_id"; + option (google.longrunning.operation_info) = { + response_type: "Rollout" + metadata_type: "OperationMetadata" + }; + } + + // Retries the specified Job in a Rollout. + rpc RetryJob(RetryJobRequest) returns (RetryJobResponse) { + option (google.api.http) = { + post: "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob" + body: "*" + }; + option (google.api.method_signature) = "rollout,phase_id,job_id"; + } + + // Lists JobRuns in a given project and location. + rpc ListJobRuns(ListJobRunsRequest) returns (ListJobRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single JobRun. + rpc GetJobRun(GetJobRunRequest) returns (JobRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the configuration for a location. + rpc GetConfig(GetConfigRequest) returns (Config) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/config}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A `DeliveryPipeline` resource in the Google Cloud Deploy API. +// +// A `DeliveryPipeline` defines a pipeline through which a Skaffold +// configuration can progress. +message DeliveryPipeline { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}" + }; + + // Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `DeliveryPipeline`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `DeliveryPipeline`. Max length is 255 characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Time at which the pipeline was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent time at which the pipeline was updated. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The ordering configuration of the `DeliveryPipeline`. + oneof pipeline { + // SerialPipeline defines a sequential set of stages for a + // `DeliveryPipeline`. + SerialPipeline serial_pipeline = 8; + } + + // Output only. Information around the state of the Delivery Pipeline. + PipelineCondition condition = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 10; + + // When suspended, no new releases or rollouts can be created, + // but in-progress ones will complete. + bool suspended = 12; +} + +// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`. +message SerialPipeline { + // Each stage specifies configuration for a `Target`. The ordering + // of this list defines the promotion flow. + repeated Stage stages = 1; +} + +// Stage specifies a location to which to deploy. +message Stage { + // The target_id to which this stage points. This field refers exclusively to + // the last segment of a target name. For example, this field would just be + // `my-target` (rather than + // `projects/project/locations/location/targets/my-target`). The location of + // the `Target` is inferred to be the same as the location of the + // `DeliveryPipeline` that contains this `Stage`. + string target_id = 1; + + // Skaffold profiles to use when rendering the manifest for this stage's + // `Target`. + repeated string profiles = 2; + + // Optional. The strategy to use for a `Rollout` to this stage. + Strategy strategy = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Strategy contains deployment strategy information. +message Strategy { + // Deployment strategy details. + oneof deployment_strategy { + // Standard deployment strategy executes a single deploy and allows + // verifying the deployment. + Standard standard = 1; + } +} + +// Standard represents the standard deployment strategy. +message Standard { + // Whether to verify a deployment. + bool verify = 1; +} + +// PipelineReadyCondition contains information around the status of the +// Pipeline. +message PipelineReadyCondition { + // True if the Pipeline is in a valid state. Otherwise at least one condition + // in `PipelineCondition` is in an invalid state. Iterate over those + // conditions and see which condition(s) has status = false to find out what + // is wrong with the Pipeline. + bool status = 3; + + // Last time the condition was updated. + google.protobuf.Timestamp update_time = 4; +} + +// TargetsPresentCondition contains information on any Targets defined in +// the Delivery Pipeline that do not actually exist. +message TargetsPresentCondition { + // True if there aren't any missing Targets. + bool status = 1; + + // The list of Target names that are missing. For example, + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + repeated string missing_targets = 2 [(google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + }]; + + // Last time the condition was updated. + google.protobuf.Timestamp update_time = 4; +} + +// PipelineCondition contains all conditions relevant to a Delivery Pipeline. +message PipelineCondition { + // Details around the Pipeline's overall status. + PipelineReadyCondition pipeline_ready_condition = 1; + + // Detalis around targets enumerated in the pipeline. + TargetsPresentCondition targets_present_condition = 3; +} + +// The request object for `ListDeliveryPipelines`. +message ListDeliveryPipelinesRequest { + // Required. The parent, which owns this collection of pipelines. Format must be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // The maximum number of pipelines to return. The service may return + // fewer than this value. If unspecified, at most 50 pipelines will + // be returned. The maximum value is 1000; values above 1000 will be set + // to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListDeliveryPipelines` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3; + + // Filter pipelines to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4; + + // Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5; +} + +// The response object from `ListDeliveryPipelines`. +message ListDeliveryPipelinesResponse { + // The `DeliveryPipeline` objects. + repeated DeliveryPipeline delivery_pipelines = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetDeliveryPipeline` +message GetDeliveryPipelineRequest { + // Required. Name of the `DeliveryPipeline`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; +} + +// The request object for `CreateDeliveryPipeline`. +message CreateDeliveryPipelineRequest { + // Required. The parent collection in which the `DeliveryPipeline` should be created. + // Format should be projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Required. ID of the `DeliveryPipeline`. + string delivery_pipeline_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeliveryPipeline` to create. + DeliveryPipeline delivery_pipeline = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `UpdateDeliveryPipeline`. +message UpdateDeliveryPipelineRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // `DeliveryPipeline` resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `DeliveryPipeline` to update. + DeliveryPipeline delivery_pipeline = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + // result in the creation of a new `DeliveryPipeline`. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `DeleteDeliveryPipeline`. +message DeleteDeliveryPipelineRequest { + // Required. The name of the `DeliveryPipeline` to delete. Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then deleting an already deleted or non-existing + // `DeliveryPipeline` will succeed. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the review, but do not actually + // post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, all child resources under this pipeline will also be + // deleted. Otherwise, the request will only work if the pipeline has + // no child resources. + bool force = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Target` resource in the Google Cloud Deploy API. +// +// A `Target` defines a location to which a Skaffold configuration +// can be deployed. +message Target { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Target" + pattern: "projects/{project}/locations/{location}/targets/{target}" + }; + + // Optional. Name of the `Target`. Format is + // projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Resource id of the `Target`. + string target_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unique identifier of the `Target`. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Description of the `Target`. Max length is 255 characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the `Target` requires approval. + bool require_approval = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Time at which the `Target` was created. + google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent time at which the `Target` was updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Destination to which the Skaffold configuration is applied during a + // rollout. + oneof deployment_target { + // Information specifying a GKE Cluster. + GkeCluster gke = 15; + + // Information specifying an Anthos Cluster. + AnthosCluster anthos_cluster = 17; + + // Information specifying a Cloud Run deployment target. + CloudRunLocation run = 18; + } + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Configurations for all execution that relates to this `Target`. + // Each `ExecutionEnvironmentUsage` value may only be used in a single + // configuration; using the same value multiple times is an error. + // When one or more configurations are specified, they must include the + // `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + // When no configurations are specified, execution will use the default + // specified in `DefaultPool`. + repeated ExecutionConfig execution_configs = 16; +} + +// Configuration of the environment to use when calling Skaffold. +message ExecutionConfig { + // Possible usages of this configuration. + enum ExecutionEnvironmentUsage { + // Default value. This value is unused. + EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0; + + // Use for rendering. + RENDER = 1; + + // Use for deploying and deployment hooks. + DEPLOY = 2; + + // Use for deployment verification. + VERIFY = 3; + } + + // Required. Usages when this configuration should be applied. + repeated ExecutionEnvironmentUsage usages = 1 [(google.api.field_behavior) = REQUIRED]; + + // Details of the environment. + oneof execution_environment { + // Optional. Use default Cloud Build pool. + DefaultPool default_pool = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Use private Cloud Build pool. + PrivatePool private_pool = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The resource name of the `WorkerPool`, with the format + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + // If this optional field is unspecified, the default Cloud Build pool will be + // used. + string worker_pool = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) is used. + string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location in which to store execution outputs. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and + // 24h in seconds format. + // If unspecified, a default timeout of 1h is used. + google.protobuf.Duration execution_timeout = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution using the default Cloud Build pool. +message DefaultPool { + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) will be used. + string service_account = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location where execution outputs should be stored. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution using a private Cloud Build pool. +message PrivatePool { + // Required. Resource name of the Cloud Build worker pool to use. The format is + // `projects/{project}/locations/{location}/workerPools/{pool}`. + string worker_pool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. Google service account to use for execution. If unspecified, + // the project execution service account + // (-compute@developer.gserviceaccount.com) will be used. + string service_account = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud Storage location where execution outputs should be stored. This can + // either be a bucket ("gs://my-bucket") or a path within a bucket + // ("gs://my-bucket/my-dir"). + // If unspecified, a default bucket located in the same region will be used. + string artifact_storage = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information specifying a GKE Cluster. +message GkeCluster { + // Information specifying a GKE Cluster. Format is + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + string cluster = 1 [(google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + }]; + + // Optional. If true, `cluster` is accessed using the private IP address of the control + // plane endpoint. Otherwise, the default IP address of the control plane + // endpoint is used. The default IP address is the private IP address for + // clusters with private control-plane endpoints and the public IP address + // otherwise. + // + // Only specify this option when `cluster` is a [private GKE + // cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept). + bool internal_ip = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information specifying an Anthos Cluster. +message AnthosCluster { + // Membership of the GKE Hub-registered cluster to which to apply the Skaffold + // configuration. Format is + // `projects/{project}/locations/{location}/memberships/{membership_name}`. + string membership = 1 [(google.api.resource_reference) = { + type: "gkehub.googleapis.com/Membership" + }]; +} + +// Information specifying where to deploy a Cloud Run Service. +message CloudRunLocation { + // Required. The location for the Cloud Run Service. Format must be + // `projects/{project}/locations/{location}`. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The request object for `ListTargets`. +message ListTargetsRequest { + // Required. The parent, which owns this collection of targets. Format must be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Optional. The maximum number of `Target` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Target` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListTargets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response object from `ListTargets`. +message ListTargetsResponse { + // The `Target` objects. + repeated Target targets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetTarget`. +message GetTargetRequest { + // Required. Name of the `Target`. Format must be + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + } + ]; +} + +// The request object for `CreateTarget`. +message CreateTargetRequest { + // Required. The parent collection in which the `Target` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Required. ID of the `Target`. + string target_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Target` to create. + Target target = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `UpdateTarget`. +message UpdateTargetRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Target resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Target` to update. + Target target = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, updating a `Target` that does not exist will + // result in the creation of a new `Target`. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request object for `DeleteTarget`. +message DeleteTargetRequest { + // Required. The name of the `Target` to delete. Format should be + // projects/{project_id}/locations/{location_name}/targets/{target_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Target" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then deleting an already deleted or non-existing + // DeliveryPipeline will succeed. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the review, but do not actually + // post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Release` resource in the Google Cloud Deploy API. +// +// A `Release` defines a specific Skaffold configuration instance +// that can be deployed. +message Release { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Release" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}" + }; + + // Valid states of the render operation. + enum RenderState { + // The render state is unspecified. + RENDER_STATE_UNSPECIFIED = 0; + + // All rendering operations have completed successfully. + SUCCEEDED = 1; + + // All rendering operations have completed, and one or more have failed. + FAILED = 2; + + // Rendering has started and is not complete. + IN_PROGRESS = 3; + } + + // Details of rendering for a single target. + message TargetRender { + // Valid states of the render operation. + enum TargetRenderState { + // The render operation state is unspecified. + TARGET_RENDER_STATE_UNSPECIFIED = 0; + + // The render operation has completed successfully. + SUCCEEDED = 1; + + // The render operation has failed. + FAILED = 2; + + // The render operation is in progress. + IN_PROGRESS = 3; + } + + // Well-known rendering failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or + // because Google Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The render operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to + // render the manifest for this target. Format is + // `projects/{project}/locations/{location}/builds/{build}`. + string rendering_build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. Current state of the render operation for this Target. + TargetRenderState rendering_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reason this render failed. This will always be unspecified while the + // render in progress. + FailureCause failure_cause = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the render failure, if available. + string failure_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Optional. Name of the `Release`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `Release`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `Release`. Max length is 255 characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Indicates whether this is an abandoned release. + bool abandoned = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Release` was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the render began. + google.protobuf.Timestamp render_start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the render completed. + google.protobuf.Timestamp render_end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Storage URI of tar.gz archive containing Skaffold configuration. + string skaffold_config_uri = 17; + + // Filepath of the Skaffold config inside of the config URI. + string skaffold_config_path = 9; + + // List of artifacts to pass through to Skaffold command. + repeated BuildArtifact build_artifacts = 10; + + // Output only. Snapshot of the parent pipeline taken at release creation time. + DeliveryPipeline delivery_pipeline_snapshot = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Snapshot of the targets taken at release creation time. + repeated Target target_snapshots = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the render operation. + RenderState render_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 16; + + // The Skaffold version to use when operating on this release, such as + // "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + // specific set of versions. + // + // If unset, the most recent supported Skaffold version will be used. + string skaffold_version = 19; + + // Output only. Map from target ID to the target artifacts created + // during the render operation. + map target_artifacts = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Map from target ID to details of the render operation for that target. + map target_renders = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Description of an a image to use during Skaffold rendering. +message BuildArtifact { + // Image name in Skaffold configuration. + string image = 3; + + // Image tag to use. This will generally be the full path to an image, such + // as "gcr.io/my-project/busybox:1.2.3" or + // "gcr.io/my-project/busybox@sha256:abc123". + string tag = 2; +} + +// The artifacts produced by a target render operation. +message TargetArtifact { + oneof uri { + // Output only. URI of a directory containing the artifacts. This contains + // deployment configuration used by Skaffold during a rollout, and all + // paths are relative to this location. + string artifact_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. File path of the resolved Skaffold configuration relative to the URI. + string skaffold_config_path = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. File path of the rendered manifest relative to the URI. + string manifest_path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request object for `ListReleases`. +message ListReleasesRequest { + // Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Optional. The maximum number of `Release` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Release` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListReleases` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response object from `ListReleases`. +message ListReleasesResponse { + // The `Release` objects. + repeated Release releases = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request object for `GetRelease`. +message GetReleaseRequest { + // Required. Name of the `Release`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; +} + +// The request object for `CreateRelease`, +message CreateReleaseRequest { + // Required. The parent collection in which the `Release` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/DeliveryPipeline" + } + ]; + + // Required. ID of the `Release`. + string release_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Release` to create. + Release release = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A `Rollout` resource in the Google Cloud Deploy API. +// +// A `Rollout` contains information around a specific deployment to a `Target`. +message Rollout { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Rollout" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}" + }; + + // Valid approval states of a `Rollout`. + enum ApprovalState { + // The `Rollout` has an unspecified approval state. + APPROVAL_STATE_UNSPECIFIED = 0; + + // The `Rollout` requires approval. + NEEDS_APPROVAL = 1; + + // The `Rollout` does not require approval. + DOES_NOT_NEED_APPROVAL = 2; + + // The `Rollout` has been approved. + APPROVED = 3; + + // The `Rollout` has been rejected. + REJECTED = 4; + } + + // Valid states of a `Rollout`. + enum State { + // The `Rollout` has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The `Rollout` has completed successfully. + SUCCEEDED = 1; + + // The `Rollout` has failed. + FAILED = 2; + + // The `Rollout` is being deployed. + IN_PROGRESS = 3; + + // The `Rollout` needs approval. + PENDING_APPROVAL = 4; + + // An approver rejected the `Rollout`. + APPROVAL_REJECTED = 5; + + // The `Rollout` is waiting for an earlier Rollout(s) to complete on this + // `Target`. + PENDING = 6; + + // The `Rollout` is waiting for the `Release` to be fully rendered. + PENDING_RELEASE = 7; + } + + // Well-known rollout failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The deploy operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // Deployment did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + + // Release is in a failed state. + RELEASE_FAILED = 4; + + // Release is abandoned. + RELEASE_ABANDONED = 5; + + // No skaffold verify configuration was found. + VERIFICATION_CONFIG_NOT_FOUND = 6; + } + + // Optional. Name of the `Rollout`. Format is projects/{project}/ + // locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `Rollout`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of the `Rollout` for user purposes. Max length is 255 + // characters. + string description = 3; + + // User annotations. These attributes can only be set and used by the + // user, and not by Google Cloud Deploy. See + // https://google.aip.dev/128#annotations for more details such as format and + // size limitations. + map annotations = 4; + + // Labels are attributes that can be set and used by both the + // user and by Google Cloud Deploy. Labels must meet the following + // constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5; + + // Output only. Time at which the `Rollout` was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` was approved. + google.protobuf.Timestamp approve_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` was enqueued. + google.protobuf.Timestamp enqueue_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` started deploying. + google.protobuf.Timestamp deploy_start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `Rollout` finished deploying. + google.protobuf.Timestamp deploy_end_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The ID of Target to which this `Rollout` is deploying. + string target_id = 18 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Approval state of the `Rollout`. + ApprovalState approval_state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the `Rollout`. + State state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the rollout failure, if available. + string failure_reason = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the Cloud Build `Build` object that is used to deploy + // the Rollout. Format is + // `projects/{project}/locations/{location}/builds/{build}`. + string deploying_build = 17 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 16; + + // Output only. The reason this rollout failed. This will always be unspecified while the + // rollout is in progress. + FailureCause deploy_failure_cause = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The phases that represent the workflows of this `Rollout`. + repeated Phase phases = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata contains information about the rollout. + Metadata metadata = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata includes information associated with a `Rollout`. +message Metadata { + // Output only. The name of the Cloud Run Service that is associated with a `Rollout`. + CloudRunMetadata cloud_run = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to +// the user. +message DeployJobRunMetadata { + // Output only. The name of the Cloud Run Service that is associated with a `DeployJobRun`. + CloudRunMetadata cloud_run = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloudRunMetadata contains information from a Cloud Run deployment. +message CloudRunMetadata { + // Output only. The name of the Cloud Run Service that is associated with a `Rollout`. + // Format is projects/{project}/locations/{location}/services/{service}. + string service = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Run Service urls that are associated with a `Rollout`. + repeated string service_urls = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Run Revision id associated with a `Rollout`. + string revision = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Phase represents a collection of jobs that are logically grouped together +// for a `Rollout`. +message Phase { + // Valid states of a Phase. + enum State { + // The Phase has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The Phase is waiting for an earlier Phase(s) to complete. + PENDING = 1; + + // The Phase is in progress. + IN_PROGRESS = 2; + + // The Phase has succeeded. + SUCCEEDED = 3; + + // The Phase has failed. + FAILED = 4; + + // The Phase was aborted. + ABORTED = 5; + } + + // Output only. The ID of the Phase. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Phase. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The job composition of this Phase. + oneof jobs { + // Output only. Deployment job composition. + DeploymentJobs deployment_jobs = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Deployment job composition. +message DeploymentJobs { + // Output only. The deploy Job. This is the first job run in the phase. + Job deploy_job = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The verify Job. Runs after a deploy if the deploy succeeds. + Job verify_job = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Job represents an operation for a `Rollout`. +message Job { + // Valid states of a Job. + enum State { + // The Job has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The Job is waiting for an earlier Phase(s) or Job(s) to complete. + PENDING = 1; + + // The Job is disabled. + DISABLED = 2; + + // The Job is in progress. + IN_PROGRESS = 3; + + // The Job succeeded. + SUCCEEDED = 4; + + // The Job failed. + FAILED = 5; + + // The Job was aborted. + ABORTED = 6; + } + + // Output only. The ID of the Job. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the Job. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the `JobRun` responsible for the most recent invocation of this + // Job. + string job_run = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/JobRun" + } + ]; + + // The type of Job. + oneof job_type { + // Output only. A deploy Job. + DeployJob deploy_job = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A verify Job. + VerifyJob verify_job = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// A deploy Job. +message DeployJob { + +} + +// A verify Job. +message VerifyJob { + +} + +// ListRolloutsRequest is the request object used by `ListRollouts`. +message ListRolloutsRequest { + // Required. The `Release` which owns this collection of `Rollout` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; + + // Optional. The maximum number of `Rollout` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `Rollout` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListRollouts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other provided parameters match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListRolloutsResponse is the response object reutrned by `ListRollouts`. +message ListRolloutsResponse { + // The `Rollout` objects. + repeated Rollout rollouts = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// GetRolloutRequest is the request object used by `GetRollout`. +message GetRolloutRequest { + // Required. Name of the `Rollout`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; +} + +// CreateRolloutRequest is the request object used by `CreateRollout`. +message CreateRolloutRequest { + // Required. The parent collection in which the `Rollout` should be created. + // Format should be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; + + // Required. ID of the `Rollout`. + string rollout_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Rollout` to create. + Rollout rollout = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request is validated and the user is provided with + // an expected result, but no actual change is made. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request object used by `ApproveRollout`. +message ApproveRolloutRequest { + // Required. Name of the Rollout. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/{rollout}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Required. True = approve; false = reject + bool approved = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response object from `ApproveRollout`. +message ApproveRolloutResponse { + +} + +// RetryJobRequest is the request object used by `RetryJob`. +message RetryJobRequest { + // Required. Name of the Rollout. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}/rollouts/{rollout}. + string rollout = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Required. The phase ID the Job to retry belongs to. + string phase_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID for the Job to retry. + string job_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The response object from 'RetryJob'. +message RetryJobResponse { + +} + +// The request object used by `AbandonRelease`. +message AbandonReleaseRequest { + // Required. Name of the Release. Format is + // projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + // releases/{release}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Release" + } + ]; +} + +// The response object for `AbandonRelease`. +message AbandonReleaseResponse { + +} + +// A `JobRun` resource in the Google Cloud Deploy API. +// +// A `JobRun` contains information of a single `Rollout` job evaluation. +message JobRun { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/JobRun" + pattern: "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}" + }; + + // Valid states of a `JobRun`. + enum State { + // The `JobRun` has an unspecified state. + STATE_UNSPECIFIED = 0; + + // The `JobRun` is in progress. + IN_PROGRESS = 1; + + // The `JobRun` has succeeded. + SUCCEEDED = 2; + + // The `JobRun` has failed. + FAILED = 3; + } + + // Optional. Name of the `JobRun`. Format is projects/{project}/locations/{location}/ + // deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ + // {rollouts}/jobRuns/{uuid}. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Unique identifier of the `JobRun`. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the `Rollout` phase this `JobRun` belongs in. + string phase_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the `Rollout` job this `JobRun` corresponds to. + string job_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` was started. + google.protobuf.Timestamp start_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the `JobRun` ended. + google.protobuf.Timestamp end_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the `JobRun`. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The `JobRun` type and the information for that type. + oneof job_run { + // Output only. Information specific to a deploy `JobRun`. + DeployJobRun deploy_job_run = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information specific to a verify `JobRun`. + VerifyJobRun verify_job_run = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// DeployJobRun contains information specific to a deploy `JobRun`. +message DeployJobRun { + // Well-known deploy failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Google Cloud Deploy has insufficient permissions. See [Required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The deploy operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // The deploy build did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to deploy. + // Format is projects/{project}/locations/{location}/builds/{build}. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. The reason the deploy failed. This will always be unspecified while the + // deploy is in progress or if it succeeded. + FailureCause failure_cause = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the deploy failure, if available. + string failure_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata containing information about the deploy job run. + DeployJobRunMetadata metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// VerifyJobRun contains information specific to a verify `JobRun`. +message VerifyJobRun { + // Well-known verify failures. + enum FailureCause { + // No reason for failure is specified. + FAILURE_CAUSE_UNSPECIFIED = 0; + + // Cloud Build is not available, either because it is not enabled or because + // Google Cloud Deploy has insufficient permissions. See [required + // permission](/deploy/docs/cloud-deploy-service-account#required_permissions). + CLOUD_BUILD_UNAVAILABLE = 1; + + // The verify operation did not complete successfully; check Cloud Build + // logs. + EXECUTION_FAILED = 2; + + // The verify build did not complete within the alloted time. + DEADLINE_EXCEEDED = 3; + + // No Skaffold verify configuration was found. + VERIFICATION_CONFIG_NOT_FOUND = 4; + } + + // Output only. The resource name of the Cloud Build `Build` object that is used to verify. + // Format is projects/{project}/locations/{location}/builds/{build}. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // Output only. URI of a directory containing the verify artifacts. This contains the + // Skaffold event log. + string artifact_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. File path of the Skaffold event log relative to the artifact URI. + string event_log_path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason the verify failed. This will always be unspecified while the + // verify is in progress or if it succeeded. + FailureCause failure_cause = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the verify failure, if available. + string failure_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ListJobRunsRequest is the request object used by `ListJobRuns`. +message ListJobRunsRequest { + // Required. The `Rollout` which owns this collection of `JobRun` objects. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Rollout" + } + ]; + + // Optional. The maximum number of `JobRun` objects to return. The service may return + // fewer than this value. If unspecified, at most 50 `JobRun` objects will be + // returned. The maximum value is 1000; values above 1000 will be set to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListJobRuns` call. Provide this + // to retrieve the subsequent page. + // + // When paginating, all other provided parameters match the call that provided + // the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to be returned. See https://google.aip.dev/160 for more + // details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListJobRunsResponse is the response object returned by `ListJobRuns`. +message ListJobRunsResponse { + // The `JobRun` objects. + repeated JobRun job_runs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. If + // this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached + repeated string unreachable = 3; +} + +// GetJobRunRequest is the request object used by `GetJobRun`. +message GetJobRunRequest { + // Required. Name of the `JobRun`. Format must be + // projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/JobRun" + } + ]; +} + +// Service-wide configuration. +message Config { + option (google.api.resource) = { + type: "clouddeploy.googleapis.com/Config" + pattern: "projects/{project}/locations/{location}/config" + }; + + // Name of the configuration. + string name = 1; + + // Output only. All supported versions of Skaffold. + repeated SkaffoldVersion supported_versions = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Default Skaffold version that is assigned when a Release is created without + // specifying a Skaffold version. + string default_skaffold_version = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of a supported Skaffold version. +message SkaffoldVersion { + // Release version number. For example, "1.20.3". + string version = 1; + + // Date when this version is expected to no longer be supported. + google.type.Date support_end_date = 2; +} + +// Request to get a configuration. +message GetConfigRequest { + // Required. Name of requested configuration. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "clouddeploy.googleapis.com/Config" + } + ]; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto new file mode 100644 index 000000000000..5fff2d0876cc --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto @@ -0,0 +1,38 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "DeliveryPipelineNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification" +// Platform Log event that describes the failure to send delivery pipeline +// status change Pub/Sub notification. +message DeliveryPipelineNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Delivery Pipeline`. + string delivery_pipeline = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto new file mode 100644 index 000000000000..f1e80d6b3257 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/jobrun_notification_payload.proto @@ -0,0 +1,50 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "JobRunNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/jobrun_notification" +// Platform Log event that describes the failure to send JobRun resource update +// Pub/Sub notification. +message JobRunNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `JobRun`. + string job_run = 2; + + // Unique identifier of the `DeliveryPipeline`. + string pipeline_uid = 3; + + // Unique identifier of the `Release`. + string release_uid = 4; + + // Unique identifier of the `Rollout`. + string rollout_uid = 5; + + // ID of the `Target`. + string target_id = 6; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 7; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto new file mode 100644 index 000000000000..cd6a32ea4b48 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/log_enums.proto @@ -0,0 +1,34 @@ +// Copyright 2022 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.cloud.deploy.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "LogEnumsProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Type indicates the type of the log entry and can be used as a filter. +enum Type { + // Type is unspecified. + TYPE_UNSPECIFIED = 0; + + // A Pub/Sub notification failed to be sent. + TYPE_PUBSUB_NOTIFICATION_FAILURE = 1; + + // Release render status changed notification. + TYPE_RENDER_STATUES_CHANGE = 2; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto new file mode 100644 index 000000000000..0383b8e566bc --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_notification_payload.proto @@ -0,0 +1,38 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "ReleaseNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/release_notification" +// Platform Log event that describes the failure to send release status change +// Pub/Sub notification. +message ReleaseNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Release`. + string release = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto new file mode 100644 index 000000000000..414e72ded347 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/release_render_payload.proto @@ -0,0 +1,33 @@ +// Copyright 2022 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.cloud.deploy.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "ReleaseRenderPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/release_render" +// Platform Log event that describes the render status change. +message ReleaseRenderEvent { + // Debug message for when a render transition occurs. Provides further + // details as rendering progresses through render states. + string message = 1; + + // The name of the `Release`. + string release = 2; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto new file mode 100644 index 000000000000..10f6864f97c8 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/rollout_notification_payload.proto @@ -0,0 +1,47 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "RolloutNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/rollout_notification" +// Platform Log event that describes the failure to send rollout status change +// Pub/Sub notification. +message RolloutNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // Unique identifier of the `DeliveryPipeline`. + string pipeline_uid = 2; + + // Unique identifier of the `Release`. + string release_uid = 3; + + // The name of the `Rollout`. + string rollout = 4; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 5; + + // ID of the `Target` that the rollout is deployed to. + string target_id = 6; +} diff --git a/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto new file mode 100644 index 000000000000..d121cdb8ded8 --- /dev/null +++ b/packages/google-cloud-deploy/protos/google/cloud/deploy/v1/target_notification_payload.proto @@ -0,0 +1,38 @@ +// Copyright 2022 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.cloud.deploy.v1; + +import "google/cloud/deploy/v1/log_enums.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy"; +option java_multiple_files = true; +option java_outer_classname = "TargetNotificationPayloadProto"; +option java_package = "com.google.cloud.deploy.v1"; + +// Payload proto for "clouddeploy.googleapis.com/target_notification" +// Platform Log event that describes the failure to send target status change +// Pub/Sub notification. +message TargetNotificationEvent { + // Debug message for when a notification fails to send. + string message = 1; + + // The name of the `Target`. + string target = 2; + + // Type of this notification, e.g. for a Pub/Sub failure. + Type type = 3; +} diff --git a/packages/google-cloud-deploy/protos/protos.d.ts b/packages/google-cloud-deploy/protos/protos.d.ts new file mode 100644 index 000000000000..5abd859ad50c --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.d.ts @@ -0,0 +1,14317 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace deploy. */ + namespace deploy { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudDeploy */ + class CloudDeploy extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudDeploy 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 CloudDeploy 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): CloudDeploy; + + /** + * Calls ListDeliveryPipelines. + * @param request ListDeliveryPipelinesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDeliveryPipelinesResponse + */ + public listDeliveryPipelines(request: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelinesCallback): void; + + /** + * Calls ListDeliveryPipelines. + * @param request ListDeliveryPipelinesRequest message or plain object + * @returns Promise + */ + public listDeliveryPipelines(request: google.cloud.deploy.v1.IListDeliveryPipelinesRequest): Promise; + + /** + * Calls GetDeliveryPipeline. + * @param request GetDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeliveryPipeline + */ + public getDeliveryPipeline(request: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipelineCallback): void; + + /** + * Calls GetDeliveryPipeline. + * @param request GetDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public getDeliveryPipeline(request: google.cloud.deploy.v1.IGetDeliveryPipelineRequest): Promise; + + /** + * Calls CreateDeliveryPipeline. + * @param request CreateDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDeliveryPipeline(request: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipelineCallback): void; + + /** + * Calls CreateDeliveryPipeline. + * @param request CreateDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public createDeliveryPipeline(request: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest): Promise; + + /** + * Calls UpdateDeliveryPipeline. + * @param request UpdateDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDeliveryPipeline(request: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipelineCallback): void; + + /** + * Calls UpdateDeliveryPipeline. + * @param request UpdateDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public updateDeliveryPipeline(request: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest): Promise; + + /** + * Calls DeleteDeliveryPipeline. + * @param request DeleteDeliveryPipelineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDeliveryPipeline(request: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, callback: google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipelineCallback): void; + + /** + * Calls DeleteDeliveryPipeline. + * @param request DeleteDeliveryPipelineRequest message or plain object + * @returns Promise + */ + public deleteDeliveryPipeline(request: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest): Promise; + + /** + * Calls ListTargets. + * @param request ListTargetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTargetsResponse + */ + public listTargets(request: google.cloud.deploy.v1.IListTargetsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListTargetsCallback): void; + + /** + * Calls ListTargets. + * @param request ListTargetsRequest message or plain object + * @returns Promise + */ + public listTargets(request: google.cloud.deploy.v1.IListTargetsRequest): Promise; + + /** + * Calls GetTarget. + * @param request GetTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Target + */ + public getTarget(request: google.cloud.deploy.v1.IGetTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetTargetCallback): void; + + /** + * Calls GetTarget. + * @param request GetTargetRequest message or plain object + * @returns Promise + */ + public getTarget(request: google.cloud.deploy.v1.IGetTargetRequest): Promise; + + /** + * Calls CreateTarget. + * @param request CreateTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTarget(request: google.cloud.deploy.v1.ICreateTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateTargetCallback): void; + + /** + * Calls CreateTarget. + * @param request CreateTargetRequest message or plain object + * @returns Promise + */ + public createTarget(request: google.cloud.deploy.v1.ICreateTargetRequest): Promise; + + /** + * Calls UpdateTarget. + * @param request UpdateTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTarget(request: google.cloud.deploy.v1.IUpdateTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.UpdateTargetCallback): void; + + /** + * Calls UpdateTarget. + * @param request UpdateTargetRequest message or plain object + * @returns Promise + */ + public updateTarget(request: google.cloud.deploy.v1.IUpdateTargetRequest): Promise; + + /** + * Calls DeleteTarget. + * @param request DeleteTargetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTarget(request: google.cloud.deploy.v1.IDeleteTargetRequest, callback: google.cloud.deploy.v1.CloudDeploy.DeleteTargetCallback): void; + + /** + * Calls DeleteTarget. + * @param request DeleteTargetRequest message or plain object + * @returns Promise + */ + public deleteTarget(request: google.cloud.deploy.v1.IDeleteTargetRequest): Promise; + + /** + * Calls ListReleases. + * @param request ListReleasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReleasesResponse + */ + public listReleases(request: google.cloud.deploy.v1.IListReleasesRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListReleasesCallback): void; + + /** + * Calls ListReleases. + * @param request ListReleasesRequest message or plain object + * @returns Promise + */ + public listReleases(request: google.cloud.deploy.v1.IListReleasesRequest): Promise; + + /** + * Calls GetRelease. + * @param request GetReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Release + */ + public getRelease(request: google.cloud.deploy.v1.IGetReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetReleaseCallback): void; + + /** + * Calls GetRelease. + * @param request GetReleaseRequest message or plain object + * @returns Promise + */ + public getRelease(request: google.cloud.deploy.v1.IGetReleaseRequest): Promise; + + /** + * Calls CreateRelease. + * @param request CreateReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRelease(request: google.cloud.deploy.v1.ICreateReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateReleaseCallback): void; + + /** + * Calls CreateRelease. + * @param request CreateReleaseRequest message or plain object + * @returns Promise + */ + public createRelease(request: google.cloud.deploy.v1.ICreateReleaseRequest): Promise; + + /** + * Calls AbandonRelease. + * @param request AbandonReleaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AbandonReleaseResponse + */ + public abandonRelease(request: google.cloud.deploy.v1.IAbandonReleaseRequest, callback: google.cloud.deploy.v1.CloudDeploy.AbandonReleaseCallback): void; + + /** + * Calls AbandonRelease. + * @param request AbandonReleaseRequest message or plain object + * @returns Promise + */ + public abandonRelease(request: google.cloud.deploy.v1.IAbandonReleaseRequest): Promise; + + /** + * Calls ApproveRollout. + * @param request ApproveRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApproveRolloutResponse + */ + public approveRollout(request: google.cloud.deploy.v1.IApproveRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.ApproveRolloutCallback): void; + + /** + * Calls ApproveRollout. + * @param request ApproveRolloutRequest message or plain object + * @returns Promise + */ + public approveRollout(request: google.cloud.deploy.v1.IApproveRolloutRequest): Promise; + + /** + * Calls ListRollouts. + * @param request ListRolloutsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRolloutsResponse + */ + public listRollouts(request: google.cloud.deploy.v1.IListRolloutsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListRolloutsCallback): void; + + /** + * Calls ListRollouts. + * @param request ListRolloutsRequest message or plain object + * @returns Promise + */ + public listRollouts(request: google.cloud.deploy.v1.IListRolloutsRequest): Promise; + + /** + * Calls GetRollout. + * @param request GetRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Rollout + */ + public getRollout(request: google.cloud.deploy.v1.IGetRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetRolloutCallback): void; + + /** + * Calls GetRollout. + * @param request GetRolloutRequest message or plain object + * @returns Promise + */ + public getRollout(request: google.cloud.deploy.v1.IGetRolloutRequest): Promise; + + /** + * Calls CreateRollout. + * @param request CreateRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRollout(request: google.cloud.deploy.v1.ICreateRolloutRequest, callback: google.cloud.deploy.v1.CloudDeploy.CreateRolloutCallback): void; + + /** + * Calls CreateRollout. + * @param request CreateRolloutRequest message or plain object + * @returns Promise + */ + public createRollout(request: google.cloud.deploy.v1.ICreateRolloutRequest): Promise; + + /** + * Calls RetryJob. + * @param request RetryJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetryJobResponse + */ + public retryJob(request: google.cloud.deploy.v1.IRetryJobRequest, callback: google.cloud.deploy.v1.CloudDeploy.RetryJobCallback): void; + + /** + * Calls RetryJob. + * @param request RetryJobRequest message or plain object + * @returns Promise + */ + public retryJob(request: google.cloud.deploy.v1.IRetryJobRequest): Promise; + + /** + * Calls ListJobRuns. + * @param request ListJobRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobRunsResponse + */ + public listJobRuns(request: google.cloud.deploy.v1.IListJobRunsRequest, callback: google.cloud.deploy.v1.CloudDeploy.ListJobRunsCallback): void; + + /** + * Calls ListJobRuns. + * @param request ListJobRunsRequest message or plain object + * @returns Promise + */ + public listJobRuns(request: google.cloud.deploy.v1.IListJobRunsRequest): Promise; + + /** + * Calls GetJobRun. + * @param request GetJobRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobRun + */ + public getJobRun(request: google.cloud.deploy.v1.IGetJobRunRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetJobRunCallback): void; + + /** + * Calls GetJobRun. + * @param request GetJobRunRequest message or plain object + * @returns Promise + */ + public getJobRun(request: google.cloud.deploy.v1.IGetJobRunRequest): Promise; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Config + */ + public getConfig(request: google.cloud.deploy.v1.IGetConfigRequest, callback: google.cloud.deploy.v1.CloudDeploy.GetConfigCallback): void; + + /** + * Calls GetConfig. + * @param request GetConfigRequest message or plain object + * @returns Promise + */ + public getConfig(request: google.cloud.deploy.v1.IGetConfigRequest): Promise; + } + + namespace CloudDeploy { + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeliveryPipelines}. + * @param error Error, if any + * @param [response] ListDeliveryPipelinesResponse + */ + type ListDeliveryPipelinesCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListDeliveryPipelinesResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeliveryPipeline}. + * @param error Error, if any + * @param [response] DeliveryPipeline + */ + type GetDeliveryPipelineCallback = (error: (Error|null), response?: google.cloud.deploy.v1.DeliveryPipeline) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeliveryPipeline}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDeliveryPipelineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listTargets}. + * @param error Error, if any + * @param [response] ListTargetsResponse + */ + type ListTargetsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListTargetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getTarget}. + * @param error Error, if any + * @param [response] Target + */ + type GetTargetCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Target) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTargetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listReleases}. + * @param error Error, if any + * @param [response] ListReleasesResponse + */ + type ListReleasesCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListReleasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRelease}. + * @param error Error, if any + * @param [response] Release + */ + type GetReleaseCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Release) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRelease}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateReleaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|abandonRelease}. + * @param error Error, if any + * @param [response] AbandonReleaseResponse + */ + type AbandonReleaseCallback = (error: (Error|null), response?: google.cloud.deploy.v1.AbandonReleaseResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. + * @param error Error, if any + * @param [response] ApproveRolloutResponse + */ + type ApproveRolloutCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ApproveRolloutResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listRollouts}. + * @param error Error, if any + * @param [response] ListRolloutsResponse + */ + type ListRolloutsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListRolloutsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRollout}. + * @param error Error, if any + * @param [response] Rollout + */ + type GetRolloutCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Rollout) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRollout}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRolloutCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|retryJob}. + * @param error Error, if any + * @param [response] RetryJobResponse + */ + type RetryJobCallback = (error: (Error|null), response?: google.cloud.deploy.v1.RetryJobResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listJobRuns}. + * @param error Error, if any + * @param [response] ListJobRunsResponse + */ + type ListJobRunsCallback = (error: (Error|null), response?: google.cloud.deploy.v1.ListJobRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getJobRun}. + * @param error Error, if any + * @param [response] JobRun + */ + type GetJobRunCallback = (error: (Error|null), response?: google.cloud.deploy.v1.JobRun) => void; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getConfig}. + * @param error Error, if any + * @param [response] Config + */ + type GetConfigCallback = (error: (Error|null), response?: google.cloud.deploy.v1.Config) => void; + } + + /** Properties of a DeliveryPipeline. */ + interface IDeliveryPipeline { + + /** DeliveryPipeline name */ + name?: (string|null); + + /** DeliveryPipeline uid */ + uid?: (string|null); + + /** DeliveryPipeline description */ + description?: (string|null); + + /** DeliveryPipeline annotations */ + annotations?: ({ [k: string]: string }|null); + + /** DeliveryPipeline labels */ + labels?: ({ [k: string]: string }|null); + + /** DeliveryPipeline createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline serialPipeline */ + serialPipeline?: (google.cloud.deploy.v1.ISerialPipeline|null); + + /** DeliveryPipeline condition */ + condition?: (google.cloud.deploy.v1.IPipelineCondition|null); + + /** DeliveryPipeline etag */ + etag?: (string|null); + + /** DeliveryPipeline suspended */ + suspended?: (boolean|null); + } + + /** Represents a DeliveryPipeline. */ + class DeliveryPipeline implements IDeliveryPipeline { + + /** + * Constructs a new DeliveryPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeliveryPipeline); + + /** DeliveryPipeline name. */ + public name: string; + + /** DeliveryPipeline uid. */ + public uid: string; + + /** DeliveryPipeline description. */ + public description: string; + + /** DeliveryPipeline annotations. */ + public annotations: { [k: string]: string }; + + /** DeliveryPipeline labels. */ + public labels: { [k: string]: string }; + + /** DeliveryPipeline createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DeliveryPipeline serialPipeline. */ + public serialPipeline?: (google.cloud.deploy.v1.ISerialPipeline|null); + + /** DeliveryPipeline condition. */ + public condition?: (google.cloud.deploy.v1.IPipelineCondition|null); + + /** DeliveryPipeline etag. */ + public etag: string; + + /** DeliveryPipeline suspended. */ + public suspended: boolean; + + /** DeliveryPipeline pipeline. */ + public pipeline?: "serialPipeline"; + + /** + * Creates a new DeliveryPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryPipeline instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeliveryPipeline): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Encodes the specified DeliveryPipeline message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @param message DeliveryPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeliveryPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeliveryPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @param message DeliveryPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeliveryPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Verifies a DeliveryPipeline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeliveryPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeliveryPipeline; + + /** + * Creates a plain object from a DeliveryPipeline message. Also converts values to other types if specified. + * @param message DeliveryPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeliveryPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeliveryPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeliveryPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SerialPipeline. */ + interface ISerialPipeline { + + /** SerialPipeline stages */ + stages?: (google.cloud.deploy.v1.IStage[]|null); + } + + /** Represents a SerialPipeline. */ + class SerialPipeline implements ISerialPipeline { + + /** + * Constructs a new SerialPipeline. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ISerialPipeline); + + /** SerialPipeline stages. */ + public stages: google.cloud.deploy.v1.IStage[]; + + /** + * Creates a new SerialPipeline instance using the specified properties. + * @param [properties] Properties to set + * @returns SerialPipeline instance + */ + public static create(properties?: google.cloud.deploy.v1.ISerialPipeline): google.cloud.deploy.v1.SerialPipeline; + + /** + * Encodes the specified SerialPipeline message. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @param message SerialPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ISerialPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerialPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @param message SerialPipeline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ISerialPipeline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.SerialPipeline; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.SerialPipeline; + + /** + * Verifies a SerialPipeline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerialPipeline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerialPipeline + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.SerialPipeline; + + /** + * Creates a plain object from a SerialPipeline message. Also converts values to other types if specified. + * @param message SerialPipeline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.SerialPipeline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerialPipeline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SerialPipeline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Stage. */ + interface IStage { + + /** Stage targetId */ + targetId?: (string|null); + + /** Stage profiles */ + profiles?: (string[]|null); + + /** Stage strategy */ + strategy?: (google.cloud.deploy.v1.IStrategy|null); + } + + /** Represents a Stage. */ + class Stage implements IStage { + + /** + * Constructs a new Stage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStage); + + /** Stage targetId. */ + public targetId: string; + + /** Stage profiles. */ + public profiles: string[]; + + /** Stage strategy. */ + public strategy?: (google.cloud.deploy.v1.IStrategy|null); + + /** + * Creates a new Stage instance using the specified properties. + * @param [properties] Properties to set + * @returns Stage instance + */ + public static create(properties?: google.cloud.deploy.v1.IStage): google.cloud.deploy.v1.Stage; + + /** + * Encodes the specified Stage message. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @param message Stage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stage message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @param message Stage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Stage; + + /** + * Decodes a Stage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Stage; + + /** + * Verifies a Stage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Stage; + + /** + * Creates a plain object from a Stage message. Also converts values to other types if specified. + * @param message Stage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Stage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Strategy. */ + interface IStrategy { + + /** Strategy standard */ + standard?: (google.cloud.deploy.v1.IStandard|null); + } + + /** Represents a Strategy. */ + class Strategy implements IStrategy { + + /** + * Constructs a new Strategy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStrategy); + + /** Strategy standard. */ + public standard?: (google.cloud.deploy.v1.IStandard|null); + + /** Strategy deploymentStrategy. */ + public deploymentStrategy?: "standard"; + + /** + * Creates a new Strategy instance using the specified properties. + * @param [properties] Properties to set + * @returns Strategy instance + */ + public static create(properties?: google.cloud.deploy.v1.IStrategy): google.cloud.deploy.v1.Strategy; + + /** + * Encodes the specified Strategy message. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @param message Strategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Strategy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @param message Strategy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStrategy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Strategy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Strategy; + + /** + * Decodes a Strategy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Strategy; + + /** + * Verifies a Strategy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Strategy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Strategy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Strategy; + + /** + * Creates a plain object from a Strategy message. Also converts values to other types if specified. + * @param message Strategy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Strategy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Strategy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Strategy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Standard. */ + interface IStandard { + + /** Standard verify */ + verify?: (boolean|null); + } + + /** Represents a Standard. */ + class Standard implements IStandard { + + /** + * Constructs a new Standard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IStandard); + + /** Standard verify. */ + public verify: boolean; + + /** + * Creates a new Standard instance using the specified properties. + * @param [properties] Properties to set + * @returns Standard instance + */ + public static create(properties?: google.cloud.deploy.v1.IStandard): google.cloud.deploy.v1.Standard; + + /** + * Encodes the specified Standard message. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @param message Standard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IStandard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Standard message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @param message Standard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IStandard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Standard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Standard; + + /** + * Decodes a Standard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Standard; + + /** + * Verifies a Standard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Standard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Standard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Standard; + + /** + * Creates a plain object from a Standard message. Also converts values to other types if specified. + * @param message Standard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Standard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Standard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Standard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PipelineReadyCondition. */ + interface IPipelineReadyCondition { + + /** PipelineReadyCondition status */ + status?: (boolean|null); + + /** PipelineReadyCondition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PipelineReadyCondition. */ + class PipelineReadyCondition implements IPipelineReadyCondition { + + /** + * Constructs a new PipelineReadyCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPipelineReadyCondition); + + /** PipelineReadyCondition status. */ + public status: boolean; + + /** PipelineReadyCondition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PipelineReadyCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PipelineReadyCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.IPipelineReadyCondition): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Encodes the specified PipelineReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @param message PipelineReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPipelineReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PipelineReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @param message PipelineReadyCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPipelineReadyCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Verifies a PipelineReadyCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PipelineReadyCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PipelineReadyCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PipelineReadyCondition; + + /** + * Creates a plain object from a PipelineReadyCondition message. Also converts values to other types if specified. + * @param message PipelineReadyCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PipelineReadyCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PipelineReadyCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PipelineReadyCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetsPresentCondition. */ + interface ITargetsPresentCondition { + + /** TargetsPresentCondition status */ + status?: (boolean|null); + + /** TargetsPresentCondition missingTargets */ + missingTargets?: (string[]|null); + + /** TargetsPresentCondition updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TargetsPresentCondition. */ + class TargetsPresentCondition implements ITargetsPresentCondition { + + /** + * Constructs a new TargetsPresentCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetsPresentCondition); + + /** TargetsPresentCondition status. */ + public status: boolean; + + /** TargetsPresentCondition missingTargets. */ + public missingTargets: string[]; + + /** TargetsPresentCondition updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TargetsPresentCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetsPresentCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetsPresentCondition): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Encodes the specified TargetsPresentCondition message. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @param message TargetsPresentCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetsPresentCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetsPresentCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @param message TargetsPresentCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetsPresentCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Verifies a TargetsPresentCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetsPresentCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetsPresentCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetsPresentCondition; + + /** + * Creates a plain object from a TargetsPresentCondition message. Also converts values to other types if specified. + * @param message TargetsPresentCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetsPresentCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetsPresentCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetsPresentCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PipelineCondition. */ + interface IPipelineCondition { + + /** PipelineCondition pipelineReadyCondition */ + pipelineReadyCondition?: (google.cloud.deploy.v1.IPipelineReadyCondition|null); + + /** PipelineCondition targetsPresentCondition */ + targetsPresentCondition?: (google.cloud.deploy.v1.ITargetsPresentCondition|null); + } + + /** Represents a PipelineCondition. */ + class PipelineCondition implements IPipelineCondition { + + /** + * Constructs a new PipelineCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPipelineCondition); + + /** PipelineCondition pipelineReadyCondition. */ + public pipelineReadyCondition?: (google.cloud.deploy.v1.IPipelineReadyCondition|null); + + /** PipelineCondition targetsPresentCondition. */ + public targetsPresentCondition?: (google.cloud.deploy.v1.ITargetsPresentCondition|null); + + /** + * Creates a new PipelineCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns PipelineCondition instance + */ + public static create(properties?: google.cloud.deploy.v1.IPipelineCondition): google.cloud.deploy.v1.PipelineCondition; + + /** + * Encodes the specified PipelineCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @param message PipelineCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPipelineCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PipelineCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @param message PipelineCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPipelineCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PipelineCondition; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PipelineCondition; + + /** + * Verifies a PipelineCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PipelineCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PipelineCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PipelineCondition; + + /** + * Creates a plain object from a PipelineCondition message. Also converts values to other types if specified. + * @param message PipelineCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PipelineCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PipelineCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PipelineCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeliveryPipelinesRequest. */ + interface IListDeliveryPipelinesRequest { + + /** ListDeliveryPipelinesRequest parent */ + parent?: (string|null); + + /** ListDeliveryPipelinesRequest pageSize */ + pageSize?: (number|null); + + /** ListDeliveryPipelinesRequest pageToken */ + pageToken?: (string|null); + + /** ListDeliveryPipelinesRequest filter */ + filter?: (string|null); + + /** ListDeliveryPipelinesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDeliveryPipelinesRequest. */ + class ListDeliveryPipelinesRequest implements IListDeliveryPipelinesRequest { + + /** + * Constructs a new ListDeliveryPipelinesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesRequest); + + /** ListDeliveryPipelinesRequest parent. */ + public parent: string; + + /** ListDeliveryPipelinesRequest pageSize. */ + public pageSize: number; + + /** ListDeliveryPipelinesRequest pageToken. */ + public pageToken: string; + + /** ListDeliveryPipelinesRequest filter. */ + public filter: string; + + /** ListDeliveryPipelinesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDeliveryPipelinesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeliveryPipelinesRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesRequest): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @param message ListDeliveryPipelinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @param message ListDeliveryPipelinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeliveryPipelinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Verifies a ListDeliveryPipelinesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeliveryPipelinesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeliveryPipelinesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeliveryPipelinesRequest; + + /** + * Creates a plain object from a ListDeliveryPipelinesRequest message. Also converts values to other types if specified. + * @param message ListDeliveryPipelinesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeliveryPipelinesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeliveryPipelinesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeliveryPipelinesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDeliveryPipelinesResponse. */ + interface IListDeliveryPipelinesResponse { + + /** ListDeliveryPipelinesResponse deliveryPipelines */ + deliveryPipelines?: (google.cloud.deploy.v1.IDeliveryPipeline[]|null); + + /** ListDeliveryPipelinesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDeliveryPipelinesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDeliveryPipelinesResponse. */ + class ListDeliveryPipelinesResponse implements IListDeliveryPipelinesResponse { + + /** + * Constructs a new ListDeliveryPipelinesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesResponse); + + /** ListDeliveryPipelinesResponse deliveryPipelines. */ + public deliveryPipelines: google.cloud.deploy.v1.IDeliveryPipeline[]; + + /** ListDeliveryPipelinesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDeliveryPipelinesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDeliveryPipelinesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDeliveryPipelinesResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListDeliveryPipelinesResponse): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @param message ListDeliveryPipelinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListDeliveryPipelinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @param message ListDeliveryPipelinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListDeliveryPipelinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Verifies a ListDeliveryPipelinesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDeliveryPipelinesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDeliveryPipelinesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListDeliveryPipelinesResponse; + + /** + * Creates a plain object from a ListDeliveryPipelinesResponse message. Also converts values to other types if specified. + * @param message ListDeliveryPipelinesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListDeliveryPipelinesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDeliveryPipelinesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDeliveryPipelinesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDeliveryPipelineRequest. */ + interface IGetDeliveryPipelineRequest { + + /** GetDeliveryPipelineRequest name */ + name?: (string|null); + } + + /** Represents a GetDeliveryPipelineRequest. */ + class GetDeliveryPipelineRequest implements IGetDeliveryPipelineRequest { + + /** + * Constructs a new GetDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetDeliveryPipelineRequest); + + /** GetDeliveryPipelineRequest name. */ + public name: string; + + /** + * Creates a new GetDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetDeliveryPipelineRequest): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Encodes the specified GetDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @param message GetDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @param message GetDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Verifies a GetDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetDeliveryPipelineRequest; + + /** + * Creates a plain object from a GetDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message GetDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDeliveryPipelineRequest. */ + interface ICreateDeliveryPipelineRequest { + + /** CreateDeliveryPipelineRequest parent */ + parent?: (string|null); + + /** CreateDeliveryPipelineRequest deliveryPipelineId */ + deliveryPipelineId?: (string|null); + + /** CreateDeliveryPipelineRequest deliveryPipeline */ + deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** CreateDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** CreateDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateDeliveryPipelineRequest. */ + class CreateDeliveryPipelineRequest implements ICreateDeliveryPipelineRequest { + + /** + * Constructs a new CreateDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest); + + /** CreateDeliveryPipelineRequest parent. */ + public parent: string; + + /** CreateDeliveryPipelineRequest deliveryPipelineId. */ + public deliveryPipelineId: string; + + /** CreateDeliveryPipelineRequest deliveryPipeline. */ + public deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** CreateDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** CreateDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @param message CreateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @param message CreateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Verifies a CreateDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateDeliveryPipelineRequest; + + /** + * Creates a plain object from a CreateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message CreateDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDeliveryPipelineRequest. */ + interface IUpdateDeliveryPipelineRequest { + + /** UpdateDeliveryPipelineRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeliveryPipelineRequest deliveryPipeline */ + deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** UpdateDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** UpdateDeliveryPipelineRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateDeliveryPipelineRequest. */ + class UpdateDeliveryPipelineRequest implements IUpdateDeliveryPipelineRequest { + + /** + * Constructs a new UpdateDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest); + + /** UpdateDeliveryPipelineRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDeliveryPipelineRequest deliveryPipeline. */ + public deliveryPipeline?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** UpdateDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** UpdateDeliveryPipelineRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @param message UpdateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @param message UpdateDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Verifies an UpdateDeliveryPipelineRequest message. + * @param message Plain 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 UpdateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.UpdateDeliveryPipelineRequest; + + /** + * Creates a plain object from an UpdateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message UpdateDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.UpdateDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDeliveryPipelineRequest. */ + interface IDeleteDeliveryPipelineRequest { + + /** DeleteDeliveryPipelineRequest name */ + name?: (string|null); + + /** DeleteDeliveryPipelineRequest requestId */ + requestId?: (string|null); + + /** DeleteDeliveryPipelineRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteDeliveryPipelineRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteDeliveryPipelineRequest force */ + force?: (boolean|null); + + /** DeleteDeliveryPipelineRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteDeliveryPipelineRequest. */ + class DeleteDeliveryPipelineRequest implements IDeleteDeliveryPipelineRequest { + + /** + * Constructs a new DeleteDeliveryPipelineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest); + + /** DeleteDeliveryPipelineRequest name. */ + public name: string; + + /** DeleteDeliveryPipelineRequest requestId. */ + public requestId: string; + + /** DeleteDeliveryPipelineRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteDeliveryPipelineRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteDeliveryPipelineRequest force. */ + public force: boolean; + + /** DeleteDeliveryPipelineRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteDeliveryPipelineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDeliveryPipelineRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @param message DeleteDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @param message DeleteDeliveryPipelineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Verifies a DeleteDeliveryPipelineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDeliveryPipelineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeleteDeliveryPipelineRequest; + + /** + * Creates a plain object from a DeleteDeliveryPipelineRequest message. Also converts values to other types if specified. + * @param message DeleteDeliveryPipelineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeleteDeliveryPipelineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDeliveryPipelineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDeliveryPipelineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Target. */ + interface ITarget { + + /** Target name */ + name?: (string|null); + + /** Target targetId */ + targetId?: (string|null); + + /** Target uid */ + uid?: (string|null); + + /** Target description */ + description?: (string|null); + + /** Target annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Target labels */ + labels?: ({ [k: string]: string }|null); + + /** Target requireApproval */ + requireApproval?: (boolean|null); + + /** Target createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Target updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Target gke */ + gke?: (google.cloud.deploy.v1.IGkeCluster|null); + + /** Target anthosCluster */ + anthosCluster?: (google.cloud.deploy.v1.IAnthosCluster|null); + + /** Target run */ + run?: (google.cloud.deploy.v1.ICloudRunLocation|null); + + /** Target etag */ + etag?: (string|null); + + /** Target executionConfigs */ + executionConfigs?: (google.cloud.deploy.v1.IExecutionConfig[]|null); + } + + /** Represents a Target. */ + class Target implements ITarget { + + /** + * Constructs a new Target. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITarget); + + /** Target name. */ + public name: string; + + /** Target targetId. */ + public targetId: string; + + /** Target uid. */ + public uid: string; + + /** Target description. */ + public description: string; + + /** Target annotations. */ + public annotations: { [k: string]: string }; + + /** Target labels. */ + public labels: { [k: string]: string }; + + /** Target requireApproval. */ + public requireApproval: boolean; + + /** Target createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Target updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Target gke. */ + public gke?: (google.cloud.deploy.v1.IGkeCluster|null); + + /** Target anthosCluster. */ + public anthosCluster?: (google.cloud.deploy.v1.IAnthosCluster|null); + + /** Target run. */ + public run?: (google.cloud.deploy.v1.ICloudRunLocation|null); + + /** Target etag. */ + public etag: string; + + /** Target executionConfigs. */ + public executionConfigs: google.cloud.deploy.v1.IExecutionConfig[]; + + /** Target deploymentTarget. */ + public deploymentTarget?: ("gke"|"anthosCluster"|"run"); + + /** + * Creates a new Target instance using the specified properties. + * @param [properties] Properties to set + * @returns Target instance + */ + public static create(properties?: google.cloud.deploy.v1.ITarget): google.cloud.deploy.v1.Target; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Target message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Target; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Target; + + /** + * Verifies a Target message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Target + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Target; + + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @param message Target + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Target, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Target to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Target + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionConfig. */ + interface IExecutionConfig { + + /** ExecutionConfig usages */ + usages?: (google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[]|null); + + /** ExecutionConfig defaultPool */ + defaultPool?: (google.cloud.deploy.v1.IDefaultPool|null); + + /** ExecutionConfig privatePool */ + privatePool?: (google.cloud.deploy.v1.IPrivatePool|null); + + /** ExecutionConfig workerPool */ + workerPool?: (string|null); + + /** ExecutionConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ExecutionConfig artifactStorage */ + artifactStorage?: (string|null); + + /** ExecutionConfig executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an ExecutionConfig. */ + class ExecutionConfig implements IExecutionConfig { + + /** + * Constructs a new ExecutionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IExecutionConfig); + + /** ExecutionConfig usages. */ + public usages: google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[]; + + /** ExecutionConfig defaultPool. */ + public defaultPool?: (google.cloud.deploy.v1.IDefaultPool|null); + + /** ExecutionConfig privatePool. */ + public privatePool?: (google.cloud.deploy.v1.IPrivatePool|null); + + /** ExecutionConfig workerPool. */ + public workerPool: string; + + /** ExecutionConfig serviceAccount. */ + public serviceAccount: string; + + /** ExecutionConfig artifactStorage. */ + public artifactStorage: string; + + /** ExecutionConfig executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); + + /** ExecutionConfig executionEnvironment. */ + public executionEnvironment?: ("defaultPool"|"privatePool"); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionConfig instance + */ + public static create(properties?: google.cloud.deploy.v1.IExecutionConfig): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Verifies an ExecutionConfig message. + * @param message Plain 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 ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ExecutionConfig; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @param message ExecutionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ExecutionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutionConfig { + + /** ExecutionEnvironmentUsage enum. */ + enum ExecutionEnvironmentUsage { + EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0, + RENDER = 1, + DEPLOY = 2, + VERIFY = 3 + } + } + + /** Properties of a DefaultPool. */ + interface IDefaultPool { + + /** DefaultPool serviceAccount */ + serviceAccount?: (string|null); + + /** DefaultPool artifactStorage */ + artifactStorage?: (string|null); + } + + /** Represents a DefaultPool. */ + class DefaultPool implements IDefaultPool { + + /** + * Constructs a new DefaultPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDefaultPool); + + /** DefaultPool serviceAccount. */ + public serviceAccount: string; + + /** DefaultPool artifactStorage. */ + public artifactStorage: string; + + /** + * Creates a new DefaultPool instance using the specified properties. + * @param [properties] Properties to set + * @returns DefaultPool instance + */ + public static create(properties?: google.cloud.deploy.v1.IDefaultPool): google.cloud.deploy.v1.DefaultPool; + + /** + * Encodes the specified DefaultPool message. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @param message DefaultPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDefaultPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DefaultPool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @param message DefaultPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDefaultPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DefaultPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DefaultPool; + + /** + * Decodes a DefaultPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DefaultPool; + + /** + * Verifies a DefaultPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DefaultPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DefaultPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DefaultPool; + + /** + * Creates a plain object from a DefaultPool message. Also converts values to other types if specified. + * @param message DefaultPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DefaultPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DefaultPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DefaultPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivatePool. */ + interface IPrivatePool { + + /** PrivatePool workerPool */ + workerPool?: (string|null); + + /** PrivatePool serviceAccount */ + serviceAccount?: (string|null); + + /** PrivatePool artifactStorage */ + artifactStorage?: (string|null); + } + + /** Represents a PrivatePool. */ + class PrivatePool implements IPrivatePool { + + /** + * Constructs a new PrivatePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPrivatePool); + + /** PrivatePool workerPool. */ + public workerPool: string; + + /** PrivatePool serviceAccount. */ + public serviceAccount: string; + + /** PrivatePool artifactStorage. */ + public artifactStorage: string; + + /** + * Creates a new PrivatePool instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivatePool instance + */ + public static create(properties?: google.cloud.deploy.v1.IPrivatePool): google.cloud.deploy.v1.PrivatePool; + + /** + * Encodes the specified PrivatePool message. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @param message PrivatePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPrivatePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivatePool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @param message PrivatePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPrivatePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivatePool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.PrivatePool; + + /** + * Decodes a PrivatePool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.PrivatePool; + + /** + * Verifies a PrivatePool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivatePool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivatePool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.PrivatePool; + + /** + * Creates a plain object from a PrivatePool message. Also converts values to other types if specified. + * @param message PrivatePool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.PrivatePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivatePool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivatePool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeCluster. */ + interface IGkeCluster { + + /** GkeCluster cluster */ + cluster?: (string|null); + + /** GkeCluster internalIp */ + internalIp?: (boolean|null); + } + + /** Represents a GkeCluster. */ + class GkeCluster implements IGkeCluster { + + /** + * Constructs a new GkeCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGkeCluster); + + /** GkeCluster cluster. */ + public cluster: string; + + /** GkeCluster internalIp. */ + public internalIp: boolean; + + /** + * Creates a new GkeCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeCluster instance + */ + public static create(properties?: google.cloud.deploy.v1.IGkeCluster): google.cloud.deploy.v1.GkeCluster; + + /** + * Encodes the specified GkeCluster message. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @param message GkeCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGkeCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @param message GkeCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGkeCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GkeCluster; + + /** + * Decodes a GkeCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GkeCluster; + + /** + * Verifies a GkeCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GkeCluster; + + /** + * Creates a plain object from a GkeCluster message. Also converts values to other types if specified. + * @param message GkeCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GkeCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnthosCluster. */ + interface IAnthosCluster { + + /** AnthosCluster membership */ + membership?: (string|null); + } + + /** Represents an AnthosCluster. */ + class AnthosCluster implements IAnthosCluster { + + /** + * Constructs a new AnthosCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAnthosCluster); + + /** AnthosCluster membership. */ + public membership: string; + + /** + * Creates a new AnthosCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns AnthosCluster instance + */ + public static create(properties?: google.cloud.deploy.v1.IAnthosCluster): google.cloud.deploy.v1.AnthosCluster; + + /** + * Encodes the specified AnthosCluster message. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @param message AnthosCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAnthosCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnthosCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @param message AnthosCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAnthosCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AnthosCluster; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AnthosCluster; + + /** + * Verifies an AnthosCluster message. + * @param message Plain 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 AnthosCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnthosCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AnthosCluster; + + /** + * Creates a plain object from an AnthosCluster message. Also converts values to other types if specified. + * @param message AnthosCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AnthosCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnthosCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnthosCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudRunLocation. */ + interface ICloudRunLocation { + + /** CloudRunLocation location */ + location?: (string|null); + } + + /** Represents a CloudRunLocation. */ + class CloudRunLocation implements ICloudRunLocation { + + /** + * Constructs a new CloudRunLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICloudRunLocation); + + /** CloudRunLocation location. */ + public location: string; + + /** + * Creates a new CloudRunLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRunLocation instance + */ + public static create(properties?: google.cloud.deploy.v1.ICloudRunLocation): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Encodes the specified CloudRunLocation message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @param message CloudRunLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICloudRunLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRunLocation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @param message CloudRunLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICloudRunLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Verifies a CloudRunLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRunLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRunLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CloudRunLocation; + + /** + * Creates a plain object from a CloudRunLocation message. Also converts values to other types if specified. + * @param message CloudRunLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CloudRunLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRunLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudRunLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetsRequest. */ + interface IListTargetsRequest { + + /** ListTargetsRequest parent */ + parent?: (string|null); + + /** ListTargetsRequest pageSize */ + pageSize?: (number|null); + + /** ListTargetsRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetsRequest filter */ + filter?: (string|null); + + /** ListTargetsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListTargetsRequest. */ + class ListTargetsRequest implements IListTargetsRequest { + + /** + * Constructs a new ListTargetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListTargetsRequest); + + /** ListTargetsRequest parent. */ + public parent: string; + + /** ListTargetsRequest pageSize. */ + public pageSize: number; + + /** ListTargetsRequest pageToken. */ + public pageToken: string; + + /** ListTargetsRequest filter. */ + public filter: string; + + /** ListTargetsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListTargetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListTargetsRequest): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Encodes the specified ListTargetsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @param message ListTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @param message ListTargetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListTargetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Verifies a ListTargetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListTargetsRequest; + + /** + * Creates a plain object from a ListTargetsRequest message. Also converts values to other types if specified. + * @param message ListTargetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListTargetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetsResponse. */ + interface IListTargetsResponse { + + /** ListTargetsResponse targets */ + targets?: (google.cloud.deploy.v1.ITarget[]|null); + + /** ListTargetsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTargetsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTargetsResponse. */ + class ListTargetsResponse implements IListTargetsResponse { + + /** + * Constructs a new ListTargetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListTargetsResponse); + + /** ListTargetsResponse targets. */ + public targets: google.cloud.deploy.v1.ITarget[]; + + /** ListTargetsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTargetsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTargetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListTargetsResponse): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Encodes the specified ListTargetsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @param message ListTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @param message ListTargetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListTargetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Verifies a ListTargetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListTargetsResponse; + + /** + * Creates a plain object from a ListTargetsResponse message. Also converts values to other types if specified. + * @param message ListTargetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListTargetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTargetRequest. */ + interface IGetTargetRequest { + + /** GetTargetRequest name */ + name?: (string|null); + } + + /** Represents a GetTargetRequest. */ + class GetTargetRequest implements IGetTargetRequest { + + /** + * Constructs a new GetTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetTargetRequest); + + /** GetTargetRequest name. */ + public name: string; + + /** + * Creates a new GetTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetTargetRequest): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Encodes the specified GetTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @param message GetTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @param message GetTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Verifies a GetTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetTargetRequest; + + /** + * Creates a plain object from a GetTargetRequest message. Also converts values to other types if specified. + * @param message GetTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTargetRequest. */ + interface ICreateTargetRequest { + + /** CreateTargetRequest parent */ + parent?: (string|null); + + /** CreateTargetRequest targetId */ + targetId?: (string|null); + + /** CreateTargetRequest target */ + target?: (google.cloud.deploy.v1.ITarget|null); + + /** CreateTargetRequest requestId */ + requestId?: (string|null); + + /** CreateTargetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTargetRequest. */ + class CreateTargetRequest implements ICreateTargetRequest { + + /** + * Constructs a new CreateTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateTargetRequest); + + /** CreateTargetRequest parent. */ + public parent: string; + + /** CreateTargetRequest targetId. */ + public targetId: string; + + /** CreateTargetRequest target. */ + public target?: (google.cloud.deploy.v1.ITarget|null); + + /** CreateTargetRequest requestId. */ + public requestId: string; + + /** CreateTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateTargetRequest): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Encodes the specified CreateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @param message CreateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @param message CreateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Verifies a CreateTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateTargetRequest; + + /** + * Creates a plain object from a CreateTargetRequest message. Also converts values to other types if specified. + * @param message CreateTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTargetRequest. */ + interface IUpdateTargetRequest { + + /** UpdateTargetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetRequest target */ + target?: (google.cloud.deploy.v1.ITarget|null); + + /** UpdateTargetRequest requestId */ + requestId?: (string|null); + + /** UpdateTargetRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateTargetRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateTargetRequest. */ + class UpdateTargetRequest implements IUpdateTargetRequest { + + /** + * Constructs a new UpdateTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IUpdateTargetRequest); + + /** UpdateTargetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetRequest target. */ + public target?: (google.cloud.deploy.v1.ITarget|null); + + /** UpdateTargetRequest requestId. */ + public requestId: string; + + /** UpdateTargetRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IUpdateTargetRequest): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Encodes the specified UpdateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @param message UpdateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IUpdateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @param message UpdateTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IUpdateTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Verifies an UpdateTargetRequest message. + * @param message Plain 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 UpdateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.UpdateTargetRequest; + + /** + * Creates a plain object from an UpdateTargetRequest message. Also converts values to other types if specified. + * @param message UpdateTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.UpdateTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTargetRequest. */ + interface IDeleteTargetRequest { + + /** DeleteTargetRequest name */ + name?: (string|null); + + /** DeleteTargetRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteTargetRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteTargetRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteTargetRequest. */ + class DeleteTargetRequest implements IDeleteTargetRequest { + + /** + * Constructs a new DeleteTargetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeleteTargetRequest); + + /** DeleteTargetRequest name. */ + public name: string; + + /** DeleteTargetRequest requestId. */ + public requestId: string; + + /** DeleteTargetRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteTargetRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteTargetRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteTargetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeleteTargetRequest): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Encodes the specified DeleteTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @param message DeleteTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeleteTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @param message DeleteTargetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeleteTargetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Verifies a DeleteTargetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeleteTargetRequest; + + /** + * Creates a plain object from a DeleteTargetRequest message. Also converts values to other types if specified. + * @param message DeleteTargetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeleteTargetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTargetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Release. */ + interface IRelease { + + /** Release name */ + name?: (string|null); + + /** Release uid */ + uid?: (string|null); + + /** Release description */ + description?: (string|null); + + /** Release annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Release labels */ + labels?: ({ [k: string]: string }|null); + + /** Release abandoned */ + abandoned?: (boolean|null); + + /** Release createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime */ + renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime */ + renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri */ + skaffoldConfigUri?: (string|null); + + /** Release skaffoldConfigPath */ + skaffoldConfigPath?: (string|null); + + /** Release buildArtifacts */ + buildArtifacts?: (google.cloud.deploy.v1.IBuildArtifact[]|null); + + /** Release deliveryPipelineSnapshot */ + deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots */ + targetSnapshots?: (google.cloud.deploy.v1.ITarget[]|null); + + /** Release renderState */ + renderState?: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState|null); + + /** Release etag */ + etag?: (string|null); + + /** Release skaffoldVersion */ + skaffoldVersion?: (string|null); + + /** Release targetArtifacts */ + targetArtifacts?: ({ [k: string]: google.cloud.deploy.v1.ITargetArtifact }|null); + + /** Release targetRenders */ + targetRenders?: ({ [k: string]: google.cloud.deploy.v1.Release.ITargetRender }|null); + } + + /** Represents a Release. */ + class Release implements IRelease { + + /** + * Constructs a new Release. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRelease); + + /** Release name. */ + public name: string; + + /** Release uid. */ + public uid: string; + + /** Release description. */ + public description: string; + + /** Release annotations. */ + public annotations: { [k: string]: string }; + + /** Release labels. */ + public labels: { [k: string]: string }; + + /** Release abandoned. */ + public abandoned: boolean; + + /** Release createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Release renderStartTime. */ + public renderStartTime?: (google.protobuf.ITimestamp|null); + + /** Release renderEndTime. */ + public renderEndTime?: (google.protobuf.ITimestamp|null); + + /** Release skaffoldConfigUri. */ + public skaffoldConfigUri: string; + + /** Release skaffoldConfigPath. */ + public skaffoldConfigPath: string; + + /** Release buildArtifacts. */ + public buildArtifacts: google.cloud.deploy.v1.IBuildArtifact[]; + + /** Release deliveryPipelineSnapshot. */ + public deliveryPipelineSnapshot?: (google.cloud.deploy.v1.IDeliveryPipeline|null); + + /** Release targetSnapshots. */ + public targetSnapshots: google.cloud.deploy.v1.ITarget[]; + + /** Release renderState. */ + public renderState: (google.cloud.deploy.v1.Release.RenderState|keyof typeof google.cloud.deploy.v1.Release.RenderState); + + /** Release etag. */ + public etag: string; + + /** Release skaffoldVersion. */ + public skaffoldVersion: string; + + /** Release targetArtifacts. */ + public targetArtifacts: { [k: string]: google.cloud.deploy.v1.ITargetArtifact }; + + /** Release targetRenders. */ + public targetRenders: { [k: string]: google.cloud.deploy.v1.Release.ITargetRender }; + + /** + * Creates a new Release instance using the specified properties. + * @param [properties] Properties to set + * @returns Release instance + */ + public static create(properties?: google.cloud.deploy.v1.IRelease): google.cloud.deploy.v1.Release; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @param message Release message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRelease, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Release message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release; + + /** + * Verifies a Release message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Release + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @param message Release + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Release to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Release + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Release { + + /** RenderState enum. */ + enum RenderState { + RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** Properties of a TargetRender. */ + interface ITargetRender { + + /** TargetRender renderingBuild */ + renderingBuild?: (string|null); + + /** TargetRender renderingState */ + renderingState?: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null); + + /** TargetRender failureCause */ + failureCause?: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause|null); + + /** TargetRender failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a TargetRender. */ + class TargetRender implements ITargetRender { + + /** + * Constructs a new TargetRender. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.Release.ITargetRender); + + /** TargetRender renderingBuild. */ + public renderingBuild: string; + + /** TargetRender renderingState. */ + public renderingState: (google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|keyof typeof google.cloud.deploy.v1.Release.TargetRender.TargetRenderState); + + /** TargetRender failureCause. */ + public failureCause: (google.cloud.deploy.v1.Release.TargetRender.FailureCause|keyof typeof google.cloud.deploy.v1.Release.TargetRender.FailureCause); + + /** TargetRender failureMessage. */ + public failureMessage: string; + + /** + * Creates a new TargetRender instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetRender instance + */ + public static create(properties?: google.cloud.deploy.v1.Release.ITargetRender): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @param message TargetRender message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.Release.ITargetRender, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Verifies a TargetRender message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetRender + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Release.TargetRender; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @param message TargetRender + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Release.TargetRender, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetRender to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetRender + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetRender { + + /** TargetRenderState enum. */ + enum TargetRenderState { + TARGET_RENDER_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3 + } + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2 + } + } + } + + /** Properties of a BuildArtifact. */ + interface IBuildArtifact { + + /** BuildArtifact image */ + image?: (string|null); + + /** BuildArtifact tag */ + tag?: (string|null); + } + + /** Represents a BuildArtifact. */ + class BuildArtifact implements IBuildArtifact { + + /** + * Constructs a new BuildArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IBuildArtifact); + + /** BuildArtifact image. */ + public image: string; + + /** BuildArtifact tag. */ + public tag: string; + + /** + * Creates a new BuildArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildArtifact instance + */ + public static create(properties?: google.cloud.deploy.v1.IBuildArtifact): google.cloud.deploy.v1.BuildArtifact; + + /** + * Encodes the specified BuildArtifact message. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @param message BuildArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IBuildArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @param message BuildArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IBuildArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.BuildArtifact; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.BuildArtifact; + + /** + * Verifies a BuildArtifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildArtifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.BuildArtifact; + + /** + * Creates a plain object from a BuildArtifact message. Also converts values to other types if specified. + * @param message BuildArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.BuildArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetArtifact. */ + interface ITargetArtifact { + + /** TargetArtifact artifactUri */ + artifactUri?: (string|null); + + /** TargetArtifact skaffoldConfigPath */ + skaffoldConfigPath?: (string|null); + + /** TargetArtifact manifestPath */ + manifestPath?: (string|null); + } + + /** Represents a TargetArtifact. */ + class TargetArtifact implements ITargetArtifact { + + /** + * Constructs a new TargetArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetArtifact); + + /** TargetArtifact artifactUri. */ + public artifactUri?: (string|null); + + /** TargetArtifact skaffoldConfigPath. */ + public skaffoldConfigPath: string; + + /** TargetArtifact manifestPath. */ + public manifestPath: string; + + /** TargetArtifact uri. */ + public uri?: "artifactUri"; + + /** + * Creates a new TargetArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetArtifact instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetArtifact): google.cloud.deploy.v1.TargetArtifact; + + /** + * Encodes the specified TargetArtifact message. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @param message TargetArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @param message TargetArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetArtifact; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetArtifact; + + /** + * Verifies a TargetArtifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetArtifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetArtifact; + + /** + * Creates a plain object from a TargetArtifact message. Also converts values to other types if specified. + * @param message TargetArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReleasesRequest. */ + interface IListReleasesRequest { + + /** ListReleasesRequest parent */ + parent?: (string|null); + + /** ListReleasesRequest pageSize */ + pageSize?: (number|null); + + /** ListReleasesRequest pageToken */ + pageToken?: (string|null); + + /** ListReleasesRequest filter */ + filter?: (string|null); + + /** ListReleasesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListReleasesRequest. */ + class ListReleasesRequest implements IListReleasesRequest { + + /** + * Constructs a new ListReleasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListReleasesRequest); + + /** ListReleasesRequest parent. */ + public parent: string; + + /** ListReleasesRequest pageSize. */ + public pageSize: number; + + /** ListReleasesRequest pageToken. */ + public pageToken: string; + + /** ListReleasesRequest filter. */ + public filter: string; + + /** ListReleasesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListReleasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReleasesRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListReleasesRequest): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Encodes the specified ListReleasesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @param message ListReleasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListReleasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReleasesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @param message ListReleasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListReleasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Verifies a ListReleasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReleasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReleasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListReleasesRequest; + + /** + * Creates a plain object from a ListReleasesRequest message. Also converts values to other types if specified. + * @param message ListReleasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListReleasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReleasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReleasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReleasesResponse. */ + interface IListReleasesResponse { + + /** ListReleasesResponse releases */ + releases?: (google.cloud.deploy.v1.IRelease[]|null); + + /** ListReleasesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListReleasesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListReleasesResponse. */ + class ListReleasesResponse implements IListReleasesResponse { + + /** + * Constructs a new ListReleasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListReleasesResponse); + + /** ListReleasesResponse releases. */ + public releases: google.cloud.deploy.v1.IRelease[]; + + /** ListReleasesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListReleasesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListReleasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReleasesResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListReleasesResponse): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Encodes the specified ListReleasesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @param message ListReleasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListReleasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReleasesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @param message ListReleasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListReleasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Verifies a ListReleasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReleasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReleasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListReleasesResponse; + + /** + * Creates a plain object from a ListReleasesResponse message. Also converts values to other types if specified. + * @param message ListReleasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListReleasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReleasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReleasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetReleaseRequest. */ + interface IGetReleaseRequest { + + /** GetReleaseRequest name */ + name?: (string|null); + } + + /** Represents a GetReleaseRequest. */ + class GetReleaseRequest implements IGetReleaseRequest { + + /** + * Constructs a new GetReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetReleaseRequest); + + /** GetReleaseRequest name. */ + public name: string; + + /** + * Creates a new GetReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetReleaseRequest): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Encodes the specified GetReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @param message GetReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @param message GetReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Verifies a GetReleaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetReleaseRequest; + + /** + * Creates a plain object from a GetReleaseRequest message. Also converts values to other types if specified. + * @param message GetReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateReleaseRequest. */ + interface ICreateReleaseRequest { + + /** CreateReleaseRequest parent */ + parent?: (string|null); + + /** CreateReleaseRequest releaseId */ + releaseId?: (string|null); + + /** CreateReleaseRequest release */ + release?: (google.cloud.deploy.v1.IRelease|null); + + /** CreateReleaseRequest requestId */ + requestId?: (string|null); + + /** CreateReleaseRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateReleaseRequest. */ + class CreateReleaseRequest implements ICreateReleaseRequest { + + /** + * Constructs a new CreateReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateReleaseRequest); + + /** CreateReleaseRequest parent. */ + public parent: string; + + /** CreateReleaseRequest releaseId. */ + public releaseId: string; + + /** CreateReleaseRequest release. */ + public release?: (google.cloud.deploy.v1.IRelease|null); + + /** CreateReleaseRequest requestId. */ + public requestId: string; + + /** CreateReleaseRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateReleaseRequest): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Encodes the specified CreateReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @param message CreateReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @param message CreateReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Verifies a CreateReleaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateReleaseRequest; + + /** + * Creates a plain object from a CreateReleaseRequest message. Also converts values to other types if specified. + * @param message CreateReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Rollout. */ + interface IRollout { + + /** Rollout name */ + name?: (string|null); + + /** Rollout uid */ + uid?: (string|null); + + /** Rollout description */ + description?: (string|null); + + /** Rollout annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Rollout labels */ + labels?: ({ [k: string]: string }|null); + + /** Rollout createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout approveTime */ + approveTime?: (google.protobuf.ITimestamp|null); + + /** Rollout enqueueTime */ + enqueueTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployStartTime */ + deployStartTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployEndTime */ + deployEndTime?: (google.protobuf.ITimestamp|null); + + /** Rollout targetId */ + targetId?: (string|null); + + /** Rollout approvalState */ + approvalState?: (google.cloud.deploy.v1.Rollout.ApprovalState|keyof typeof google.cloud.deploy.v1.Rollout.ApprovalState|null); + + /** Rollout state */ + state?: (google.cloud.deploy.v1.Rollout.State|keyof typeof google.cloud.deploy.v1.Rollout.State|null); + + /** Rollout failureReason */ + failureReason?: (string|null); + + /** Rollout deployingBuild */ + deployingBuild?: (string|null); + + /** Rollout etag */ + etag?: (string|null); + + /** Rollout deployFailureCause */ + deployFailureCause?: (google.cloud.deploy.v1.Rollout.FailureCause|keyof typeof google.cloud.deploy.v1.Rollout.FailureCause|null); + + /** Rollout phases */ + phases?: (google.cloud.deploy.v1.IPhase[]|null); + + /** Rollout metadata */ + metadata?: (google.cloud.deploy.v1.IMetadata|null); + } + + /** Represents a Rollout. */ + class Rollout implements IRollout { + + /** + * Constructs a new Rollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRollout); + + /** Rollout name. */ + public name: string; + + /** Rollout uid. */ + public uid: string; + + /** Rollout description. */ + public description: string; + + /** Rollout annotations. */ + public annotations: { [k: string]: string }; + + /** Rollout labels. */ + public labels: { [k: string]: string }; + + /** Rollout createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Rollout approveTime. */ + public approveTime?: (google.protobuf.ITimestamp|null); + + /** Rollout enqueueTime. */ + public enqueueTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployStartTime. */ + public deployStartTime?: (google.protobuf.ITimestamp|null); + + /** Rollout deployEndTime. */ + public deployEndTime?: (google.protobuf.ITimestamp|null); + + /** Rollout targetId. */ + public targetId: string; + + /** Rollout approvalState. */ + public approvalState: (google.cloud.deploy.v1.Rollout.ApprovalState|keyof typeof google.cloud.deploy.v1.Rollout.ApprovalState); + + /** Rollout state. */ + public state: (google.cloud.deploy.v1.Rollout.State|keyof typeof google.cloud.deploy.v1.Rollout.State); + + /** Rollout failureReason. */ + public failureReason: string; + + /** Rollout deployingBuild. */ + public deployingBuild: string; + + /** Rollout etag. */ + public etag: string; + + /** Rollout deployFailureCause. */ + public deployFailureCause: (google.cloud.deploy.v1.Rollout.FailureCause|keyof typeof google.cloud.deploy.v1.Rollout.FailureCause); + + /** Rollout phases. */ + public phases: google.cloud.deploy.v1.IPhase[]; + + /** Rollout metadata. */ + public metadata?: (google.cloud.deploy.v1.IMetadata|null); + + /** + * Creates a new Rollout instance using the specified properties. + * @param [properties] Properties to set + * @returns Rollout instance + */ + public static create(properties?: google.cloud.deploy.v1.IRollout): google.cloud.deploy.v1.Rollout; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @param message Rollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Rollout; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Rollout; + + /** + * Verifies a Rollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Rollout; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @param message Rollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Rollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rollout { + + /** ApprovalState enum. */ + enum ApprovalState { + APPROVAL_STATE_UNSPECIFIED = 0, + NEEDS_APPROVAL = 1, + DOES_NOT_NEED_APPROVAL = 2, + APPROVED = 3, + REJECTED = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + IN_PROGRESS = 3, + PENDING_APPROVAL = 4, + APPROVAL_REJECTED = 5, + PENDING = 6, + PENDING_RELEASE = 7 + } + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3, + RELEASE_FAILED = 4, + RELEASE_ABANDONED = 5, + VERIFICATION_CONFIG_NOT_FOUND = 6 + } + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata cloudRun */ + cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IMetadata); + + /** Metadata cloudRun. */ + public cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.deploy.v1.IMetadata): google.cloud.deploy.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployJobRunMetadata. */ + interface IDeployJobRunMetadata { + + /** DeployJobRunMetadata cloudRun */ + cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + } + + /** Represents a DeployJobRunMetadata. */ + class DeployJobRunMetadata implements IDeployJobRunMetadata { + + /** + * Constructs a new DeployJobRunMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJobRunMetadata); + + /** DeployJobRunMetadata cloudRun. */ + public cloudRun?: (google.cloud.deploy.v1.ICloudRunMetadata|null); + + /** + * Creates a new DeployJobRunMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJobRunMetadata instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJobRunMetadata): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Encodes the specified DeployJobRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @param message DeployJobRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJobRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJobRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @param message DeployJobRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJobRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Verifies a DeployJobRunMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJobRunMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJobRunMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJobRunMetadata; + + /** + * Creates a plain object from a DeployJobRunMetadata message. Also converts values to other types if specified. + * @param message DeployJobRunMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJobRunMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJobRunMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJobRunMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudRunMetadata. */ + interface ICloudRunMetadata { + + /** CloudRunMetadata service */ + service?: (string|null); + + /** CloudRunMetadata serviceUrls */ + serviceUrls?: (string[]|null); + + /** CloudRunMetadata revision */ + revision?: (string|null); + } + + /** Represents a CloudRunMetadata. */ + class CloudRunMetadata implements ICloudRunMetadata { + + /** + * Constructs a new CloudRunMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICloudRunMetadata); + + /** CloudRunMetadata service. */ + public service: string; + + /** CloudRunMetadata serviceUrls. */ + public serviceUrls: string[]; + + /** CloudRunMetadata revision. */ + public revision: string; + + /** + * Creates a new CloudRunMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRunMetadata instance + */ + public static create(properties?: google.cloud.deploy.v1.ICloudRunMetadata): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Encodes the specified CloudRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @param message CloudRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICloudRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @param message CloudRunMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICloudRunMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Verifies a CloudRunMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRunMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRunMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CloudRunMetadata; + + /** + * Creates a plain object from a CloudRunMetadata message. Also converts values to other types if specified. + * @param message CloudRunMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CloudRunMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRunMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudRunMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Phase. */ + interface IPhase { + + /** Phase id */ + id?: (string|null); + + /** Phase state */ + state?: (google.cloud.deploy.v1.Phase.State|keyof typeof google.cloud.deploy.v1.Phase.State|null); + + /** Phase deploymentJobs */ + deploymentJobs?: (google.cloud.deploy.v1.IDeploymentJobs|null); + } + + /** Represents a Phase. */ + class Phase implements IPhase { + + /** + * Constructs a new Phase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IPhase); + + /** Phase id. */ + public id: string; + + /** Phase state. */ + public state: (google.cloud.deploy.v1.Phase.State|keyof typeof google.cloud.deploy.v1.Phase.State); + + /** Phase deploymentJobs. */ + public deploymentJobs?: (google.cloud.deploy.v1.IDeploymentJobs|null); + + /** Phase jobs. */ + public jobs?: "deploymentJobs"; + + /** + * Creates a new Phase instance using the specified properties. + * @param [properties] Properties to set + * @returns Phase instance + */ + public static create(properties?: google.cloud.deploy.v1.IPhase): google.cloud.deploy.v1.Phase; + + /** + * Encodes the specified Phase message. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @param message Phase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IPhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Phase message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @param message Phase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IPhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Phase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Phase; + + /** + * Decodes a Phase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Phase; + + /** + * Verifies a Phase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Phase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Phase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Phase; + + /** + * Creates a plain object from a Phase message. Also converts values to other types if specified. + * @param message Phase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Phase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Phase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Phase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Phase { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + IN_PROGRESS = 2, + SUCCEEDED = 3, + FAILED = 4, + ABORTED = 5 + } + } + + /** Properties of a DeploymentJobs. */ + interface IDeploymentJobs { + + /** DeploymentJobs deployJob */ + deployJob?: (google.cloud.deploy.v1.IJob|null); + + /** DeploymentJobs verifyJob */ + verifyJob?: (google.cloud.deploy.v1.IJob|null); + } + + /** Represents a DeploymentJobs. */ + class DeploymentJobs implements IDeploymentJobs { + + /** + * Constructs a new DeploymentJobs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeploymentJobs); + + /** DeploymentJobs deployJob. */ + public deployJob?: (google.cloud.deploy.v1.IJob|null); + + /** DeploymentJobs verifyJob. */ + public verifyJob?: (google.cloud.deploy.v1.IJob|null); + + /** + * Creates a new DeploymentJobs instance using the specified properties. + * @param [properties] Properties to set + * @returns DeploymentJobs instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeploymentJobs): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Encodes the specified DeploymentJobs message. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @param message DeploymentJobs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeploymentJobs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeploymentJobs message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @param message DeploymentJobs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeploymentJobs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Verifies a DeploymentJobs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeploymentJobs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeploymentJobs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeploymentJobs; + + /** + * Creates a plain object from a DeploymentJobs message. Also converts values to other types if specified. + * @param message DeploymentJobs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeploymentJobs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeploymentJobs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeploymentJobs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job id */ + id?: (string|null); + + /** Job state */ + state?: (google.cloud.deploy.v1.Job.State|keyof typeof google.cloud.deploy.v1.Job.State|null); + + /** Job jobRun */ + jobRun?: (string|null); + + /** Job deployJob */ + deployJob?: (google.cloud.deploy.v1.IDeployJob|null); + + /** Job verifyJob */ + verifyJob?: (google.cloud.deploy.v1.IVerifyJob|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJob); + + /** Job id. */ + public id: string; + + /** Job state. */ + public state: (google.cloud.deploy.v1.Job.State|keyof typeof google.cloud.deploy.v1.Job.State); + + /** Job jobRun. */ + public jobRun: string; + + /** Job deployJob. */ + public deployJob?: (google.cloud.deploy.v1.IDeployJob|null); + + /** Job verifyJob. */ + public verifyJob?: (google.cloud.deploy.v1.IVerifyJob|null); + + /** Job jobType. */ + public jobType?: ("deployJob"|"verifyJob"); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.deploy.v1.IJob): google.cloud.deploy.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + DISABLED = 2, + IN_PROGRESS = 3, + SUCCEEDED = 4, + FAILED = 5, + ABORTED = 6 + } + } + + /** Properties of a DeployJob. */ + interface IDeployJob { + } + + /** Represents a DeployJob. */ + class DeployJob implements IDeployJob { + + /** + * Constructs a new DeployJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJob); + + /** + * Creates a new DeployJob instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJob instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJob): google.cloud.deploy.v1.DeployJob; + + /** + * Encodes the specified DeployJob message. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @param message DeployJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @param message DeployJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJob; + + /** + * Decodes a DeployJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJob; + + /** + * Verifies a DeployJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJob; + + /** + * Creates a plain object from a DeployJob message. Also converts values to other types if specified. + * @param message DeployJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifyJob. */ + interface IVerifyJob { + } + + /** Represents a VerifyJob. */ + class VerifyJob implements IVerifyJob { + + /** + * Constructs a new VerifyJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IVerifyJob); + + /** + * Creates a new VerifyJob instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyJob instance + */ + public static create(properties?: google.cloud.deploy.v1.IVerifyJob): google.cloud.deploy.v1.VerifyJob; + + /** + * Encodes the specified VerifyJob message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @param message VerifyJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IVerifyJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VerifyJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @param message VerifyJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IVerifyJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VerifyJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.VerifyJob; + + /** + * Decodes a VerifyJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.VerifyJob; + + /** + * Verifies a VerifyJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VerifyJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.VerifyJob; + + /** + * Creates a plain object from a VerifyJob message. Also converts values to other types if specified. + * @param message VerifyJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.VerifyJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VerifyJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifyJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRolloutsRequest. */ + interface IListRolloutsRequest { + + /** ListRolloutsRequest parent */ + parent?: (string|null); + + /** ListRolloutsRequest pageSize */ + pageSize?: (number|null); + + /** ListRolloutsRequest pageToken */ + pageToken?: (string|null); + + /** ListRolloutsRequest filter */ + filter?: (string|null); + + /** ListRolloutsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRolloutsRequest. */ + class ListRolloutsRequest implements IListRolloutsRequest { + + /** + * Constructs a new ListRolloutsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListRolloutsRequest); + + /** ListRolloutsRequest parent. */ + public parent: string; + + /** ListRolloutsRequest pageSize. */ + public pageSize: number; + + /** ListRolloutsRequest pageToken. */ + public pageToken: string; + + /** ListRolloutsRequest filter. */ + public filter: string; + + /** ListRolloutsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRolloutsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRolloutsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListRolloutsRequest): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Encodes the specified ListRolloutsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @param message ListRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRolloutsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @param message ListRolloutsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListRolloutsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Verifies a ListRolloutsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRolloutsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListRolloutsRequest; + + /** + * Creates a plain object from a ListRolloutsRequest message. Also converts values to other types if specified. + * @param message ListRolloutsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListRolloutsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRolloutsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRolloutsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRolloutsResponse. */ + interface IListRolloutsResponse { + + /** ListRolloutsResponse rollouts */ + rollouts?: (google.cloud.deploy.v1.IRollout[]|null); + + /** ListRolloutsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRolloutsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRolloutsResponse. */ + class ListRolloutsResponse implements IListRolloutsResponse { + + /** + * Constructs a new ListRolloutsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListRolloutsResponse); + + /** ListRolloutsResponse rollouts. */ + public rollouts: google.cloud.deploy.v1.IRollout[]; + + /** ListRolloutsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRolloutsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRolloutsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRolloutsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListRolloutsResponse): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Encodes the specified ListRolloutsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @param message ListRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRolloutsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @param message ListRolloutsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListRolloutsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Verifies a ListRolloutsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRolloutsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListRolloutsResponse; + + /** + * Creates a plain object from a ListRolloutsResponse message. Also converts values to other types if specified. + * @param message ListRolloutsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListRolloutsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRolloutsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRolloutsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRolloutRequest. */ + interface IGetRolloutRequest { + + /** GetRolloutRequest name */ + name?: (string|null); + } + + /** Represents a GetRolloutRequest. */ + class GetRolloutRequest implements IGetRolloutRequest { + + /** + * Constructs a new GetRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetRolloutRequest); + + /** GetRolloutRequest name. */ + public name: string; + + /** + * Creates a new GetRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetRolloutRequest): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Encodes the specified GetRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @param message GetRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @param message GetRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Verifies a GetRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetRolloutRequest; + + /** + * Creates a plain object from a GetRolloutRequest message. Also converts values to other types if specified. + * @param message GetRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRolloutRequest. */ + interface ICreateRolloutRequest { + + /** CreateRolloutRequest parent */ + parent?: (string|null); + + /** CreateRolloutRequest rolloutId */ + rolloutId?: (string|null); + + /** CreateRolloutRequest rollout */ + rollout?: (google.cloud.deploy.v1.IRollout|null); + + /** CreateRolloutRequest requestId */ + requestId?: (string|null); + + /** CreateRolloutRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateRolloutRequest. */ + class CreateRolloutRequest implements ICreateRolloutRequest { + + /** + * Constructs a new CreateRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ICreateRolloutRequest); + + /** CreateRolloutRequest parent. */ + public parent: string; + + /** CreateRolloutRequest rolloutId. */ + public rolloutId: string; + + /** CreateRolloutRequest rollout. */ + public rollout?: (google.cloud.deploy.v1.IRollout|null); + + /** CreateRolloutRequest requestId. */ + public requestId: string; + + /** CreateRolloutRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.ICreateRolloutRequest): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Encodes the specified CreateRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @param message CreateRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ICreateRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @param message CreateRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ICreateRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Verifies a CreateRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.CreateRolloutRequest; + + /** + * Creates a plain object from a CreateRolloutRequest message. Also converts values to other types if specified. + * @param message CreateRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.CreateRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.deploy.v1.IOperationMetadata): google.cloud.deploy.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.deploy.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApproveRolloutRequest. */ + interface IApproveRolloutRequest { + + /** ApproveRolloutRequest name */ + name?: (string|null); + + /** ApproveRolloutRequest approved */ + approved?: (boolean|null); + } + + /** Represents an ApproveRolloutRequest. */ + class ApproveRolloutRequest implements IApproveRolloutRequest { + + /** + * Constructs a new ApproveRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IApproveRolloutRequest); + + /** ApproveRolloutRequest name. */ + public name: string; + + /** ApproveRolloutRequest approved. */ + public approved: boolean; + + /** + * Creates a new ApproveRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApproveRolloutRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IApproveRolloutRequest): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Encodes the specified ApproveRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @param message ApproveRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IApproveRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApproveRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @param message ApproveRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IApproveRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Verifies an ApproveRolloutRequest message. + * @param message Plain 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 ApproveRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApproveRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ApproveRolloutRequest; + + /** + * Creates a plain object from an ApproveRolloutRequest message. Also converts values to other types if specified. + * @param message ApproveRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ApproveRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApproveRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApproveRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApproveRolloutResponse. */ + interface IApproveRolloutResponse { + } + + /** Represents an ApproveRolloutResponse. */ + class ApproveRolloutResponse implements IApproveRolloutResponse { + + /** + * Constructs a new ApproveRolloutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IApproveRolloutResponse); + + /** + * Creates a new ApproveRolloutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ApproveRolloutResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IApproveRolloutResponse): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Encodes the specified ApproveRolloutResponse message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @param message ApproveRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IApproveRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApproveRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @param message ApproveRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IApproveRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Verifies an ApproveRolloutResponse message. + * @param message Plain 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 ApproveRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApproveRolloutResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ApproveRolloutResponse; + + /** + * Creates a plain object from an ApproveRolloutResponse message. Also converts values to other types if specified. + * @param message ApproveRolloutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ApproveRolloutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApproveRolloutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApproveRolloutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryJobRequest. */ + interface IRetryJobRequest { + + /** RetryJobRequest rollout */ + rollout?: (string|null); + + /** RetryJobRequest phaseId */ + phaseId?: (string|null); + + /** RetryJobRequest jobId */ + jobId?: (string|null); + } + + /** Represents a RetryJobRequest. */ + class RetryJobRequest implements IRetryJobRequest { + + /** + * Constructs a new RetryJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRetryJobRequest); + + /** RetryJobRequest rollout. */ + public rollout: string; + + /** RetryJobRequest phaseId. */ + public phaseId: string; + + /** RetryJobRequest jobId. */ + public jobId: string; + + /** + * Creates a new RetryJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryJobRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IRetryJobRequest): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Encodes the specified RetryJobRequest message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @param message RetryJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRetryJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryJobRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @param message RetryJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRetryJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Verifies a RetryJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RetryJobRequest; + + /** + * Creates a plain object from a RetryJobRequest message. Also converts values to other types if specified. + * @param message RetryJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RetryJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryJobResponse. */ + interface IRetryJobResponse { + } + + /** Represents a RetryJobResponse. */ + class RetryJobResponse implements IRetryJobResponse { + + /** + * Constructs a new RetryJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRetryJobResponse); + + /** + * Creates a new RetryJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryJobResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IRetryJobResponse): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Encodes the specified RetryJobResponse message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @param message RetryJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRetryJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryJobResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @param message RetryJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRetryJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Verifies a RetryJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RetryJobResponse; + + /** + * Creates a plain object from a RetryJobResponse message. Also converts values to other types if specified. + * @param message RetryJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RetryJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AbandonReleaseRequest. */ + interface IAbandonReleaseRequest { + + /** AbandonReleaseRequest name */ + name?: (string|null); + } + + /** Represents an AbandonReleaseRequest. */ + class AbandonReleaseRequest implements IAbandonReleaseRequest { + + /** + * Constructs a new AbandonReleaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAbandonReleaseRequest); + + /** AbandonReleaseRequest name. */ + public name: string; + + /** + * Creates a new AbandonReleaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonReleaseRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IAbandonReleaseRequest): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Encodes the specified AbandonReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @param message AbandonReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAbandonReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @param message AbandonReleaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAbandonReleaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Verifies an AbandonReleaseRequest message. + * @param message Plain 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 AbandonReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonReleaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AbandonReleaseRequest; + + /** + * Creates a plain object from an AbandonReleaseRequest message. Also converts values to other types if specified. + * @param message AbandonReleaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AbandonReleaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonReleaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AbandonReleaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AbandonReleaseResponse. */ + interface IAbandonReleaseResponse { + } + + /** Represents an AbandonReleaseResponse. */ + class AbandonReleaseResponse implements IAbandonReleaseResponse { + + /** + * Constructs a new AbandonReleaseResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IAbandonReleaseResponse); + + /** + * Creates a new AbandonReleaseResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonReleaseResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IAbandonReleaseResponse): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Encodes the specified AbandonReleaseResponse message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @param message AbandonReleaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IAbandonReleaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonReleaseResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @param message AbandonReleaseResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IAbandonReleaseResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Verifies an AbandonReleaseResponse message. + * @param message Plain 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 AbandonReleaseResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonReleaseResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.AbandonReleaseResponse; + + /** + * Creates a plain object from an AbandonReleaseResponse message. Also converts values to other types if specified. + * @param message AbandonReleaseResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.AbandonReleaseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonReleaseResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AbandonReleaseResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobRun. */ + interface IJobRun { + + /** JobRun name */ + name?: (string|null); + + /** JobRun uid */ + uid?: (string|null); + + /** JobRun phaseId */ + phaseId?: (string|null); + + /** JobRun jobId */ + jobId?: (string|null); + + /** JobRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** JobRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** JobRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** JobRun state */ + state?: (google.cloud.deploy.v1.JobRun.State|keyof typeof google.cloud.deploy.v1.JobRun.State|null); + + /** JobRun deployJobRun */ + deployJobRun?: (google.cloud.deploy.v1.IDeployJobRun|null); + + /** JobRun verifyJobRun */ + verifyJobRun?: (google.cloud.deploy.v1.IVerifyJobRun|null); + + /** JobRun etag */ + etag?: (string|null); + } + + /** Represents a JobRun. */ + class JobRun implements IJobRun { + + /** + * Constructs a new JobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJobRun); + + /** JobRun name. */ + public name: string; + + /** JobRun uid. */ + public uid: string; + + /** JobRun phaseId. */ + public phaseId: string; + + /** JobRun jobId. */ + public jobId: string; + + /** JobRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** JobRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** JobRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** JobRun state. */ + public state: (google.cloud.deploy.v1.JobRun.State|keyof typeof google.cloud.deploy.v1.JobRun.State); + + /** JobRun deployJobRun. */ + public deployJobRun?: (google.cloud.deploy.v1.IDeployJobRun|null); + + /** JobRun verifyJobRun. */ + public verifyJobRun?: (google.cloud.deploy.v1.IVerifyJobRun|null); + + /** JobRun etag. */ + public etag: string; + + /** JobRun jobRun. */ + public jobRun?: ("deployJobRun"|"verifyJobRun"); + + /** + * Creates a new JobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns JobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IJobRun): google.cloud.deploy.v1.JobRun; + + /** + * Encodes the specified JobRun message. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @param message JobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @param message JobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.JobRun; + + /** + * Decodes a JobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.JobRun; + + /** + * Verifies a JobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.JobRun; + + /** + * Creates a plain object from a JobRun message. Also converts values to other types if specified. + * @param message JobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.JobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobRun { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + SUCCEEDED = 2, + FAILED = 3 + } + } + + /** Properties of a DeployJobRun. */ + interface IDeployJobRun { + + /** DeployJobRun build */ + build?: (string|null); + + /** DeployJobRun failureCause */ + failureCause?: (google.cloud.deploy.v1.DeployJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.DeployJobRun.FailureCause|null); + + /** DeployJobRun failureMessage */ + failureMessage?: (string|null); + + /** DeployJobRun metadata */ + metadata?: (google.cloud.deploy.v1.IDeployJobRunMetadata|null); + } + + /** Represents a DeployJobRun. */ + class DeployJobRun implements IDeployJobRun { + + /** + * Constructs a new DeployJobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeployJobRun); + + /** DeployJobRun build. */ + public build: string; + + /** DeployJobRun failureCause. */ + public failureCause: (google.cloud.deploy.v1.DeployJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.DeployJobRun.FailureCause); + + /** DeployJobRun failureMessage. */ + public failureMessage: string; + + /** DeployJobRun metadata. */ + public metadata?: (google.cloud.deploy.v1.IDeployJobRunMetadata|null); + + /** + * Creates a new DeployJobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployJobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeployJobRun): google.cloud.deploy.v1.DeployJobRun; + + /** + * Encodes the specified DeployJobRun message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @param message DeployJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeployJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @param message DeployJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeployJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeployJobRun; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeployJobRun; + + /** + * Verifies a DeployJobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployJobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployJobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeployJobRun; + + /** + * Creates a plain object from a DeployJobRun message. Also converts values to other types if specified. + * @param message DeployJobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeployJobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployJobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployJobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployJobRun { + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3 + } + } + + /** Properties of a VerifyJobRun. */ + interface IVerifyJobRun { + + /** VerifyJobRun build */ + build?: (string|null); + + /** VerifyJobRun artifactUri */ + artifactUri?: (string|null); + + /** VerifyJobRun eventLogPath */ + eventLogPath?: (string|null); + + /** VerifyJobRun failureCause */ + failureCause?: (google.cloud.deploy.v1.VerifyJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.VerifyJobRun.FailureCause|null); + + /** VerifyJobRun failureMessage */ + failureMessage?: (string|null); + } + + /** Represents a VerifyJobRun. */ + class VerifyJobRun implements IVerifyJobRun { + + /** + * Constructs a new VerifyJobRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IVerifyJobRun); + + /** VerifyJobRun build. */ + public build: string; + + /** VerifyJobRun artifactUri. */ + public artifactUri: string; + + /** VerifyJobRun eventLogPath. */ + public eventLogPath: string; + + /** VerifyJobRun failureCause. */ + public failureCause: (google.cloud.deploy.v1.VerifyJobRun.FailureCause|keyof typeof google.cloud.deploy.v1.VerifyJobRun.FailureCause); + + /** VerifyJobRun failureMessage. */ + public failureMessage: string; + + /** + * Creates a new VerifyJobRun instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyJobRun instance + */ + public static create(properties?: google.cloud.deploy.v1.IVerifyJobRun): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Encodes the specified VerifyJobRun message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @param message VerifyJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IVerifyJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VerifyJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @param message VerifyJobRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IVerifyJobRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Verifies a VerifyJobRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VerifyJobRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyJobRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.VerifyJobRun; + + /** + * Creates a plain object from a VerifyJobRun message. Also converts values to other types if specified. + * @param message VerifyJobRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.VerifyJobRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VerifyJobRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifyJobRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VerifyJobRun { + + /** FailureCause enum. */ + enum FailureCause { + FAILURE_CAUSE_UNSPECIFIED = 0, + CLOUD_BUILD_UNAVAILABLE = 1, + EXECUTION_FAILED = 2, + DEADLINE_EXCEEDED = 3, + VERIFICATION_CONFIG_NOT_FOUND = 4 + } + } + + /** Properties of a ListJobRunsRequest. */ + interface IListJobRunsRequest { + + /** ListJobRunsRequest parent */ + parent?: (string|null); + + /** ListJobRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobRunsRequest filter */ + filter?: (string|null); + + /** ListJobRunsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListJobRunsRequest. */ + class ListJobRunsRequest implements IListJobRunsRequest { + + /** + * Constructs a new ListJobRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListJobRunsRequest); + + /** ListJobRunsRequest parent. */ + public parent: string; + + /** ListJobRunsRequest pageSize. */ + public pageSize: number; + + /** ListJobRunsRequest pageToken. */ + public pageToken: string; + + /** ListJobRunsRequest filter. */ + public filter: string; + + /** ListJobRunsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListJobRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobRunsRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IListJobRunsRequest): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Encodes the specified ListJobRunsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @param message ListJobRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListJobRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobRunsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @param message ListJobRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListJobRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Verifies a ListJobRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListJobRunsRequest; + + /** + * Creates a plain object from a ListJobRunsRequest message. Also converts values to other types if specified. + * @param message ListJobRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListJobRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobRunsResponse. */ + interface IListJobRunsResponse { + + /** ListJobRunsResponse jobRuns */ + jobRuns?: (google.cloud.deploy.v1.IJobRun[]|null); + + /** ListJobRunsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobRunsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobRunsResponse. */ + class ListJobRunsResponse implements IListJobRunsResponse { + + /** + * Constructs a new ListJobRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IListJobRunsResponse); + + /** ListJobRunsResponse jobRuns. */ + public jobRuns: google.cloud.deploy.v1.IJobRun[]; + + /** ListJobRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobRunsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobRunsResponse instance + */ + public static create(properties?: google.cloud.deploy.v1.IListJobRunsResponse): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Encodes the specified ListJobRunsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @param message ListJobRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IListJobRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobRunsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @param message ListJobRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IListJobRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Verifies a ListJobRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ListJobRunsResponse; + + /** + * Creates a plain object from a ListJobRunsResponse message. Also converts values to other types if specified. + * @param message ListJobRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ListJobRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRunRequest. */ + interface IGetJobRunRequest { + + /** GetJobRunRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRunRequest. */ + class GetJobRunRequest implements IGetJobRunRequest { + + /** + * Constructs a new GetJobRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetJobRunRequest); + + /** GetJobRunRequest name. */ + public name: string; + + /** + * Creates a new GetJobRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRunRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetJobRunRequest): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Encodes the specified GetJobRunRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @param message GetJobRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetJobRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRunRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @param message GetJobRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetJobRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Verifies a GetJobRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetJobRunRequest; + + /** + * Creates a plain object from a GetJobRunRequest message. Also converts values to other types if specified. + * @param message GetJobRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetJobRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Config. */ + interface IConfig { + + /** Config name */ + name?: (string|null); + + /** Config supportedVersions */ + supportedVersions?: (google.cloud.deploy.v1.ISkaffoldVersion[]|null); + + /** Config defaultSkaffoldVersion */ + defaultSkaffoldVersion?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IConfig); + + /** Config name. */ + public name: string; + + /** Config supportedVersions. */ + public supportedVersions: google.cloud.deploy.v1.ISkaffoldVersion[]; + + /** Config defaultSkaffoldVersion. */ + public defaultSkaffoldVersion: string; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.deploy.v1.IConfig): google.cloud.deploy.v1.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @param message Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.Config; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.Config; + + /** + * Verifies a Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.Config; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @param message Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkaffoldVersion. */ + interface ISkaffoldVersion { + + /** SkaffoldVersion version */ + version?: (string|null); + + /** SkaffoldVersion supportEndDate */ + supportEndDate?: (google.type.IDate|null); + } + + /** Represents a SkaffoldVersion. */ + class SkaffoldVersion implements ISkaffoldVersion { + + /** + * Constructs a new SkaffoldVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ISkaffoldVersion); + + /** SkaffoldVersion version. */ + public version: string; + + /** SkaffoldVersion supportEndDate. */ + public supportEndDate?: (google.type.IDate|null); + + /** + * Creates a new SkaffoldVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SkaffoldVersion instance + */ + public static create(properties?: google.cloud.deploy.v1.ISkaffoldVersion): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Encodes the specified SkaffoldVersion message. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @param message SkaffoldVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ISkaffoldVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkaffoldVersion message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @param message SkaffoldVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ISkaffoldVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Verifies a SkaffoldVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkaffoldVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkaffoldVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.SkaffoldVersion; + + /** + * Creates a plain object from a SkaffoldVersion message. Also converts values to other types if specified. + * @param message SkaffoldVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.SkaffoldVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkaffoldVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkaffoldVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConfigRequest. */ + interface IGetConfigRequest { + + /** GetConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetConfigRequest. */ + class GetConfigRequest implements IGetConfigRequest { + + /** + * Constructs a new GetConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IGetConfigRequest); + + /** GetConfigRequest name. */ + public name: string; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConfigRequest instance + */ + public static create(properties?: google.cloud.deploy.v1.IGetConfigRequest): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @param message GetConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IGetConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Verifies a GetConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.GetConfigRequest; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @param message GetConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.GetConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeliveryPipelineNotificationEvent. */ + interface IDeliveryPipelineNotificationEvent { + + /** DeliveryPipelineNotificationEvent message */ + message?: (string|null); + + /** DeliveryPipelineNotificationEvent deliveryPipeline */ + deliveryPipeline?: (string|null); + + /** DeliveryPipelineNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a DeliveryPipelineNotificationEvent. */ + class DeliveryPipelineNotificationEvent implements IDeliveryPipelineNotificationEvent { + + /** + * Constructs a new DeliveryPipelineNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent); + + /** DeliveryPipelineNotificationEvent message. */ + public message: string; + + /** DeliveryPipelineNotificationEvent deliveryPipeline. */ + public deliveryPipeline: string; + + /** DeliveryPipelineNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryPipelineNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @param message DeliveryPipelineNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @param message DeliveryPipelineNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Verifies a DeliveryPipelineNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryPipelineNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.DeliveryPipelineNotificationEvent; + + /** + * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. + * @param message DeliveryPipelineNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.DeliveryPipelineNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeliveryPipelineNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeliveryPipelineNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TYPE_PUBSUB_NOTIFICATION_FAILURE = 1, + TYPE_RENDER_STATUES_CHANGE = 2 + } + + /** Properties of a JobRunNotificationEvent. */ + interface IJobRunNotificationEvent { + + /** JobRunNotificationEvent message */ + message?: (string|null); + + /** JobRunNotificationEvent jobRun */ + jobRun?: (string|null); + + /** JobRunNotificationEvent pipelineUid */ + pipelineUid?: (string|null); + + /** JobRunNotificationEvent releaseUid */ + releaseUid?: (string|null); + + /** JobRunNotificationEvent rolloutUid */ + rolloutUid?: (string|null); + + /** JobRunNotificationEvent targetId */ + targetId?: (string|null); + + /** JobRunNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a JobRunNotificationEvent. */ + class JobRunNotificationEvent implements IJobRunNotificationEvent { + + /** + * Constructs a new JobRunNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IJobRunNotificationEvent); + + /** JobRunNotificationEvent message. */ + public message: string; + + /** JobRunNotificationEvent jobRun. */ + public jobRun: string; + + /** JobRunNotificationEvent pipelineUid. */ + public pipelineUid: string; + + /** JobRunNotificationEvent releaseUid. */ + public releaseUid: string; + + /** JobRunNotificationEvent rolloutUid. */ + public rolloutUid: string; + + /** JobRunNotificationEvent targetId. */ + public targetId: string; + + /** JobRunNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new JobRunNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns JobRunNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IJobRunNotificationEvent): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Encodes the specified JobRunNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @param message JobRunNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IJobRunNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobRunNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @param message JobRunNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IJobRunNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Verifies a JobRunNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobRunNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobRunNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.JobRunNotificationEvent; + + /** + * Creates a plain object from a JobRunNotificationEvent message. Also converts values to other types if specified. + * @param message JobRunNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.JobRunNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobRunNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobRunNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseNotificationEvent. */ + interface IReleaseNotificationEvent { + + /** ReleaseNotificationEvent message */ + message?: (string|null); + + /** ReleaseNotificationEvent release */ + release?: (string|null); + + /** ReleaseNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a ReleaseNotificationEvent. */ + class ReleaseNotificationEvent implements IReleaseNotificationEvent { + + /** + * Constructs a new ReleaseNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IReleaseNotificationEvent); + + /** ReleaseNotificationEvent message. */ + public message: string; + + /** ReleaseNotificationEvent release. */ + public release: string; + + /** ReleaseNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new ReleaseNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IReleaseNotificationEvent): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Encodes the specified ReleaseNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @param message ReleaseNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IReleaseNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @param message ReleaseNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IReleaseNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Verifies a ReleaseNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ReleaseNotificationEvent; + + /** + * Creates a plain object from a ReleaseNotificationEvent message. Also converts values to other types if specified. + * @param message ReleaseNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ReleaseNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReleaseRenderEvent. */ + interface IReleaseRenderEvent { + + /** ReleaseRenderEvent message */ + message?: (string|null); + + /** ReleaseRenderEvent release */ + release?: (string|null); + } + + /** Represents a ReleaseRenderEvent. */ + class ReleaseRenderEvent implements IReleaseRenderEvent { + + /** + * Constructs a new ReleaseRenderEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IReleaseRenderEvent); + + /** ReleaseRenderEvent message. */ + public message: string; + + /** ReleaseRenderEvent release. */ + public release: string; + + /** + * Creates a new ReleaseRenderEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ReleaseRenderEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IReleaseRenderEvent): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Encodes the specified ReleaseRenderEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @param message ReleaseRenderEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IReleaseRenderEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReleaseRenderEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @param message ReleaseRenderEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IReleaseRenderEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Verifies a ReleaseRenderEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReleaseRenderEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReleaseRenderEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.ReleaseRenderEvent; + + /** + * Creates a plain object from a ReleaseRenderEvent message. Also converts values to other types if specified. + * @param message ReleaseRenderEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.ReleaseRenderEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReleaseRenderEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReleaseRenderEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RolloutNotificationEvent. */ + interface IRolloutNotificationEvent { + + /** RolloutNotificationEvent message */ + message?: (string|null); + + /** RolloutNotificationEvent pipelineUid */ + pipelineUid?: (string|null); + + /** RolloutNotificationEvent releaseUid */ + releaseUid?: (string|null); + + /** RolloutNotificationEvent rollout */ + rollout?: (string|null); + + /** RolloutNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + + /** RolloutNotificationEvent targetId */ + targetId?: (string|null); + } + + /** Represents a RolloutNotificationEvent. */ + class RolloutNotificationEvent implements IRolloutNotificationEvent { + + /** + * Constructs a new RolloutNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.IRolloutNotificationEvent); + + /** RolloutNotificationEvent message. */ + public message: string; + + /** RolloutNotificationEvent pipelineUid. */ + public pipelineUid: string; + + /** RolloutNotificationEvent releaseUid. */ + public releaseUid: string; + + /** RolloutNotificationEvent rollout. */ + public rollout: string; + + /** RolloutNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** RolloutNotificationEvent targetId. */ + public targetId: string; + + /** + * Creates a new RolloutNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.IRolloutNotificationEvent): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Encodes the specified RolloutNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @param message RolloutNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.IRolloutNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @param message RolloutNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.IRolloutNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Verifies a RolloutNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RolloutNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.RolloutNotificationEvent; + + /** + * Creates a plain object from a RolloutNotificationEvent message. Also converts values to other types if specified. + * @param message RolloutNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.RolloutNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetNotificationEvent. */ + interface ITargetNotificationEvent { + + /** TargetNotificationEvent message */ + message?: (string|null); + + /** TargetNotificationEvent target */ + target?: (string|null); + + /** TargetNotificationEvent type */ + type?: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type|null); + } + + /** Represents a TargetNotificationEvent. */ + class TargetNotificationEvent implements ITargetNotificationEvent { + + /** + * Constructs a new TargetNotificationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.deploy.v1.ITargetNotificationEvent); + + /** TargetNotificationEvent message. */ + public message: string; + + /** TargetNotificationEvent target. */ + public target: string; + + /** TargetNotificationEvent type. */ + public type: (google.cloud.deploy.v1.Type|keyof typeof google.cloud.deploy.v1.Type); + + /** + * Creates a new TargetNotificationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetNotificationEvent instance + */ + public static create(properties?: google.cloud.deploy.v1.ITargetNotificationEvent): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Encodes the specified TargetNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @param message TargetNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.deploy.v1.ITargetNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @param message TargetNotificationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.deploy.v1.ITargetNotificationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Verifies a TargetNotificationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetNotificationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.deploy.v1.TargetNotificationEvent; + + /** + * Creates a plain object from a TargetNotificationEvent message. Also converts values to other types if specified. + * @param message TargetNotificationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.deploy.v1.TargetNotificationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetNotificationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetNotificationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-deploy/protos/protos.js b/packages/google-cloud-deploy/protos/protos.js new file mode 100644 index 000000000000..4ff10bf85822 --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.js @@ -0,0 +1,36309 @@ +// Copyright 2022 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_deploy_protos || ($protobuf.roots._google_cloud_deploy_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.deploy = (function() { + + /** + * Namespace deploy. + * @memberof google.cloud + * @namespace + */ + var deploy = {}; + + deploy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.deploy + * @namespace + */ + var v1 = {}; + + v1.CloudDeploy = (function() { + + /** + * Constructs a new CloudDeploy service. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudDeploy + * @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 CloudDeploy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudDeploy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudDeploy; + + /** + * Creates new CloudDeploy service using the specified rpc implementation. + * @function create + * @memberof google.cloud.deploy.v1.CloudDeploy + * @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 {CloudDeploy} RPC service. Useful where requests and/or responses are streamed. + */ + CloudDeploy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listDeliveryPipelines}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListDeliveryPipelinesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} [response] ListDeliveryPipelinesResponse + */ + + /** + * Calls ListDeliveryPipelines. + * @function listDeliveryPipelines + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} request ListDeliveryPipelinesRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelinesCallback} callback Node-style callback called with the error, if any, and ListDeliveryPipelinesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listDeliveryPipelines = function listDeliveryPipelines(request, callback) { + return this.rpcCall(listDeliveryPipelines, $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest, $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse, request, callback); + }, "name", { value: "ListDeliveryPipelines" }); + + /** + * Calls ListDeliveryPipelines. + * @function listDeliveryPipelines + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} request ListDeliveryPipelinesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.DeliveryPipeline} [response] DeliveryPipeline + */ + + /** + * Calls GetDeliveryPipeline. + * @function getDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} request GetDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and DeliveryPipeline + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getDeliveryPipeline = function getDeliveryPipeline(request, callback) { + return this.rpcCall(getDeliveryPipeline, $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest, $root.google.cloud.deploy.v1.DeliveryPipeline, request, callback); + }, "name", { value: "GetDeliveryPipeline" }); + + /** + * Calls GetDeliveryPipeline. + * @function getDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} request GetDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDeliveryPipeline. + * @function createDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} request CreateDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createDeliveryPipeline = function createDeliveryPipeline(request, callback) { + return this.rpcCall(createDeliveryPipeline, $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDeliveryPipeline" }); + + /** + * Calls CreateDeliveryPipeline. + * @function createDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} request CreateDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef UpdateDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDeliveryPipeline. + * @function updateDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} request UpdateDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.updateDeliveryPipeline = function updateDeliveryPipeline(request, callback) { + return this.rpcCall(updateDeliveryPipeline, $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDeliveryPipeline" }); + + /** + * Calls UpdateDeliveryPipeline. + * @function updateDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} request UpdateDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteDeliveryPipeline}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef DeleteDeliveryPipelineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDeliveryPipeline. + * @function deleteDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} request DeleteDeliveryPipelineRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipelineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.deleteDeliveryPipeline = function deleteDeliveryPipeline(request, callback) { + return this.rpcCall(deleteDeliveryPipeline, $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDeliveryPipeline" }); + + /** + * Calls DeleteDeliveryPipeline. + * @function deleteDeliveryPipeline + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} request DeleteDeliveryPipelineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listTargets}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListTargetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListTargetsResponse} [response] ListTargetsResponse + */ + + /** + * Calls ListTargets. + * @function listTargets + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListTargetsRequest} request ListTargetsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListTargetsCallback} callback Node-style callback called with the error, if any, and ListTargetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listTargets = function listTargets(request, callback) { + return this.rpcCall(listTargets, $root.google.cloud.deploy.v1.ListTargetsRequest, $root.google.cloud.deploy.v1.ListTargetsResponse, request, callback); + }, "name", { value: "ListTargets" }); + + /** + * Calls ListTargets. + * @function listTargets + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListTargetsRequest} request ListTargetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Target} [response] Target + */ + + /** + * Calls GetTarget. + * @function getTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetTargetRequest} request GetTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetTargetCallback} callback Node-style callback called with the error, if any, and Target + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getTarget = function getTarget(request, callback) { + return this.rpcCall(getTarget, $root.google.cloud.deploy.v1.GetTargetRequest, $root.google.cloud.deploy.v1.Target, request, callback); + }, "name", { value: "GetTarget" }); + + /** + * Calls GetTarget. + * @function getTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetTargetRequest} request GetTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTarget. + * @function createTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateTargetRequest} request CreateTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createTarget = function createTarget(request, callback) { + return this.rpcCall(createTarget, $root.google.cloud.deploy.v1.CreateTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTarget" }); + + /** + * Calls CreateTarget. + * @function createTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateTargetRequest} request CreateTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|updateTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef UpdateTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTarget. + * @function updateTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} request UpdateTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.UpdateTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.updateTarget = function updateTarget(request, callback) { + return this.rpcCall(updateTarget, $root.google.cloud.deploy.v1.UpdateTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTarget" }); + + /** + * Calls UpdateTarget. + * @function updateTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} request UpdateTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|deleteTarget}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef DeleteTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTarget. + * @function deleteTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} request DeleteTargetRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.DeleteTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.deleteTarget = function deleteTarget(request, callback) { + return this.rpcCall(deleteTarget, $root.google.cloud.deploy.v1.DeleteTargetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTarget" }); + + /** + * Calls DeleteTarget. + * @function deleteTarget + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} request DeleteTargetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listReleases}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListReleasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListReleasesResponse} [response] ListReleasesResponse + */ + + /** + * Calls ListReleases. + * @function listReleases + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListReleasesRequest} request ListReleasesRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListReleasesCallback} callback Node-style callback called with the error, if any, and ListReleasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listReleases = function listReleases(request, callback) { + return this.rpcCall(listReleases, $root.google.cloud.deploy.v1.ListReleasesRequest, $root.google.cloud.deploy.v1.ListReleasesResponse, request, callback); + }, "name", { value: "ListReleases" }); + + /** + * Calls ListReleases. + * @function listReleases + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListReleasesRequest} request ListReleasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Release} [response] Release + */ + + /** + * Calls GetRelease. + * @function getRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetReleaseRequest} request GetReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetReleaseCallback} callback Node-style callback called with the error, if any, and Release + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getRelease = function getRelease(request, callback) { + return this.rpcCall(getRelease, $root.google.cloud.deploy.v1.GetReleaseRequest, $root.google.cloud.deploy.v1.Release, request, callback); + }, "name", { value: "GetRelease" }); + + /** + * Calls GetRelease. + * @function getRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetReleaseRequest} request GetReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRelease. + * @function createRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} request CreateReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateReleaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createRelease = function createRelease(request, callback) { + return this.rpcCall(createRelease, $root.google.cloud.deploy.v1.CreateReleaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRelease" }); + + /** + * Calls CreateRelease. + * @function createRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} request CreateReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|abandonRelease}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef AbandonReleaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.AbandonReleaseResponse} [response] AbandonReleaseResponse + */ + + /** + * Calls AbandonRelease. + * @function abandonRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} request AbandonReleaseRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.AbandonReleaseCallback} callback Node-style callback called with the error, if any, and AbandonReleaseResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.abandonRelease = function abandonRelease(request, callback) { + return this.rpcCall(abandonRelease, $root.google.cloud.deploy.v1.AbandonReleaseRequest, $root.google.cloud.deploy.v1.AbandonReleaseResponse, request, callback); + }, "name", { value: "AbandonRelease" }); + + /** + * Calls AbandonRelease. + * @function abandonRelease + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} request AbandonReleaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|approveRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ApproveRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ApproveRolloutResponse} [response] ApproveRolloutResponse + */ + + /** + * Calls ApproveRollout. + * @function approveRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} request ApproveRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ApproveRolloutCallback} callback Node-style callback called with the error, if any, and ApproveRolloutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.approveRollout = function approveRollout(request, callback) { + return this.rpcCall(approveRollout, $root.google.cloud.deploy.v1.ApproveRolloutRequest, $root.google.cloud.deploy.v1.ApproveRolloutResponse, request, callback); + }, "name", { value: "ApproveRollout" }); + + /** + * Calls ApproveRollout. + * @function approveRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} request ApproveRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listRollouts}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListRolloutsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListRolloutsResponse} [response] ListRolloutsResponse + */ + + /** + * Calls ListRollouts. + * @function listRollouts + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListRolloutsRequest} request ListRolloutsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListRolloutsCallback} callback Node-style callback called with the error, if any, and ListRolloutsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listRollouts = function listRollouts(request, callback) { + return this.rpcCall(listRollouts, $root.google.cloud.deploy.v1.ListRolloutsRequest, $root.google.cloud.deploy.v1.ListRolloutsResponse, request, callback); + }, "name", { value: "ListRollouts" }); + + /** + * Calls ListRollouts. + * @function listRollouts + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListRolloutsRequest} request ListRolloutsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Rollout} [response] Rollout + */ + + /** + * Calls GetRollout. + * @function getRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetRolloutRequest} request GetRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetRolloutCallback} callback Node-style callback called with the error, if any, and Rollout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getRollout = function getRollout(request, callback) { + return this.rpcCall(getRollout, $root.google.cloud.deploy.v1.GetRolloutRequest, $root.google.cloud.deploy.v1.Rollout, request, callback); + }, "name", { value: "GetRollout" }); + + /** + * Calls GetRollout. + * @function getRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetRolloutRequest} request GetRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|createRollout}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef CreateRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRollout. + * @function createRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} request CreateRolloutRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.CreateRolloutCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.createRollout = function createRollout(request, callback) { + return this.rpcCall(createRollout, $root.google.cloud.deploy.v1.CreateRolloutRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRollout" }); + + /** + * Calls CreateRollout. + * @function createRollout + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} request CreateRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|retryJob}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef RetryJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.RetryJobResponse} [response] RetryJobResponse + */ + + /** + * Calls RetryJob. + * @function retryJob + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IRetryJobRequest} request RetryJobRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.RetryJobCallback} callback Node-style callback called with the error, if any, and RetryJobResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.retryJob = function retryJob(request, callback) { + return this.rpcCall(retryJob, $root.google.cloud.deploy.v1.RetryJobRequest, $root.google.cloud.deploy.v1.RetryJobResponse, request, callback); + }, "name", { value: "RetryJob" }); + + /** + * Calls RetryJob. + * @function retryJob + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IRetryJobRequest} request RetryJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|listJobRuns}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef ListJobRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.ListJobRunsResponse} [response] ListJobRunsResponse + */ + + /** + * Calls ListJobRuns. + * @function listJobRuns + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListJobRunsRequest} request ListJobRunsRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.ListJobRunsCallback} callback Node-style callback called with the error, if any, and ListJobRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.listJobRuns = function listJobRuns(request, callback) { + return this.rpcCall(listJobRuns, $root.google.cloud.deploy.v1.ListJobRunsRequest, $root.google.cloud.deploy.v1.ListJobRunsResponse, request, callback); + }, "name", { value: "ListJobRuns" }); + + /** + * Calls ListJobRuns. + * @function listJobRuns + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IListJobRunsRequest} request ListJobRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getJobRun}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetJobRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.JobRun} [response] JobRun + */ + + /** + * Calls GetJobRun. + * @function getJobRun + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetJobRunRequest} request GetJobRunRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetJobRunCallback} callback Node-style callback called with the error, if any, and JobRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getJobRun = function getJobRun(request, callback) { + return this.rpcCall(getJobRun, $root.google.cloud.deploy.v1.GetJobRunRequest, $root.google.cloud.deploy.v1.JobRun, request, callback); + }, "name", { value: "GetJobRun" }); + + /** + * Calls GetJobRun. + * @function getJobRun + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetJobRunRequest} request GetJobRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.deploy.v1.CloudDeploy|getConfig}. + * @memberof google.cloud.deploy.v1.CloudDeploy + * @typedef GetConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.deploy.v1.Config} [response] Config + */ + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetConfigRequest} request GetConfigRequest message or plain object + * @param {google.cloud.deploy.v1.CloudDeploy.GetConfigCallback} callback Node-style callback called with the error, if any, and Config + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudDeploy.prototype.getConfig = function getConfig(request, callback) { + return this.rpcCall(getConfig, $root.google.cloud.deploy.v1.GetConfigRequest, $root.google.cloud.deploy.v1.Config, request, callback); + }, "name", { value: "GetConfig" }); + + /** + * Calls GetConfig. + * @function getConfig + * @memberof google.cloud.deploy.v1.CloudDeploy + * @instance + * @param {google.cloud.deploy.v1.IGetConfigRequest} request GetConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudDeploy; + })(); + + v1.DeliveryPipeline = (function() { + + /** + * Properties of a DeliveryPipeline. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipeline + * @property {string|null} [name] DeliveryPipeline name + * @property {string|null} [uid] DeliveryPipeline uid + * @property {string|null} [description] DeliveryPipeline description + * @property {Object.|null} [annotations] DeliveryPipeline annotations + * @property {Object.|null} [labels] DeliveryPipeline labels + * @property {google.protobuf.ITimestamp|null} [createTime] DeliveryPipeline createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DeliveryPipeline updateTime + * @property {google.cloud.deploy.v1.ISerialPipeline|null} [serialPipeline] DeliveryPipeline serialPipeline + * @property {google.cloud.deploy.v1.IPipelineCondition|null} [condition] DeliveryPipeline condition + * @property {string|null} [etag] DeliveryPipeline etag + * @property {boolean|null} [suspended] DeliveryPipeline suspended + */ + + /** + * Constructs a new DeliveryPipeline. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipeline. + * @implements IDeliveryPipeline + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipeline=} [properties] Properties to set + */ + function DeliveryPipeline(properties) { + this.annotations = {}; + 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]]; + } + + /** + * DeliveryPipeline name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.name = ""; + + /** + * DeliveryPipeline uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.uid = ""; + + /** + * DeliveryPipeline description. + * @member {string} description + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.description = ""; + + /** + * DeliveryPipeline annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.annotations = $util.emptyObject; + + /** + * DeliveryPipeline labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.labels = $util.emptyObject; + + /** + * DeliveryPipeline createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.createTime = null; + + /** + * DeliveryPipeline updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.updateTime = null; + + /** + * DeliveryPipeline serialPipeline. + * @member {google.cloud.deploy.v1.ISerialPipeline|null|undefined} serialPipeline + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.serialPipeline = null; + + /** + * DeliveryPipeline condition. + * @member {google.cloud.deploy.v1.IPipelineCondition|null|undefined} condition + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.condition = null; + + /** + * DeliveryPipeline etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.etag = ""; + + /** + * DeliveryPipeline suspended. + * @member {boolean} suspended + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + DeliveryPipeline.prototype.suspended = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeliveryPipeline pipeline. + * @member {"serialPipeline"|undefined} pipeline + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + */ + Object.defineProperty(DeliveryPipeline.prototype, "pipeline", { + get: $util.oneOfGetter($oneOfFields = ["serialPipeline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeliveryPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline instance + */ + DeliveryPipeline.create = function create(properties) { + return new DeliveryPipeline(properties); + }; + + /** + * Encodes the specified DeliveryPipeline message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline} message DeliveryPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipeline.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serialPipeline != null && Object.hasOwnProperty.call(message, "serialPipeline")) + $root.google.cloud.deploy.v1.SerialPipeline.encode(message.serialPipeline, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.deploy.v1.PipelineCondition.encode(message.condition, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.suspended); + return writer; + }; + + /** + * Encodes the specified DeliveryPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipeline} message DeliveryPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipeline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipeline(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.decode(reader, reader.uint32()); + break; + } + case 11: { + message.condition = $root.google.cloud.deploy.v1.PipelineCondition.decode(reader, reader.uint32()); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 12: { + message.suspended = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryPipeline message. + * @function verify + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k: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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.serialPipeline != null && message.hasOwnProperty("serialPipeline")) { + properties.pipeline = 1; + { + var error = $root.google.cloud.deploy.v1.SerialPipeline.verify(message.serialPipeline); + if (error) + return "serialPipeline." + error; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.deploy.v1.PipelineCondition.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + return null; + }; + + /** + * Creates a DeliveryPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeliveryPipeline} DeliveryPipeline + */ + DeliveryPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipeline) + return object; + var message = new $root.google.cloud.deploy.v1.DeliveryPipeline(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.serialPipeline != null) { + if (typeof object.serialPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.serialPipeline: object expected"); + message.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.fromObject(object.serialPipeline); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.deploy.v1.DeliveryPipeline.condition: object expected"); + message.condition = $root.google.cloud.deploy.v1.PipelineCondition.fromObject(object.condition); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + return message; + }; + + /** + * Creates a plain object from a DeliveryPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {google.cloud.deploy.v1.DeliveryPipeline} message DeliveryPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeliveryPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.condition = null; + object.suspended = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.serialPipeline != null && message.hasOwnProperty("serialPipeline")) { + object.serialPipeline = $root.google.cloud.deploy.v1.SerialPipeline.toObject(message.serialPipeline, options); + if (options.oneofs) + object.pipeline = "serialPipeline"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.deploy.v1.PipelineCondition.toObject(message.condition, options); + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + return object; + }; + + /** + * Converts this DeliveryPipeline to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @instance + * @returns {Object.} JSON object + */ + DeliveryPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryPipeline + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeliveryPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipeline"; + }; + + return DeliveryPipeline; + })(); + + v1.SerialPipeline = (function() { + + /** + * Properties of a SerialPipeline. + * @memberof google.cloud.deploy.v1 + * @interface ISerialPipeline + * @property {Array.|null} [stages] SerialPipeline stages + */ + + /** + * Constructs a new SerialPipeline. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a SerialPipeline. + * @implements ISerialPipeline + * @constructor + * @param {google.cloud.deploy.v1.ISerialPipeline=} [properties] Properties to set + */ + function SerialPipeline(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerialPipeline stages. + * @member {Array.} stages + * @memberof google.cloud.deploy.v1.SerialPipeline + * @instance + */ + SerialPipeline.prototype.stages = $util.emptyArray; + + /** + * Creates a new SerialPipeline instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline instance + */ + SerialPipeline.create = function create(properties) { + return new SerialPipeline(properties); + }; + + /** + * Encodes the specified SerialPipeline message. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline} message SerialPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPipeline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.cloud.deploy.v1.Stage.encode(message.stages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SerialPipeline message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SerialPipeline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.ISerialPipeline} message SerialPipeline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPipeline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPipeline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.SerialPipeline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.cloud.deploy.v1.Stage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerialPipeline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPipeline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerialPipeline message. + * @function verify + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerialPipeline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.cloud.deploy.v1.Stage.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates a SerialPipeline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.SerialPipeline} SerialPipeline + */ + SerialPipeline.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.SerialPipeline) + return object; + var message = new $root.google.cloud.deploy.v1.SerialPipeline(); + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.cloud.deploy.v1.SerialPipeline.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.SerialPipeline.stages: object expected"); + message.stages[i] = $root.google.cloud.deploy.v1.Stage.fromObject(object.stages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SerialPipeline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {google.cloud.deploy.v1.SerialPipeline} message SerialPipeline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerialPipeline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.cloud.deploy.v1.Stage.toObject(message.stages[j], options); + } + return object; + }; + + /** + * Converts this SerialPipeline to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.SerialPipeline + * @instance + * @returns {Object.} JSON object + */ + SerialPipeline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SerialPipeline + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.SerialPipeline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SerialPipeline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.SerialPipeline"; + }; + + return SerialPipeline; + })(); + + v1.Stage = (function() { + + /** + * Properties of a Stage. + * @memberof google.cloud.deploy.v1 + * @interface IStage + * @property {string|null} [targetId] Stage targetId + * @property {Array.|null} [profiles] Stage profiles + * @property {google.cloud.deploy.v1.IStrategy|null} [strategy] Stage strategy + */ + + /** + * Constructs a new Stage. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Stage. + * @implements IStage + * @constructor + * @param {google.cloud.deploy.v1.IStage=} [properties] Properties to set + */ + function Stage(properties) { + this.profiles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stage targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.targetId = ""; + + /** + * Stage profiles. + * @member {Array.} profiles + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.profiles = $util.emptyArray; + + /** + * Stage strategy. + * @member {google.cloud.deploy.v1.IStrategy|null|undefined} strategy + * @memberof google.cloud.deploy.v1.Stage + * @instance + */ + Stage.prototype.strategy = null; + + /** + * Creates a new Stage instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Stage} Stage instance + */ + Stage.create = function create(properties) { + return new Stage(properties); + }; + + /** + * Encodes the specified Stage message. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage} message Stage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetId); + if (message.profiles != null && message.profiles.length) + for (var i = 0; i < message.profiles.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.profiles[i]); + if (message.strategy != null && Object.hasOwnProperty.call(message, "strategy")) + $root.google.cloud.deploy.v1.Strategy.encode(message.strategy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Stage message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Stage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.IStage} message Stage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Stage} Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Stage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetId = reader.string(); + break; + } + case 2: { + if (!(message.profiles && message.profiles.length)) + message.profiles = []; + message.profiles.push(reader.string()); + break; + } + case 5: { + message.strategy = $root.google.cloud.deploy.v1.Strategy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Stage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Stage} Stage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stage message. + * @function verify + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.profiles != null && message.hasOwnProperty("profiles")) { + if (!Array.isArray(message.profiles)) + return "profiles: array expected"; + for (var i = 0; i < message.profiles.length; ++i) + if (!$util.isString(message.profiles[i])) + return "profiles: string[] expected"; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) { + var error = $root.google.cloud.deploy.v1.Strategy.verify(message.strategy); + if (error) + return "strategy." + error; + } + return null; + }; + + /** + * Creates a Stage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Stage} Stage + */ + Stage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Stage) + return object; + var message = new $root.google.cloud.deploy.v1.Stage(); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.profiles) { + if (!Array.isArray(object.profiles)) + throw TypeError(".google.cloud.deploy.v1.Stage.profiles: array expected"); + message.profiles = []; + for (var i = 0; i < object.profiles.length; ++i) + message.profiles[i] = String(object.profiles[i]); + } + if (object.strategy != null) { + if (typeof object.strategy !== "object") + throw TypeError(".google.cloud.deploy.v1.Stage.strategy: object expected"); + message.strategy = $root.google.cloud.deploy.v1.Strategy.fromObject(object.strategy); + } + return message; + }; + + /** + * Creates a plain object from a Stage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {google.cloud.deploy.v1.Stage} message Stage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.profiles = []; + if (options.defaults) { + object.targetId = ""; + object.strategy = null; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.profiles && message.profiles.length) { + object.profiles = []; + for (var j = 0; j < message.profiles.length; ++j) + object.profiles[j] = message.profiles[j]; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) + object.strategy = $root.google.cloud.deploy.v1.Strategy.toObject(message.strategy, options); + return object; + }; + + /** + * Converts this Stage to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Stage + * @instance + * @returns {Object.} JSON object + */ + Stage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stage + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Stage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Stage"; + }; + + return Stage; + })(); + + v1.Strategy = (function() { + + /** + * Properties of a Strategy. + * @memberof google.cloud.deploy.v1 + * @interface IStrategy + * @property {google.cloud.deploy.v1.IStandard|null} [standard] Strategy standard + */ + + /** + * Constructs a new Strategy. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Strategy. + * @implements IStrategy + * @constructor + * @param {google.cloud.deploy.v1.IStrategy=} [properties] Properties to set + */ + function Strategy(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]]; + } + + /** + * Strategy standard. + * @member {google.cloud.deploy.v1.IStandard|null|undefined} standard + * @memberof google.cloud.deploy.v1.Strategy + * @instance + */ + Strategy.prototype.standard = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Strategy deploymentStrategy. + * @member {"standard"|undefined} deploymentStrategy + * @memberof google.cloud.deploy.v1.Strategy + * @instance + */ + Object.defineProperty(Strategy.prototype, "deploymentStrategy", { + get: $util.oneOfGetter($oneOfFields = ["standard"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Strategy instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Strategy} Strategy instance + */ + Strategy.create = function create(properties) { + return new Strategy(properties); + }; + + /** + * Encodes the specified Strategy message. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy} message Strategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Strategy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standard != null && Object.hasOwnProperty.call(message, "standard")) + $root.google.cloud.deploy.v1.Standard.encode(message.standard, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Strategy message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Strategy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.IStrategy} message Strategy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Strategy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Strategy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Strategy} Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Strategy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Strategy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.standard = $root.google.cloud.deploy.v1.Standard.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Strategy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Strategy} Strategy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Strategy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Strategy message. + * @function verify + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Strategy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.standard != null && message.hasOwnProperty("standard")) { + properties.deploymentStrategy = 1; + { + var error = $root.google.cloud.deploy.v1.Standard.verify(message.standard); + if (error) + return "standard." + error; + } + } + return null; + }; + + /** + * Creates a Strategy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Strategy} Strategy + */ + Strategy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Strategy) + return object; + var message = new $root.google.cloud.deploy.v1.Strategy(); + if (object.standard != null) { + if (typeof object.standard !== "object") + throw TypeError(".google.cloud.deploy.v1.Strategy.standard: object expected"); + message.standard = $root.google.cloud.deploy.v1.Standard.fromObject(object.standard); + } + return message; + }; + + /** + * Creates a plain object from a Strategy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {google.cloud.deploy.v1.Strategy} message Strategy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Strategy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.standard != null && message.hasOwnProperty("standard")) { + object.standard = $root.google.cloud.deploy.v1.Standard.toObject(message.standard, options); + if (options.oneofs) + object.deploymentStrategy = "standard"; + } + return object; + }; + + /** + * Converts this Strategy to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Strategy + * @instance + * @returns {Object.} JSON object + */ + Strategy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Strategy + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Strategy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Strategy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Strategy"; + }; + + return Strategy; + })(); + + v1.Standard = (function() { + + /** + * Properties of a Standard. + * @memberof google.cloud.deploy.v1 + * @interface IStandard + * @property {boolean|null} [verify] Standard verify + */ + + /** + * Constructs a new Standard. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Standard. + * @implements IStandard + * @constructor + * @param {google.cloud.deploy.v1.IStandard=} [properties] Properties to set + */ + function Standard(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]]; + } + + /** + * Standard verify. + * @member {boolean} verify + * @memberof google.cloud.deploy.v1.Standard + * @instance + */ + Standard.prototype.verify = false; + + /** + * Creates a new Standard instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Standard} Standard instance + */ + Standard.create = function create(properties) { + return new Standard(properties); + }; + + /** + * Encodes the specified Standard message. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard} message Standard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Standard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.verify != null && Object.hasOwnProperty.call(message, "verify")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.verify); + return writer; + }; + + /** + * Encodes the specified Standard message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Standard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.IStandard} message Standard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Standard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Standard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Standard} Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Standard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Standard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.verify = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Standard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Standard} Standard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Standard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Standard message. + * @function verify + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Standard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.verify != null && message.hasOwnProperty("verify")) + if (typeof message.verify !== "boolean") + return "verify: boolean expected"; + return null; + }; + + /** + * Creates a Standard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Standard} Standard + */ + Standard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Standard) + return object; + var message = new $root.google.cloud.deploy.v1.Standard(); + if (object.verify != null) + message.verify = Boolean(object.verify); + return message; + }; + + /** + * Creates a plain object from a Standard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {google.cloud.deploy.v1.Standard} message Standard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Standard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.verify = false; + if (message.verify != null && message.hasOwnProperty("verify")) + object.verify = message.verify; + return object; + }; + + /** + * Converts this Standard to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Standard + * @instance + * @returns {Object.} JSON object + */ + Standard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Standard + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Standard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Standard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Standard"; + }; + + return Standard; + })(); + + v1.PipelineReadyCondition = (function() { + + /** + * Properties of a PipelineReadyCondition. + * @memberof google.cloud.deploy.v1 + * @interface IPipelineReadyCondition + * @property {boolean|null} [status] PipelineReadyCondition status + * @property {google.protobuf.ITimestamp|null} [updateTime] PipelineReadyCondition updateTime + */ + + /** + * Constructs a new PipelineReadyCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PipelineReadyCondition. + * @implements IPipelineReadyCondition + * @constructor + * @param {google.cloud.deploy.v1.IPipelineReadyCondition=} [properties] Properties to set + */ + function PipelineReadyCondition(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]]; + } + + /** + * PipelineReadyCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + */ + PipelineReadyCondition.prototype.status = false; + + /** + * PipelineReadyCondition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + */ + PipelineReadyCondition.prototype.updateTime = null; + + /** + * Creates a new PipelineReadyCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition instance + */ + PipelineReadyCondition.create = function create(properties) { + return new PipelineReadyCondition(properties); + }; + + /** + * Encodes the specified PipelineReadyCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition} message PipelineReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineReadyCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.status); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PipelineReadyCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineReadyCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineReadyCondition} message PipelineReadyCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineReadyCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineReadyCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PipelineReadyCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.status = reader.bool(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PipelineReadyCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineReadyCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PipelineReadyCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PipelineReadyCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a PipelineReadyCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PipelineReadyCondition} PipelineReadyCondition + */ + PipelineReadyCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PipelineReadyCondition) + return object; + var message = new $root.google.cloud.deploy.v1.PipelineReadyCondition(); + if (object.status != null) + message.status = Boolean(object.status); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineReadyCondition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a PipelineReadyCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {google.cloud.deploy.v1.PipelineReadyCondition} message PipelineReadyCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PipelineReadyCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = false; + object.updateTime = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this PipelineReadyCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @instance + * @returns {Object.} JSON object + */ + PipelineReadyCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PipelineReadyCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PipelineReadyCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PipelineReadyCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PipelineReadyCondition"; + }; + + return PipelineReadyCondition; + })(); + + v1.TargetsPresentCondition = (function() { + + /** + * Properties of a TargetsPresentCondition. + * @memberof google.cloud.deploy.v1 + * @interface ITargetsPresentCondition + * @property {boolean|null} [status] TargetsPresentCondition status + * @property {Array.|null} [missingTargets] TargetsPresentCondition missingTargets + * @property {google.protobuf.ITimestamp|null} [updateTime] TargetsPresentCondition updateTime + */ + + /** + * Constructs a new TargetsPresentCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetsPresentCondition. + * @implements ITargetsPresentCondition + * @constructor + * @param {google.cloud.deploy.v1.ITargetsPresentCondition=} [properties] Properties to set + */ + function TargetsPresentCondition(properties) { + this.missingTargets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetsPresentCondition status. + * @member {boolean} status + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.status = false; + + /** + * TargetsPresentCondition missingTargets. + * @member {Array.} missingTargets + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.missingTargets = $util.emptyArray; + + /** + * TargetsPresentCondition updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + */ + TargetsPresentCondition.prototype.updateTime = null; + + /** + * Creates a new TargetsPresentCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition instance + */ + TargetsPresentCondition.create = function create(properties) { + return new TargetsPresentCondition(properties); + }; + + /** + * Encodes the specified TargetsPresentCondition message. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition} message TargetsPresentCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetsPresentCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.status); + if (message.missingTargets != null && message.missingTargets.length) + for (var i = 0; i < message.missingTargets.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.missingTargets[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetsPresentCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetsPresentCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.ITargetsPresentCondition} message TargetsPresentCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetsPresentCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetsPresentCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetsPresentCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status = reader.bool(); + break; + } + case 2: { + if (!(message.missingTargets && message.missingTargets.length)) + message.missingTargets = []; + message.missingTargets.push(reader.string()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetsPresentCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetsPresentCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetsPresentCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetsPresentCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (typeof message.status !== "boolean") + return "status: boolean expected"; + if (message.missingTargets != null && message.hasOwnProperty("missingTargets")) { + if (!Array.isArray(message.missingTargets)) + return "missingTargets: array expected"; + for (var i = 0; i < message.missingTargets.length; ++i) + if (!$util.isString(message.missingTargets[i])) + return "missingTargets: string[] expected"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a TargetsPresentCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetsPresentCondition} TargetsPresentCondition + */ + TargetsPresentCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetsPresentCondition) + return object; + var message = new $root.google.cloud.deploy.v1.TargetsPresentCondition(); + if (object.status != null) + message.status = Boolean(object.status); + if (object.missingTargets) { + if (!Array.isArray(object.missingTargets)) + throw TypeError(".google.cloud.deploy.v1.TargetsPresentCondition.missingTargets: array expected"); + message.missingTargets = []; + for (var i = 0; i < object.missingTargets.length; ++i) + message.missingTargets[i] = String(object.missingTargets[i]); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.TargetsPresentCondition.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a TargetsPresentCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {google.cloud.deploy.v1.TargetsPresentCondition} message TargetsPresentCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetsPresentCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.missingTargets = []; + if (options.defaults) { + object.status = false; + object.updateTime = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + if (message.missingTargets && message.missingTargets.length) { + object.missingTargets = []; + for (var j = 0; j < message.missingTargets.length; ++j) + object.missingTargets[j] = message.missingTargets[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this TargetsPresentCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @instance + * @returns {Object.} JSON object + */ + TargetsPresentCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetsPresentCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetsPresentCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetsPresentCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetsPresentCondition"; + }; + + return TargetsPresentCondition; + })(); + + v1.PipelineCondition = (function() { + + /** + * Properties of a PipelineCondition. + * @memberof google.cloud.deploy.v1 + * @interface IPipelineCondition + * @property {google.cloud.deploy.v1.IPipelineReadyCondition|null} [pipelineReadyCondition] PipelineCondition pipelineReadyCondition + * @property {google.cloud.deploy.v1.ITargetsPresentCondition|null} [targetsPresentCondition] PipelineCondition targetsPresentCondition + */ + + /** + * Constructs a new PipelineCondition. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PipelineCondition. + * @implements IPipelineCondition + * @constructor + * @param {google.cloud.deploy.v1.IPipelineCondition=} [properties] Properties to set + */ + function PipelineCondition(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]]; + } + + /** + * PipelineCondition pipelineReadyCondition. + * @member {google.cloud.deploy.v1.IPipelineReadyCondition|null|undefined} pipelineReadyCondition + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + */ + PipelineCondition.prototype.pipelineReadyCondition = null; + + /** + * PipelineCondition targetsPresentCondition. + * @member {google.cloud.deploy.v1.ITargetsPresentCondition|null|undefined} targetsPresentCondition + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + */ + PipelineCondition.prototype.targetsPresentCondition = null; + + /** + * Creates a new PipelineCondition instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition instance + */ + PipelineCondition.create = function create(properties) { + return new PipelineCondition(properties); + }; + + /** + * Encodes the specified PipelineCondition message. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition} message PipelineCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pipelineReadyCondition != null && Object.hasOwnProperty.call(message, "pipelineReadyCondition")) + $root.google.cloud.deploy.v1.PipelineReadyCondition.encode(message.pipelineReadyCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targetsPresentCondition != null && Object.hasOwnProperty.call(message, "targetsPresentCondition")) + $root.google.cloud.deploy.v1.TargetsPresentCondition.encode(message.targetsPresentCondition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PipelineCondition message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PipelineCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.IPipelineCondition} message PipelineCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PipelineCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.decode(reader, reader.uint32()); + break; + } + case 3: { + message.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PipelineCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PipelineCondition message. + * @function verify + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PipelineCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pipelineReadyCondition != null && message.hasOwnProperty("pipelineReadyCondition")) { + var error = $root.google.cloud.deploy.v1.PipelineReadyCondition.verify(message.pipelineReadyCondition); + if (error) + return "pipelineReadyCondition." + error; + } + if (message.targetsPresentCondition != null && message.hasOwnProperty("targetsPresentCondition")) { + var error = $root.google.cloud.deploy.v1.TargetsPresentCondition.verify(message.targetsPresentCondition); + if (error) + return "targetsPresentCondition." + error; + } + return null; + }; + + /** + * Creates a PipelineCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PipelineCondition} PipelineCondition + */ + PipelineCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PipelineCondition) + return object; + var message = new $root.google.cloud.deploy.v1.PipelineCondition(); + if (object.pipelineReadyCondition != null) { + if (typeof object.pipelineReadyCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineCondition.pipelineReadyCondition: object expected"); + message.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.fromObject(object.pipelineReadyCondition); + } + if (object.targetsPresentCondition != null) { + if (typeof object.targetsPresentCondition !== "object") + throw TypeError(".google.cloud.deploy.v1.PipelineCondition.targetsPresentCondition: object expected"); + message.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.fromObject(object.targetsPresentCondition); + } + return message; + }; + + /** + * Creates a plain object from a PipelineCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {google.cloud.deploy.v1.PipelineCondition} message PipelineCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PipelineCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pipelineReadyCondition = null; + object.targetsPresentCondition = null; + } + if (message.pipelineReadyCondition != null && message.hasOwnProperty("pipelineReadyCondition")) + object.pipelineReadyCondition = $root.google.cloud.deploy.v1.PipelineReadyCondition.toObject(message.pipelineReadyCondition, options); + if (message.targetsPresentCondition != null && message.hasOwnProperty("targetsPresentCondition")) + object.targetsPresentCondition = $root.google.cloud.deploy.v1.TargetsPresentCondition.toObject(message.targetsPresentCondition, options); + return object; + }; + + /** + * Converts this PipelineCondition to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PipelineCondition + * @instance + * @returns {Object.} JSON object + */ + PipelineCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PipelineCondition + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PipelineCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PipelineCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PipelineCondition"; + }; + + return PipelineCondition; + })(); + + v1.ListDeliveryPipelinesRequest = (function() { + + /** + * Properties of a ListDeliveryPipelinesRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListDeliveryPipelinesRequest + * @property {string|null} [parent] ListDeliveryPipelinesRequest parent + * @property {number|null} [pageSize] ListDeliveryPipelinesRequest pageSize + * @property {string|null} [pageToken] ListDeliveryPipelinesRequest pageToken + * @property {string|null} [filter] ListDeliveryPipelinesRequest filter + * @property {string|null} [orderBy] ListDeliveryPipelinesRequest orderBy + */ + + /** + * Constructs a new ListDeliveryPipelinesRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeliveryPipelinesRequest. + * @implements IListDeliveryPipelinesRequest + * @constructor + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest=} [properties] Properties to set + */ + function ListDeliveryPipelinesRequest(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]]; + } + + /** + * ListDeliveryPipelinesRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.parent = ""; + + /** + * ListDeliveryPipelinesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.pageSize = 0; + + /** + * ListDeliveryPipelinesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.pageToken = ""; + + /** + * ListDeliveryPipelinesRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.filter = ""; + + /** + * ListDeliveryPipelinesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + */ + ListDeliveryPipelinesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDeliveryPipelinesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest instance + */ + ListDeliveryPipelinesRequest.create = function create(properties) { + return new ListDeliveryPipelinesRequest(properties); + }; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDeliveryPipelinesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeliveryPipelinesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeliveryPipelinesRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeliveryPipelinesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDeliveryPipelinesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} ListDeliveryPipelinesRequest + */ + ListDeliveryPipelinesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDeliveryPipelinesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesRequest} message ListDeliveryPipelinesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeliveryPipelinesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDeliveryPipelinesRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDeliveryPipelinesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeliveryPipelinesRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeliveryPipelinesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"; + }; + + return ListDeliveryPipelinesRequest; + })(); + + v1.ListDeliveryPipelinesResponse = (function() { + + /** + * Properties of a ListDeliveryPipelinesResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListDeliveryPipelinesResponse + * @property {Array.|null} [deliveryPipelines] ListDeliveryPipelinesResponse deliveryPipelines + * @property {string|null} [nextPageToken] ListDeliveryPipelinesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDeliveryPipelinesResponse unreachable + */ + + /** + * Constructs a new ListDeliveryPipelinesResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListDeliveryPipelinesResponse. + * @implements IListDeliveryPipelinesResponse + * @constructor + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse=} [properties] Properties to set + */ + function ListDeliveryPipelinesResponse(properties) { + this.deliveryPipelines = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDeliveryPipelinesResponse deliveryPipelines. + * @member {Array.} deliveryPipelines + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.deliveryPipelines = $util.emptyArray; + + /** + * ListDeliveryPipelinesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.nextPageToken = ""; + + /** + * ListDeliveryPipelinesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + */ + ListDeliveryPipelinesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDeliveryPipelinesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse instance + */ + ListDeliveryPipelinesResponse.create = function create(properties) { + return new ListDeliveryPipelinesResponse(properties); + }; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deliveryPipelines != null && message.deliveryPipelines.length) + for (var i = 0; i < message.deliveryPipelines.length; ++i) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelines[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDeliveryPipelinesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListDeliveryPipelinesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.IListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDeliveryPipelinesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deliveryPipelines && message.deliveryPipelines.length)) + message.deliveryPipelines = []; + message.deliveryPipelines.push($root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDeliveryPipelinesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDeliveryPipelinesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDeliveryPipelinesResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDeliveryPipelinesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deliveryPipelines != null && message.hasOwnProperty("deliveryPipelines")) { + if (!Array.isArray(message.deliveryPipelines)) + return "deliveryPipelines: array expected"; + for (var i = 0; i < message.deliveryPipelines.length; ++i) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelines[i]); + if (error) + return "deliveryPipelines." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDeliveryPipelinesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} ListDeliveryPipelinesResponse + */ + ListDeliveryPipelinesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListDeliveryPipelinesResponse(); + if (object.deliveryPipelines) { + if (!Array.isArray(object.deliveryPipelines)) + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.deliveryPipelines: array expected"); + message.deliveryPipelines = []; + for (var i = 0; i < object.deliveryPipelines.length; ++i) { + if (typeof object.deliveryPipelines[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.deliveryPipelines: object expected"); + message.deliveryPipelines[i] = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelines[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListDeliveryPipelinesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListDeliveryPipelinesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {google.cloud.deploy.v1.ListDeliveryPipelinesResponse} message ListDeliveryPipelinesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDeliveryPipelinesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deliveryPipelines = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.deliveryPipelines && message.deliveryPipelines.length) { + object.deliveryPipelines = []; + for (var j = 0; j < message.deliveryPipelines.length; ++j) + object.deliveryPipelines[j] = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelines[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListDeliveryPipelinesResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDeliveryPipelinesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDeliveryPipelinesResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListDeliveryPipelinesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDeliveryPipelinesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"; + }; + + return ListDeliveryPipelinesResponse; + })(); + + v1.GetDeliveryPipelineRequest = (function() { + + /** + * Properties of a GetDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetDeliveryPipelineRequest + * @property {string|null} [name] GetDeliveryPipelineRequest name + */ + + /** + * Constructs a new GetDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetDeliveryPipelineRequest. + * @implements IGetDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest=} [properties] Properties to set + */ + function GetDeliveryPipelineRequest(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]]; + } + + /** + * GetDeliveryPipelineRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @instance + */ + GetDeliveryPipelineRequest.prototype.name = ""; + + /** + * Creates a new GetDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest instance + */ + GetDeliveryPipelineRequest.create = function create(properties) { + return new GetDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified GetDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} message GetDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeliveryPipelineRequest.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 GetDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IGetDeliveryPipelineRequest} message GetDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest(); + 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 GetDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDeliveryPipelineRequest.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 GetDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetDeliveryPipelineRequest} GetDeliveryPipelineRequest + */ + GetDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetDeliveryPipelineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.GetDeliveryPipelineRequest} message GetDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDeliveryPipelineRequest.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 GetDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + GetDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetDeliveryPipelineRequest"; + }; + + return GetDeliveryPipelineRequest; + })(); + + v1.CreateDeliveryPipelineRequest = (function() { + + /** + * Properties of a CreateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateDeliveryPipelineRequest + * @property {string|null} [parent] CreateDeliveryPipelineRequest parent + * @property {string|null} [deliveryPipelineId] CreateDeliveryPipelineRequest deliveryPipelineId + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipeline] CreateDeliveryPipelineRequest deliveryPipeline + * @property {string|null} [requestId] CreateDeliveryPipelineRequest requestId + * @property {boolean|null} [validateOnly] CreateDeliveryPipelineRequest validateOnly + */ + + /** + * Constructs a new CreateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateDeliveryPipelineRequest. + * @implements ICreateDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest=} [properties] Properties to set + */ + function CreateDeliveryPipelineRequest(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]]; + } + + /** + * CreateDeliveryPipelineRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.parent = ""; + + /** + * CreateDeliveryPipelineRequest deliveryPipelineId. + * @member {string} deliveryPipelineId + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.deliveryPipelineId = ""; + + /** + * CreateDeliveryPipelineRequest deliveryPipeline. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipeline + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.deliveryPipeline = null; + + /** + * CreateDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * CreateDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + */ + CreateDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest instance + */ + CreateDeliveryPipelineRequest.create = function create(properties) { + return new CreateDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeliveryPipelineRequest.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.deliveryPipelineId != null && Object.hasOwnProperty.call(message, "deliveryPipelineId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipelineId); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipeline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.ICreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deliveryPipelineId = reader.string(); + break; + } + case 3: { + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDeliveryPipelineRequest.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.deliveryPipelineId != null && message.hasOwnProperty("deliveryPipelineId")) + if (!$util.isString(message.deliveryPipelineId)) + return "deliveryPipelineId: string expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipeline); + if (error) + return "deliveryPipeline." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} CreateDeliveryPipelineRequest + */ + CreateDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateDeliveryPipelineRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deliveryPipelineId != null) + message.deliveryPipelineId = String(object.deliveryPipelineId); + if (object.deliveryPipeline != null) { + if (typeof object.deliveryPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateDeliveryPipelineRequest.deliveryPipeline: object expected"); + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipeline); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.CreateDeliveryPipelineRequest} message CreateDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deliveryPipelineId = ""; + object.deliveryPipeline = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deliveryPipelineId != null && message.hasOwnProperty("deliveryPipelineId")) + object.deliveryPipelineId = message.deliveryPipelineId; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipeline, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"; + }; + + return CreateDeliveryPipelineRequest; + })(); + + v1.UpdateDeliveryPipelineRequest = (function() { + + /** + * Properties of an UpdateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IUpdateDeliveryPipelineRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDeliveryPipelineRequest updateMask + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipeline] UpdateDeliveryPipelineRequest deliveryPipeline + * @property {string|null} [requestId] UpdateDeliveryPipelineRequest requestId + * @property {boolean|null} [allowMissing] UpdateDeliveryPipelineRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateDeliveryPipelineRequest validateOnly + */ + + /** + * Constructs a new UpdateDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an UpdateDeliveryPipelineRequest. + * @implements IUpdateDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest=} [properties] Properties to set + */ + function UpdateDeliveryPipelineRequest(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]]; + } + + /** + * UpdateDeliveryPipelineRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.updateMask = null; + + /** + * UpdateDeliveryPipelineRequest deliveryPipeline. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipeline + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.deliveryPipeline = null; + + /** + * UpdateDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * UpdateDeliveryPipelineRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.allowMissing = false; + + /** + * UpdateDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + */ + UpdateDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest instance + */ + UpdateDeliveryPipelineRequest.create = function create(properties) { + return new UpdateDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeliveryPipelineRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipeline, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDeliveryPipelineRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipeline); + if (error) + return "deliveryPipeline." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} UpdateDeliveryPipelineRequest + */ + UpdateDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.deliveryPipeline != null) { + if (typeof object.deliveryPipeline !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateDeliveryPipelineRequest.deliveryPipeline: object expected"); + message.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipeline); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.UpdateDeliveryPipelineRequest} message UpdateDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.deliveryPipeline = null; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipeline, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"; + }; + + return UpdateDeliveryPipelineRequest; + })(); + + v1.DeleteDeliveryPipelineRequest = (function() { + + /** + * Properties of a DeleteDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @interface IDeleteDeliveryPipelineRequest + * @property {string|null} [name] DeleteDeliveryPipelineRequest name + * @property {string|null} [requestId] DeleteDeliveryPipelineRequest requestId + * @property {boolean|null} [allowMissing] DeleteDeliveryPipelineRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteDeliveryPipelineRequest validateOnly + * @property {boolean|null} [force] DeleteDeliveryPipelineRequest force + * @property {string|null} [etag] DeleteDeliveryPipelineRequest etag + */ + + /** + * Constructs a new DeleteDeliveryPipelineRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeleteDeliveryPipelineRequest. + * @implements IDeleteDeliveryPipelineRequest + * @constructor + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest=} [properties] Properties to set + */ + function DeleteDeliveryPipelineRequest(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]]; + } + + /** + * DeleteDeliveryPipelineRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.name = ""; + + /** + * DeleteDeliveryPipelineRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.requestId = ""; + + /** + * DeleteDeliveryPipelineRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.allowMissing = false; + + /** + * DeleteDeliveryPipelineRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.validateOnly = false; + + /** + * DeleteDeliveryPipelineRequest force. + * @member {boolean} force + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.force = false; + + /** + * DeleteDeliveryPipelineRequest etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + */ + DeleteDeliveryPipelineRequest.prototype.etag = ""; + + /** + * Creates a new DeleteDeliveryPipelineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest instance + */ + DeleteDeliveryPipelineRequest.create = function create(properties) { + return new DeleteDeliveryPipelineRequest(properties); + }; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeliveryPipelineRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteDeliveryPipelineRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteDeliveryPipelineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDeliveryPipelineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeliveryPipelineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.force = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDeliveryPipelineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDeliveryPipelineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDeliveryPipelineRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDeliveryPipelineRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteDeliveryPipelineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} DeleteDeliveryPipelineRequest + */ + DeleteDeliveryPipelineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest) + return object; + var message = new $root.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteDeliveryPipelineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {google.cloud.deploy.v1.DeleteDeliveryPipelineRequest} message DeleteDeliveryPipelineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDeliveryPipelineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteDeliveryPipelineRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDeliveryPipelineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDeliveryPipelineRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDeliveryPipelineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"; + }; + + return DeleteDeliveryPipelineRequest; + })(); + + v1.Target = (function() { + + /** + * Properties of a Target. + * @memberof google.cloud.deploy.v1 + * @interface ITarget + * @property {string|null} [name] Target name + * @property {string|null} [targetId] Target targetId + * @property {string|null} [uid] Target uid + * @property {string|null} [description] Target description + * @property {Object.|null} [annotations] Target annotations + * @property {Object.|null} [labels] Target labels + * @property {boolean|null} [requireApproval] Target requireApproval + * @property {google.protobuf.ITimestamp|null} [createTime] Target createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Target updateTime + * @property {google.cloud.deploy.v1.IGkeCluster|null} [gke] Target gke + * @property {google.cloud.deploy.v1.IAnthosCluster|null} [anthosCluster] Target anthosCluster + * @property {google.cloud.deploy.v1.ICloudRunLocation|null} [run] Target run + * @property {string|null} [etag] Target etag + * @property {Array.|null} [executionConfigs] Target executionConfigs + */ + + /** + * Constructs a new Target. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Target. + * @implements ITarget + * @constructor + * @param {google.cloud.deploy.v1.ITarget=} [properties] Properties to set + */ + function Target(properties) { + this.annotations = {}; + this.labels = {}; + this.executionConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Target name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.name = ""; + + /** + * Target targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.targetId = ""; + + /** + * Target uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.uid = ""; + + /** + * Target description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.description = ""; + + /** + * Target annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.annotations = $util.emptyObject; + + /** + * Target labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.labels = $util.emptyObject; + + /** + * Target requireApproval. + * @member {boolean} requireApproval + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.requireApproval = false; + + /** + * Target createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.createTime = null; + + /** + * Target updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.updateTime = null; + + /** + * Target gke. + * @member {google.cloud.deploy.v1.IGkeCluster|null|undefined} gke + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.gke = null; + + /** + * Target anthosCluster. + * @member {google.cloud.deploy.v1.IAnthosCluster|null|undefined} anthosCluster + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.anthosCluster = null; + + /** + * Target run. + * @member {google.cloud.deploy.v1.ICloudRunLocation|null|undefined} run + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.run = null; + + /** + * Target etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.etag = ""; + + /** + * Target executionConfigs. + * @member {Array.} executionConfigs + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Target.prototype.executionConfigs = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Target deploymentTarget. + * @member {"gke"|"anthosCluster"|"run"|undefined} deploymentTarget + * @memberof google.cloud.deploy.v1.Target + * @instance + */ + Object.defineProperty(Target.prototype, "deploymentTarget", { + get: $util.oneOfGetter($oneOfFields = ["gke", "anthosCluster", "run"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Target instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Target} Target instance + */ + Target.create = function create(properties) { + return new Target(properties); + }; + + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetId); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.requireApproval != null && Object.hasOwnProperty.call(message, "requireApproval")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.requireApproval); + if (message.gke != null && Object.hasOwnProperty.call(message, "gke")) + $root.google.cloud.deploy.v1.GkeCluster.encode(message.gke, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.executionConfigs != null && message.executionConfigs.length) + for (var i = 0; i < message.executionConfigs.length; ++i) + $root.google.cloud.deploy.v1.ExecutionConfig.encode(message.executionConfigs[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.anthosCluster != null && Object.hasOwnProperty.call(message, "anthosCluster")) + $root.google.cloud.deploy.v1.AnthosCluster.encode(message.anthosCluster, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.run != null && Object.hasOwnProperty.call(message, "run")) + $root.google.cloud.deploy.v1.CloudRunLocation.encode(message.run, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Target.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Target message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Target(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.targetId = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 6: { + 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 13: { + message.requireApproval = reader.bool(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.gke = $root.google.cloud.deploy.v1.GkeCluster.decode(reader, reader.uint32()); + break; + } + case 17: { + message.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.decode(reader, reader.uint32()); + break; + } + case 18: { + message.run = $root.google.cloud.deploy.v1.CloudRunLocation.decode(reader, reader.uint32()); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 16: { + if (!(message.executionConfigs && message.executionConfigs.length)) + message.executionConfigs = []; + message.executionConfigs.push($root.google.cloud.deploy.v1.ExecutionConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Target message. + * @function verify + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Target.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k: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.requireApproval != null && message.hasOwnProperty("requireApproval")) + if (typeof message.requireApproval !== "boolean") + return "requireApproval: boolean expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.gke != null && message.hasOwnProperty("gke")) { + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.GkeCluster.verify(message.gke); + if (error) + return "gke." + error; + } + } + if (message.anthosCluster != null && message.hasOwnProperty("anthosCluster")) { + if (properties.deploymentTarget === 1) + return "deploymentTarget: multiple values"; + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.AnthosCluster.verify(message.anthosCluster); + if (error) + return "anthosCluster." + error; + } + } + if (message.run != null && message.hasOwnProperty("run")) { + if (properties.deploymentTarget === 1) + return "deploymentTarget: multiple values"; + properties.deploymentTarget = 1; + { + var error = $root.google.cloud.deploy.v1.CloudRunLocation.verify(message.run); + if (error) + return "run." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.executionConfigs != null && message.hasOwnProperty("executionConfigs")) { + if (!Array.isArray(message.executionConfigs)) + return "executionConfigs: array expected"; + for (var i = 0; i < message.executionConfigs.length; ++i) { + var error = $root.google.cloud.deploy.v1.ExecutionConfig.verify(message.executionConfigs[i]); + if (error) + return "executionConfigs." + error; + } + } + return null; + }; + + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Target} Target + */ + Target.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Target) + return object; + var message = new $root.google.cloud.deploy.v1.Target(); + if (object.name != null) + message.name = String(object.name); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.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.requireApproval != null) + message.requireApproval = Boolean(object.requireApproval); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.gke != null) { + if (typeof object.gke !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.gke: object expected"); + message.gke = $root.google.cloud.deploy.v1.GkeCluster.fromObject(object.gke); + } + if (object.anthosCluster != null) { + if (typeof object.anthosCluster !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.anthosCluster: object expected"); + message.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.fromObject(object.anthosCluster); + } + if (object.run != null) { + if (typeof object.run !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.run: object expected"); + message.run = $root.google.cloud.deploy.v1.CloudRunLocation.fromObject(object.run); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.executionConfigs) { + if (!Array.isArray(object.executionConfigs)) + throw TypeError(".google.cloud.deploy.v1.Target.executionConfigs: array expected"); + message.executionConfigs = []; + for (var i = 0; i < object.executionConfigs.length; ++i) { + if (typeof object.executionConfigs[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Target.executionConfigs: object expected"); + message.executionConfigs[i] = $root.google.cloud.deploy.v1.ExecutionConfig.fromObject(object.executionConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {google.cloud.deploy.v1.Target} message Target + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Target.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.executionConfigs = []; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.targetId = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.requireApproval = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.requireApproval != null && message.hasOwnProperty("requireApproval")) + object.requireApproval = message.requireApproval; + if (message.gke != null && message.hasOwnProperty("gke")) { + object.gke = $root.google.cloud.deploy.v1.GkeCluster.toObject(message.gke, options); + if (options.oneofs) + object.deploymentTarget = "gke"; + } + if (message.executionConfigs && message.executionConfigs.length) { + object.executionConfigs = []; + for (var j = 0; j < message.executionConfigs.length; ++j) + object.executionConfigs[j] = $root.google.cloud.deploy.v1.ExecutionConfig.toObject(message.executionConfigs[j], options); + } + if (message.anthosCluster != null && message.hasOwnProperty("anthosCluster")) { + object.anthosCluster = $root.google.cloud.deploy.v1.AnthosCluster.toObject(message.anthosCluster, options); + if (options.oneofs) + object.deploymentTarget = "anthosCluster"; + } + if (message.run != null && message.hasOwnProperty("run")) { + object.run = $root.google.cloud.deploy.v1.CloudRunLocation.toObject(message.run, options); + if (options.oneofs) + object.deploymentTarget = "run"; + } + return object; + }; + + /** + * Converts this Target to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Target + * @instance + * @returns {Object.} JSON object + */ + Target.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Target + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Target + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Target.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Target"; + }; + + return Target; + })(); + + v1.ExecutionConfig = (function() { + + /** + * Properties of an ExecutionConfig. + * @memberof google.cloud.deploy.v1 + * @interface IExecutionConfig + * @property {Array.|null} [usages] ExecutionConfig usages + * @property {google.cloud.deploy.v1.IDefaultPool|null} [defaultPool] ExecutionConfig defaultPool + * @property {google.cloud.deploy.v1.IPrivatePool|null} [privatePool] ExecutionConfig privatePool + * @property {string|null} [workerPool] ExecutionConfig workerPool + * @property {string|null} [serviceAccount] ExecutionConfig serviceAccount + * @property {string|null} [artifactStorage] ExecutionConfig artifactStorage + * @property {google.protobuf.IDuration|null} [executionTimeout] ExecutionConfig executionTimeout + */ + + /** + * Constructs a new ExecutionConfig. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ExecutionConfig. + * @implements IExecutionConfig + * @constructor + * @param {google.cloud.deploy.v1.IExecutionConfig=} [properties] Properties to set + */ + function ExecutionConfig(properties) { + this.usages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionConfig usages. + * @member {Array.} usages + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.usages = $util.emptyArray; + + /** + * ExecutionConfig defaultPool. + * @member {google.cloud.deploy.v1.IDefaultPool|null|undefined} defaultPool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.defaultPool = null; + + /** + * ExecutionConfig privatePool. + * @member {google.cloud.deploy.v1.IPrivatePool|null|undefined} privatePool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.privatePool = null; + + /** + * ExecutionConfig workerPool. + * @member {string} workerPool + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.workerPool = ""; + + /** + * ExecutionConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.serviceAccount = ""; + + /** + * ExecutionConfig artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.artifactStorage = ""; + + /** + * ExecutionConfig executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.executionTimeout = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecutionConfig executionEnvironment. + * @member {"defaultPool"|"privatePool"|undefined} executionEnvironment + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + */ + Object.defineProperty(ExecutionConfig.prototype, "executionEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["defaultPool", "privatePool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig instance + */ + ExecutionConfig.create = function create(properties) { + return new ExecutionConfig(properties); + }; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.usages != null && message.usages.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.usages.length; ++i) + writer.int32(message.usages[i]); + writer.ldelim(); + } + if (message.defaultPool != null && Object.hasOwnProperty.call(message, "defaultPool")) + $root.google.cloud.deploy.v1.DefaultPool.encode(message.defaultPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.privatePool != null && Object.hasOwnProperty.call(message, "privatePool")) + $root.google.cloud.deploy.v1.PrivatePool.encode(message.privatePool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.workerPool); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.artifactStorage); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ExecutionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ExecutionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.usages && message.usages.length)) + message.usages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.usages.push(reader.int32()); + } else + message.usages.push(reader.int32()); + break; + } + case 2: { + message.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.privatePool = $root.google.cloud.deploy.v1.PrivatePool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.workerPool = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.artifactStorage = reader.string(); + break; + } + case 7: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionConfig message. + * @function verify + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.usages != null && message.hasOwnProperty("usages")) { + if (!Array.isArray(message.usages)) + return "usages: array expected"; + for (var i = 0; i < message.usages.length; ++i) + switch (message.usages[i]) { + default: + return "usages: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.defaultPool != null && message.hasOwnProperty("defaultPool")) { + properties.executionEnvironment = 1; + { + var error = $root.google.cloud.deploy.v1.DefaultPool.verify(message.defaultPool); + if (error) + return "defaultPool." + error; + } + } + if (message.privatePool != null && message.hasOwnProperty("privatePool")) { + if (properties.executionEnvironment === 1) + return "executionEnvironment: multiple values"; + properties.executionEnvironment = 1; + { + var error = $root.google.cloud.deploy.v1.PrivatePool.verify(message.privatePool); + if (error) + return "privatePool." + error; + } + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; + } + return null; + }; + + /** + * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ExecutionConfig} ExecutionConfig + */ + ExecutionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ExecutionConfig) + return object; + var message = new $root.google.cloud.deploy.v1.ExecutionConfig(); + if (object.usages) { + if (!Array.isArray(object.usages)) + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.usages: array expected"); + message.usages = []; + for (var i = 0; i < object.usages.length; ++i) + switch (object.usages[i]) { + default: + case "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED": + case 0: + message.usages[i] = 0; + break; + case "RENDER": + case 1: + message.usages[i] = 1; + break; + case "DEPLOY": + case 2: + message.usages[i] = 2; + break; + case "VERIFY": + case 3: + message.usages[i] = 3; + break; + } + } + if (object.defaultPool != null) { + if (typeof object.defaultPool !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.defaultPool: object expected"); + message.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.fromObject(object.defaultPool); + } + if (object.privatePool != null) { + if (typeof object.privatePool !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.privatePool: object expected"); + message.privatePool = $root.google.cloud.deploy.v1.PrivatePool.fromObject(object.privatePool); + } + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.deploy.v1.ExecutionConfig.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {google.cloud.deploy.v1.ExecutionConfig} message ExecutionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.usages = []; + if (options.defaults) { + object.workerPool = ""; + object.serviceAccount = ""; + object.artifactStorage = ""; + object.executionTimeout = null; + } + if (message.usages && message.usages.length) { + object.usages = []; + for (var j = 0; j < message.usages.length; ++j) + object.usages[j] = options.enums === String ? $root.google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage[message.usages[j]] : message.usages[j]; + } + if (message.defaultPool != null && message.hasOwnProperty("defaultPool")) { + object.defaultPool = $root.google.cloud.deploy.v1.DefaultPool.toObject(message.defaultPool, options); + if (options.oneofs) + object.executionEnvironment = "defaultPool"; + } + if (message.privatePool != null && message.hasOwnProperty("privatePool")) { + object.privatePool = $root.google.cloud.deploy.v1.PrivatePool.toObject(message.privatePool, options); + if (options.oneofs) + object.executionEnvironment = "privatePool"; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + return object; + }; + + /** + * Converts this ExecutionConfig to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @instance + * @returns {Object.} JSON object + */ + ExecutionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionConfig + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ExecutionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ExecutionConfig"; + }; + + /** + * ExecutionEnvironmentUsage enum. + * @name google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage + * @enum {number} + * @property {number} EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED=0 EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED value + * @property {number} RENDER=1 RENDER value + * @property {number} DEPLOY=2 DEPLOY value + * @property {number} VERIFY=3 VERIFY value + */ + ExecutionConfig.ExecutionEnvironmentUsage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RENDER"] = 1; + values[valuesById[2] = "DEPLOY"] = 2; + values[valuesById[3] = "VERIFY"] = 3; + return values; + })(); + + return ExecutionConfig; + })(); + + v1.DefaultPool = (function() { + + /** + * Properties of a DefaultPool. + * @memberof google.cloud.deploy.v1 + * @interface IDefaultPool + * @property {string|null} [serviceAccount] DefaultPool serviceAccount + * @property {string|null} [artifactStorage] DefaultPool artifactStorage + */ + + /** + * Constructs a new DefaultPool. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DefaultPool. + * @implements IDefaultPool + * @constructor + * @param {google.cloud.deploy.v1.IDefaultPool=} [properties] Properties to set + */ + function DefaultPool(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]]; + } + + /** + * DefaultPool serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + */ + DefaultPool.prototype.serviceAccount = ""; + + /** + * DefaultPool artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + */ + DefaultPool.prototype.artifactStorage = ""; + + /** + * Creates a new DefaultPool instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool instance + */ + DefaultPool.create = function create(properties) { + return new DefaultPool(properties); + }; + + /** + * Encodes the specified DefaultPool message. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool} message DefaultPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.artifactStorage); + return writer; + }; + + /** + * Encodes the specified DefaultPool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DefaultPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.IDefaultPool} message DefaultPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefaultPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefaultPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DefaultPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAccount = reader.string(); + break; + } + case 2: { + message.artifactStorage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefaultPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefaultPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefaultPool message. + * @function verify + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefaultPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + return null; + }; + + /** + * Creates a DefaultPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DefaultPool} DefaultPool + */ + DefaultPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DefaultPool) + return object; + var message = new $root.google.cloud.deploy.v1.DefaultPool(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + return message; + }; + + /** + * Creates a plain object from a DefaultPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {google.cloud.deploy.v1.DefaultPool} message DefaultPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefaultPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceAccount = ""; + object.artifactStorage = ""; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + return object; + }; + + /** + * Converts this DefaultPool to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DefaultPool + * @instance + * @returns {Object.} JSON object + */ + DefaultPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefaultPool + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DefaultPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefaultPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DefaultPool"; + }; + + return DefaultPool; + })(); + + v1.PrivatePool = (function() { + + /** + * Properties of a PrivatePool. + * @memberof google.cloud.deploy.v1 + * @interface IPrivatePool + * @property {string|null} [workerPool] PrivatePool workerPool + * @property {string|null} [serviceAccount] PrivatePool serviceAccount + * @property {string|null} [artifactStorage] PrivatePool artifactStorage + */ + + /** + * Constructs a new PrivatePool. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a PrivatePool. + * @implements IPrivatePool + * @constructor + * @param {google.cloud.deploy.v1.IPrivatePool=} [properties] Properties to set + */ + function PrivatePool(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]]; + } + + /** + * PrivatePool workerPool. + * @member {string} workerPool + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.workerPool = ""; + + /** + * PrivatePool serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.serviceAccount = ""; + + /** + * PrivatePool artifactStorage. + * @member {string} artifactStorage + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + */ + PrivatePool.prototype.artifactStorage = ""; + + /** + * Creates a new PrivatePool instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool instance + */ + PrivatePool.create = function create(properties) { + return new PrivatePool(properties); + }; + + /** + * Encodes the specified PrivatePool message. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool} message PrivatePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + if (message.artifactStorage != null && Object.hasOwnProperty.call(message, "artifactStorage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.artifactStorage); + return writer; + }; + + /** + * Encodes the specified PrivatePool message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.PrivatePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.IPrivatePool} message PrivatePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivatePool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.PrivatePool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + case 3: { + message.artifactStorage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivatePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivatePool message. + * @function verify + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivatePool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + if (!$util.isString(message.artifactStorage)) + return "artifactStorage: string expected"; + return null; + }; + + /** + * Creates a PrivatePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.PrivatePool} PrivatePool + */ + PrivatePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.PrivatePool) + return object; + var message = new $root.google.cloud.deploy.v1.PrivatePool(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.artifactStorage != null) + message.artifactStorage = String(object.artifactStorage); + return message; + }; + + /** + * Creates a plain object from a PrivatePool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {google.cloud.deploy.v1.PrivatePool} message PrivatePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivatePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = ""; + object.serviceAccount = ""; + object.artifactStorage = ""; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.artifactStorage != null && message.hasOwnProperty("artifactStorage")) + object.artifactStorage = message.artifactStorage; + return object; + }; + + /** + * Converts this PrivatePool to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.PrivatePool + * @instance + * @returns {Object.} JSON object + */ + PrivatePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivatePool + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.PrivatePool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivatePool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.PrivatePool"; + }; + + return PrivatePool; + })(); + + v1.GkeCluster = (function() { + + /** + * Properties of a GkeCluster. + * @memberof google.cloud.deploy.v1 + * @interface IGkeCluster + * @property {string|null} [cluster] GkeCluster cluster + * @property {boolean|null} [internalIp] GkeCluster internalIp + */ + + /** + * Constructs a new GkeCluster. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GkeCluster. + * @implements IGkeCluster + * @constructor + * @param {google.cloud.deploy.v1.IGkeCluster=} [properties] Properties to set + */ + function GkeCluster(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]]; + } + + /** + * GkeCluster cluster. + * @member {string} cluster + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + */ + GkeCluster.prototype.cluster = ""; + + /** + * GkeCluster internalIp. + * @member {boolean} internalIp + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + */ + GkeCluster.prototype.internalIp = false; + + /** + * Creates a new GkeCluster instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster instance + */ + GkeCluster.create = function create(properties) { + return new GkeCluster(properties); + }; + + /** + * Encodes the specified GkeCluster message. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster} message GkeCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.internalIp); + return writer; + }; + + /** + * Encodes the specified GkeCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GkeCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.IGkeCluster} message GkeCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GkeCluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + message.internalIp = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeCluster message. + * @function verify + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (typeof message.internalIp !== "boolean") + return "internalIp: boolean expected"; + return null; + }; + + /** + * Creates a GkeCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GkeCluster} GkeCluster + */ + GkeCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GkeCluster) + return object; + var message = new $root.google.cloud.deploy.v1.GkeCluster(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.internalIp != null) + message.internalIp = Boolean(object.internalIp); + return message; + }; + + /** + * Creates a plain object from a GkeCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {google.cloud.deploy.v1.GkeCluster} message GkeCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cluster = ""; + object.internalIp = false; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + return object; + }; + + /** + * Converts this GkeCluster to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GkeCluster + * @instance + * @returns {Object.} JSON object + */ + GkeCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeCluster + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GkeCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GkeCluster"; + }; + + return GkeCluster; + })(); + + v1.AnthosCluster = (function() { + + /** + * Properties of an AnthosCluster. + * @memberof google.cloud.deploy.v1 + * @interface IAnthosCluster + * @property {string|null} [membership] AnthosCluster membership + */ + + /** + * Constructs a new AnthosCluster. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AnthosCluster. + * @implements IAnthosCluster + * @constructor + * @param {google.cloud.deploy.v1.IAnthosCluster=} [properties] Properties to set + */ + function AnthosCluster(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]]; + } + + /** + * AnthosCluster membership. + * @member {string} membership + * @memberof google.cloud.deploy.v1.AnthosCluster + * @instance + */ + AnthosCluster.prototype.membership = ""; + + /** + * Creates a new AnthosCluster instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster instance + */ + AnthosCluster.create = function create(properties) { + return new AnthosCluster(properties); + }; + + /** + * Encodes the specified AnthosCluster message. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster} message AnthosCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnthosCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.membership); + return writer; + }; + + /** + * Encodes the specified AnthosCluster message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AnthosCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.IAnthosCluster} message AnthosCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnthosCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnthosCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AnthosCluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnthosCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnthosCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnthosCluster message. + * @function verify + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnthosCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) + if (!$util.isString(message.membership)) + return "membership: string expected"; + return null; + }; + + /** + * Creates an AnthosCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AnthosCluster} AnthosCluster + */ + AnthosCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AnthosCluster) + return object; + var message = new $root.google.cloud.deploy.v1.AnthosCluster(); + if (object.membership != null) + message.membership = String(object.membership); + return message; + }; + + /** + * Creates a plain object from an AnthosCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {google.cloud.deploy.v1.AnthosCluster} message AnthosCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnthosCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.membership = ""; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = message.membership; + return object; + }; + + /** + * Converts this AnthosCluster to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AnthosCluster + * @instance + * @returns {Object.} JSON object + */ + AnthosCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnthosCluster + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AnthosCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnthosCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AnthosCluster"; + }; + + return AnthosCluster; + })(); + + v1.CloudRunLocation = (function() { + + /** + * Properties of a CloudRunLocation. + * @memberof google.cloud.deploy.v1 + * @interface ICloudRunLocation + * @property {string|null} [location] CloudRunLocation location + */ + + /** + * Constructs a new CloudRunLocation. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudRunLocation. + * @implements ICloudRunLocation + * @constructor + * @param {google.cloud.deploy.v1.ICloudRunLocation=} [properties] Properties to set + */ + function CloudRunLocation(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]]; + } + + /** + * CloudRunLocation location. + * @member {string} location + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @instance + */ + CloudRunLocation.prototype.location = ""; + + /** + * Creates a new CloudRunLocation instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation instance + */ + CloudRunLocation.create = function create(properties) { + return new CloudRunLocation(properties); + }; + + /** + * Encodes the specified CloudRunLocation message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation} message CloudRunLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + return writer; + }; + + /** + * Encodes the specified CloudRunLocation message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.ICloudRunLocation} message CloudRunLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CloudRunLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudRunLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudRunLocation message. + * @function verify + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudRunLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a CloudRunLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CloudRunLocation} CloudRunLocation + */ + CloudRunLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CloudRunLocation) + return object; + var message = new $root.google.cloud.deploy.v1.CloudRunLocation(); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a CloudRunLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {google.cloud.deploy.v1.CloudRunLocation} message CloudRunLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudRunLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CloudRunLocation to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @instance + * @returns {Object.} JSON object + */ + CloudRunLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudRunLocation + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CloudRunLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudRunLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CloudRunLocation"; + }; + + return CloudRunLocation; + })(); + + v1.ListTargetsRequest = (function() { + + /** + * Properties of a ListTargetsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListTargetsRequest + * @property {string|null} [parent] ListTargetsRequest parent + * @property {number|null} [pageSize] ListTargetsRequest pageSize + * @property {string|null} [pageToken] ListTargetsRequest pageToken + * @property {string|null} [filter] ListTargetsRequest filter + * @property {string|null} [orderBy] ListTargetsRequest orderBy + */ + + /** + * Constructs a new ListTargetsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListTargetsRequest. + * @implements IListTargetsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListTargetsRequest=} [properties] Properties to set + */ + function ListTargetsRequest(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]]; + } + + /** + * ListTargetsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.parent = ""; + + /** + * ListTargetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.pageSize = 0; + + /** + * ListTargetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.pageToken = ""; + + /** + * ListTargetsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.filter = ""; + + /** + * ListTargetsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + */ + ListTargetsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListTargetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest instance + */ + ListTargetsRequest.create = function create(properties) { + return new ListTargetsRequest(properties); + }; + + /** + * Encodes the specified ListTargetsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest} message ListTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListTargetsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.IListTargetsRequest} message ListTargetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListTargetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListTargetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListTargetsRequest} ListTargetsRequest + */ + ListTargetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListTargetsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListTargetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListTargetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {google.cloud.deploy.v1.ListTargetsRequest} message ListTargetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListTargetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListTargetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListTargetsRequest"; + }; + + return ListTargetsRequest; + })(); + + v1.ListTargetsResponse = (function() { + + /** + * Properties of a ListTargetsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListTargetsResponse + * @property {Array.|null} [targets] ListTargetsResponse targets + * @property {string|null} [nextPageToken] ListTargetsResponse nextPageToken + * @property {Array.|null} [unreachable] ListTargetsResponse unreachable + */ + + /** + * Constructs a new ListTargetsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListTargetsResponse. + * @implements IListTargetsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListTargetsResponse=} [properties] Properties to set + */ + function ListTargetsResponse(properties) { + this.targets = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetsResponse targets. + * @member {Array.} targets + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.targets = $util.emptyArray; + + /** + * ListTargetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.nextPageToken = ""; + + /** + * ListTargetsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + */ + ListTargetsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTargetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse instance + */ + ListTargetsResponse.create = function create(properties) { + return new ListTargetsResponse(properties); + }; + + /** + * Encodes the specified ListTargetsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse} message ListTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + $root.google.cloud.deploy.v1.Target.encode(message.targets[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTargetsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListTargetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.IListTargetsResponse} message ListTargetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListTargetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.targets && message.targets.length)) + message.targets = []; + message.targets.push($root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.targets[i]); + if (error) + return "targets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTargetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListTargetsResponse} ListTargetsResponse + */ + ListTargetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListTargetsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListTargetsResponse(); + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) { + if (typeof object.targets[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.targets: object expected"); + message.targets[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListTargetsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTargetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {google.cloud.deploy.v1.ListTargetsResponse} message ListTargetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTargetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTargetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListTargetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListTargetsResponse"; + }; + + return ListTargetsResponse; + })(); + + v1.GetTargetRequest = (function() { + + /** + * Properties of a GetTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetTargetRequest + * @property {string|null} [name] GetTargetRequest name + */ + + /** + * Constructs a new GetTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetTargetRequest. + * @implements IGetTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetTargetRequest=} [properties] Properties to set + */ + function GetTargetRequest(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]]; + } + + /** + * GetTargetRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @instance + */ + GetTargetRequest.prototype.name = ""; + + /** + * Creates a new GetTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest instance + */ + GetTargetRequest.create = function create(properties) { + return new GetTargetRequest(properties); + }; + + /** + * Encodes the specified GetTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest} message GetTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetRequest.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 GetTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.IGetTargetRequest} message GetTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetTargetRequest(); + 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 GetTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetRequest.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 GetTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetTargetRequest} GetTargetRequest + */ + GetTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetTargetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {google.cloud.deploy.v1.GetTargetRequest} message GetTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetRequest.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 GetTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetTargetRequest"; + }; + + return GetTargetRequest; + })(); + + v1.CreateTargetRequest = (function() { + + /** + * Properties of a CreateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateTargetRequest + * @property {string|null} [parent] CreateTargetRequest parent + * @property {string|null} [targetId] CreateTargetRequest targetId + * @property {google.cloud.deploy.v1.ITarget|null} [target] CreateTargetRequest target + * @property {string|null} [requestId] CreateTargetRequest requestId + * @property {boolean|null} [validateOnly] CreateTargetRequest validateOnly + */ + + /** + * Constructs a new CreateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateTargetRequest. + * @implements ICreateTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateTargetRequest=} [properties] Properties to set + */ + function CreateTargetRequest(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]]; + } + + /** + * CreateTargetRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.parent = ""; + + /** + * CreateTargetRequest targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.targetId = ""; + + /** + * CreateTargetRequest target. + * @member {google.cloud.deploy.v1.ITarget|null|undefined} target + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.target = null; + + /** + * CreateTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.requestId = ""; + + /** + * CreateTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + */ + CreateTargetRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest instance + */ + CreateTargetRequest.create = function create(properties) { + return new CreateTargetRequest(properties); + }; + + /** + * Encodes the specified CreateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest} message CreateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetRequest.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.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetId); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.deploy.v1.Target.encode(message.target, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.ICreateTargetRequest} message CreateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.targetId = reader.string(); + break; + } + case 3: { + message.target = $root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTargetRequest.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.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.target); + if (error) + return "target." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateTargetRequest} CreateTargetRequest + */ + CreateTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateTargetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.targetId != null) + message.targetId = String(object.targetId); + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateTargetRequest.target: object expected"); + message.target = $root.google.cloud.deploy.v1.Target.fromObject(object.target); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {google.cloud.deploy.v1.CreateTargetRequest} message CreateTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.targetId = ""; + object.target = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.deploy.v1.Target.toObject(message.target, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateTargetRequest"; + }; + + return CreateTargetRequest; + })(); + + v1.UpdateTargetRequest = (function() { + + /** + * Properties of an UpdateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IUpdateTargetRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTargetRequest updateMask + * @property {google.cloud.deploy.v1.ITarget|null} [target] UpdateTargetRequest target + * @property {string|null} [requestId] UpdateTargetRequest requestId + * @property {boolean|null} [allowMissing] UpdateTargetRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateTargetRequest validateOnly + */ + + /** + * Constructs a new UpdateTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an UpdateTargetRequest. + * @implements IUpdateTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IUpdateTargetRequest=} [properties] Properties to set + */ + function UpdateTargetRequest(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]]; + } + + /** + * UpdateTargetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.updateMask = null; + + /** + * UpdateTargetRequest target. + * @member {google.cloud.deploy.v1.ITarget|null|undefined} target + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.target = null; + + /** + * UpdateTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.requestId = ""; + + /** + * UpdateTargetRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.allowMissing = false; + + /** + * UpdateTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + */ + UpdateTargetRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest instance + */ + UpdateTargetRequest.create = function create(properties) { + return new UpdateTargetRequest(properties); + }; + + /** + * Encodes the specified UpdateTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} message UpdateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.deploy.v1.Target.encode(message.target, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.UpdateTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.IUpdateTargetRequest} message UpdateTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.UpdateTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.target = $root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTargetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.target); + if (error) + return "target." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.UpdateTargetRequest} UpdateTargetRequest + */ + UpdateTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.UpdateTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.UpdateTargetRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateTargetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.deploy.v1.UpdateTargetRequest.target: object expected"); + message.target = $root.google.cloud.deploy.v1.Target.fromObject(object.target); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {google.cloud.deploy.v1.UpdateTargetRequest} message UpdateTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.target = null; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.deploy.v1.Target.toObject(message.target, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.UpdateTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.UpdateTargetRequest"; + }; + + return UpdateTargetRequest; + })(); + + v1.DeleteTargetRequest = (function() { + + /** + * Properties of a DeleteTargetRequest. + * @memberof google.cloud.deploy.v1 + * @interface IDeleteTargetRequest + * @property {string|null} [name] DeleteTargetRequest name + * @property {string|null} [requestId] DeleteTargetRequest requestId + * @property {boolean|null} [allowMissing] DeleteTargetRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteTargetRequest validateOnly + * @property {string|null} [etag] DeleteTargetRequest etag + */ + + /** + * Constructs a new DeleteTargetRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeleteTargetRequest. + * @implements IDeleteTargetRequest + * @constructor + * @param {google.cloud.deploy.v1.IDeleteTargetRequest=} [properties] Properties to set + */ + function DeleteTargetRequest(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]]; + } + + /** + * DeleteTargetRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.name = ""; + + /** + * DeleteTargetRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.requestId = ""; + + /** + * DeleteTargetRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.allowMissing = false; + + /** + * DeleteTargetRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.validateOnly = false; + + /** + * DeleteTargetRequest etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + */ + DeleteTargetRequest.prototype.etag = ""; + + /** + * Creates a new DeleteTargetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest instance + */ + DeleteTargetRequest.create = function create(properties) { + return new DeleteTargetRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetRequest message. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} message DeleteTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteTargetRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeleteTargetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.IDeleteTargetRequest} message DeleteTargetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeleteTargetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeleteTargetRequest} DeleteTargetRequest + */ + DeleteTargetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeleteTargetRequest) + return object; + var message = new $root.google.cloud.deploy.v1.DeleteTargetRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {google.cloud.deploy.v1.DeleteTargetRequest} message DeleteTargetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.allowMissing = false; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteTargetRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTargetRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeleteTargetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTargetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeleteTargetRequest"; + }; + + return DeleteTargetRequest; + })(); + + v1.Release = (function() { + + /** + * Properties of a Release. + * @memberof google.cloud.deploy.v1 + * @interface IRelease + * @property {string|null} [name] Release name + * @property {string|null} [uid] Release uid + * @property {string|null} [description] Release description + * @property {Object.|null} [annotations] Release annotations + * @property {Object.|null} [labels] Release labels + * @property {boolean|null} [abandoned] Release abandoned + * @property {google.protobuf.ITimestamp|null} [createTime] Release createTime + * @property {google.protobuf.ITimestamp|null} [renderStartTime] Release renderStartTime + * @property {google.protobuf.ITimestamp|null} [renderEndTime] Release renderEndTime + * @property {string|null} [skaffoldConfigUri] Release skaffoldConfigUri + * @property {string|null} [skaffoldConfigPath] Release skaffoldConfigPath + * @property {Array.|null} [buildArtifacts] Release buildArtifacts + * @property {google.cloud.deploy.v1.IDeliveryPipeline|null} [deliveryPipelineSnapshot] Release deliveryPipelineSnapshot + * @property {Array.|null} [targetSnapshots] Release targetSnapshots + * @property {google.cloud.deploy.v1.Release.RenderState|null} [renderState] Release renderState + * @property {string|null} [etag] Release etag + * @property {string|null} [skaffoldVersion] Release skaffoldVersion + * @property {Object.|null} [targetArtifacts] Release targetArtifacts + * @property {Object.|null} [targetRenders] Release targetRenders + */ + + /** + * Constructs a new Release. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Release. + * @implements IRelease + * @constructor + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + */ + function Release(properties) { + this.annotations = {}; + this.labels = {}; + this.buildArtifacts = []; + this.targetSnapshots = []; + this.targetArtifacts = {}; + this.targetRenders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Release name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.name = ""; + + /** + * Release uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.uid = ""; + + /** + * Release description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.description = ""; + + /** + * Release annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.annotations = $util.emptyObject; + + /** + * Release labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.labels = $util.emptyObject; + + /** + * Release abandoned. + * @member {boolean} abandoned + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.abandoned = false; + + /** + * Release createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.createTime = null; + + /** + * Release renderStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderStartTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderStartTime = null; + + /** + * Release renderEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} renderEndTime + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderEndTime = null; + + /** + * Release skaffoldConfigUri. + * @member {string} skaffoldConfigUri + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigUri = ""; + + /** + * Release skaffoldConfigPath. + * @member {string} skaffoldConfigPath + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldConfigPath = ""; + + /** + * Release buildArtifacts. + * @member {Array.} buildArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.buildArtifacts = $util.emptyArray; + + /** + * Release deliveryPipelineSnapshot. + * @member {google.cloud.deploy.v1.IDeliveryPipeline|null|undefined} deliveryPipelineSnapshot + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.deliveryPipelineSnapshot = null; + + /** + * Release targetSnapshots. + * @member {Array.} targetSnapshots + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetSnapshots = $util.emptyArray; + + /** + * Release renderState. + * @member {google.cloud.deploy.v1.Release.RenderState} renderState + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.renderState = 0; + + /** + * Release etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.etag = ""; + + /** + * Release skaffoldVersion. + * @member {string} skaffoldVersion + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.skaffoldVersion = ""; + + /** + * Release targetArtifacts. + * @member {Object.} targetArtifacts + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetArtifacts = $util.emptyObject; + + /** + * Release targetRenders. + * @member {Object.} targetRenders + * @memberof google.cloud.deploy.v1.Release + * @instance + */ + Release.prototype.targetRenders = $util.emptyObject; + + /** + * Creates a new Release instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release} Release instance + */ + Release.create = function create(properties) { + return new Release(properties); + }; + + /** + * Encodes the specified Release message. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.renderStartTime != null && Object.hasOwnProperty.call(message, "renderStartTime")) + $root.google.protobuf.Timestamp.encode(message.renderStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.renderEndTime != null && Object.hasOwnProperty.call(message, "renderEndTime")) + $root.google.protobuf.Timestamp.encode(message.renderEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.skaffoldConfigPath); + if (message.buildArtifacts != null && message.buildArtifacts.length) + for (var i = 0; i < message.buildArtifacts.length; ++i) + $root.google.cloud.deploy.v1.BuildArtifact.encode(message.buildArtifacts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.deliveryPipelineSnapshot != null && Object.hasOwnProperty.call(message, "deliveryPipelineSnapshot")) + $root.google.cloud.deploy.v1.DeliveryPipeline.encode(message.deliveryPipelineSnapshot, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.targetSnapshots != null && message.targetSnapshots.length) + for (var i = 0; i < message.targetSnapshots.length; ++i) + $root.google.cloud.deploy.v1.Target.encode(message.targetSnapshots[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.renderState != null && Object.hasOwnProperty.call(message, "renderState")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.renderState); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); + if (message.skaffoldConfigUri != null && Object.hasOwnProperty.call(message, "skaffoldConfigUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.skaffoldConfigUri); + if (message.skaffoldVersion != null && Object.hasOwnProperty.call(message, "skaffoldVersion")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.skaffoldVersion); + if (message.targetArtifacts != null && Object.hasOwnProperty.call(message, "targetArtifacts")) + for (var keys = Object.keys(message.targetArtifacts), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.TargetArtifact.encode(message.targetArtifacts[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.targetRenders != null && Object.hasOwnProperty.call(message, "targetRenders")) + for (var keys = Object.keys(message.targetRenders), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.deploy.v1.Release.TargetRender.encode(message.targetRenders[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.abandoned != null && Object.hasOwnProperty.call(message, "abandoned")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.abandoned); + return writer; + }; + + /** + * Encodes the specified Release message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.IRelease} message Release message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Release.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Release message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 23: { + message.abandoned = reader.bool(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.renderStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.renderEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.skaffoldConfigUri = reader.string(); + break; + } + case 9: { + message.skaffoldConfigPath = reader.string(); + break; + } + case 10: { + if (!(message.buildArtifacts && message.buildArtifacts.length)) + message.buildArtifacts = []; + message.buildArtifacts.push($root.google.cloud.deploy.v1.BuildArtifact.decode(reader, reader.uint32())); + break; + } + case 11: { + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.targetSnapshots && message.targetSnapshots.length)) + message.targetSnapshots = []; + message.targetSnapshots.push($root.google.cloud.deploy.v1.Target.decode(reader, reader.uint32())); + break; + } + case 13: { + message.renderState = reader.int32(); + break; + } + case 16: { + message.etag = reader.string(); + break; + } + case 19: { + message.skaffoldVersion = reader.string(); + break; + } + case 20: { + if (message.targetArtifacts === $util.emptyObject) + message.targetArtifacts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.TargetArtifact.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetArtifacts[key] = value; + break; + } + case 22: { + if (message.targetRenders === $util.emptyObject) + message.targetRenders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.deploy.v1.Release.TargetRender.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetRenders[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Release message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release} Release + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Release.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Release message. + * @function verify + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Release.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k: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.abandoned != null && message.hasOwnProperty("abandoned")) + if (typeof message.abandoned !== "boolean") + return "abandoned: boolean expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderStartTime); + if (error) + return "renderStartTime." + error; + } + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.renderEndTime); + if (error) + return "renderEndTime." + error; + } + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + if (!$util.isString(message.skaffoldConfigUri)) + return "skaffoldConfigUri: string expected"; + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + if (!$util.isString(message.skaffoldConfigPath)) + return "skaffoldConfigPath: string expected"; + if (message.buildArtifacts != null && message.hasOwnProperty("buildArtifacts")) { + if (!Array.isArray(message.buildArtifacts)) + return "buildArtifacts: array expected"; + for (var i = 0; i < message.buildArtifacts.length; ++i) { + var error = $root.google.cloud.deploy.v1.BuildArtifact.verify(message.buildArtifacts[i]); + if (error) + return "buildArtifacts." + error; + } + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) { + var error = $root.google.cloud.deploy.v1.DeliveryPipeline.verify(message.deliveryPipelineSnapshot); + if (error) + return "deliveryPipelineSnapshot." + error; + } + if (message.targetSnapshots != null && message.hasOwnProperty("targetSnapshots")) { + if (!Array.isArray(message.targetSnapshots)) + return "targetSnapshots: array expected"; + for (var i = 0; i < message.targetSnapshots.length; ++i) { + var error = $root.google.cloud.deploy.v1.Target.verify(message.targetSnapshots[i]); + if (error) + return "targetSnapshots." + error; + } + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + switch (message.renderState) { + default: + return "renderState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + if (!$util.isString(message.skaffoldVersion)) + return "skaffoldVersion: string expected"; + if (message.targetArtifacts != null && message.hasOwnProperty("targetArtifacts")) { + if (!$util.isObject(message.targetArtifacts)) + return "targetArtifacts: object expected"; + var key = Object.keys(message.targetArtifacts); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.TargetArtifact.verify(message.targetArtifacts[key[i]]); + if (error) + return "targetArtifacts." + error; + } + } + if (message.targetRenders != null && message.hasOwnProperty("targetRenders")) { + if (!$util.isObject(message.targetRenders)) + return "targetRenders: object expected"; + var key = Object.keys(message.targetRenders); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.deploy.v1.Release.TargetRender.verify(message.targetRenders[key[i]]); + if (error) + return "targetRenders." + error; + } + } + return null; + }; + + /** + * Creates a Release message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release} Release + */ + Release.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release) + return object; + var message = new $root.google.cloud.deploy.v1.Release(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.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.abandoned != null) + message.abandoned = Boolean(object.abandoned); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.renderStartTime != null) { + if (typeof object.renderStartTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderStartTime: object expected"); + message.renderStartTime = $root.google.protobuf.Timestamp.fromObject(object.renderStartTime); + } + if (object.renderEndTime != null) { + if (typeof object.renderEndTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.renderEndTime: object expected"); + message.renderEndTime = $root.google.protobuf.Timestamp.fromObject(object.renderEndTime); + } + if (object.skaffoldConfigUri != null) + message.skaffoldConfigUri = String(object.skaffoldConfigUri); + if (object.skaffoldConfigPath != null) + message.skaffoldConfigPath = String(object.skaffoldConfigPath); + if (object.buildArtifacts) { + if (!Array.isArray(object.buildArtifacts)) + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: array expected"); + message.buildArtifacts = []; + for (var i = 0; i < object.buildArtifacts.length; ++i) { + if (typeof object.buildArtifacts[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.buildArtifacts: object expected"); + message.buildArtifacts[i] = $root.google.cloud.deploy.v1.BuildArtifact.fromObject(object.buildArtifacts[i]); + } + } + if (object.deliveryPipelineSnapshot != null) { + if (typeof object.deliveryPipelineSnapshot !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.deliveryPipelineSnapshot: object expected"); + message.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.fromObject(object.deliveryPipelineSnapshot); + } + if (object.targetSnapshots) { + if (!Array.isArray(object.targetSnapshots)) + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: array expected"); + message.targetSnapshots = []; + for (var i = 0; i < object.targetSnapshots.length; ++i) { + if (typeof object.targetSnapshots[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetSnapshots: object expected"); + message.targetSnapshots[i] = $root.google.cloud.deploy.v1.Target.fromObject(object.targetSnapshots[i]); + } + } + switch (object.renderState) { + case "RENDER_STATE_UNSPECIFIED": + case 0: + message.renderState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderState = 1; + break; + case "FAILED": + case 2: + message.renderState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderState = 3; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.skaffoldVersion != null) + message.skaffoldVersion = String(object.skaffoldVersion); + if (object.targetArtifacts) { + if (typeof object.targetArtifacts !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts = {}; + for (var keys = Object.keys(object.targetArtifacts), i = 0; i < keys.length; ++i) { + if (typeof object.targetArtifacts[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetArtifacts: object expected"); + message.targetArtifacts[keys[i]] = $root.google.cloud.deploy.v1.TargetArtifact.fromObject(object.targetArtifacts[keys[i]]); + } + } + if (object.targetRenders) { + if (typeof object.targetRenders !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders = {}; + for (var keys = Object.keys(object.targetRenders), i = 0; i < keys.length; ++i) { + if (typeof object.targetRenders[keys[i]] !== "object") + throw TypeError(".google.cloud.deploy.v1.Release.targetRenders: object expected"); + message.targetRenders[keys[i]] = $root.google.cloud.deploy.v1.Release.TargetRender.fromObject(object.targetRenders[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Release message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {google.cloud.deploy.v1.Release} message Release + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Release.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.buildArtifacts = []; + object.targetSnapshots = []; + } + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + object.targetArtifacts = {}; + object.targetRenders = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.renderStartTime = null; + object.renderEndTime = null; + object.skaffoldConfigPath = ""; + object.deliveryPipelineSnapshot = null; + object.renderState = options.enums === String ? "RENDER_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.skaffoldConfigUri = ""; + object.skaffoldVersion = ""; + object.abandoned = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.renderStartTime != null && message.hasOwnProperty("renderStartTime")) + object.renderStartTime = $root.google.protobuf.Timestamp.toObject(message.renderStartTime, options); + if (message.renderEndTime != null && message.hasOwnProperty("renderEndTime")) + object.renderEndTime = $root.google.protobuf.Timestamp.toObject(message.renderEndTime, options); + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + object.skaffoldConfigPath = message.skaffoldConfigPath; + if (message.buildArtifacts && message.buildArtifacts.length) { + object.buildArtifacts = []; + for (var j = 0; j < message.buildArtifacts.length; ++j) + object.buildArtifacts[j] = $root.google.cloud.deploy.v1.BuildArtifact.toObject(message.buildArtifacts[j], options); + } + if (message.deliveryPipelineSnapshot != null && message.hasOwnProperty("deliveryPipelineSnapshot")) + object.deliveryPipelineSnapshot = $root.google.cloud.deploy.v1.DeliveryPipeline.toObject(message.deliveryPipelineSnapshot, options); + if (message.targetSnapshots && message.targetSnapshots.length) { + object.targetSnapshots = []; + for (var j = 0; j < message.targetSnapshots.length; ++j) + object.targetSnapshots[j] = $root.google.cloud.deploy.v1.Target.toObject(message.targetSnapshots[j], options); + } + if (message.renderState != null && message.hasOwnProperty("renderState")) + object.renderState = options.enums === String ? $root.google.cloud.deploy.v1.Release.RenderState[message.renderState] : message.renderState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.skaffoldConfigUri != null && message.hasOwnProperty("skaffoldConfigUri")) + object.skaffoldConfigUri = message.skaffoldConfigUri; + if (message.skaffoldVersion != null && message.hasOwnProperty("skaffoldVersion")) + object.skaffoldVersion = message.skaffoldVersion; + if (message.targetArtifacts && (keys2 = Object.keys(message.targetArtifacts)).length) { + object.targetArtifacts = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetArtifacts[keys2[j]] = $root.google.cloud.deploy.v1.TargetArtifact.toObject(message.targetArtifacts[keys2[j]], options); + } + if (message.targetRenders && (keys2 = Object.keys(message.targetRenders)).length) { + object.targetRenders = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetRenders[keys2[j]] = $root.google.cloud.deploy.v1.Release.TargetRender.toObject(message.targetRenders[keys2[j]], options); + } + if (message.abandoned != null && message.hasOwnProperty("abandoned")) + object.abandoned = message.abandoned; + return object; + }; + + /** + * Converts this Release to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release + * @instance + * @returns {Object.} JSON object + */ + Release.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Release + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Release.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release"; + }; + + /** + * RenderState enum. + * @name google.cloud.deploy.v1.Release.RenderState + * @enum {number} + * @property {number} RENDER_STATE_UNSPECIFIED=0 RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + Release.RenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + Release.TargetRender = (function() { + + /** + * Properties of a TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @interface ITargetRender + * @property {string|null} [renderingBuild] TargetRender renderingBuild + * @property {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState|null} [renderingState] TargetRender renderingState + * @property {google.cloud.deploy.v1.Release.TargetRender.FailureCause|null} [failureCause] TargetRender failureCause + * @property {string|null} [failureMessage] TargetRender failureMessage + */ + + /** + * Constructs a new TargetRender. + * @memberof google.cloud.deploy.v1.Release + * @classdesc Represents a TargetRender. + * @implements ITargetRender + * @constructor + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + */ + function TargetRender(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]]; + } + + /** + * TargetRender renderingBuild. + * @member {string} renderingBuild + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingBuild = ""; + + /** + * TargetRender renderingState. + * @member {google.cloud.deploy.v1.Release.TargetRender.TargetRenderState} renderingState + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.renderingState = 0; + + /** + * TargetRender failureCause. + * @member {google.cloud.deploy.v1.Release.TargetRender.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureCause = 0; + + /** + * TargetRender failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + */ + TargetRender.prototype.failureMessage = ""; + + /** + * Creates a new TargetRender instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender instance + */ + TargetRender.create = function create(properties) { + return new TargetRender(properties); + }; + + /** + * Encodes the specified TargetRender message. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderingBuild != null && Object.hasOwnProperty.call(message, "renderingBuild")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderingBuild); + if (message.renderingState != null && Object.hasOwnProperty.call(message, "renderingState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.renderingState); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); + return writer; + }; + + /** + * Encodes the specified TargetRender message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Release.TargetRender.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.ITargetRender} message TargetRender message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetRender.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.renderingBuild = reader.string(); + break; + } + case 2: { + message.renderingState = reader.int32(); + break; + } + case 4: { + message.failureCause = reader.int32(); + break; + } + case 5: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetRender message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetRender.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetRender message. + * @function verify + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetRender.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + if (!$util.isString(message.renderingBuild)) + return "renderingBuild: string expected"; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + switch (message.renderingState) { + default: + return "renderingState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a TargetRender message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Release.TargetRender} TargetRender + */ + TargetRender.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Release.TargetRender) + return object; + var message = new $root.google.cloud.deploy.v1.Release.TargetRender(); + if (object.renderingBuild != null) + message.renderingBuild = String(object.renderingBuild); + switch (object.renderingState) { + case "TARGET_RENDER_STATE_UNSPECIFIED": + case 0: + message.renderingState = 0; + break; + case "SUCCEEDED": + case 1: + message.renderingState = 1; + break; + case "FAILED": + case 2: + message.renderingState = 2; + break; + case "IN_PROGRESS": + case 3: + message.renderingState = 3; + break; + } + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a TargetRender message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {google.cloud.deploy.v1.Release.TargetRender} message TargetRender + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetRender.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderingBuild = ""; + object.renderingState = options.enums === String ? "TARGET_RENDER_STATE_UNSPECIFIED" : 0; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + } + if (message.renderingBuild != null && message.hasOwnProperty("renderingBuild")) + object.renderingBuild = message.renderingBuild; + if (message.renderingState != null && message.hasOwnProperty("renderingState")) + object.renderingState = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.TargetRenderState[message.renderingState] : message.renderingState; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.Release.TargetRender.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + return object; + }; + + /** + * Converts this TargetRender to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @instance + * @returns {Object.} JSON object + */ + TargetRender.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetRender + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Release.TargetRender + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetRender.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Release.TargetRender"; + }; + + /** + * TargetRenderState enum. + * @name google.cloud.deploy.v1.Release.TargetRender.TargetRenderState + * @enum {number} + * @property {number} TARGET_RENDER_STATE_UNSPECIFIED=0 TARGET_RENDER_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + */ + TargetRender.TargetRenderState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_RENDER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + return values; + })(); + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.Release.TargetRender.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + */ + TargetRender.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + return values; + })(); + + return TargetRender; + })(); + + return Release; + })(); + + v1.BuildArtifact = (function() { + + /** + * Properties of a BuildArtifact. + * @memberof google.cloud.deploy.v1 + * @interface IBuildArtifact + * @property {string|null} [image] BuildArtifact image + * @property {string|null} [tag] BuildArtifact tag + */ + + /** + * Constructs a new BuildArtifact. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a BuildArtifact. + * @implements IBuildArtifact + * @constructor + * @param {google.cloud.deploy.v1.IBuildArtifact=} [properties] Properties to set + */ + function BuildArtifact(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]]; + } + + /** + * BuildArtifact image. + * @member {string} image + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + */ + BuildArtifact.prototype.image = ""; + + /** + * BuildArtifact tag. + * @member {string} tag + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + */ + BuildArtifact.prototype.tag = ""; + + /** + * Creates a new BuildArtifact instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact instance + */ + BuildArtifact.create = function create(properties) { + return new BuildArtifact(properties); + }; + + /** + * Encodes the specified BuildArtifact message. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact} message BuildArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.image); + return writer; + }; + + /** + * Encodes the specified BuildArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.BuildArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.IBuildArtifact} message BuildArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.BuildArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.image = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildArtifact message. + * @function verify + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a BuildArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.BuildArtifact} BuildArtifact + */ + BuildArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.BuildArtifact) + return object; + var message = new $root.google.cloud.deploy.v1.BuildArtifact(); + if (object.image != null) + message.image = String(object.image); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a BuildArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {google.cloud.deploy.v1.BuildArtifact} message BuildArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = ""; + object.image = ""; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + return object; + }; + + /** + * Converts this BuildArtifact to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.BuildArtifact + * @instance + * @returns {Object.} JSON object + */ + BuildArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildArtifact + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.BuildArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.BuildArtifact"; + }; + + return BuildArtifact; + })(); + + v1.TargetArtifact = (function() { + + /** + * Properties of a TargetArtifact. + * @memberof google.cloud.deploy.v1 + * @interface ITargetArtifact + * @property {string|null} [artifactUri] TargetArtifact artifactUri + * @property {string|null} [skaffoldConfigPath] TargetArtifact skaffoldConfigPath + * @property {string|null} [manifestPath] TargetArtifact manifestPath + */ + + /** + * Constructs a new TargetArtifact. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetArtifact. + * @implements ITargetArtifact + * @constructor + * @param {google.cloud.deploy.v1.ITargetArtifact=} [properties] Properties to set + */ + function TargetArtifact(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]]; + } + + /** + * TargetArtifact artifactUri. + * @member {string|null|undefined} artifactUri + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.artifactUri = null; + + /** + * TargetArtifact skaffoldConfigPath. + * @member {string} skaffoldConfigPath + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.skaffoldConfigPath = ""; + + /** + * TargetArtifact manifestPath. + * @member {string} manifestPath + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + TargetArtifact.prototype.manifestPath = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetArtifact uri. + * @member {"artifactUri"|undefined} uri + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + */ + Object.defineProperty(TargetArtifact.prototype, "uri", { + get: $util.oneOfGetter($oneOfFields = ["artifactUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetArtifact instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact instance + */ + TargetArtifact.create = function create(properties) { + return new TargetArtifact(properties); + }; + + /** + * Encodes the specified TargetArtifact message. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact} message TargetArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skaffoldConfigPath != null && Object.hasOwnProperty.call(message, "skaffoldConfigPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.skaffoldConfigPath); + if (message.manifestPath != null && Object.hasOwnProperty.call(message, "manifestPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.manifestPath); + if (message.artifactUri != null && Object.hasOwnProperty.call(message, "artifactUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.artifactUri); + return writer; + }; + + /** + * Encodes the specified TargetArtifact message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.ITargetArtifact} message TargetArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.artifactUri = reader.string(); + break; + } + case 2: { + message.skaffoldConfigPath = reader.string(); + break; + } + case 3: { + message.manifestPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetArtifact message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) { + properties.uri = 1; + if (!$util.isString(message.artifactUri)) + return "artifactUri: string expected"; + } + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + if (!$util.isString(message.skaffoldConfigPath)) + return "skaffoldConfigPath: string expected"; + if (message.manifestPath != null && message.hasOwnProperty("manifestPath")) + if (!$util.isString(message.manifestPath)) + return "manifestPath: string expected"; + return null; + }; + + /** + * Creates a TargetArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetArtifact} TargetArtifact + */ + TargetArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetArtifact) + return object; + var message = new $root.google.cloud.deploy.v1.TargetArtifact(); + if (object.artifactUri != null) + message.artifactUri = String(object.artifactUri); + if (object.skaffoldConfigPath != null) + message.skaffoldConfigPath = String(object.skaffoldConfigPath); + if (object.manifestPath != null) + message.manifestPath = String(object.manifestPath); + return message; + }; + + /** + * Creates a plain object from a TargetArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {google.cloud.deploy.v1.TargetArtifact} message TargetArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.skaffoldConfigPath = ""; + object.manifestPath = ""; + } + if (message.skaffoldConfigPath != null && message.hasOwnProperty("skaffoldConfigPath")) + object.skaffoldConfigPath = message.skaffoldConfigPath; + if (message.manifestPath != null && message.hasOwnProperty("manifestPath")) + object.manifestPath = message.manifestPath; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) { + object.artifactUri = message.artifactUri; + if (options.oneofs) + object.uri = "artifactUri"; + } + return object; + }; + + /** + * Converts this TargetArtifact to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetArtifact + * @instance + * @returns {Object.} JSON object + */ + TargetArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetArtifact + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetArtifact"; + }; + + return TargetArtifact; + })(); + + v1.ListReleasesRequest = (function() { + + /** + * Properties of a ListReleasesRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListReleasesRequest + * @property {string|null} [parent] ListReleasesRequest parent + * @property {number|null} [pageSize] ListReleasesRequest pageSize + * @property {string|null} [pageToken] ListReleasesRequest pageToken + * @property {string|null} [filter] ListReleasesRequest filter + * @property {string|null} [orderBy] ListReleasesRequest orderBy + */ + + /** + * Constructs a new ListReleasesRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListReleasesRequest. + * @implements IListReleasesRequest + * @constructor + * @param {google.cloud.deploy.v1.IListReleasesRequest=} [properties] Properties to set + */ + function ListReleasesRequest(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]]; + } + + /** + * ListReleasesRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.parent = ""; + + /** + * ListReleasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.pageSize = 0; + + /** + * ListReleasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.pageToken = ""; + + /** + * ListReleasesRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.filter = ""; + + /** + * ListReleasesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + */ + ListReleasesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListReleasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest instance + */ + ListReleasesRequest.create = function create(properties) { + return new ListReleasesRequest(properties); + }; + + /** + * Encodes the specified ListReleasesRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest} message ListReleasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListReleasesRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.IListReleasesRequest} message ListReleasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListReleasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReleasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReleasesRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReleasesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListReleasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListReleasesRequest} ListReleasesRequest + */ + ListReleasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListReleasesRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListReleasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListReleasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {google.cloud.deploy.v1.ListReleasesRequest} message ListReleasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReleasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListReleasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReleasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReleasesRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListReleasesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReleasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListReleasesRequest"; + }; + + return ListReleasesRequest; + })(); + + v1.ListReleasesResponse = (function() { + + /** + * Properties of a ListReleasesResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListReleasesResponse + * @property {Array.|null} [releases] ListReleasesResponse releases + * @property {string|null} [nextPageToken] ListReleasesResponse nextPageToken + * @property {Array.|null} [unreachable] ListReleasesResponse unreachable + */ + + /** + * Constructs a new ListReleasesResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListReleasesResponse. + * @implements IListReleasesResponse + * @constructor + * @param {google.cloud.deploy.v1.IListReleasesResponse=} [properties] Properties to set + */ + function ListReleasesResponse(properties) { + this.releases = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReleasesResponse releases. + * @member {Array.} releases + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.releases = $util.emptyArray; + + /** + * ListReleasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.nextPageToken = ""; + + /** + * ListReleasesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + */ + ListReleasesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListReleasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse instance + */ + ListReleasesResponse.create = function create(properties) { + return new ListReleasesResponse(properties); + }; + + /** + * Encodes the specified ListReleasesResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse} message ListReleasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.releases != null && message.releases.length) + for (var i = 0; i < message.releases.length; ++i) + $root.google.cloud.deploy.v1.Release.encode(message.releases[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListReleasesResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListReleasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.IListReleasesResponse} message ListReleasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReleasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListReleasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.releases && message.releases.length)) + message.releases = []; + message.releases.push($root.google.cloud.deploy.v1.Release.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReleasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReleasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReleasesResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReleasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.releases != null && message.hasOwnProperty("releases")) { + if (!Array.isArray(message.releases)) + return "releases: array expected"; + for (var i = 0; i < message.releases.length; ++i) { + var error = $root.google.cloud.deploy.v1.Release.verify(message.releases[i]); + if (error) + return "releases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListReleasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListReleasesResponse} ListReleasesResponse + */ + ListReleasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListReleasesResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListReleasesResponse(); + if (object.releases) { + if (!Array.isArray(object.releases)) + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.releases: array expected"); + message.releases = []; + for (var i = 0; i < object.releases.length; ++i) { + if (typeof object.releases[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.releases: object expected"); + message.releases[i] = $root.google.cloud.deploy.v1.Release.fromObject(object.releases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListReleasesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListReleasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {google.cloud.deploy.v1.ListReleasesResponse} message ListReleasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReleasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.releases = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.releases && message.releases.length) { + object.releases = []; + for (var j = 0; j < message.releases.length; ++j) + object.releases[j] = $root.google.cloud.deploy.v1.Release.toObject(message.releases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListReleasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReleasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReleasesResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListReleasesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReleasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListReleasesResponse"; + }; + + return ListReleasesResponse; + })(); + + v1.GetReleaseRequest = (function() { + + /** + * Properties of a GetReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetReleaseRequest + * @property {string|null} [name] GetReleaseRequest name + */ + + /** + * Constructs a new GetReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetReleaseRequest. + * @implements IGetReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetReleaseRequest=} [properties] Properties to set + */ + function GetReleaseRequest(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]]; + } + + /** + * GetReleaseRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @instance + */ + GetReleaseRequest.prototype.name = ""; + + /** + * Creates a new GetReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest instance + */ + GetReleaseRequest.create = function create(properties) { + return new GetReleaseRequest(properties); + }; + + /** + * Encodes the specified GetReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest} message GetReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReleaseRequest.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 GetReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IGetReleaseRequest} message GetReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetReleaseRequest(); + 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 GetReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReleaseRequest.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 GetReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetReleaseRequest} GetReleaseRequest + */ + GetReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetReleaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {google.cloud.deploy.v1.GetReleaseRequest} message GetReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReleaseRequest.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 GetReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetReleaseRequest"; + }; + + return GetReleaseRequest; + })(); + + v1.CreateReleaseRequest = (function() { + + /** + * Properties of a CreateReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateReleaseRequest + * @property {string|null} [parent] CreateReleaseRequest parent + * @property {string|null} [releaseId] CreateReleaseRequest releaseId + * @property {google.cloud.deploy.v1.IRelease|null} [release] CreateReleaseRequest release + * @property {string|null} [requestId] CreateReleaseRequest requestId + * @property {boolean|null} [validateOnly] CreateReleaseRequest validateOnly + */ + + /** + * Constructs a new CreateReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateReleaseRequest. + * @implements ICreateReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateReleaseRequest=} [properties] Properties to set + */ + function CreateReleaseRequest(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]]; + } + + /** + * CreateReleaseRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.parent = ""; + + /** + * CreateReleaseRequest releaseId. + * @member {string} releaseId + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.releaseId = ""; + + /** + * CreateReleaseRequest release. + * @member {google.cloud.deploy.v1.IRelease|null|undefined} release + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.release = null; + + /** + * CreateReleaseRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.requestId = ""; + + /** + * CreateReleaseRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + */ + CreateReleaseRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest instance + */ + CreateReleaseRequest.create = function create(properties) { + return new CreateReleaseRequest(properties); + }; + + /** + * Encodes the specified CreateReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} message CreateReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReleaseRequest.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.releaseId != null && Object.hasOwnProperty.call(message, "releaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.releaseId); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + $root.google.cloud.deploy.v1.Release.encode(message.release, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.ICreateReleaseRequest} message CreateReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateReleaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.releaseId = reader.string(); + break; + } + case 3: { + message.release = $root.google.cloud.deploy.v1.Release.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReleaseRequest.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.releaseId != null && message.hasOwnProperty("releaseId")) + if (!$util.isString(message.releaseId)) + return "releaseId: string expected"; + if (message.release != null && message.hasOwnProperty("release")) { + var error = $root.google.cloud.deploy.v1.Release.verify(message.release); + if (error) + return "release." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateReleaseRequest} CreateReleaseRequest + */ + CreateReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateReleaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.releaseId != null) + message.releaseId = String(object.releaseId); + if (object.release != null) { + if (typeof object.release !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateReleaseRequest.release: object expected"); + message.release = $root.google.cloud.deploy.v1.Release.fromObject(object.release); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {google.cloud.deploy.v1.CreateReleaseRequest} message CreateReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReleaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.releaseId = ""; + object.release = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.releaseId != null && message.hasOwnProperty("releaseId")) + object.releaseId = message.releaseId; + if (message.release != null && message.hasOwnProperty("release")) + object.release = $root.google.cloud.deploy.v1.Release.toObject(message.release, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateReleaseRequest"; + }; + + return CreateReleaseRequest; + })(); + + v1.Rollout = (function() { + + /** + * Properties of a Rollout. + * @memberof google.cloud.deploy.v1 + * @interface IRollout + * @property {string|null} [name] Rollout name + * @property {string|null} [uid] Rollout uid + * @property {string|null} [description] Rollout description + * @property {Object.|null} [annotations] Rollout annotations + * @property {Object.|null} [labels] Rollout labels + * @property {google.protobuf.ITimestamp|null} [createTime] Rollout createTime + * @property {google.protobuf.ITimestamp|null} [approveTime] Rollout approveTime + * @property {google.protobuf.ITimestamp|null} [enqueueTime] Rollout enqueueTime + * @property {google.protobuf.ITimestamp|null} [deployStartTime] Rollout deployStartTime + * @property {google.protobuf.ITimestamp|null} [deployEndTime] Rollout deployEndTime + * @property {string|null} [targetId] Rollout targetId + * @property {google.cloud.deploy.v1.Rollout.ApprovalState|null} [approvalState] Rollout approvalState + * @property {google.cloud.deploy.v1.Rollout.State|null} [state] Rollout state + * @property {string|null} [failureReason] Rollout failureReason + * @property {string|null} [deployingBuild] Rollout deployingBuild + * @property {string|null} [etag] Rollout etag + * @property {google.cloud.deploy.v1.Rollout.FailureCause|null} [deployFailureCause] Rollout deployFailureCause + * @property {Array.|null} [phases] Rollout phases + * @property {google.cloud.deploy.v1.IMetadata|null} [metadata] Rollout metadata + */ + + /** + * Constructs a new Rollout. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Rollout. + * @implements IRollout + * @constructor + * @param {google.cloud.deploy.v1.IRollout=} [properties] Properties to set + */ + function Rollout(properties) { + this.annotations = {}; + this.labels = {}; + this.phases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Rollout name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.name = ""; + + /** + * Rollout uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.uid = ""; + + /** + * Rollout description. + * @member {string} description + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.description = ""; + + /** + * Rollout annotations. + * @member {Object.} annotations + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.annotations = $util.emptyObject; + + /** + * Rollout labels. + * @member {Object.} labels + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.labels = $util.emptyObject; + + /** + * Rollout createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.createTime = null; + + /** + * Rollout approveTime. + * @member {google.protobuf.ITimestamp|null|undefined} approveTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.approveTime = null; + + /** + * Rollout enqueueTime. + * @member {google.protobuf.ITimestamp|null|undefined} enqueueTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.enqueueTime = null; + + /** + * Rollout deployStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployStartTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployStartTime = null; + + /** + * Rollout deployEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployEndTime + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployEndTime = null; + + /** + * Rollout targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.targetId = ""; + + /** + * Rollout approvalState. + * @member {google.cloud.deploy.v1.Rollout.ApprovalState} approvalState + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.approvalState = 0; + + /** + * Rollout state. + * @member {google.cloud.deploy.v1.Rollout.State} state + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.state = 0; + + /** + * Rollout failureReason. + * @member {string} failureReason + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.failureReason = ""; + + /** + * Rollout deployingBuild. + * @member {string} deployingBuild + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployingBuild = ""; + + /** + * Rollout etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.etag = ""; + + /** + * Rollout deployFailureCause. + * @member {google.cloud.deploy.v1.Rollout.FailureCause} deployFailureCause + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.deployFailureCause = 0; + + /** + * Rollout phases. + * @member {Array.} phases + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.phases = $util.emptyArray; + + /** + * Rollout metadata. + * @member {google.cloud.deploy.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.deploy.v1.Rollout + * @instance + */ + Rollout.prototype.metadata = null; + + /** + * Creates a new Rollout instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Rollout} Rollout instance + */ + Rollout.create = function create(properties) { + return new Rollout(properties); + }; + + /** + * Encodes the specified Rollout message. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.approveTime != null && Object.hasOwnProperty.call(message, "approveTime")) + $root.google.protobuf.Timestamp.encode(message.approveTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.enqueueTime != null && Object.hasOwnProperty.call(message, "enqueueTime")) + $root.google.protobuf.Timestamp.encode(message.enqueueTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deployStartTime != null && Object.hasOwnProperty.call(message, "deployStartTime")) + $root.google.protobuf.Timestamp.encode(message.deployStartTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deployEndTime != null && Object.hasOwnProperty.call(message, "deployEndTime")) + $root.google.protobuf.Timestamp.encode(message.deployEndTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.approvalState != null && Object.hasOwnProperty.call(message, "approvalState")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.approvalState); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.state); + if (message.failureReason != null && Object.hasOwnProperty.call(message, "failureReason")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.failureReason); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.etag); + if (message.deployingBuild != null && Object.hasOwnProperty.call(message, "deployingBuild")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.deployingBuild); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.targetId); + if (message.deployFailureCause != null && Object.hasOwnProperty.call(message, "deployFailureCause")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.deployFailureCause); + if (message.phases != null && message.phases.length) + for (var i = 0; i < message.phases.length; ++i) + $root.google.cloud.deploy.v1.Phase.encode(message.phases[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.deploy.v1.Metadata.encode(message.metadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rollout message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Rollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.IRollout} message Rollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Rollout(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.approveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.enqueueTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deployStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deployEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.targetId = reader.string(); + break; + } + case 12: { + message.approvalState = reader.int32(); + break; + } + case 13: { + message.state = reader.int32(); + break; + } + case 14: { + message.failureReason = reader.string(); + break; + } + case 17: { + message.deployingBuild = reader.string(); + break; + } + case 16: { + message.etag = reader.string(); + break; + } + case 19: { + message.deployFailureCause = reader.int32(); + break; + } + case 23: { + if (!(message.phases && message.phases.length)) + message.phases = []; + message.phases.push($root.google.cloud.deploy.v1.Phase.decode(reader, reader.uint32())); + break; + } + case 24: { + message.metadata = $root.google.cloud.deploy.v1.Metadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Rollout} Rollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rollout message. + * @function verify + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rollout.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k: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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.approveTime != null && message.hasOwnProperty("approveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.approveTime); + if (error) + return "approveTime." + error; + } + if (message.enqueueTime != null && message.hasOwnProperty("enqueueTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.enqueueTime); + if (error) + return "enqueueTime." + error; + } + if (message.deployStartTime != null && message.hasOwnProperty("deployStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployStartTime); + if (error) + return "deployStartTime." + error; + } + if (message.deployEndTime != null && message.hasOwnProperty("deployEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployEndTime); + if (error) + return "deployEndTime." + error; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + if (message.approvalState != null && message.hasOwnProperty("approvalState")) + switch (message.approvalState) { + default: + return "approvalState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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: + case 6: + case 7: + break; + } + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + if (!$util.isString(message.failureReason)) + return "failureReason: string expected"; + if (message.deployingBuild != null && message.hasOwnProperty("deployingBuild")) + if (!$util.isString(message.deployingBuild)) + return "deployingBuild: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.deployFailureCause != null && message.hasOwnProperty("deployFailureCause")) + switch (message.deployFailureCause) { + default: + return "deployFailureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.phases != null && message.hasOwnProperty("phases")) { + if (!Array.isArray(message.phases)) + return "phases: array expected"; + for (var i = 0; i < message.phases.length; ++i) { + var error = $root.google.cloud.deploy.v1.Phase.verify(message.phases[i]); + if (error) + return "phases." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.deploy.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a Rollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Rollout} Rollout + */ + Rollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Rollout) + return object; + var message = new $root.google.cloud.deploy.v1.Rollout(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.description != null) + message.description = String(object.description); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.approveTime != null) { + if (typeof object.approveTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.approveTime: object expected"); + message.approveTime = $root.google.protobuf.Timestamp.fromObject(object.approveTime); + } + if (object.enqueueTime != null) { + if (typeof object.enqueueTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.enqueueTime: object expected"); + message.enqueueTime = $root.google.protobuf.Timestamp.fromObject(object.enqueueTime); + } + if (object.deployStartTime != null) { + if (typeof object.deployStartTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.deployStartTime: object expected"); + message.deployStartTime = $root.google.protobuf.Timestamp.fromObject(object.deployStartTime); + } + if (object.deployEndTime != null) { + if (typeof object.deployEndTime !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.deployEndTime: object expected"); + message.deployEndTime = $root.google.protobuf.Timestamp.fromObject(object.deployEndTime); + } + if (object.targetId != null) + message.targetId = String(object.targetId); + switch (object.approvalState) { + case "APPROVAL_STATE_UNSPECIFIED": + case 0: + message.approvalState = 0; + break; + case "NEEDS_APPROVAL": + case 1: + message.approvalState = 1; + break; + case "DOES_NOT_NEED_APPROVAL": + case 2: + message.approvalState = 2; + break; + case "APPROVED": + case 3: + message.approvalState = 3; + break; + case "REJECTED": + case 4: + message.approvalState = 4; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SUCCEEDED": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "PENDING_APPROVAL": + case 4: + message.state = 4; + break; + case "APPROVAL_REJECTED": + case 5: + message.state = 5; + break; + case "PENDING": + case 6: + message.state = 6; + break; + case "PENDING_RELEASE": + case 7: + message.state = 7; + break; + } + if (object.failureReason != null) + message.failureReason = String(object.failureReason); + if (object.deployingBuild != null) + message.deployingBuild = String(object.deployingBuild); + if (object.etag != null) + message.etag = String(object.etag); + switch (object.deployFailureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.deployFailureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.deployFailureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.deployFailureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.deployFailureCause = 3; + break; + case "RELEASE_FAILED": + case 4: + message.deployFailureCause = 4; + break; + case "RELEASE_ABANDONED": + case 5: + message.deployFailureCause = 5; + break; + case "VERIFICATION_CONFIG_NOT_FOUND": + case 6: + message.deployFailureCause = 6; + break; + } + if (object.phases) { + if (!Array.isArray(object.phases)) + throw TypeError(".google.cloud.deploy.v1.Rollout.phases: array expected"); + message.phases = []; + for (var i = 0; i < object.phases.length; ++i) { + if (typeof object.phases[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.phases: object expected"); + message.phases[i] = $root.google.cloud.deploy.v1.Phase.fromObject(object.phases[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.deploy.v1.Rollout.metadata: object expected"); + message.metadata = $root.google.cloud.deploy.v1.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a Rollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {google.cloud.deploy.v1.Rollout} message Rollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phases = []; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.description = ""; + object.createTime = null; + object.approveTime = null; + object.enqueueTime = null; + object.deployStartTime = null; + object.deployEndTime = null; + object.approvalState = options.enums === String ? "APPROVAL_STATE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.failureReason = ""; + object.etag = ""; + object.deployingBuild = ""; + object.targetId = ""; + object.deployFailureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.metadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.approveTime != null && message.hasOwnProperty("approveTime")) + object.approveTime = $root.google.protobuf.Timestamp.toObject(message.approveTime, options); + if (message.enqueueTime != null && message.hasOwnProperty("enqueueTime")) + object.enqueueTime = $root.google.protobuf.Timestamp.toObject(message.enqueueTime, options); + if (message.deployStartTime != null && message.hasOwnProperty("deployStartTime")) + object.deployStartTime = $root.google.protobuf.Timestamp.toObject(message.deployStartTime, options); + if (message.deployEndTime != null && message.hasOwnProperty("deployEndTime")) + object.deployEndTime = $root.google.protobuf.Timestamp.toObject(message.deployEndTime, options); + if (message.approvalState != null && message.hasOwnProperty("approvalState")) + object.approvalState = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.ApprovalState[message.approvalState] : message.approvalState; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.State[message.state] : message.state; + if (message.failureReason != null && message.hasOwnProperty("failureReason")) + object.failureReason = message.failureReason; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.deployingBuild != null && message.hasOwnProperty("deployingBuild")) + object.deployingBuild = message.deployingBuild; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.deployFailureCause != null && message.hasOwnProperty("deployFailureCause")) + object.deployFailureCause = options.enums === String ? $root.google.cloud.deploy.v1.Rollout.FailureCause[message.deployFailureCause] : message.deployFailureCause; + if (message.phases && message.phases.length) { + object.phases = []; + for (var j = 0; j < message.phases.length; ++j) + object.phases[j] = $root.google.cloud.deploy.v1.Phase.toObject(message.phases[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.deploy.v1.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this Rollout to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Rollout + * @instance + * @returns {Object.} JSON object + */ + Rollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rollout + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Rollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Rollout"; + }; + + /** + * ApprovalState enum. + * @name google.cloud.deploy.v1.Rollout.ApprovalState + * @enum {number} + * @property {number} APPROVAL_STATE_UNSPECIFIED=0 APPROVAL_STATE_UNSPECIFIED value + * @property {number} NEEDS_APPROVAL=1 NEEDS_APPROVAL value + * @property {number} DOES_NOT_NEED_APPROVAL=2 DOES_NOT_NEED_APPROVAL value + * @property {number} APPROVED=3 APPROVED value + * @property {number} REJECTED=4 REJECTED value + */ + Rollout.ApprovalState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "APPROVAL_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEEDS_APPROVAL"] = 1; + values[valuesById[2] = "DOES_NOT_NEED_APPROVAL"] = 2; + values[valuesById[3] = "APPROVED"] = 3; + values[valuesById[4] = "REJECTED"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.deploy.v1.Rollout.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} PENDING_APPROVAL=4 PENDING_APPROVAL value + * @property {number} APPROVAL_REJECTED=5 APPROVAL_REJECTED value + * @property {number} PENDING=6 PENDING value + * @property {number} PENDING_RELEASE=7 PENDING_RELEASE value + */ + Rollout.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "PENDING_APPROVAL"] = 4; + values[valuesById[5] = "APPROVAL_REJECTED"] = 5; + values[valuesById[6] = "PENDING"] = 6; + values[valuesById[7] = "PENDING_RELEASE"] = 7; + return values; + })(); + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.Rollout.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + * @property {number} RELEASE_FAILED=4 RELEASE_FAILED value + * @property {number} RELEASE_ABANDONED=5 RELEASE_ABANDONED value + * @property {number} VERIFICATION_CONFIG_NOT_FOUND=6 VERIFICATION_CONFIG_NOT_FOUND value + */ + Rollout.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + values[valuesById[4] = "RELEASE_FAILED"] = 4; + values[valuesById[5] = "RELEASE_ABANDONED"] = 5; + values[valuesById[6] = "VERIFICATION_CONFIG_NOT_FOUND"] = 6; + return values; + })(); + + return Rollout; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.deploy.v1 + * @interface IMetadata + * @property {google.cloud.deploy.v1.ICloudRunMetadata|null} [cloudRun] Metadata cloudRun + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.deploy.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(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]]; + } + + /** + * Metadata cloudRun. + * @member {google.cloud.deploy.v1.ICloudRunMetadata|null|undefined} cloudRun + * @memberof google.cloud.deploy.v1.Metadata + * @instance + */ + Metadata.prototype.cloudRun = null; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudRun != null && Object.hasOwnProperty.call(message, "cloudRun")) + $root.google.cloud.deploy.v1.CloudRunMetadata.encode(message.cloudRun, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + var error = $root.google.cloud.deploy.v1.CloudRunMetadata.verify(message.cloudRun); + if (error) + return "cloudRun." + error; + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Metadata) + return object; + var message = new $root.google.cloud.deploy.v1.Metadata(); + if (object.cloudRun != null) { + if (typeof object.cloudRun !== "object") + throw TypeError(".google.cloud.deploy.v1.Metadata.cloudRun: object expected"); + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.fromObject(object.cloudRun); + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {google.cloud.deploy.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudRun = null; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) + object.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.toObject(message.cloudRun, options); + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Metadata"; + }; + + return Metadata; + })(); + + v1.DeployJobRunMetadata = (function() { + + /** + * Properties of a DeployJobRunMetadata. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJobRunMetadata + * @property {google.cloud.deploy.v1.ICloudRunMetadata|null} [cloudRun] DeployJobRunMetadata cloudRun + */ + + /** + * Constructs a new DeployJobRunMetadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJobRunMetadata. + * @implements IDeployJobRunMetadata + * @constructor + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata=} [properties] Properties to set + */ + function DeployJobRunMetadata(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]]; + } + + /** + * DeployJobRunMetadata cloudRun. + * @member {google.cloud.deploy.v1.ICloudRunMetadata|null|undefined} cloudRun + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @instance + */ + DeployJobRunMetadata.prototype.cloudRun = null; + + /** + * Creates a new DeployJobRunMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata instance + */ + DeployJobRunMetadata.create = function create(properties) { + return new DeployJobRunMetadata(properties); + }; + + /** + * Encodes the specified DeployJobRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata} message DeployJobRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRunMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudRun != null && Object.hasOwnProperty.call(message, "cloudRun")) + $root.google.cloud.deploy.v1.CloudRunMetadata.encode(message.cloudRun, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployJobRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRunMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.IDeployJobRunMetadata} message DeployJobRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRunMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRunMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJobRunMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJobRunMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRunMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJobRunMetadata message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJobRunMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + var error = $root.google.cloud.deploy.v1.CloudRunMetadata.verify(message.cloudRun); + if (error) + return "cloudRun." + error; + } + return null; + }; + + /** + * Creates a DeployJobRunMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJobRunMetadata} DeployJobRunMetadata + */ + DeployJobRunMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJobRunMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.DeployJobRunMetadata(); + if (object.cloudRun != null) { + if (typeof object.cloudRun !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployJobRunMetadata.cloudRun: object expected"); + message.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.fromObject(object.cloudRun); + } + return message; + }; + + /** + * Creates a plain object from a DeployJobRunMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {google.cloud.deploy.v1.DeployJobRunMetadata} message DeployJobRunMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJobRunMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cloudRun = null; + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) + object.cloudRun = $root.google.cloud.deploy.v1.CloudRunMetadata.toObject(message.cloudRun, options); + return object; + }; + + /** + * Converts this DeployJobRunMetadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployJobRunMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJobRunMetadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJobRunMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJobRunMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJobRunMetadata"; + }; + + return DeployJobRunMetadata; + })(); + + v1.CloudRunMetadata = (function() { + + /** + * Properties of a CloudRunMetadata. + * @memberof google.cloud.deploy.v1 + * @interface ICloudRunMetadata + * @property {string|null} [service] CloudRunMetadata service + * @property {Array.|null} [serviceUrls] CloudRunMetadata serviceUrls + * @property {string|null} [revision] CloudRunMetadata revision + */ + + /** + * Constructs a new CloudRunMetadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CloudRunMetadata. + * @implements ICloudRunMetadata + * @constructor + * @param {google.cloud.deploy.v1.ICloudRunMetadata=} [properties] Properties to set + */ + function CloudRunMetadata(properties) { + this.serviceUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudRunMetadata service. + * @member {string} service + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.service = ""; + + /** + * CloudRunMetadata serviceUrls. + * @member {Array.} serviceUrls + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.serviceUrls = $util.emptyArray; + + /** + * CloudRunMetadata revision. + * @member {string} revision + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + */ + CloudRunMetadata.prototype.revision = ""; + + /** + * Creates a new CloudRunMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata instance + */ + CloudRunMetadata.create = function create(properties) { + return new CloudRunMetadata(properties); + }; + + /** + * Encodes the specified CloudRunMetadata message. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata} message CloudRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.serviceUrls != null && message.serviceUrls.length) + for (var i = 0; i < message.serviceUrls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceUrls[i]); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.revision); + return writer; + }; + + /** + * Encodes the specified CloudRunMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CloudRunMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.ICloudRunMetadata} message CloudRunMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRunMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CloudRunMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 2: { + if (!(message.serviceUrls && message.serviceUrls.length)) + message.serviceUrls = []; + message.serviceUrls.push(reader.string()); + break; + } + case 3: { + message.revision = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudRunMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRunMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudRunMetadata message. + * @function verify + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudRunMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.serviceUrls != null && message.hasOwnProperty("serviceUrls")) { + if (!Array.isArray(message.serviceUrls)) + return "serviceUrls: array expected"; + for (var i = 0; i < message.serviceUrls.length; ++i) + if (!$util.isString(message.serviceUrls[i])) + return "serviceUrls: string[] expected"; + } + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + return null; + }; + + /** + * Creates a CloudRunMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CloudRunMetadata} CloudRunMetadata + */ + CloudRunMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CloudRunMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.CloudRunMetadata(); + if (object.service != null) + message.service = String(object.service); + if (object.serviceUrls) { + if (!Array.isArray(object.serviceUrls)) + throw TypeError(".google.cloud.deploy.v1.CloudRunMetadata.serviceUrls: array expected"); + message.serviceUrls = []; + for (var i = 0; i < object.serviceUrls.length; ++i) + message.serviceUrls[i] = String(object.serviceUrls[i]); + } + if (object.revision != null) + message.revision = String(object.revision); + return message; + }; + + /** + * Creates a plain object from a CloudRunMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {google.cloud.deploy.v1.CloudRunMetadata} message CloudRunMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudRunMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceUrls = []; + if (options.defaults) { + object.service = ""; + object.revision = ""; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.serviceUrls && message.serviceUrls.length) { + object.serviceUrls = []; + for (var j = 0; j < message.serviceUrls.length; ++j) + object.serviceUrls[j] = message.serviceUrls[j]; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + return object; + }; + + /** + * Converts this CloudRunMetadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @instance + * @returns {Object.} JSON object + */ + CloudRunMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudRunMetadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CloudRunMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudRunMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CloudRunMetadata"; + }; + + return CloudRunMetadata; + })(); + + v1.Phase = (function() { + + /** + * Properties of a Phase. + * @memberof google.cloud.deploy.v1 + * @interface IPhase + * @property {string|null} [id] Phase id + * @property {google.cloud.deploy.v1.Phase.State|null} [state] Phase state + * @property {google.cloud.deploy.v1.IDeploymentJobs|null} [deploymentJobs] Phase deploymentJobs + */ + + /** + * Constructs a new Phase. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Phase. + * @implements IPhase + * @constructor + * @param {google.cloud.deploy.v1.IPhase=} [properties] Properties to set + */ + function Phase(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]]; + } + + /** + * Phase id. + * @member {string} id + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.id = ""; + + /** + * Phase state. + * @member {google.cloud.deploy.v1.Phase.State} state + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.state = 0; + + /** + * Phase deploymentJobs. + * @member {google.cloud.deploy.v1.IDeploymentJobs|null|undefined} deploymentJobs + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Phase.prototype.deploymentJobs = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Phase jobs. + * @member {"deploymentJobs"|undefined} jobs + * @memberof google.cloud.deploy.v1.Phase + * @instance + */ + Object.defineProperty(Phase.prototype, "jobs", { + get: $util.oneOfGetter($oneOfFields = ["deploymentJobs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Phase instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Phase} Phase instance + */ + Phase.create = function create(properties) { + return new Phase(properties); + }; + + /** + * Encodes the specified Phase message. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase} message Phase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.deploymentJobs != null && Object.hasOwnProperty.call(message, "deploymentJobs")) + $root.google.cloud.deploy.v1.DeploymentJobs.encode(message.deploymentJobs, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Phase message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Phase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.IPhase} message Phase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Phase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Phase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Phase} Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Phase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Phase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Phase} Phase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Phase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Phase message. + * @function verify + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Phase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string 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.deploymentJobs != null && message.hasOwnProperty("deploymentJobs")) { + properties.jobs = 1; + { + var error = $root.google.cloud.deploy.v1.DeploymentJobs.verify(message.deploymentJobs); + if (error) + return "deploymentJobs." + error; + } + } + return null; + }; + + /** + * Creates a Phase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Phase} Phase + */ + Phase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Phase) + return object; + var message = new $root.google.cloud.deploy.v1.Phase(); + if (object.id != null) + message.id = String(object.id); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "IN_PROGRESS": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "ABORTED": + case 5: + message.state = 5; + break; + } + if (object.deploymentJobs != null) { + if (typeof object.deploymentJobs !== "object") + throw TypeError(".google.cloud.deploy.v1.Phase.deploymentJobs: object expected"); + message.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.fromObject(object.deploymentJobs); + } + return message; + }; + + /** + * Creates a plain object from a Phase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {google.cloud.deploy.v1.Phase} message Phase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Phase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Phase.State[message.state] : message.state; + if (message.deploymentJobs != null && message.hasOwnProperty("deploymentJobs")) { + object.deploymentJobs = $root.google.cloud.deploy.v1.DeploymentJobs.toObject(message.deploymentJobs, options); + if (options.oneofs) + object.jobs = "deploymentJobs"; + } + return object; + }; + + /** + * Converts this Phase to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Phase + * @instance + * @returns {Object.} JSON object + */ + Phase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Phase + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Phase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Phase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Phase"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.Phase.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} IN_PROGRESS=2 IN_PROGRESS value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} ABORTED=5 ABORTED value + */ + Phase.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "IN_PROGRESS"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "ABORTED"] = 5; + return values; + })(); + + return Phase; + })(); + + v1.DeploymentJobs = (function() { + + /** + * Properties of a DeploymentJobs. + * @memberof google.cloud.deploy.v1 + * @interface IDeploymentJobs + * @property {google.cloud.deploy.v1.IJob|null} [deployJob] DeploymentJobs deployJob + * @property {google.cloud.deploy.v1.IJob|null} [verifyJob] DeploymentJobs verifyJob + */ + + /** + * Constructs a new DeploymentJobs. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeploymentJobs. + * @implements IDeploymentJobs + * @constructor + * @param {google.cloud.deploy.v1.IDeploymentJobs=} [properties] Properties to set + */ + function DeploymentJobs(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]]; + } + + /** + * DeploymentJobs deployJob. + * @member {google.cloud.deploy.v1.IJob|null|undefined} deployJob + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + */ + DeploymentJobs.prototype.deployJob = null; + + /** + * DeploymentJobs verifyJob. + * @member {google.cloud.deploy.v1.IJob|null|undefined} verifyJob + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + */ + DeploymentJobs.prototype.verifyJob = null; + + /** + * Creates a new DeploymentJobs instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs instance + */ + DeploymentJobs.create = function create(properties) { + return new DeploymentJobs(properties); + }; + + /** + * Encodes the specified DeploymentJobs message. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs} message DeploymentJobs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeploymentJobs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployJob != null && Object.hasOwnProperty.call(message, "deployJob")) + $root.google.cloud.deploy.v1.Job.encode(message.deployJob, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.verifyJob != null && Object.hasOwnProperty.call(message, "verifyJob")) + $root.google.cloud.deploy.v1.Job.encode(message.verifyJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeploymentJobs message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeploymentJobs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.IDeploymentJobs} message DeploymentJobs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeploymentJobs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeploymentJobs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeploymentJobs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployJob = $root.google.cloud.deploy.v1.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.verifyJob = $root.google.cloud.deploy.v1.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeploymentJobs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeploymentJobs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeploymentJobs message. + * @function verify + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeploymentJobs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + var error = $root.google.cloud.deploy.v1.Job.verify(message.deployJob); + if (error) + return "deployJob." + error; + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + var error = $root.google.cloud.deploy.v1.Job.verify(message.verifyJob); + if (error) + return "verifyJob." + error; + } + return null; + }; + + /** + * Creates a DeploymentJobs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeploymentJobs} DeploymentJobs + */ + DeploymentJobs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeploymentJobs) + return object; + var message = new $root.google.cloud.deploy.v1.DeploymentJobs(); + if (object.deployJob != null) { + if (typeof object.deployJob !== "object") + throw TypeError(".google.cloud.deploy.v1.DeploymentJobs.deployJob: object expected"); + message.deployJob = $root.google.cloud.deploy.v1.Job.fromObject(object.deployJob); + } + if (object.verifyJob != null) { + if (typeof object.verifyJob !== "object") + throw TypeError(".google.cloud.deploy.v1.DeploymentJobs.verifyJob: object expected"); + message.verifyJob = $root.google.cloud.deploy.v1.Job.fromObject(object.verifyJob); + } + return message; + }; + + /** + * Creates a plain object from a DeploymentJobs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {google.cloud.deploy.v1.DeploymentJobs} message DeploymentJobs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeploymentJobs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployJob = null; + object.verifyJob = null; + } + if (message.deployJob != null && message.hasOwnProperty("deployJob")) + object.deployJob = $root.google.cloud.deploy.v1.Job.toObject(message.deployJob, options); + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) + object.verifyJob = $root.google.cloud.deploy.v1.Job.toObject(message.verifyJob, options); + return object; + }; + + /** + * Converts this DeploymentJobs to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @instance + * @returns {Object.} JSON object + */ + DeploymentJobs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeploymentJobs + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeploymentJobs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeploymentJobs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeploymentJobs"; + }; + + return DeploymentJobs; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.deploy.v1 + * @interface IJob + * @property {string|null} [id] Job id + * @property {google.cloud.deploy.v1.Job.State|null} [state] Job state + * @property {string|null} [jobRun] Job jobRun + * @property {google.cloud.deploy.v1.IDeployJob|null} [deployJob] Job deployJob + * @property {google.cloud.deploy.v1.IVerifyJob|null} [verifyJob] Job verifyJob + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.deploy.v1.IJob=} [properties] Properties to set + */ + function Job(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]]; + } + + /** + * Job id. + * @member {string} id + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.id = ""; + + /** + * Job state. + * @member {google.cloud.deploy.v1.Job.State} state + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.state = 0; + + /** + * Job jobRun. + * @member {string} jobRun + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.jobRun = ""; + + /** + * Job deployJob. + * @member {google.cloud.deploy.v1.IDeployJob|null|undefined} deployJob + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.deployJob = null; + + /** + * Job verifyJob. + * @member {google.cloud.deploy.v1.IVerifyJob|null|undefined} verifyJob + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Job.prototype.verifyJob = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Job jobType. + * @member {"deployJob"|"verifyJob"|undefined} jobType + * @memberof google.cloud.deploy.v1.Job + * @instance + */ + Object.defineProperty(Job.prototype, "jobType", { + get: $util.oneOfGetter($oneOfFields = ["deployJob", "verifyJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.jobRun != null && Object.hasOwnProperty.call(message, "jobRun")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobRun); + if (message.deployJob != null && Object.hasOwnProperty.call(message, "deployJob")) + $root.google.cloud.deploy.v1.DeployJob.encode(message.deployJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.verifyJob != null && Object.hasOwnProperty.call(message, "verifyJob")) + $root.google.cloud.deploy.v1.VerifyJob.encode(message.verifyJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Job(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.jobRun = reader.string(); + break; + } + case 4: { + message.deployJob = $root.google.cloud.deploy.v1.DeployJob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string 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: + case 6: + break; + } + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + if (!$util.isString(message.jobRun)) + return "jobRun: string expected"; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + properties.jobType = 1; + { + var error = $root.google.cloud.deploy.v1.DeployJob.verify(message.deployJob); + if (error) + return "deployJob." + error; + } + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.deploy.v1.VerifyJob.verify(message.verifyJob); + if (error) + return "verifyJob." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Job) + return object; + var message = new $root.google.cloud.deploy.v1.Job(); + if (object.id != null) + message.id = String(object.id); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "ABORTED": + case 6: + message.state = 6; + break; + } + if (object.jobRun != null) + message.jobRun = String(object.jobRun); + if (object.deployJob != null) { + if (typeof object.deployJob !== "object") + throw TypeError(".google.cloud.deploy.v1.Job.deployJob: object expected"); + message.deployJob = $root.google.cloud.deploy.v1.DeployJob.fromObject(object.deployJob); + } + if (object.verifyJob != null) { + if (typeof object.verifyJob !== "object") + throw TypeError(".google.cloud.deploy.v1.Job.verifyJob: object expected"); + message.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.fromObject(object.verifyJob); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {google.cloud.deploy.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.jobRun = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.Job.State[message.state] : message.state; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + object.jobRun = message.jobRun; + if (message.deployJob != null && message.hasOwnProperty("deployJob")) { + object.deployJob = $root.google.cloud.deploy.v1.DeployJob.toObject(message.deployJob, options); + if (options.oneofs) + object.jobType = "deployJob"; + } + if (message.verifyJob != null && message.hasOwnProperty("verifyJob")) { + object.verifyJob = $root.google.cloud.deploy.v1.VerifyJob.toObject(message.verifyJob, options); + if (options.oneofs) + object.jobType = "verifyJob"; + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Job"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.Job.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} DISABLED=2 DISABLED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} ABORTED=6 ABORTED value + */ + Job.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "ABORTED"] = 6; + return values; + })(); + + return Job; + })(); + + v1.DeployJob = (function() { + + /** + * Properties of a DeployJob. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJob + */ + + /** + * Constructs a new DeployJob. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJob. + * @implements IDeployJob + * @constructor + * @param {google.cloud.deploy.v1.IDeployJob=} [properties] Properties to set + */ + function DeployJob(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 DeployJob instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob instance + */ + DeployJob.create = function create(properties) { + return new DeployJob(properties); + }; + + /** + * Encodes the specified DeployJob message. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob} message DeployJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.IDeployJob} message DeployJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJob message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJob} DeployJob + */ + DeployJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJob) + return object; + return new $root.google.cloud.deploy.v1.DeployJob(); + }; + + /** + * Creates a plain object from a DeployJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {google.cloud.deploy.v1.DeployJob} message DeployJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJob.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployJob to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJob + * @instance + * @returns {Object.} JSON object + */ + DeployJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJob + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJob"; + }; + + return DeployJob; + })(); + + v1.VerifyJob = (function() { + + /** + * Properties of a VerifyJob. + * @memberof google.cloud.deploy.v1 + * @interface IVerifyJob + */ + + /** + * Constructs a new VerifyJob. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a VerifyJob. + * @implements IVerifyJob + * @constructor + * @param {google.cloud.deploy.v1.IVerifyJob=} [properties] Properties to set + */ + function VerifyJob(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 VerifyJob instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob instance + */ + VerifyJob.create = function create(properties) { + return new VerifyJob(properties); + }; + + /** + * Encodes the specified VerifyJob message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob} message VerifyJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VerifyJob message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.IVerifyJob} message VerifyJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifyJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.VerifyJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VerifyJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifyJob message. + * @function verify + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifyJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VerifyJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.VerifyJob} VerifyJob + */ + VerifyJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.VerifyJob) + return object; + return new $root.google.cloud.deploy.v1.VerifyJob(); + }; + + /** + * Creates a plain object from a VerifyJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {google.cloud.deploy.v1.VerifyJob} message VerifyJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifyJob.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VerifyJob to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.VerifyJob + * @instance + * @returns {Object.} JSON object + */ + VerifyJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifyJob + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.VerifyJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifyJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.VerifyJob"; + }; + + return VerifyJob; + })(); + + v1.ListRolloutsRequest = (function() { + + /** + * Properties of a ListRolloutsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListRolloutsRequest + * @property {string|null} [parent] ListRolloutsRequest parent + * @property {number|null} [pageSize] ListRolloutsRequest pageSize + * @property {string|null} [pageToken] ListRolloutsRequest pageToken + * @property {string|null} [filter] ListRolloutsRequest filter + * @property {string|null} [orderBy] ListRolloutsRequest orderBy + */ + + /** + * Constructs a new ListRolloutsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListRolloutsRequest. + * @implements IListRolloutsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListRolloutsRequest=} [properties] Properties to set + */ + function ListRolloutsRequest(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]]; + } + + /** + * ListRolloutsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.parent = ""; + + /** + * ListRolloutsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.pageSize = 0; + + /** + * ListRolloutsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.pageToken = ""; + + /** + * ListRolloutsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.filter = ""; + + /** + * ListRolloutsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + */ + ListRolloutsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRolloutsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest instance + */ + ListRolloutsRequest.create = function create(properties) { + return new ListRolloutsRequest(properties); + }; + + /** + * Encodes the specified ListRolloutsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest} message ListRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListRolloutsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.IListRolloutsRequest} message ListRolloutsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListRolloutsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRolloutsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRolloutsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRolloutsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListRolloutsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListRolloutsRequest} ListRolloutsRequest + */ + ListRolloutsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListRolloutsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListRolloutsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListRolloutsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {google.cloud.deploy.v1.ListRolloutsRequest} message ListRolloutsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRolloutsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListRolloutsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRolloutsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRolloutsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListRolloutsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRolloutsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListRolloutsRequest"; + }; + + return ListRolloutsRequest; + })(); + + v1.ListRolloutsResponse = (function() { + + /** + * Properties of a ListRolloutsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListRolloutsResponse + * @property {Array.|null} [rollouts] ListRolloutsResponse rollouts + * @property {string|null} [nextPageToken] ListRolloutsResponse nextPageToken + * @property {Array.|null} [unreachable] ListRolloutsResponse unreachable + */ + + /** + * Constructs a new ListRolloutsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListRolloutsResponse. + * @implements IListRolloutsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListRolloutsResponse=} [properties] Properties to set + */ + function ListRolloutsResponse(properties) { + this.rollouts = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRolloutsResponse rollouts. + * @member {Array.} rollouts + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.rollouts = $util.emptyArray; + + /** + * ListRolloutsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.nextPageToken = ""; + + /** + * ListRolloutsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + */ + ListRolloutsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRolloutsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse instance + */ + ListRolloutsResponse.create = function create(properties) { + return new ListRolloutsResponse(properties); + }; + + /** + * Encodes the specified ListRolloutsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse} message ListRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollouts != null && message.rollouts.length) + for (var i = 0; i < message.rollouts.length; ++i) + $root.google.cloud.deploy.v1.Rollout.encode(message.rollouts[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListRolloutsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListRolloutsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.IListRolloutsResponse} message ListRolloutsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRolloutsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListRolloutsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rollouts && message.rollouts.length)) + message.rollouts = []; + message.rollouts.push($root.google.cloud.deploy.v1.Rollout.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRolloutsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRolloutsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRolloutsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRolloutsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollouts != null && message.hasOwnProperty("rollouts")) { + if (!Array.isArray(message.rollouts)) + return "rollouts: array expected"; + for (var i = 0; i < message.rollouts.length; ++i) { + var error = $root.google.cloud.deploy.v1.Rollout.verify(message.rollouts[i]); + if (error) + return "rollouts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListRolloutsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListRolloutsResponse} ListRolloutsResponse + */ + ListRolloutsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListRolloutsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListRolloutsResponse(); + if (object.rollouts) { + if (!Array.isArray(object.rollouts)) + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.rollouts: array expected"); + message.rollouts = []; + for (var i = 0; i < object.rollouts.length; ++i) { + if (typeof object.rollouts[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.rollouts: object expected"); + message.rollouts[i] = $root.google.cloud.deploy.v1.Rollout.fromObject(object.rollouts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListRolloutsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListRolloutsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {google.cloud.deploy.v1.ListRolloutsResponse} message ListRolloutsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRolloutsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rollouts = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.rollouts && message.rollouts.length) { + object.rollouts = []; + for (var j = 0; j < message.rollouts.length; ++j) + object.rollouts[j] = $root.google.cloud.deploy.v1.Rollout.toObject(message.rollouts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListRolloutsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRolloutsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRolloutsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListRolloutsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRolloutsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListRolloutsResponse"; + }; + + return ListRolloutsResponse; + })(); + + v1.GetRolloutRequest = (function() { + + /** + * Properties of a GetRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetRolloutRequest + * @property {string|null} [name] GetRolloutRequest name + */ + + /** + * Constructs a new GetRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetRolloutRequest. + * @implements IGetRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetRolloutRequest=} [properties] Properties to set + */ + function GetRolloutRequest(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]]; + } + + /** + * GetRolloutRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @instance + */ + GetRolloutRequest.prototype.name = ""; + + /** + * Creates a new GetRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest instance + */ + GetRolloutRequest.create = function create(properties) { + return new GetRolloutRequest(properties); + }; + + /** + * Encodes the specified GetRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest} message GetRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRolloutRequest.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 GetRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IGetRolloutRequest} message GetRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetRolloutRequest(); + 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 GetRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRolloutRequest.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 GetRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetRolloutRequest} GetRolloutRequest + */ + GetRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {google.cloud.deploy.v1.GetRolloutRequest} message GetRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRolloutRequest.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 GetRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + GetRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetRolloutRequest"; + }; + + return GetRolloutRequest; + })(); + + v1.CreateRolloutRequest = (function() { + + /** + * Properties of a CreateRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface ICreateRolloutRequest + * @property {string|null} [parent] CreateRolloutRequest parent + * @property {string|null} [rolloutId] CreateRolloutRequest rolloutId + * @property {google.cloud.deploy.v1.IRollout|null} [rollout] CreateRolloutRequest rollout + * @property {string|null} [requestId] CreateRolloutRequest requestId + * @property {boolean|null} [validateOnly] CreateRolloutRequest validateOnly + */ + + /** + * Constructs a new CreateRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a CreateRolloutRequest. + * @implements ICreateRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.ICreateRolloutRequest=} [properties] Properties to set + */ + function CreateRolloutRequest(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]]; + } + + /** + * CreateRolloutRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.parent = ""; + + /** + * CreateRolloutRequest rolloutId. + * @member {string} rolloutId + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.rolloutId = ""; + + /** + * CreateRolloutRequest rollout. + * @member {google.cloud.deploy.v1.IRollout|null|undefined} rollout + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.rollout = null; + + /** + * CreateRolloutRequest requestId. + * @member {string} requestId + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.requestId = ""; + + /** + * CreateRolloutRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + */ + CreateRolloutRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest instance + */ + CreateRolloutRequest.create = function create(properties) { + return new CreateRolloutRequest(properties); + }; + + /** + * Encodes the specified CreateRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} message CreateRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRolloutRequest.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.rolloutId != null && Object.hasOwnProperty.call(message, "rolloutId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolloutId); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.deploy.v1.Rollout.encode(message.rollout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.CreateRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ICreateRolloutRequest} message CreateRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.CreateRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.rolloutId = reader.string(); + break; + } + case 3: { + message.rollout = $root.google.cloud.deploy.v1.Rollout.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRolloutRequest.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.rolloutId != null && message.hasOwnProperty("rolloutId")) + if (!$util.isString(message.rolloutId)) + return "rolloutId: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.deploy.v1.Rollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.CreateRolloutRequest} CreateRolloutRequest + */ + CreateRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.CreateRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.CreateRolloutRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.rolloutId != null) + message.rolloutId = String(object.rolloutId); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.deploy.v1.CreateRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.deploy.v1.Rollout.fromObject(object.rollout); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {google.cloud.deploy.v1.CreateRolloutRequest} message CreateRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.rolloutId = ""; + object.rollout = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.rolloutId != null && message.hasOwnProperty("rolloutId")) + object.rolloutId = message.rolloutId; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.deploy.v1.Rollout.toObject(message.rollout, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.CreateRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.CreateRolloutRequest"; + }; + + return CreateRolloutRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.deploy.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.deploy.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.deploy.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.deploy.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.deploy.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {google.cloud.deploy.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ApproveRolloutRequest = (function() { + + /** + * Properties of an ApproveRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @interface IApproveRolloutRequest + * @property {string|null} [name] ApproveRolloutRequest name + * @property {boolean|null} [approved] ApproveRolloutRequest approved + */ + + /** + * Constructs a new ApproveRolloutRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ApproveRolloutRequest. + * @implements IApproveRolloutRequest + * @constructor + * @param {google.cloud.deploy.v1.IApproveRolloutRequest=} [properties] Properties to set + */ + function ApproveRolloutRequest(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]]; + } + + /** + * ApproveRolloutRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + */ + ApproveRolloutRequest.prototype.name = ""; + + /** + * ApproveRolloutRequest approved. + * @member {boolean} approved + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + */ + ApproveRolloutRequest.prototype.approved = false; + + /** + * Creates a new ApproveRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest instance + */ + ApproveRolloutRequest.create = function create(properties) { + return new ApproveRolloutRequest(properties); + }; + + /** + * Encodes the specified ApproveRolloutRequest message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} message ApproveRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutRequest.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.approved != null && Object.hasOwnProperty.call(message, "approved")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.approved); + return writer; + }; + + /** + * Encodes the specified ApproveRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutRequest} message ApproveRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ApproveRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.approved = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApproveRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApproveRolloutRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApproveRolloutRequest.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.approved != null && message.hasOwnProperty("approved")) + if (typeof message.approved !== "boolean") + return "approved: boolean expected"; + return null; + }; + + /** + * Creates an ApproveRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ApproveRolloutRequest} ApproveRolloutRequest + */ + ApproveRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ApproveRolloutRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ApproveRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.approved != null) + message.approved = Boolean(object.approved); + return message; + }; + + /** + * Creates a plain object from an ApproveRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {google.cloud.deploy.v1.ApproveRolloutRequest} message ApproveRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApproveRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.approved = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.approved != null && message.hasOwnProperty("approved")) + object.approved = message.approved; + return object; + }; + + /** + * Converts this ApproveRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + ApproveRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApproveRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ApproveRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApproveRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ApproveRolloutRequest"; + }; + + return ApproveRolloutRequest; + })(); + + v1.ApproveRolloutResponse = (function() { + + /** + * Properties of an ApproveRolloutResponse. + * @memberof google.cloud.deploy.v1 + * @interface IApproveRolloutResponse + */ + + /** + * Constructs a new ApproveRolloutResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an ApproveRolloutResponse. + * @implements IApproveRolloutResponse + * @constructor + * @param {google.cloud.deploy.v1.IApproveRolloutResponse=} [properties] Properties to set + */ + function ApproveRolloutResponse(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 ApproveRolloutResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse instance + */ + ApproveRolloutResponse.create = function create(properties) { + return new ApproveRolloutResponse(properties); + }; + + /** + * Encodes the specified ApproveRolloutResponse message. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse} message ApproveRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ApproveRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ApproveRolloutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.IApproveRolloutResponse} message ApproveRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveRolloutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ApproveRolloutResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApproveRolloutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveRolloutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApproveRolloutResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApproveRolloutResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ApproveRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ApproveRolloutResponse} ApproveRolloutResponse + */ + ApproveRolloutResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ApproveRolloutResponse) + return object; + return new $root.google.cloud.deploy.v1.ApproveRolloutResponse(); + }; + + /** + * Creates a plain object from an ApproveRolloutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {google.cloud.deploy.v1.ApproveRolloutResponse} message ApproveRolloutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApproveRolloutResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ApproveRolloutResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @instance + * @returns {Object.} JSON object + */ + ApproveRolloutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApproveRolloutResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ApproveRolloutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApproveRolloutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ApproveRolloutResponse"; + }; + + return ApproveRolloutResponse; + })(); + + v1.RetryJobRequest = (function() { + + /** + * Properties of a RetryJobRequest. + * @memberof google.cloud.deploy.v1 + * @interface IRetryJobRequest + * @property {string|null} [rollout] RetryJobRequest rollout + * @property {string|null} [phaseId] RetryJobRequest phaseId + * @property {string|null} [jobId] RetryJobRequest jobId + */ + + /** + * Constructs a new RetryJobRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RetryJobRequest. + * @implements IRetryJobRequest + * @constructor + * @param {google.cloud.deploy.v1.IRetryJobRequest=} [properties] Properties to set + */ + function RetryJobRequest(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]]; + } + + /** + * RetryJobRequest rollout. + * @member {string} rollout + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.rollout = ""; + + /** + * RetryJobRequest phaseId. + * @member {string} phaseId + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.phaseId = ""; + + /** + * RetryJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + */ + RetryJobRequest.prototype.jobId = ""; + + /** + * Creates a new RetryJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest instance + */ + RetryJobRequest.create = function create(properties) { + return new RetryJobRequest(properties); + }; + + /** + * Encodes the specified RetryJobRequest message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest} message RetryJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rollout); + if (message.phaseId != null && Object.hasOwnProperty.call(message, "phaseId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phaseId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + return writer; + }; + + /** + * Encodes the specified RetryJobRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.IRetryJobRequest} message RetryJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RetryJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = reader.string(); + break; + } + case 2: { + message.phaseId = reader.string(); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryJobRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) + if (!$util.isString(message.rollout)) + return "rollout: string expected"; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + if (!$util.isString(message.phaseId)) + return "phaseId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + return null; + }; + + /** + * Creates a RetryJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RetryJobRequest} RetryJobRequest + */ + RetryJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RetryJobRequest) + return object; + var message = new $root.google.cloud.deploy.v1.RetryJobRequest(); + if (object.rollout != null) + message.rollout = String(object.rollout); + if (object.phaseId != null) + message.phaseId = String(object.phaseId); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a RetryJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {google.cloud.deploy.v1.RetryJobRequest} message RetryJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = ""; + object.phaseId = ""; + object.jobId = ""; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = message.rollout; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + object.phaseId = message.phaseId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + return object; + }; + + /** + * Converts this RetryJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @instance + * @returns {Object.} JSON object + */ + RetryJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryJobRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RetryJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RetryJobRequest"; + }; + + return RetryJobRequest; + })(); + + v1.RetryJobResponse = (function() { + + /** + * Properties of a RetryJobResponse. + * @memberof google.cloud.deploy.v1 + * @interface IRetryJobResponse + */ + + /** + * Constructs a new RetryJobResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RetryJobResponse. + * @implements IRetryJobResponse + * @constructor + * @param {google.cloud.deploy.v1.IRetryJobResponse=} [properties] Properties to set + */ + function RetryJobResponse(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 RetryJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse instance + */ + RetryJobResponse.create = function create(properties) { + return new RetryJobResponse(properties); + }; + + /** + * Encodes the specified RetryJobResponse message. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse} message RetryJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RetryJobResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RetryJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.IRetryJobResponse} message RetryJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RetryJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryJobResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RetryJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RetryJobResponse} RetryJobResponse + */ + RetryJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RetryJobResponse) + return object; + return new $root.google.cloud.deploy.v1.RetryJobResponse(); + }; + + /** + * Creates a plain object from a RetryJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {google.cloud.deploy.v1.RetryJobResponse} message RetryJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RetryJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @instance + * @returns {Object.} JSON object + */ + RetryJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryJobResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RetryJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RetryJobResponse"; + }; + + return RetryJobResponse; + })(); + + v1.AbandonReleaseRequest = (function() { + + /** + * Properties of an AbandonReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @interface IAbandonReleaseRequest + * @property {string|null} [name] AbandonReleaseRequest name + */ + + /** + * Constructs a new AbandonReleaseRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AbandonReleaseRequest. + * @implements IAbandonReleaseRequest + * @constructor + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest=} [properties] Properties to set + */ + function AbandonReleaseRequest(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]]; + } + + /** + * AbandonReleaseRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @instance + */ + AbandonReleaseRequest.prototype.name = ""; + + /** + * Creates a new AbandonReleaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest instance + */ + AbandonReleaseRequest.create = function create(properties) { + return new AbandonReleaseRequest(properties); + }; + + /** + * Encodes the specified AbandonReleaseRequest message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} message AbandonReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseRequest.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 AbandonReleaseRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseRequest} message AbandonReleaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonReleaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AbandonReleaseRequest(); + 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 an AbandonReleaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonReleaseRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonReleaseRequest.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 an AbandonReleaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AbandonReleaseRequest} AbandonReleaseRequest + */ + AbandonReleaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AbandonReleaseRequest) + return object; + var message = new $root.google.cloud.deploy.v1.AbandonReleaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AbandonReleaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {google.cloud.deploy.v1.AbandonReleaseRequest} message AbandonReleaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonReleaseRequest.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 AbandonReleaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @instance + * @returns {Object.} JSON object + */ + AbandonReleaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AbandonReleaseRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AbandonReleaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AbandonReleaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AbandonReleaseRequest"; + }; + + return AbandonReleaseRequest; + })(); + + v1.AbandonReleaseResponse = (function() { + + /** + * Properties of an AbandonReleaseResponse. + * @memberof google.cloud.deploy.v1 + * @interface IAbandonReleaseResponse + */ + + /** + * Constructs a new AbandonReleaseResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents an AbandonReleaseResponse. + * @implements IAbandonReleaseResponse + * @constructor + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse=} [properties] Properties to set + */ + function AbandonReleaseResponse(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 AbandonReleaseResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse instance + */ + AbandonReleaseResponse.create = function create(properties) { + return new AbandonReleaseResponse(properties); + }; + + /** + * Encodes the specified AbandonReleaseResponse message. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse} message AbandonReleaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AbandonReleaseResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.AbandonReleaseResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.IAbandonReleaseResponse} message AbandonReleaseResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonReleaseResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.AbandonReleaseResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AbandonReleaseResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonReleaseResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonReleaseResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonReleaseResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AbandonReleaseResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.AbandonReleaseResponse} AbandonReleaseResponse + */ + AbandonReleaseResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.AbandonReleaseResponse) + return object; + return new $root.google.cloud.deploy.v1.AbandonReleaseResponse(); + }; + + /** + * Creates a plain object from an AbandonReleaseResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {google.cloud.deploy.v1.AbandonReleaseResponse} message AbandonReleaseResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonReleaseResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AbandonReleaseResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @instance + * @returns {Object.} JSON object + */ + AbandonReleaseResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AbandonReleaseResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.AbandonReleaseResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AbandonReleaseResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.AbandonReleaseResponse"; + }; + + return AbandonReleaseResponse; + })(); + + v1.JobRun = (function() { + + /** + * Properties of a JobRun. + * @memberof google.cloud.deploy.v1 + * @interface IJobRun + * @property {string|null} [name] JobRun name + * @property {string|null} [uid] JobRun uid + * @property {string|null} [phaseId] JobRun phaseId + * @property {string|null} [jobId] JobRun jobId + * @property {google.protobuf.ITimestamp|null} [createTime] JobRun createTime + * @property {google.protobuf.ITimestamp|null} [startTime] JobRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] JobRun endTime + * @property {google.cloud.deploy.v1.JobRun.State|null} [state] JobRun state + * @property {google.cloud.deploy.v1.IDeployJobRun|null} [deployJobRun] JobRun deployJobRun + * @property {google.cloud.deploy.v1.IVerifyJobRun|null} [verifyJobRun] JobRun verifyJobRun + * @property {string|null} [etag] JobRun etag + */ + + /** + * Constructs a new JobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a JobRun. + * @implements IJobRun + * @constructor + * @param {google.cloud.deploy.v1.IJobRun=} [properties] Properties to set + */ + function JobRun(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]]; + } + + /** + * JobRun name. + * @member {string} name + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.name = ""; + + /** + * JobRun uid. + * @member {string} uid + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.uid = ""; + + /** + * JobRun phaseId. + * @member {string} phaseId + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.phaseId = ""; + + /** + * JobRun jobId. + * @member {string} jobId + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.jobId = ""; + + /** + * JobRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.createTime = null; + + /** + * JobRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.startTime = null; + + /** + * JobRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.endTime = null; + + /** + * JobRun state. + * @member {google.cloud.deploy.v1.JobRun.State} state + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.state = 0; + + /** + * JobRun deployJobRun. + * @member {google.cloud.deploy.v1.IDeployJobRun|null|undefined} deployJobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.deployJobRun = null; + + /** + * JobRun verifyJobRun. + * @member {google.cloud.deploy.v1.IVerifyJobRun|null|undefined} verifyJobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.verifyJobRun = null; + + /** + * JobRun etag. + * @member {string} etag + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + JobRun.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * JobRun jobRun. + * @member {"deployJobRun"|"verifyJobRun"|undefined} jobRun + * @memberof google.cloud.deploy.v1.JobRun + * @instance + */ + Object.defineProperty(JobRun.prototype, "jobRun", { + get: $util.oneOfGetter($oneOfFields = ["deployJobRun", "verifyJobRun"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.JobRun} JobRun instance + */ + JobRun.create = function create(properties) { + return new JobRun(properties); + }; + + /** + * Encodes the specified JobRun message. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun} message JobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRun.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.phaseId != null && Object.hasOwnProperty.call(message, "phaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phaseId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jobId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.deployJobRun != null && Object.hasOwnProperty.call(message, "deployJobRun")) + $root.google.cloud.deploy.v1.DeployJobRun.encode(message.deployJobRun, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.verifyJobRun != null && Object.hasOwnProperty.call(message, "verifyJobRun")) + $root.google.cloud.deploy.v1.VerifyJobRun.encode(message.verifyJobRun, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + return writer; + }; + + /** + * Encodes the specified JobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.IJobRun} message JobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.JobRun} JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.JobRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.phaseId = reader.string(); + break; + } + case 4: { + message.jobId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.decode(reader, reader.uint32()); + break; + } + case 10: { + message.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.JobRun} JobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + if (!$util.isString(message.phaseId)) + return "phaseId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.deployJobRun != null && message.hasOwnProperty("deployJobRun")) { + properties.jobRun = 1; + { + var error = $root.google.cloud.deploy.v1.DeployJobRun.verify(message.deployJobRun); + if (error) + return "deployJobRun." + error; + } + } + if (message.verifyJobRun != null && message.hasOwnProperty("verifyJobRun")) { + if (properties.jobRun === 1) + return "jobRun: multiple values"; + properties.jobRun = 1; + { + var error = $root.google.cloud.deploy.v1.VerifyJobRun.verify(message.verifyJobRun); + if (error) + return "verifyJobRun." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a JobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.JobRun} JobRun + */ + JobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.JobRun) + return object; + var message = new $root.google.cloud.deploy.v1.JobRun(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.phaseId != null) + message.phaseId = String(object.phaseId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "IN_PROGRESS": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.deployJobRun != null) { + if (typeof object.deployJobRun !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.deployJobRun: object expected"); + message.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.fromObject(object.deployJobRun); + } + if (object.verifyJobRun != null) { + if (typeof object.verifyJobRun !== "object") + throw TypeError(".google.cloud.deploy.v1.JobRun.verifyJobRun: object expected"); + message.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.fromObject(object.verifyJobRun); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a JobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {google.cloud.deploy.v1.JobRun} message JobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.phaseId = ""; + object.jobId = ""; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.phaseId != null && message.hasOwnProperty("phaseId")) + object.phaseId = message.phaseId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.deploy.v1.JobRun.State[message.state] : message.state; + if (message.deployJobRun != null && message.hasOwnProperty("deployJobRun")) { + object.deployJobRun = $root.google.cloud.deploy.v1.DeployJobRun.toObject(message.deployJobRun, options); + if (options.oneofs) + object.jobRun = "deployJobRun"; + } + if (message.verifyJobRun != null && message.hasOwnProperty("verifyJobRun")) { + object.verifyJobRun = $root.google.cloud.deploy.v1.VerifyJobRun.toObject(message.verifyJobRun, options); + if (options.oneofs) + object.jobRun = "verifyJobRun"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this JobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.JobRun + * @instance + * @returns {Object.} JSON object + */ + JobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.JobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.JobRun"; + }; + + /** + * State enum. + * @name google.cloud.deploy.v1.JobRun.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + JobRun.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return JobRun; + })(); + + v1.DeployJobRun = (function() { + + /** + * Properties of a DeployJobRun. + * @memberof google.cloud.deploy.v1 + * @interface IDeployJobRun + * @property {string|null} [build] DeployJobRun build + * @property {google.cloud.deploy.v1.DeployJobRun.FailureCause|null} [failureCause] DeployJobRun failureCause + * @property {string|null} [failureMessage] DeployJobRun failureMessage + * @property {google.cloud.deploy.v1.IDeployJobRunMetadata|null} [metadata] DeployJobRun metadata + */ + + /** + * Constructs a new DeployJobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeployJobRun. + * @implements IDeployJobRun + * @constructor + * @param {google.cloud.deploy.v1.IDeployJobRun=} [properties] Properties to set + */ + function DeployJobRun(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]]; + } + + /** + * DeployJobRun build. + * @member {string} build + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.build = ""; + + /** + * DeployJobRun failureCause. + * @member {google.cloud.deploy.v1.DeployJobRun.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.failureCause = 0; + + /** + * DeployJobRun failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.failureMessage = ""; + + /** + * DeployJobRun metadata. + * @member {google.cloud.deploy.v1.IDeployJobRunMetadata|null|undefined} metadata + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + */ + DeployJobRun.prototype.metadata = null; + + /** + * Creates a new DeployJobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun instance + */ + DeployJobRun.create = function create(properties) { + return new DeployJobRun(properties); + }; + + /** + * Encodes the specified DeployJobRun message. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun} message DeployJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.build); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.failureMessage); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.deploy.v1.DeployJobRunMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeployJobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.IDeployJobRun} message DeployJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployJobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeployJobRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.build = reader.string(); + break; + } + case 2: { + message.failureCause = reader.int32(); + break; + } + case 3: { + message.failureMessage = reader.string(); + break; + } + case 4: { + message.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployJobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployJobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployJobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployJobRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.build != null && message.hasOwnProperty("build")) + if (!$util.isString(message.build)) + return "build: string expected"; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.deploy.v1.DeployJobRunMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a DeployJobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeployJobRun} DeployJobRun + */ + DeployJobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeployJobRun) + return object; + var message = new $root.google.cloud.deploy.v1.DeployJobRun(); + if (object.build != null) + message.build = String(object.build); + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.failureCause = 3; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.deploy.v1.DeployJobRun.metadata: object expected"); + message.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a DeployJobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {google.cloud.deploy.v1.DeployJobRun} message DeployJobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployJobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.build = ""; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + object.metadata = null; + } + if (message.build != null && message.hasOwnProperty("build")) + object.build = message.build; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.DeployJobRun.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.deploy.v1.DeployJobRunMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this DeployJobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeployJobRun + * @instance + * @returns {Object.} JSON object + */ + DeployJobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployJobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeployJobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployJobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeployJobRun"; + }; + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.DeployJobRun.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + */ + DeployJobRun.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + return values; + })(); + + return DeployJobRun; + })(); + + v1.VerifyJobRun = (function() { + + /** + * Properties of a VerifyJobRun. + * @memberof google.cloud.deploy.v1 + * @interface IVerifyJobRun + * @property {string|null} [build] VerifyJobRun build + * @property {string|null} [artifactUri] VerifyJobRun artifactUri + * @property {string|null} [eventLogPath] VerifyJobRun eventLogPath + * @property {google.cloud.deploy.v1.VerifyJobRun.FailureCause|null} [failureCause] VerifyJobRun failureCause + * @property {string|null} [failureMessage] VerifyJobRun failureMessage + */ + + /** + * Constructs a new VerifyJobRun. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a VerifyJobRun. + * @implements IVerifyJobRun + * @constructor + * @param {google.cloud.deploy.v1.IVerifyJobRun=} [properties] Properties to set + */ + function VerifyJobRun(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]]; + } + + /** + * VerifyJobRun build. + * @member {string} build + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.build = ""; + + /** + * VerifyJobRun artifactUri. + * @member {string} artifactUri + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.artifactUri = ""; + + /** + * VerifyJobRun eventLogPath. + * @member {string} eventLogPath + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.eventLogPath = ""; + + /** + * VerifyJobRun failureCause. + * @member {google.cloud.deploy.v1.VerifyJobRun.FailureCause} failureCause + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.failureCause = 0; + + /** + * VerifyJobRun failureMessage. + * @member {string} failureMessage + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + */ + VerifyJobRun.prototype.failureMessage = ""; + + /** + * Creates a new VerifyJobRun instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun instance + */ + VerifyJobRun.create = function create(properties) { + return new VerifyJobRun(properties); + }; + + /** + * Encodes the specified VerifyJobRun message. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun} message VerifyJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJobRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.build); + if (message.artifactUri != null && Object.hasOwnProperty.call(message, "artifactUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.artifactUri); + if (message.eventLogPath != null && Object.hasOwnProperty.call(message, "eventLogPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventLogPath); + if (message.failureCause != null && Object.hasOwnProperty.call(message, "failureCause")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureCause); + if (message.failureMessage != null && Object.hasOwnProperty.call(message, "failureMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.failureMessage); + return writer; + }; + + /** + * Encodes the specified VerifyJobRun message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.VerifyJobRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.IVerifyJobRun} message VerifyJobRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyJobRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJobRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.VerifyJobRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.build = reader.string(); + break; + } + case 2: { + message.artifactUri = reader.string(); + break; + } + case 3: { + message.eventLogPath = reader.string(); + break; + } + case 4: { + message.failureCause = reader.int32(); + break; + } + case 5: { + message.failureMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VerifyJobRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyJobRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifyJobRun message. + * @function verify + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifyJobRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.build != null && message.hasOwnProperty("build")) + if (!$util.isString(message.build)) + return "build: string expected"; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + if (!$util.isString(message.artifactUri)) + return "artifactUri: string expected"; + if (message.eventLogPath != null && message.hasOwnProperty("eventLogPath")) + if (!$util.isString(message.eventLogPath)) + return "eventLogPath: string expected"; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + switch (message.failureCause) { + default: + return "failureCause: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + if (!$util.isString(message.failureMessage)) + return "failureMessage: string expected"; + return null; + }; + + /** + * Creates a VerifyJobRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.VerifyJobRun} VerifyJobRun + */ + VerifyJobRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.VerifyJobRun) + return object; + var message = new $root.google.cloud.deploy.v1.VerifyJobRun(); + if (object.build != null) + message.build = String(object.build); + if (object.artifactUri != null) + message.artifactUri = String(object.artifactUri); + if (object.eventLogPath != null) + message.eventLogPath = String(object.eventLogPath); + switch (object.failureCause) { + case "FAILURE_CAUSE_UNSPECIFIED": + case 0: + message.failureCause = 0; + break; + case "CLOUD_BUILD_UNAVAILABLE": + case 1: + message.failureCause = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.failureCause = 2; + break; + case "DEADLINE_EXCEEDED": + case 3: + message.failureCause = 3; + break; + case "VERIFICATION_CONFIG_NOT_FOUND": + case 4: + message.failureCause = 4; + break; + } + if (object.failureMessage != null) + message.failureMessage = String(object.failureMessage); + return message; + }; + + /** + * Creates a plain object from a VerifyJobRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {google.cloud.deploy.v1.VerifyJobRun} message VerifyJobRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifyJobRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.build = ""; + object.artifactUri = ""; + object.eventLogPath = ""; + object.failureCause = options.enums === String ? "FAILURE_CAUSE_UNSPECIFIED" : 0; + object.failureMessage = ""; + } + if (message.build != null && message.hasOwnProperty("build")) + object.build = message.build; + if (message.artifactUri != null && message.hasOwnProperty("artifactUri")) + object.artifactUri = message.artifactUri; + if (message.eventLogPath != null && message.hasOwnProperty("eventLogPath")) + object.eventLogPath = message.eventLogPath; + if (message.failureCause != null && message.hasOwnProperty("failureCause")) + object.failureCause = options.enums === String ? $root.google.cloud.deploy.v1.VerifyJobRun.FailureCause[message.failureCause] : message.failureCause; + if (message.failureMessage != null && message.hasOwnProperty("failureMessage")) + object.failureMessage = message.failureMessage; + return object; + }; + + /** + * Converts this VerifyJobRun to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @instance + * @returns {Object.} JSON object + */ + VerifyJobRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifyJobRun + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.VerifyJobRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifyJobRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.VerifyJobRun"; + }; + + /** + * FailureCause enum. + * @name google.cloud.deploy.v1.VerifyJobRun.FailureCause + * @enum {number} + * @property {number} FAILURE_CAUSE_UNSPECIFIED=0 FAILURE_CAUSE_UNSPECIFIED value + * @property {number} CLOUD_BUILD_UNAVAILABLE=1 CLOUD_BUILD_UNAVAILABLE value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} DEADLINE_EXCEEDED=3 DEADLINE_EXCEEDED value + * @property {number} VERIFICATION_CONFIG_NOT_FOUND=4 VERIFICATION_CONFIG_NOT_FOUND value + */ + VerifyJobRun.FailureCause = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_CAUSE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_BUILD_UNAVAILABLE"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "DEADLINE_EXCEEDED"] = 3; + values[valuesById[4] = "VERIFICATION_CONFIG_NOT_FOUND"] = 4; + return values; + })(); + + return VerifyJobRun; + })(); + + v1.ListJobRunsRequest = (function() { + + /** + * Properties of a ListJobRunsRequest. + * @memberof google.cloud.deploy.v1 + * @interface IListJobRunsRequest + * @property {string|null} [parent] ListJobRunsRequest parent + * @property {number|null} [pageSize] ListJobRunsRequest pageSize + * @property {string|null} [pageToken] ListJobRunsRequest pageToken + * @property {string|null} [filter] ListJobRunsRequest filter + * @property {string|null} [orderBy] ListJobRunsRequest orderBy + */ + + /** + * Constructs a new ListJobRunsRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListJobRunsRequest. + * @implements IListJobRunsRequest + * @constructor + * @param {google.cloud.deploy.v1.IListJobRunsRequest=} [properties] Properties to set + */ + function ListJobRunsRequest(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]]; + } + + /** + * ListJobRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.parent = ""; + + /** + * ListJobRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.pageSize = 0; + + /** + * ListJobRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.pageToken = ""; + + /** + * ListJobRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.filter = ""; + + /** + * ListJobRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + */ + ListJobRunsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListJobRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest instance + */ + ListJobRunsRequest.create = function create(properties) { + return new ListJobRunsRequest(properties); + }; + + /** + * Encodes the specified ListJobRunsRequest message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest} message ListJobRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListJobRunsRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.IListJobRunsRequest} message ListJobRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListJobRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobRunsRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobRunsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListJobRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListJobRunsRequest} ListJobRunsRequest + */ + ListJobRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListJobRunsRequest) + return object; + var message = new $root.google.cloud.deploy.v1.ListJobRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListJobRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {google.cloud.deploy.v1.ListJobRunsRequest} message ListJobRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListJobRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobRunsRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListJobRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListJobRunsRequest"; + }; + + return ListJobRunsRequest; + })(); + + v1.ListJobRunsResponse = (function() { + + /** + * Properties of a ListJobRunsResponse. + * @memberof google.cloud.deploy.v1 + * @interface IListJobRunsResponse + * @property {Array.|null} [jobRuns] ListJobRunsResponse jobRuns + * @property {string|null} [nextPageToken] ListJobRunsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobRunsResponse unreachable + */ + + /** + * Constructs a new ListJobRunsResponse. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ListJobRunsResponse. + * @implements IListJobRunsResponse + * @constructor + * @param {google.cloud.deploy.v1.IListJobRunsResponse=} [properties] Properties to set + */ + function ListJobRunsResponse(properties) { + this.jobRuns = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobRunsResponse jobRuns. + * @member {Array.} jobRuns + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.jobRuns = $util.emptyArray; + + /** + * ListJobRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.nextPageToken = ""; + + /** + * ListJobRunsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + */ + ListJobRunsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse instance + */ + ListJobRunsResponse.create = function create(properties) { + return new ListJobRunsResponse(properties); + }; + + /** + * Encodes the specified ListJobRunsResponse message. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse} message ListJobRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobRuns != null && message.jobRuns.length) + for (var i = 0; i < message.jobRuns.length; ++i) + $root.google.cloud.deploy.v1.JobRun.encode(message.jobRuns[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobRunsResponse message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ListJobRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.IListJobRunsResponse} message ListJobRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ListJobRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobRuns && message.jobRuns.length)) + message.jobRuns = []; + message.jobRuns.push($root.google.cloud.deploy.v1.JobRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobRunsResponse message. + * @function verify + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobRuns != null && message.hasOwnProperty("jobRuns")) { + if (!Array.isArray(message.jobRuns)) + return "jobRuns: array expected"; + for (var i = 0; i < message.jobRuns.length; ++i) { + var error = $root.google.cloud.deploy.v1.JobRun.verify(message.jobRuns[i]); + if (error) + return "jobRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ListJobRunsResponse} ListJobRunsResponse + */ + ListJobRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ListJobRunsResponse) + return object; + var message = new $root.google.cloud.deploy.v1.ListJobRunsResponse(); + if (object.jobRuns) { + if (!Array.isArray(object.jobRuns)) + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.jobRuns: array expected"); + message.jobRuns = []; + for (var i = 0; i < object.jobRuns.length; ++i) { + if (typeof object.jobRuns[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.jobRuns: object expected"); + message.jobRuns[i] = $root.google.cloud.deploy.v1.JobRun.fromObject(object.jobRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.deploy.v1.ListJobRunsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {google.cloud.deploy.v1.ListJobRunsResponse} message ListJobRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobRuns = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobRuns && message.jobRuns.length) { + object.jobRuns = []; + for (var j = 0; j < message.jobRuns.length; ++j) + object.jobRuns[j] = $root.google.cloud.deploy.v1.JobRun.toObject(message.jobRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobRunsResponse + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ListJobRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ListJobRunsResponse"; + }; + + return ListJobRunsResponse; + })(); + + v1.GetJobRunRequest = (function() { + + /** + * Properties of a GetJobRunRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetJobRunRequest + * @property {string|null} [name] GetJobRunRequest name + */ + + /** + * Constructs a new GetJobRunRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetJobRunRequest. + * @implements IGetJobRunRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetJobRunRequest=} [properties] Properties to set + */ + function GetJobRunRequest(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]]; + } + + /** + * GetJobRunRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @instance + */ + GetJobRunRequest.prototype.name = ""; + + /** + * Creates a new GetJobRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest instance + */ + GetJobRunRequest.create = function create(properties) { + return new GetJobRunRequest(properties); + }; + + /** + * Encodes the specified GetJobRunRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest} message GetJobRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRunRequest.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 GetJobRunRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetJobRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.IGetJobRunRequest} message GetJobRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetJobRunRequest(); + 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 GetJobRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRunRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRunRequest.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 GetJobRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetJobRunRequest} GetJobRunRequest + */ + GetJobRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetJobRunRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetJobRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {google.cloud.deploy.v1.GetJobRunRequest} message GetJobRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRunRequest.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 GetJobRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRunRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetJobRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetJobRunRequest"; + }; + + return GetJobRunRequest; + })(); + + v1.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.deploy.v1 + * @interface IConfig + * @property {string|null} [name] Config name + * @property {Array.|null} [supportedVersions] Config supportedVersions + * @property {string|null} [defaultSkaffoldVersion] Config defaultSkaffoldVersion + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.deploy.v1.IConfig=} [properties] Properties to set + */ + function Config(properties) { + this.supportedVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Config name. + * @member {string} name + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.name = ""; + + /** + * Config supportedVersions. + * @member {Array.} supportedVersions + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.supportedVersions = $util.emptyArray; + + /** + * Config defaultSkaffoldVersion. + * @member {string} defaultSkaffoldVersion + * @memberof google.cloud.deploy.v1.Config + * @instance + */ + Config.prototype.defaultSkaffoldVersion = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.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.supportedVersions != null && message.supportedVersions.length) + for (var i = 0; i < message.supportedVersions.length; ++i) + $root.google.cloud.deploy.v1.SkaffoldVersion.encode(message.supportedVersions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultSkaffoldVersion != null && Object.hasOwnProperty.call(message, "defaultSkaffoldVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultSkaffoldVersion); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.IConfig} message Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.supportedVersions && message.supportedVersions.length)) + message.supportedVersions = []; + message.supportedVersions.push($root.google.cloud.deploy.v1.SkaffoldVersion.decode(reader, reader.uint32())); + break; + } + case 3: { + message.defaultSkaffoldVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.Config} Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Config message. + * @function verify + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Config.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.supportedVersions != null && message.hasOwnProperty("supportedVersions")) { + if (!Array.isArray(message.supportedVersions)) + return "supportedVersions: array expected"; + for (var i = 0; i < message.supportedVersions.length; ++i) { + var error = $root.google.cloud.deploy.v1.SkaffoldVersion.verify(message.supportedVersions[i]); + if (error) + return "supportedVersions." + error; + } + } + if (message.defaultSkaffoldVersion != null && message.hasOwnProperty("defaultSkaffoldVersion")) + if (!$util.isString(message.defaultSkaffoldVersion)) + return "defaultSkaffoldVersion: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.Config) + return object; + var message = new $root.google.cloud.deploy.v1.Config(); + if (object.name != null) + message.name = String(object.name); + if (object.supportedVersions) { + if (!Array.isArray(object.supportedVersions)) + throw TypeError(".google.cloud.deploy.v1.Config.supportedVersions: array expected"); + message.supportedVersions = []; + for (var i = 0; i < object.supportedVersions.length; ++i) { + if (typeof object.supportedVersions[i] !== "object") + throw TypeError(".google.cloud.deploy.v1.Config.supportedVersions: object expected"); + message.supportedVersions[i] = $root.google.cloud.deploy.v1.SkaffoldVersion.fromObject(object.supportedVersions[i]); + } + } + if (object.defaultSkaffoldVersion != null) + message.defaultSkaffoldVersion = String(object.defaultSkaffoldVersion); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {google.cloud.deploy.v1.Config} message Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedVersions = []; + if (options.defaults) { + object.name = ""; + object.defaultSkaffoldVersion = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.supportedVersions && message.supportedVersions.length) { + object.supportedVersions = []; + for (var j = 0; j < message.supportedVersions.length; ++j) + object.supportedVersions[j] = $root.google.cloud.deploy.v1.SkaffoldVersion.toObject(message.supportedVersions[j], options); + } + if (message.defaultSkaffoldVersion != null && message.hasOwnProperty("defaultSkaffoldVersion")) + object.defaultSkaffoldVersion = message.defaultSkaffoldVersion; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.Config + * @instance + * @returns {Object.} JSON object + */ + Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Config + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.Config"; + }; + + return Config; + })(); + + v1.SkaffoldVersion = (function() { + + /** + * Properties of a SkaffoldVersion. + * @memberof google.cloud.deploy.v1 + * @interface ISkaffoldVersion + * @property {string|null} [version] SkaffoldVersion version + * @property {google.type.IDate|null} [supportEndDate] SkaffoldVersion supportEndDate + */ + + /** + * Constructs a new SkaffoldVersion. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a SkaffoldVersion. + * @implements ISkaffoldVersion + * @constructor + * @param {google.cloud.deploy.v1.ISkaffoldVersion=} [properties] Properties to set + */ + function SkaffoldVersion(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]]; + } + + /** + * SkaffoldVersion version. + * @member {string} version + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + */ + SkaffoldVersion.prototype.version = ""; + + /** + * SkaffoldVersion supportEndDate. + * @member {google.type.IDate|null|undefined} supportEndDate + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + */ + SkaffoldVersion.prototype.supportEndDate = null; + + /** + * Creates a new SkaffoldVersion instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion instance + */ + SkaffoldVersion.create = function create(properties) { + return new SkaffoldVersion(properties); + }; + + /** + * Encodes the specified SkaffoldVersion message. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion} message SkaffoldVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldVersion.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.supportEndDate != null && Object.hasOwnProperty.call(message, "supportEndDate")) + $root.google.type.Date.encode(message.supportEndDate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SkaffoldVersion message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.SkaffoldVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.ISkaffoldVersion} message SkaffoldVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkaffoldVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.SkaffoldVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.supportEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkaffoldVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkaffoldVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkaffoldVersion message. + * @function verify + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkaffoldVersion.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.supportEndDate != null && message.hasOwnProperty("supportEndDate")) { + var error = $root.google.type.Date.verify(message.supportEndDate); + if (error) + return "supportEndDate." + error; + } + return null; + }; + + /** + * Creates a SkaffoldVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.SkaffoldVersion} SkaffoldVersion + */ + SkaffoldVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.SkaffoldVersion) + return object; + var message = new $root.google.cloud.deploy.v1.SkaffoldVersion(); + if (object.version != null) + message.version = String(object.version); + if (object.supportEndDate != null) { + if (typeof object.supportEndDate !== "object") + throw TypeError(".google.cloud.deploy.v1.SkaffoldVersion.supportEndDate: object expected"); + message.supportEndDate = $root.google.type.Date.fromObject(object.supportEndDate); + } + return message; + }; + + /** + * Creates a plain object from a SkaffoldVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {google.cloud.deploy.v1.SkaffoldVersion} message SkaffoldVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkaffoldVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.supportEndDate = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.supportEndDate != null && message.hasOwnProperty("supportEndDate")) + object.supportEndDate = $root.google.type.Date.toObject(message.supportEndDate, options); + return object; + }; + + /** + * Converts this SkaffoldVersion to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @instance + * @returns {Object.} JSON object + */ + SkaffoldVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkaffoldVersion + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.SkaffoldVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkaffoldVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.SkaffoldVersion"; + }; + + return SkaffoldVersion; + })(); + + v1.GetConfigRequest = (function() { + + /** + * Properties of a GetConfigRequest. + * @memberof google.cloud.deploy.v1 + * @interface IGetConfigRequest + * @property {string|null} [name] GetConfigRequest name + */ + + /** + * Constructs a new GetConfigRequest. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a GetConfigRequest. + * @implements IGetConfigRequest + * @constructor + * @param {google.cloud.deploy.v1.IGetConfigRequest=} [properties] Properties to set + */ + function GetConfigRequest(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]]; + } + + /** + * GetConfigRequest name. + * @member {string} name + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @instance + */ + GetConfigRequest.prototype.name = ""; + + /** + * Creates a new GetConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest instance + */ + GetConfigRequest.create = function create(properties) { + return new GetConfigRequest(properties); + }; + + /** + * Encodes the specified GetConfigRequest message. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.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 GetConfigRequest message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.GetConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.IGetConfigRequest} message GetConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.GetConfigRequest(); + 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 GetConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConfigRequest message. + * @function verify + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConfigRequest.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 GetConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.GetConfigRequest} GetConfigRequest + */ + GetConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.GetConfigRequest) + return object; + var message = new $root.google.cloud.deploy.v1.GetConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {google.cloud.deploy.v1.GetConfigRequest} message GetConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConfigRequest.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 GetConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConfigRequest + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.GetConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.GetConfigRequest"; + }; + + return GetConfigRequest; + })(); + + v1.DeliveryPipelineNotificationEvent = (function() { + + /** + * Properties of a DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IDeliveryPipelineNotificationEvent + * @property {string|null} [message] DeliveryPipelineNotificationEvent message + * @property {string|null} [deliveryPipeline] DeliveryPipelineNotificationEvent deliveryPipeline + * @property {google.cloud.deploy.v1.Type|null} [type] DeliveryPipelineNotificationEvent type + */ + + /** + * Constructs a new DeliveryPipelineNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a DeliveryPipelineNotificationEvent. + * @implements IDeliveryPipelineNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + */ + function DeliveryPipelineNotificationEvent(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]]; + } + + /** + * DeliveryPipelineNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.message = ""; + + /** + * DeliveryPipelineNotificationEvent deliveryPipeline. + * @member {string} deliveryPipeline + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.deliveryPipeline = ""; + + /** + * DeliveryPipelineNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + */ + DeliveryPipelineNotificationEvent.prototype.type = 0; + + /** + * Creates a new DeliveryPipelineNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent instance + */ + DeliveryPipelineNotificationEvent.create = function create(properties) { + return new DeliveryPipelineNotificationEvent(properties); + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.deliveryPipeline != null && Object.hasOwnProperty.call(message, "deliveryPipeline")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deliveryPipeline); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified DeliveryPipelineNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.DeliveryPipelineNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IDeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryPipelineNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.deliveryPipeline = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryPipelineNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryPipelineNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryPipelineNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryPipelineNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + if (!$util.isString(message.deliveryPipeline)) + return "deliveryPipeline: 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; + } + return null; + }; + + /** + * Creates a DeliveryPipelineNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} DeliveryPipelineNotificationEvent + */ + DeliveryPipelineNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.DeliveryPipelineNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.deliveryPipeline != null) + message.deliveryPipeline = String(object.deliveryPipeline); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeliveryPipelineNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {google.cloud.deploy.v1.DeliveryPipelineNotificationEvent} message DeliveryPipelineNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeliveryPipelineNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.deliveryPipeline = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.deliveryPipeline != null && message.hasOwnProperty("deliveryPipeline")) + object.deliveryPipeline = message.deliveryPipeline; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this DeliveryPipelineNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + DeliveryPipelineNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryPipelineNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.DeliveryPipelineNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryPipelineNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"; + }; + + return DeliveryPipelineNotificationEvent; + })(); + + /** + * Type enum. + * @name google.cloud.deploy.v1.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TYPE_PUBSUB_NOTIFICATION_FAILURE=1 TYPE_PUBSUB_NOTIFICATION_FAILURE value + * @property {number} TYPE_RENDER_STATUES_CHANGE=2 TYPE_RENDER_STATUES_CHANGE value + */ + v1.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_PUBSUB_NOTIFICATION_FAILURE"] = 1; + values[valuesById[2] = "TYPE_RENDER_STATUES_CHANGE"] = 2; + return values; + })(); + + v1.JobRunNotificationEvent = (function() { + + /** + * Properties of a JobRunNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IJobRunNotificationEvent + * @property {string|null} [message] JobRunNotificationEvent message + * @property {string|null} [jobRun] JobRunNotificationEvent jobRun + * @property {string|null} [pipelineUid] JobRunNotificationEvent pipelineUid + * @property {string|null} [releaseUid] JobRunNotificationEvent releaseUid + * @property {string|null} [rolloutUid] JobRunNotificationEvent rolloutUid + * @property {string|null} [targetId] JobRunNotificationEvent targetId + * @property {google.cloud.deploy.v1.Type|null} [type] JobRunNotificationEvent type + */ + + /** + * Constructs a new JobRunNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a JobRunNotificationEvent. + * @implements IJobRunNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent=} [properties] Properties to set + */ + function JobRunNotificationEvent(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]]; + } + + /** + * JobRunNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.message = ""; + + /** + * JobRunNotificationEvent jobRun. + * @member {string} jobRun + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.jobRun = ""; + + /** + * JobRunNotificationEvent pipelineUid. + * @member {string} pipelineUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.pipelineUid = ""; + + /** + * JobRunNotificationEvent releaseUid. + * @member {string} releaseUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.releaseUid = ""; + + /** + * JobRunNotificationEvent rolloutUid. + * @member {string} rolloutUid + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.rolloutUid = ""; + + /** + * JobRunNotificationEvent targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.targetId = ""; + + /** + * JobRunNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + */ + JobRunNotificationEvent.prototype.type = 0; + + /** + * Creates a new JobRunNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent instance + */ + JobRunNotificationEvent.create = function create(properties) { + return new JobRunNotificationEvent(properties); + }; + + /** + * Encodes the specified JobRunNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent} message JobRunNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRunNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.jobRun != null && Object.hasOwnProperty.call(message, "jobRun")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobRun); + if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pipelineUid); + if (message.releaseUid != null && Object.hasOwnProperty.call(message, "releaseUid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.releaseUid); + if (message.rolloutUid != null && Object.hasOwnProperty.call(message, "rolloutUid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.rolloutUid); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.type); + return writer; + }; + + /** + * Encodes the specified JobRunNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.JobRunNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IJobRunNotificationEvent} message JobRunNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobRunNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRunNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.JobRunNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.jobRun = reader.string(); + break; + } + case 3: { + message.pipelineUid = reader.string(); + break; + } + case 4: { + message.releaseUid = reader.string(); + break; + } + case 5: { + message.rolloutUid = reader.string(); + break; + } + case 6: { + message.targetId = reader.string(); + break; + } + case 7: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobRunNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobRunNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobRunNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobRunNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + if (!$util.isString(message.jobRun)) + return "jobRun: string expected"; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + if (!$util.isString(message.pipelineUid)) + return "pipelineUid: string expected"; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + if (!$util.isString(message.releaseUid)) + return "releaseUid: string expected"; + if (message.rolloutUid != null && message.hasOwnProperty("rolloutUid")) + if (!$util.isString(message.rolloutUid)) + return "rolloutUid: string expected"; + if (message.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: 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; + } + return null; + }; + + /** + * Creates a JobRunNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.JobRunNotificationEvent} JobRunNotificationEvent + */ + JobRunNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.JobRunNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.JobRunNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.jobRun != null) + message.jobRun = String(object.jobRun); + if (object.pipelineUid != null) + message.pipelineUid = String(object.pipelineUid); + if (object.releaseUid != null) + message.releaseUid = String(object.releaseUid); + if (object.rolloutUid != null) + message.rolloutUid = String(object.rolloutUid); + if (object.targetId != null) + message.targetId = String(object.targetId); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobRunNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {google.cloud.deploy.v1.JobRunNotificationEvent} message JobRunNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobRunNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.jobRun = ""; + object.pipelineUid = ""; + object.releaseUid = ""; + object.rolloutUid = ""; + object.targetId = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.jobRun != null && message.hasOwnProperty("jobRun")) + object.jobRun = message.jobRun; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + object.pipelineUid = message.pipelineUid; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + object.releaseUid = message.releaseUid; + if (message.rolloutUid != null && message.hasOwnProperty("rolloutUid")) + object.rolloutUid = message.rolloutUid; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this JobRunNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + JobRunNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobRunNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.JobRunNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobRunNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.JobRunNotificationEvent"; + }; + + return JobRunNotificationEvent; + })(); + + v1.ReleaseNotificationEvent = (function() { + + /** + * Properties of a ReleaseNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IReleaseNotificationEvent + * @property {string|null} [message] ReleaseNotificationEvent message + * @property {string|null} [release] ReleaseNotificationEvent release + * @property {google.cloud.deploy.v1.Type|null} [type] ReleaseNotificationEvent type + */ + + /** + * Constructs a new ReleaseNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ReleaseNotificationEvent. + * @implements IReleaseNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent=} [properties] Properties to set + */ + function ReleaseNotificationEvent(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]]; + } + + /** + * ReleaseNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.message = ""; + + /** + * ReleaseNotificationEvent release. + * @member {string} release + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.release = ""; + + /** + * ReleaseNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + */ + ReleaseNotificationEvent.prototype.type = 0; + + /** + * Creates a new ReleaseNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent instance + */ + ReleaseNotificationEvent.create = function create(properties) { + return new ReleaseNotificationEvent(properties); + }; + + /** + * Encodes the specified ReleaseNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent} message ReleaseNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.release); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ReleaseNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseNotificationEvent} message ReleaseNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ReleaseNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.release = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.release != null && message.hasOwnProperty("release")) + if (!$util.isString(message.release)) + return "release: 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; + } + return null; + }; + + /** + * Creates a ReleaseNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ReleaseNotificationEvent} ReleaseNotificationEvent + */ + ReleaseNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ReleaseNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.ReleaseNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.release != null) + message.release = String(object.release); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReleaseNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ReleaseNotificationEvent} message ReleaseNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.release = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.release != null && message.hasOwnProperty("release")) + object.release = message.release; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this ReleaseNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + ReleaseNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ReleaseNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ReleaseNotificationEvent"; + }; + + return ReleaseNotificationEvent; + })(); + + v1.ReleaseRenderEvent = (function() { + + /** + * Properties of a ReleaseRenderEvent. + * @memberof google.cloud.deploy.v1 + * @interface IReleaseRenderEvent + * @property {string|null} [message] ReleaseRenderEvent message + * @property {string|null} [release] ReleaseRenderEvent release + */ + + /** + * Constructs a new ReleaseRenderEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a ReleaseRenderEvent. + * @implements IReleaseRenderEvent + * @constructor + * @param {google.cloud.deploy.v1.IReleaseRenderEvent=} [properties] Properties to set + */ + function ReleaseRenderEvent(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]]; + } + + /** + * ReleaseRenderEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + */ + ReleaseRenderEvent.prototype.message = ""; + + /** + * ReleaseRenderEvent release. + * @member {string} release + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + */ + ReleaseRenderEvent.prototype.release = ""; + + /** + * Creates a new ReleaseRenderEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent instance + */ + ReleaseRenderEvent.create = function create(properties) { + return new ReleaseRenderEvent(properties); + }; + + /** + * Encodes the specified ReleaseRenderEvent message. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent} message ReleaseRenderEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseRenderEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.release != null && Object.hasOwnProperty.call(message, "release")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.release); + return writer; + }; + + /** + * Encodes the specified ReleaseRenderEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.ReleaseRenderEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.IReleaseRenderEvent} message ReleaseRenderEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReleaseRenderEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseRenderEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.ReleaseRenderEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.release = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReleaseRenderEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReleaseRenderEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReleaseRenderEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReleaseRenderEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.release != null && message.hasOwnProperty("release")) + if (!$util.isString(message.release)) + return "release: string expected"; + return null; + }; + + /** + * Creates a ReleaseRenderEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.ReleaseRenderEvent} ReleaseRenderEvent + */ + ReleaseRenderEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.ReleaseRenderEvent) + return object; + var message = new $root.google.cloud.deploy.v1.ReleaseRenderEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.release != null) + message.release = String(object.release); + return message; + }; + + /** + * Creates a plain object from a ReleaseRenderEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {google.cloud.deploy.v1.ReleaseRenderEvent} message ReleaseRenderEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReleaseRenderEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.release = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.release != null && message.hasOwnProperty("release")) + object.release = message.release; + return object; + }; + + /** + * Converts this ReleaseRenderEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @instance + * @returns {Object.} JSON object + */ + ReleaseRenderEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReleaseRenderEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.ReleaseRenderEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReleaseRenderEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.ReleaseRenderEvent"; + }; + + return ReleaseRenderEvent; + })(); + + v1.RolloutNotificationEvent = (function() { + + /** + * Properties of a RolloutNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface IRolloutNotificationEvent + * @property {string|null} [message] RolloutNotificationEvent message + * @property {string|null} [pipelineUid] RolloutNotificationEvent pipelineUid + * @property {string|null} [releaseUid] RolloutNotificationEvent releaseUid + * @property {string|null} [rollout] RolloutNotificationEvent rollout + * @property {google.cloud.deploy.v1.Type|null} [type] RolloutNotificationEvent type + * @property {string|null} [targetId] RolloutNotificationEvent targetId + */ + + /** + * Constructs a new RolloutNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a RolloutNotificationEvent. + * @implements IRolloutNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent=} [properties] Properties to set + */ + function RolloutNotificationEvent(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]]; + } + + /** + * RolloutNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.message = ""; + + /** + * RolloutNotificationEvent pipelineUid. + * @member {string} pipelineUid + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.pipelineUid = ""; + + /** + * RolloutNotificationEvent releaseUid. + * @member {string} releaseUid + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.releaseUid = ""; + + /** + * RolloutNotificationEvent rollout. + * @member {string} rollout + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.rollout = ""; + + /** + * RolloutNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.type = 0; + + /** + * RolloutNotificationEvent targetId. + * @member {string} targetId + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + */ + RolloutNotificationEvent.prototype.targetId = ""; + + /** + * Creates a new RolloutNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent instance + */ + RolloutNotificationEvent.create = function create(properties) { + return new RolloutNotificationEvent(properties); + }; + + /** + * Encodes the specified RolloutNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent} message RolloutNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.pipelineUid != null && Object.hasOwnProperty.call(message, "pipelineUid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pipelineUid); + if (message.releaseUid != null && Object.hasOwnProperty.call(message, "releaseUid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.releaseUid); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rollout); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.targetId); + return writer; + }; + + /** + * Encodes the specified RolloutNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.RolloutNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.IRolloutNotificationEvent} message RolloutNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.RolloutNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.pipelineUid = reader.string(); + break; + } + case 3: { + message.releaseUid = reader.string(); + break; + } + case 4: { + message.rollout = reader.string(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.targetId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + if (!$util.isString(message.pipelineUid)) + return "pipelineUid: string expected"; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + if (!$util.isString(message.releaseUid)) + return "releaseUid: string expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) + if (!$util.isString(message.rollout)) + return "rollout: 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.targetId != null && message.hasOwnProperty("targetId")) + if (!$util.isString(message.targetId)) + return "targetId: string expected"; + return null; + }; + + /** + * Creates a RolloutNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.RolloutNotificationEvent} RolloutNotificationEvent + */ + RolloutNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.RolloutNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.RolloutNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.pipelineUid != null) + message.pipelineUid = String(object.pipelineUid); + if (object.releaseUid != null) + message.releaseUid = String(object.releaseUid); + if (object.rollout != null) + message.rollout = String(object.rollout); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + if (object.targetId != null) + message.targetId = String(object.targetId); + return message; + }; + + /** + * Creates a plain object from a RolloutNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {google.cloud.deploy.v1.RolloutNotificationEvent} message RolloutNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.pipelineUid = ""; + object.releaseUid = ""; + object.rollout = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.targetId = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.pipelineUid != null && message.hasOwnProperty("pipelineUid")) + object.pipelineUid = message.pipelineUid; + if (message.releaseUid != null && message.hasOwnProperty("releaseUid")) + object.releaseUid = message.releaseUid; + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = message.rollout; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + if (message.targetId != null && message.hasOwnProperty("targetId")) + object.targetId = message.targetId; + return object; + }; + + /** + * Converts this RolloutNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + RolloutNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.RolloutNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.RolloutNotificationEvent"; + }; + + return RolloutNotificationEvent; + })(); + + v1.TargetNotificationEvent = (function() { + + /** + * Properties of a TargetNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @interface ITargetNotificationEvent + * @property {string|null} [message] TargetNotificationEvent message + * @property {string|null} [target] TargetNotificationEvent target + * @property {google.cloud.deploy.v1.Type|null} [type] TargetNotificationEvent type + */ + + /** + * Constructs a new TargetNotificationEvent. + * @memberof google.cloud.deploy.v1 + * @classdesc Represents a TargetNotificationEvent. + * @implements ITargetNotificationEvent + * @constructor + * @param {google.cloud.deploy.v1.ITargetNotificationEvent=} [properties] Properties to set + */ + function TargetNotificationEvent(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]]; + } + + /** + * TargetNotificationEvent message. + * @member {string} message + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.message = ""; + + /** + * TargetNotificationEvent target. + * @member {string} target + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.target = ""; + + /** + * TargetNotificationEvent type. + * @member {google.cloud.deploy.v1.Type} type + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + */ + TargetNotificationEvent.prototype.type = 0; + + /** + * Creates a new TargetNotificationEvent instance using the specified properties. + * @function create + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent=} [properties] Properties to set + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent instance + */ + TargetNotificationEvent.create = function create(properties) { + return new TargetNotificationEvent(properties); + }; + + /** + * Encodes the specified TargetNotificationEvent message. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent} message TargetNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNotificationEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.target); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified TargetNotificationEvent message, length delimited. Does not implicitly {@link google.cloud.deploy.v1.TargetNotificationEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.ITargetNotificationEvent} message TargetNotificationEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetNotificationEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNotificationEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.deploy.v1.TargetNotificationEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.target = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetNotificationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetNotificationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetNotificationEvent message. + * @function verify + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetNotificationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: 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; + } + return null; + }; + + /** + * Creates a TargetNotificationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.deploy.v1.TargetNotificationEvent} TargetNotificationEvent + */ + TargetNotificationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.deploy.v1.TargetNotificationEvent) + return object; + var message = new $root.google.cloud.deploy.v1.TargetNotificationEvent(); + if (object.message != null) + message.message = String(object.message); + if (object.target != null) + message.target = String(object.target); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PUBSUB_NOTIFICATION_FAILURE": + case 1: + message.type = 1; + break; + case "TYPE_RENDER_STATUES_CHANGE": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetNotificationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {google.cloud.deploy.v1.TargetNotificationEvent} message TargetNotificationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetNotificationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.target = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.deploy.v1.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this TargetNotificationEvent to JSON. + * @function toJSON + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @instance + * @returns {Object.} JSON object + */ + TargetNotificationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetNotificationEvent + * @function getTypeUrl + * @memberof google.cloud.deploy.v1.TargetNotificationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetNotificationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.deploy.v1.TargetNotificationEvent"; + }; + + return TargetNotificationEvent; + })(); + + return v1; + })(); + + return deploy; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-deploy/protos/protos.json b/packages/google-cloud-deploy/protos/protos.json new file mode 100644 index 000000000000..85547b0e1f5e --- /dev/null +++ b/packages/google-cloud-deploy/protos/protos.json @@ -0,0 +1,4142 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "deploy": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/deploy/v1;deploy", + "java_multiple_files": true, + "java_outer_classname": "TargetNotificationPayloadProto", + "java_package": "com.google.cloud.deploy.v1", + "(google.api.resource_definition).type": "gkehub.googleapis.com/Membership", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/memberships/{membership}" + }, + "nested": { + "CloudDeploy": { + "options": { + "(google.api.default_host)": "clouddeploy.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListDeliveryPipelines": { + "requestType": "ListDeliveryPipelinesRequest", + "responseType": "ListDeliveryPipelinesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/deliveryPipelines" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDeliveryPipeline": { + "requestType": "GetDeliveryPipelineRequest", + "responseType": "DeliveryPipeline", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDeliveryPipeline": { + "requestType": "CreateDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "(google.api.http).body": "delivery_pipeline", + "(google.api.method_signature)": "parent,delivery_pipeline,delivery_pipeline_id", + "(google.longrunning.operation_info).response_type": "DeliveryPipeline", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/deliveryPipelines", + "body": "delivery_pipeline" + } + }, + { + "(google.api.method_signature)": "parent,delivery_pipeline,delivery_pipeline_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeliveryPipeline", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateDeliveryPipeline": { + "requestType": "UpdateDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}", + "(google.api.http).body": "delivery_pipeline", + "(google.api.method_signature)": "delivery_pipeline,update_mask", + "(google.longrunning.operation_info).response_type": "DeliveryPipeline", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}", + "body": "delivery_pipeline" + } + }, + { + "(google.api.method_signature)": "delivery_pipeline,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeliveryPipeline", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDeliveryPipeline": { + "requestType": "DeleteDeliveryPipelineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/deliveryPipelines/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListTargets": { + "requestType": "ListTargetsRequest", + "responseType": "ListTargetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/targets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/targets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTarget": { + "requestType": "GetTargetRequest", + "responseType": "Target", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/targets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/targets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTarget": { + "requestType": "CreateTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/targets", + "(google.api.http).body": "target", + "(google.api.method_signature)": "parent,target,target_id", + "(google.longrunning.operation_info).response_type": "Target", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/targets", + "body": "target" + } + }, + { + "(google.api.method_signature)": "parent,target,target_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Target", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateTarget": { + "requestType": "UpdateTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{target.name=projects/*/locations/*/targets/*}", + "(google.api.http).body": "target", + "(google.api.method_signature)": "target,update_mask", + "(google.longrunning.operation_info).response_type": "Target", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{target.name=projects/*/locations/*/targets/*}", + "body": "target" + } + }, + { + "(google.api.method_signature)": "target,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Target", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteTarget": { + "requestType": "DeleteTargetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/targets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/targets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListReleases": { + "requestType": "ListReleasesRequest", + "responseType": "ListReleasesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRelease": { + "requestType": "GetReleaseRequest", + "responseType": "Release", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRelease": { + "requestType": "CreateReleaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "(google.api.http).body": "release", + "(google.api.method_signature)": "parent,release,release_id", + "(google.longrunning.operation_info).response_type": "Release", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases", + "body": "release" + } + }, + { + "(google.api.method_signature)": "parent,release,release_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Release", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "AbandonRelease": { + "requestType": "AbandonReleaseRequest", + "responseType": "AbandonReleaseResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}:abandon", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ApproveRollout": { + "requestType": "ApproveRolloutRequest", + "responseType": "ApproveRolloutResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRollouts": { + "requestType": "ListRolloutsRequest", + "responseType": "ListRolloutsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRollout": { + "requestType": "GetRolloutRequest", + "responseType": "Rollout", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRollout": { + "requestType": "CreateRolloutRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "(google.api.http).body": "rollout", + "(google.api.method_signature)": "parent,rollout,rollout_id", + "(google.longrunning.operation_info).response_type": "Rollout", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts", + "body": "rollout" + } + }, + { + "(google.api.method_signature)": "parent,rollout,rollout_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Rollout", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RetryJob": { + "requestType": "RetryJobRequest", + "responseType": "RetryJobResponse", + "options": { + "(google.api.http).post": "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob", + "(google.api.http).body": "*", + "(google.api.method_signature)": "rollout,phase_id,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{rollout=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:retryJob", + "body": "*" + } + }, + { + "(google.api.method_signature)": "rollout,phase_id,job_id" + } + ] + }, + "ListJobRuns": { + "requestType": "ListJobRunsRequest", + "responseType": "ListJobRunsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}/jobRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetJobRun": { + "requestType": "GetJobRunRequest", + "responseType": "JobRun", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetConfig": { + "requestType": "GetConfigRequest", + "responseType": "Config", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/config}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/config}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "DeliveryPipeline": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/DeliveryPipeline", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}" + }, + "oneofs": { + "pipeline": { + "oneof": [ + "serialPipeline" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serialPipeline": { + "type": "SerialPipeline", + "id": 8 + }, + "condition": { + "type": "PipelineCondition", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 10 + }, + "suspended": { + "type": "bool", + "id": 12 + } + } + }, + "SerialPipeline": { + "fields": { + "stages": { + "rule": "repeated", + "type": "Stage", + "id": 1 + } + } + }, + "Stage": { + "fields": { + "targetId": { + "type": "string", + "id": 1 + }, + "profiles": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "strategy": { + "type": "Strategy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Strategy": { + "oneofs": { + "deploymentStrategy": { + "oneof": [ + "standard" + ] + } + }, + "fields": { + "standard": { + "type": "Standard", + "id": 1 + } + } + }, + "Standard": { + "fields": { + "verify": { + "type": "bool", + "id": 1 + } + } + }, + "PipelineReadyCondition": { + "fields": { + "status": { + "type": "bool", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "TargetsPresentCondition": { + "fields": { + "status": { + "type": "bool", + "id": 1 + }, + "missingTargets": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "PipelineCondition": { + "fields": { + "pipelineReadyCondition": { + "type": "PipelineReadyCondition", + "id": 1 + }, + "targetsPresentCondition": { + "type": "TargetsPresentCondition", + "id": 3 + } + } + }, + "ListDeliveryPipelinesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListDeliveryPipelinesResponse": { + "fields": { + "deliveryPipelines": { + "rule": "repeated", + "type": "DeliveryPipeline", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDeliveryPipelineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + } + } + }, + "CreateDeliveryPipelineRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "deliveryPipelineId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliveryPipeline": { + "type": "DeliveryPipeline", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateDeliveryPipelineRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deliveryPipeline": { + "type": "DeliveryPipeline", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteDeliveryPipelineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Target": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Target", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/targets/{target}" + }, + "oneofs": { + "deploymentTarget": { + "oneof": [ + "gke", + "anthosCluster", + "run" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requireApproval": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gke": { + "type": "GkeCluster", + "id": 15 + }, + "anthosCluster": { + "type": "AnthosCluster", + "id": 17 + }, + "run": { + "type": "CloudRunLocation", + "id": 18 + }, + "etag": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionConfigs": { + "rule": "repeated", + "type": "ExecutionConfig", + "id": 16 + } + } + }, + "ExecutionConfig": { + "oneofs": { + "executionEnvironment": { + "oneof": [ + "defaultPool", + "privatePool" + ] + } + }, + "fields": { + "usages": { + "rule": "repeated", + "type": "ExecutionEnvironmentUsage", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "defaultPool": { + "type": "DefaultPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "privatePool": { + "type": "PrivatePool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerPool": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ExecutionEnvironmentUsage": { + "values": { + "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED": 0, + "RENDER": 1, + "DEPLOY": 2, + "VERIFY": 3 + } + } + } + }, + "DefaultPool": { + "fields": { + "serviceAccount": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PrivatePool": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "artifactStorage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GkeCluster": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "internalIp": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AnthosCluster": { + "fields": { + "membership": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "gkehub.googleapis.com/Membership" + } + } + } + }, + "CloudRunLocation": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + } + } + }, + "ListTargetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/Target" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTargetsResponse": { + "fields": { + "targets": { + "rule": "repeated", + "type": "Target", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTargetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + } + } + }, + "CreateTargetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "clouddeploy.googleapis.com/Target" + } + }, + "targetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "target": { + "type": "Target", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTargetRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "target": { + "type": "Target", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTargetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Target" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Release": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Release", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "abandoned": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderStartTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderEndTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "skaffoldConfigUri": { + "type": "string", + "id": 17 + }, + "skaffoldConfigPath": { + "type": "string", + "id": 9 + }, + "buildArtifacts": { + "rule": "repeated", + "type": "BuildArtifact", + "id": 10 + }, + "deliveryPipelineSnapshot": { + "type": "DeliveryPipeline", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetSnapshots": { + "rule": "repeated", + "type": "Target", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renderState": { + "type": "RenderState", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 16 + }, + "skaffoldVersion": { + "type": "string", + "id": 19 + }, + "targetArtifacts": { + "keyType": "string", + "type": "TargetArtifact", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetRenders": { + "keyType": "string", + "type": "TargetRender", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RenderState": { + "values": { + "RENDER_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3 + } + }, + "TargetRender": { + "fields": { + "renderingBuild": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "renderingState": { + "type": "TargetRenderState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TargetRenderState": { + "values": { + "TARGET_RENDER_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3 + } + }, + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2 + } + } + } + } + } + }, + "BuildArtifact": { + "fields": { + "image": { + "type": "string", + "id": 3 + }, + "tag": { + "type": "string", + "id": 2 + } + } + }, + "TargetArtifact": { + "oneofs": { + "uri": { + "oneof": [ + "artifactUri" + ] + } + }, + "fields": { + "artifactUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "skaffoldConfigPath": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "manifestPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListReleasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReleasesResponse": { + "fields": { + "releases": { + "rule": "repeated", + "type": "Release", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetReleaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + } + } + }, + "CreateReleaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/DeliveryPipeline" + } + }, + "releaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "release": { + "type": "Release", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Rollout": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Rollout", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approveTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enqueueTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployStartTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployEndTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetId": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "approvalState": { + "type": "ApprovalState", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureReason": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployingBuild": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "etag": { + "type": "string", + "id": 16 + }, + "deployFailureCause": { + "type": "FailureCause", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "phases": { + "rule": "repeated", + "type": "Phase", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "type": "Metadata", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ApprovalState": { + "values": { + "APPROVAL_STATE_UNSPECIFIED": 0, + "NEEDS_APPROVAL": 1, + "DOES_NOT_NEED_APPROVAL": 2, + "APPROVED": 3, + "REJECTED": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "IN_PROGRESS": 3, + "PENDING_APPROVAL": 4, + "APPROVAL_REJECTED": 5, + "PENDING": 6, + "PENDING_RELEASE": 7 + } + }, + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3, + "RELEASE_FAILED": 4, + "RELEASE_ABANDONED": 5, + "VERIFICATION_CONFIG_NOT_FOUND": 6 + } + } + } + }, + "Metadata": { + "fields": { + "cloudRun": { + "type": "CloudRunMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeployJobRunMetadata": { + "fields": { + "cloudRun": { + "type": "CloudRunMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CloudRunMetadata": { + "fields": { + "service": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceUrls": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revision": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Phase": { + "oneofs": { + "jobs": { + "oneof": [ + "deploymentJobs" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deploymentJobs": { + "type": "DeploymentJobs", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "IN_PROGRESS": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "ABORTED": 5 + } + } + } + }, + "DeploymentJobs": { + "fields": { + "deployJob": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJob": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "oneofs": { + "jobType": { + "oneof": [ + "deployJob", + "verifyJob" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobRun": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/JobRun" + } + }, + "deployJob": { + "type": "DeployJob", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJob": { + "type": "VerifyJob", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "DISABLED": 2, + "IN_PROGRESS": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "ABORTED": 6 + } + } + } + }, + "DeployJob": { + "fields": {} + }, + "VerifyJob": { + "fields": {} + }, + "ListRolloutsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRolloutsResponse": { + "fields": { + "rollouts": { + "rule": "repeated", + "type": "Rollout", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + } + } + }, + "CreateRolloutRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + }, + "rolloutId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rollout": { + "type": "Rollout", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ApproveRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "approved": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ApproveRolloutResponse": { + "fields": {} + }, + "RetryJobRequest": { + "fields": { + "rollout": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "phaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RetryJobResponse": { + "fields": {} + }, + "AbandonReleaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Release" + } + } + } + }, + "AbandonReleaseResponse": { + "fields": {} + }, + "JobRun": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/JobRun", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}" + }, + "oneofs": { + "jobRun": { + "oneof": [ + "deployJobRun", + "verifyJobRun" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "phaseId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deployJobRun": { + "type": "DeployJobRun", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verifyJobRun": { + "type": "VerifyJobRun", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + } + } + }, + "DeployJobRun": { + "fields": { + "build": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "type": "DeployJobRunMetadata", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3 + } + } + } + }, + "VerifyJobRun": { + "fields": { + "build": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "artifactUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eventLogPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureCause": { + "type": "FailureCause", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "FailureCause": { + "values": { + "FAILURE_CAUSE_UNSPECIFIED": 0, + "CLOUD_BUILD_UNAVAILABLE": 1, + "EXECUTION_FAILED": 2, + "DEADLINE_EXCEEDED": 3, + "VERIFICATION_CONFIG_NOT_FOUND": 4 + } + } + } + }, + "ListJobRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Rollout" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobRunsResponse": { + "fields": { + "jobRuns": { + "rule": "repeated", + "type": "JobRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetJobRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/JobRun" + } + } + } + }, + "Config": { + "options": { + "(google.api.resource).type": "clouddeploy.googleapis.com/Config", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/config" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "supportedVersions": { + "rule": "repeated", + "type": "SkaffoldVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultSkaffoldVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SkaffoldVersion": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "supportEndDate": { + "type": "google.type.Date", + "id": 2 + } + } + }, + "GetConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "clouddeploy.googleapis.com/Config" + } + } + } + }, + "DeliveryPipelineNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "deliveryPipeline": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TYPE_PUBSUB_NOTIFICATION_FAILURE": 1, + "TYPE_RENDER_STATUES_CHANGE": 2 + } + }, + "JobRunNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "jobRun": { + "type": "string", + "id": 2 + }, + "pipelineUid": { + "type": "string", + "id": 3 + }, + "releaseUid": { + "type": "string", + "id": 4 + }, + "rolloutUid": { + "type": "string", + "id": 5 + }, + "targetId": { + "type": "string", + "id": 6 + }, + "type": { + "type": "Type", + "id": 7 + } + } + }, + "ReleaseNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "release": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + }, + "ReleaseRenderEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "release": { + "type": "string", + "id": 2 + } + } + }, + "RolloutNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "pipelineUid": { + "type": "string", + "id": 2 + }, + "releaseUid": { + "type": "string", + "id": 3 + }, + "rollout": { + "type": "string", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "targetId": { + "type": "string", + "id": 6 + } + } + }, + "TargetNotificationEvent": { + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "target": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3 + } + } + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-deploy/samples/README.md b/packages/google-cloud-deploy/samples/README.md new file mode 100644 index 000000000000..abc484235774 --- /dev/null +++ b/packages/google-cloud-deploy/samples/README.md @@ -0,0 +1,464 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Deploy: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Cloud_deploy.abandon_release](#cloud_deploy.abandon_release) + * [Cloud_deploy.approve_rollout](#cloud_deploy.approve_rollout) + * [Cloud_deploy.create_delivery_pipeline](#cloud_deploy.create_delivery_pipeline) + * [Cloud_deploy.create_release](#cloud_deploy.create_release) + * [Cloud_deploy.create_rollout](#cloud_deploy.create_rollout) + * [Cloud_deploy.create_target](#cloud_deploy.create_target) + * [Cloud_deploy.delete_delivery_pipeline](#cloud_deploy.delete_delivery_pipeline) + * [Cloud_deploy.delete_target](#cloud_deploy.delete_target) + * [Cloud_deploy.get_config](#cloud_deploy.get_config) + * [Cloud_deploy.get_delivery_pipeline](#cloud_deploy.get_delivery_pipeline) + * [Cloud_deploy.get_job_run](#cloud_deploy.get_job_run) + * [Cloud_deploy.get_release](#cloud_deploy.get_release) + * [Cloud_deploy.get_rollout](#cloud_deploy.get_rollout) + * [Cloud_deploy.get_target](#cloud_deploy.get_target) + * [Cloud_deploy.list_delivery_pipelines](#cloud_deploy.list_delivery_pipelines) + * [Cloud_deploy.list_job_runs](#cloud_deploy.list_job_runs) + * [Cloud_deploy.list_releases](#cloud_deploy.list_releases) + * [Cloud_deploy.list_rollouts](#cloud_deploy.list_rollouts) + * [Cloud_deploy.list_targets](#cloud_deploy.list_targets) + * [Cloud_deploy.retry_job](#cloud_deploy.retry_job) + * [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline) + * [Cloud_deploy.update_target](#cloud_deploy.update_target) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Cloud_deploy.abandon_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js` + + +----- + + + + +### Cloud_deploy.approve_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js` + + +----- + + + + +### Cloud_deploy.create_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.create_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js` + + +----- + + + + +### Cloud_deploy.create_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js` + + +----- + + + + +### Cloud_deploy.create_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js` + + +----- + + + + +### Cloud_deploy.delete_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.delete_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js` + + +----- + + + + +### Cloud_deploy.get_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js` + + +----- + + + + +### Cloud_deploy.get_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.get_job_run + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js` + + +----- + + + + +### Cloud_deploy.get_release + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js` + + +----- + + + + +### Cloud_deploy.get_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js` + + +----- + + + + +### Cloud_deploy.get_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js` + + +----- + + + + +### Cloud_deploy.list_delivery_pipelines + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js` + + +----- + + + + +### Cloud_deploy.list_job_runs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js` + + +----- + + + + +### Cloud_deploy.list_releases + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js` + + +----- + + + + +### Cloud_deploy.list_rollouts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js` + + +----- + + + + +### Cloud_deploy.list_targets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js` + + +----- + + + + +### Cloud_deploy.retry_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js` + + +----- + + + + +### Cloud_deploy.update_delivery_pipeline + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js` + + +----- + + + + +### Cloud_deploy.update_target + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-deploy/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/deploy/ diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js new file mode 100644 index 000000000000..efbb667979a4 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.abandon_release.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callAbandonRelease() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.abandonRelease(request); + console.log(response); + } + + callAbandonRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js new file mode 100644 index 000000000000..e998b6c1ba3e --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(name, approved) { + // [START clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + */ + // const name = 'abc123' + /** + * Required. True = approve; false = reject + */ + // const approved = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callApproveRollout() { + // Construct request + const request = { + name, + approved, + }; + + // Run request + const response = await deployClient.approveRollout(request); + console.log(response); + } + + callApproveRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js new file mode 100644 index 000000000000..4432b55be544 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js @@ -0,0 +1,92 @@ +// Copyright 2022 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'; + +function main(parent, deliveryPipelineId, deliveryPipeline) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `DeliveryPipeline`. + */ + // const deliveryPipelineId = 'abc123' + /** + * Required. The `DeliveryPipeline` to create. + */ + // const deliveryPipeline = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateDeliveryPipeline() { + // Construct request + const request = { + parent, + deliveryPipelineId, + deliveryPipeline, + }; + + // Run request + const [operation] = await deployClient.createDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js new file mode 100644 index 000000000000..7179e4416226 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js @@ -0,0 +1,93 @@ +// Copyright 2022 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'; + +function main(parent, releaseId, release) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Release`. + */ + // const releaseId = 'abc123' + /** + * Required. The `Release` to create. + */ + // const release = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateRelease() { + // Construct request + const request = { + parent, + releaseId, + release, + }; + + // Run request + const [operation] = await deployClient.createRelease(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js new file mode 100644 index 000000000000..9d04a45da3ad --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_rollout.js @@ -0,0 +1,93 @@ +// Copyright 2022 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'; + +function main(parent, rolloutId, rollout) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Rollout`. + */ + // const rolloutId = 'abc123' + /** + * Required. The `Rollout` to create. + */ + // const rollout = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateRollout() { + // Construct request + const request = { + parent, + rolloutId, + rollout, + }; + + // Run request + const [operation] = await deployClient.createRollout(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js new file mode 100644 index 000000000000..7241169b91e7 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_target.js @@ -0,0 +1,93 @@ +// Copyright 2022 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'; + +function main(parent, targetId, target) { + // [START clouddeploy_v1_generated_CloudDeploy_CreateTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Required. ID of the `Target`. + */ + // const targetId = 'abc123' + /** + * Required. The `Target` to create. + */ + // const target = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callCreateTarget() { + // Construct request + const request = { + parent, + targetId, + target, + }; + + // Run request + const [operation] = await deployClient.createTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_CreateTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js new file mode 100644 index 000000000000..45ee126c493e --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js @@ -0,0 +1,99 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + */ + // const allowMissing = true + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + */ + // const validateOnly = true + /** + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + */ + // const force = true + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callDeleteDeliveryPipeline() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await deployClient.deleteDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js new file mode 100644 index 000000000000..924acdecddde --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js @@ -0,0 +1,93 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + */ + // const allowMissing = true + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + */ + // const validateOnly = true + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + */ + // const etag = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callDeleteTarget() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await deployClient.deleteTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js new file mode 100644 index 000000000000..020fa6754770 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of requested configuration. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getConfig(request); + console.log(response); + } + + callGetConfig(); + // [END clouddeploy_v1_generated_CloudDeploy_GetConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js new file mode 100644 index 000000000000..4446e09eb6aa --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetDeliveryPipeline() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getDeliveryPipeline(request); + console.log(response); + } + + callGetDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js new file mode 100644 index 000000000000..e7e9147e027f --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetJobRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetJobRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getJobRun(request); + console.log(response); + } + + callGetJobRun(); + // [END clouddeploy_v1_generated_CloudDeploy_GetJobRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js new file mode 100644 index 000000000000..4130f1f1f3d5 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_release.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetRelease_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetRelease() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getRelease(request); + console.log(response); + } + + callGetRelease(); + // [END clouddeploy_v1_generated_CloudDeploy_GetRelease_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js new file mode 100644 index 000000000000..d5e64fa2b0a6 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_rollout.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getRollout(request); + console.log(response); + } + + callGetRollout(); + // [END clouddeploy_v1_generated_CloudDeploy_GetRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js new file mode 100644 index 000000000000..55d5e9632046 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_target.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START clouddeploy_v1_generated_CloudDeploy_GetTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + */ + // const name = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callGetTarget() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await deployClient.getTarget(request); + console.log(response); + } + + callGetTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_GetTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js new file mode 100644 index 000000000000..63298cdfc0ec --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js @@ -0,0 +1,87 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDeliveryPipelines(); + // [END clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js new file mode 100644 index 000000000000..0bc1c0a66695 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `Rollout` which owns this collection of `JobRun` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * When paginating, all other provided parameters match the call that provided + * the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListJobRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listJobRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobRuns(); + // [END clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js new file mode 100644 index 000000000000..d635dcdad8ae --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_releases.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START clouddeploy_v1_generated_CloudDeploy_ListReleases_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListReleases() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listReleasesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReleases(); + // [END clouddeploy_v1_generated_CloudDeploy_ListReleases_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js new file mode 100644 index 000000000000..cb6dab835daa --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_rollouts.js @@ -0,0 +1,85 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START clouddeploy_v1_generated_CloudDeploy_ListRollouts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `Release` which owns this collection of `Rollout` objects. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListRollouts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listRolloutsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRollouts(); + // [END clouddeploy_v1_generated_CloudDeploy_ListRollouts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js new file mode 100644 index 000000000000..34c7cf51d834 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_targets.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START clouddeploy_v1_generated_CloudDeploy_ListTargets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callListTargets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listTargetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTargets(); + // [END clouddeploy_v1_generated_CloudDeploy_ListTargets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js new file mode 100644 index 000000000000..947255955665 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.retry_job.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(rollout, phaseId, jobId) { + // [START clouddeploy_v1_generated_CloudDeploy_RetryJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + */ + // const rollout = 'abc123' + /** + * Required. The phase ID the Job to retry belongs to. + */ + // const phaseId = 'abc123' + /** + * Required. The job ID for the Job to retry. + */ + // const jobId = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callRetryJob() { + // Construct request + const request = { + rollout, + phaseId, + jobId, + }; + + // Run request + const response = await deployClient.retryJob(request); + console.log(response); + } + + callRetryJob(); + // [END clouddeploy_v1_generated_CloudDeploy_RetryJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js new file mode 100644 index 000000000000..0cad66e7f565 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js @@ -0,0 +1,95 @@ +// Copyright 2022 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'; + +function main(updateMask, deliveryPipeline) { + // [START clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The `DeliveryPipeline` to update. + */ + // const deliveryPipeline = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + */ + // const allowMissing = true + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callUpdateDeliveryPipeline() { + // Construct request + const request = { + updateMask, + deliveryPipeline, + }; + + // Run request + const [operation] = await deployClient.updateDeliveryPipeline(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDeliveryPipeline(); + // [END clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js new file mode 100644 index 000000000000..aa31f9966a16 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js @@ -0,0 +1,95 @@ +// Copyright 2022 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'; + +function main(updateMask, target) { + // [START clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The `Target` to update. + */ + // const target = {} + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + */ + // const allowMissing = true + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + */ + // const validateOnly = true + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function callUpdateTarget() { + // Construct request + const request = { + updateMask, + target, + }; + + // Run request + const [operation] = await deployClient.updateTarget(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTarget(); + // [END clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json new file mode 100644 index 000000000000..98bb9f40d259 --- /dev/null +++ b/packages/google-cloud-deploy/samples/generated/v1/snippet_metadata.google.cloud.deploy.v1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "nodejs-deploy", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.deploy.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async", + "title": "CloudDeploy listDeliveryPipelines Sample", + "origin": "API_DEFINITION", + "description": " Lists DeliveryPipelines in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_delivery_pipelines.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDeliveryPipelines", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelines", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListDeliveryPipelinesResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListDeliveryPipelines", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListDeliveryPipelines", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async", + "title": "CloudDeploy getDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.get_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.DeliveryPipeline", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async", + "title": "CloudDeploy createDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Creates a new DeliveryPipeline in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "delivery_pipeline_id", + "type": "TYPE_STRING" + }, + { + "name": "delivery_pipeline", + "type": ".google.cloud.deploy.v1.DeliveryPipeline" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async", + "title": "CloudDeploy updateDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.update_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "delivery_pipeline", + "type": ".google.cloud.deploy.v1.DeliveryPipeline" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "UpdateDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async", + "title": "CloudDeploy deleteDeliveryPipeline Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single DeliveryPipeline.", + "canonical": true, + "file": "cloud_deploy.delete_delivery_pipeline.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipeline", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "DeleteDeliveryPipeline", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteDeliveryPipeline", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListTargets_async", + "title": "CloudDeploy listTargets Sample", + "origin": "API_DEFINITION", + "description": " Lists Targets in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_targets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTargets", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListTargets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListTargetsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListTargets", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListTargets", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetTarget_async", + "title": "CloudDeploy getTarget Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Target.", + "canonical": true, + "file": "cloud_deploy.get_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetTarget", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Target", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateTarget_async", + "title": "CloudDeploy createTarget Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Target in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateTarget", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "target_id", + "type": "TYPE_STRING" + }, + { + "name": "target", + "type": ".google.cloud.deploy.v1.Target" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async", + "title": "CloudDeploy updateTarget Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Target.", + "canonical": true, + "file": "cloud_deploy.update_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateTarget", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "target", + "type": ".google.cloud.deploy.v1.Target" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "UpdateTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.UpdateTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async", + "title": "CloudDeploy deleteTarget Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Target.", + "canonical": true, + "file": "cloud_deploy.delete_target.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteTarget", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "DeleteTarget", + "fullName": "google.cloud.deploy.v1.CloudDeploy.DeleteTarget", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListReleases_async", + "title": "CloudDeploy listReleases Sample", + "origin": "API_DEFINITION", + "description": " Lists Releases in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_releases.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReleases", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListReleases", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListReleasesResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListReleases", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListReleases", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetRelease_async", + "title": "CloudDeploy getRelease Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Release.", + "canonical": true, + "file": "cloud_deploy.get_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRelease", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Release", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateRelease_async", + "title": "CloudDeploy createRelease Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Release in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRelease", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "release_id", + "type": "TYPE_STRING" + }, + { + "name": "release", + "type": ".google.cloud.deploy.v1.Release" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async", + "title": "CloudDeploy abandonRelease Sample", + "origin": "API_DEFINITION", + "description": " Abandons a Release in the Delivery Pipeline.", + "canonical": true, + "file": "cloud_deploy.abandon_release.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AbandonRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.AbandonRelease", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.AbandonReleaseResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "AbandonRelease", + "fullName": "google.cloud.deploy.v1.CloudDeploy.AbandonRelease", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async", + "title": "CloudDeploy approveRollout Sample", + "origin": "API_DEFINITION", + "description": " Approves a Rollout.", + "canonical": true, + "file": "cloud_deploy.approve_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApproveRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ApproveRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "approved", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.deploy.v1.ApproveRolloutResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ApproveRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ApproveRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListRollouts_async", + "title": "CloudDeploy listRollouts Sample", + "origin": "API_DEFINITION", + "description": " Lists Rollouts in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_rollouts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRollouts", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListRollouts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListRolloutsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListRollouts", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListRollouts", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetRollout_async", + "title": "CloudDeploy getRollout Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Rollout.", + "canonical": true, + "file": "cloud_deploy.get_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Rollout", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_CreateRollout_async", + "title": "CloudDeploy createRollout Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Rollout in a given project and location.", + "canonical": true, + "file": "cloud_deploy.create_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRollout", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rollout_id", + "type": "TYPE_STRING" + }, + { + "name": "rollout", + "type": ".google.cloud.deploy.v1.Rollout" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "CreateRollout", + "fullName": "google.cloud.deploy.v1.CloudDeploy.CreateRollout", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_RetryJob_async", + "title": "CloudDeploy retryJob Sample", + "origin": "API_DEFINITION", + "description": " Retries the specified Job in a Rollout.", + "canonical": true, + "file": "cloud_deploy.retry_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetryJob", + "fullName": "google.cloud.deploy.v1.CloudDeploy.RetryJob", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": "TYPE_STRING" + }, + { + "name": "phase_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.RetryJobResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "RetryJob", + "fullName": "google.cloud.deploy.v1.CloudDeploy.RetryJob", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async", + "title": "CloudDeploy listJobRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists JobRuns in a given project and location.", + "canonical": true, + "file": "cloud_deploy.list_job_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobRuns", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListJobRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.ListJobRunsResponse", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "ListJobRuns", + "fullName": "google.cloud.deploy.v1.CloudDeploy.ListJobRuns", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetJobRun_async", + "title": "CloudDeploy getJobRun Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single JobRun.", + "canonical": true, + "file": "cloud_deploy.get_job_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobRun", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetJobRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.JobRun", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetJobRun", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetJobRun", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + }, + { + "regionTag": "clouddeploy_v1_generated_CloudDeploy_GetConfig_async", + "title": "CloudDeploy getConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets the configuration for a location.", + "canonical": true, + "file": "cloud_deploy.get_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConfig", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.deploy.v1.Config", + "client": { + "shortName": "CloudDeployClient", + "fullName": "google.cloud.deploy.v1.CloudDeployClient" + }, + "method": { + "shortName": "GetConfig", + "fullName": "google.cloud.deploy.v1.CloudDeploy.GetConfig", + "service": { + "shortName": "CloudDeploy", + "fullName": "google.cloud.deploy.v1.CloudDeploy" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-deploy/samples/package.json b/packages/google-cloud-deploy/samples/package.json new file mode 100644 index 000000000000..ce386e55197a --- /dev/null +++ b/packages/google-cloud-deploy/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-deploy", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/deploy": "^2.2.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0" + } +} diff --git a/packages/google-cloud-deploy/samples/quickstart.js b/packages/google-cloud-deploy/samples/quickstart.js new file mode 100644 index 000000000000..62c40ac106ef --- /dev/null +++ b/packages/google-cloud-deploy/samples/quickstart.js @@ -0,0 +1,78 @@ +// 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 +// +// 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. + +'use strict'; + +function main(parent) { + // [START clouddeploy_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + */ + // const parent = 'abc123' + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + */ + // const filter = 'abc123' + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Deploy library + const {CloudDeployClient} = require('@google-cloud/deploy').v1; + + // Instantiates a client + const deployClient = new CloudDeployClient(); + + async function listDeliveryPipelines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await deployClient.listDeliveryPipelinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listDeliveryPipelines(); + // [END clouddeploy_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-deploy/samples/test/quickstart.js b/packages/google-cloud-deploy/samples/test/quickstart.js new file mode 100644 index 000000000000..3c783c46cc22 --- /dev/null +++ b/packages/google-cloud-deploy/samples/test/quickstart.js @@ -0,0 +1,48 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {CloudDeployClient} = require('@google-cloud/deploy'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new CloudDeployClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); + assert(stdout !== null); + }); +}); diff --git a/packages/google-cloud-deploy/src/index.ts b/packages/google-cloud-deploy/src/index.ts new file mode 100644 index 000000000000..50fdb29ebeb3 --- /dev/null +++ b/packages/google-cloud-deploy/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const CloudDeployClient = v1.CloudDeployClient; +type CloudDeployClient = v1.CloudDeployClient; + +export {v1, CloudDeployClient}; +export default {v1, CloudDeployClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts new file mode 100644 index 000000000000..581b14d6c4f4 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client.ts @@ -0,0 +1,4848 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} 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/cloud_deploy_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_deploy_client_config.json'; +const version = require('../../../package.json').version; + +/** + * CloudDeploy service creates and manages Continuous Delivery operations + * on Google Cloud Platform via Skaffold (https://skaffold.dev). + * @class + * @memberof v1 + */ +export class CloudDeployClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudDeployStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudDeployClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 CloudDeployClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CloudDeployClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + buildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/builds/{build}' + ), + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + configPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/config' + ), + deliveryPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}' + ), + jobRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + membershipPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/memberships/{membership}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + releasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}' + ), + rolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}' + ), + targetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/targets/{target}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listDeliveryPipelines: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'deliveryPipelines' + ), + listTargets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'targets' + ), + listReleases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'releases' + ), + listRollouts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rollouts' + ), + listJobRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobRuns' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/targets/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/targets/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/targets/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeliveryPipeline' + ) as gax.protobuf.Type; + const createDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.DeliveryPipeline' + ) as gax.protobuf.Type; + const updateDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDeliveryPipelineResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDeliveryPipelineMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTargetResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Target' + ) as gax.protobuf.Type; + const createTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTargetResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Target' + ) as gax.protobuf.Type; + const updateTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTargetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTargetMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createReleaseResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Release' + ) as gax.protobuf.Type; + const createReleaseMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createRolloutResponse = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.Rollout' + ) as gax.protobuf.Type; + const createRolloutMetadata = protoFilesRoot.lookup( + '.google.cloud.deploy.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDeliveryPipelineResponse.decode.bind( + createDeliveryPipelineResponse + ), + createDeliveryPipelineMetadata.decode.bind( + createDeliveryPipelineMetadata + ) + ), + updateDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDeliveryPipelineResponse.decode.bind( + updateDeliveryPipelineResponse + ), + updateDeliveryPipelineMetadata.decode.bind( + updateDeliveryPipelineMetadata + ) + ), + deleteDeliveryPipeline: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDeliveryPipelineResponse.decode.bind( + deleteDeliveryPipelineResponse + ), + deleteDeliveryPipelineMetadata.decode.bind( + deleteDeliveryPipelineMetadata + ) + ), + createTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTargetResponse.decode.bind(createTargetResponse), + createTargetMetadata.decode.bind(createTargetMetadata) + ), + updateTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTargetResponse.decode.bind(updateTargetResponse), + updateTargetMetadata.decode.bind(updateTargetMetadata) + ), + deleteTarget: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTargetResponse.decode.bind(deleteTargetResponse), + deleteTargetMetadata.decode.bind(deleteTargetMetadata) + ), + createRelease: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createReleaseResponse.decode.bind(createReleaseResponse), + createReleaseMetadata.decode.bind(createReleaseMetadata) + ), + createRollout: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRolloutResponse.decode.bind(createRolloutResponse), + createRolloutMetadata.decode.bind(createRolloutMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.deploy.v1.CloudDeploy', + 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.cloudDeployStub) { + return this.cloudDeployStub; + } + + // Put together the "service stub" for + // google.cloud.deploy.v1.CloudDeploy. + this.cloudDeployStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.deploy.v1.CloudDeploy' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.deploy.v1.CloudDeploy, + 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 cloudDeployStubMethods = [ + 'listDeliveryPipelines', + 'getDeliveryPipeline', + 'createDeliveryPipeline', + 'updateDeliveryPipeline', + 'deleteDeliveryPipeline', + 'listTargets', + 'getTarget', + 'createTarget', + 'updateTarget', + 'deleteTarget', + 'listReleases', + 'getRelease', + 'createRelease', + 'abandonRelease', + 'approveRollout', + 'listRollouts', + 'getRollout', + 'createRollout', + 'retryJob', + 'listJobRuns', + 'getJobRun', + 'getConfig', + ]; + for (const methodName of cloudDeployStubMethods) { + const callPromise = this.cloudDeployStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudDeployStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'clouddeploy.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'clouddeploy.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Gets details of a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @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 [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_async + */ + getDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest | undefined, + {} | undefined + ] + >; + getDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + | protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IGetDeliveryPipelineRequest | 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.getDeliveryPipeline(request, options, callback); + } + /** + * Gets details of a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @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 [Target]{@link google.cloud.deploy.v1.Target}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetTarget_async + */ + getTarget( + request?: protos.google.cloud.deploy.v1.IGetTargetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | undefined, + {} | undefined + ] + >; + getTarget( + request: protos.google.cloud.deploy.v1.IGetTargetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): void; + getTarget( + request: protos.google.cloud.deploy.v1.IGetTargetRequest, + callback: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): void; + getTarget( + request?: protos.google.cloud.deploy.v1.IGetTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IGetTargetRequest | 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.getTarget(request, options, callback); + } + /** + * Gets details of a single Release. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @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 [Release]{@link google.cloud.deploy.v1.Release}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetRelease_async + */ + getRelease( + request?: protos.google.cloud.deploy.v1.IGetReleaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | undefined, + {} | undefined + ] + >; + getRelease( + request: protos.google.cloud.deploy.v1.IGetReleaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getRelease( + request: protos.google.cloud.deploy.v1.IGetReleaseRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + getRelease( + request?: protos.google.cloud.deploy.v1.IGetReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IGetReleaseRequest | 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.getRelease(request, options, callback); + } + /** + * Abandons a Release in the Delivery Pipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the Release. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}. + * @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 [AbandonReleaseResponse]{@link google.cloud.deploy.v1.AbandonReleaseResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.abandon_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_AbandonRelease_async + */ + abandonRelease( + request?: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | undefined, + {} | undefined + ] + >; + abandonRelease( + request: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + abandonRelease( + request: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): void; + abandonRelease( + request?: protos.google.cloud.deploy.v1.IAbandonReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + | protos.google.cloud.deploy.v1.IAbandonReleaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IAbandonReleaseResponse, + protos.google.cloud.deploy.v1.IAbandonReleaseRequest | 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.abandonRelease(request, options, callback); + } + /** + * Approves a Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param {boolean} request.approved + * Required. True = approve; false = reject + * @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 [ApproveRolloutResponse]{@link google.cloud.deploy.v1.ApproveRolloutResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.approve_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ApproveRollout_async + */ + approveRollout( + request?: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | undefined, + {} | undefined + ] + >; + approveRollout( + request: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + approveRollout( + request: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + approveRollout( + request?: protos.google.cloud.deploy.v1.IApproveRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + | protos.google.cloud.deploy.v1.IApproveRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IApproveRolloutResponse, + protos.google.cloud.deploy.v1.IApproveRolloutRequest | 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.approveRollout(request, options, callback); + } + /** + * Gets details of a single Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * @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 [Rollout]{@link google.cloud.deploy.v1.Rollout}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetRollout_async + */ + getRollout( + request?: protos.google.cloud.deploy.v1.IGetRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | undefined, + {} | undefined + ] + >; + getRollout( + request: protos.google.cloud.deploy.v1.IGetRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + getRollout( + request: protos.google.cloud.deploy.v1.IGetRolloutRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): void; + getRollout( + request?: protos.google.cloud.deploy.v1.IGetRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IGetRolloutRequest | 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.getRollout(request, options, callback); + } + /** + * Retries the specified Job in a Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.rollout + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param {string} request.phaseId + * Required. The phase ID the Job to retry belongs to. + * @param {string} request.jobId + * Required. The job ID for the Job to retry. + * @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 [RetryJobResponse]{@link google.cloud.deploy.v1.RetryJobResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.retry_job.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_RetryJob_async + */ + retryJob( + request?: protos.google.cloud.deploy.v1.IRetryJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | undefined, + {} | undefined + ] + >; + retryJob( + request: protos.google.cloud.deploy.v1.IRetryJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): void; + retryJob( + request: protos.google.cloud.deploy.v1.IRetryJobRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): void; + retryJob( + request?: protos.google.cloud.deploy.v1.IRetryJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRetryJobResponse, + protos.google.cloud.deploy.v1.IRetryJobRequest | 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({ + rollout: request.rollout ?? '', + }); + this.initialize(); + return this.innerApiCalls.retryJob(request, options, callback); + } + /** + * Gets details of a single JobRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `JobRun`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * @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 [JobRun]{@link google.cloud.deploy.v1.JobRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_job_run.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetJobRun_async + */ + getJobRun( + request?: protos.google.cloud.deploy.v1.IGetJobRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | undefined, + {} | undefined + ] + >; + getJobRun( + request: protos.google.cloud.deploy.v1.IGetJobRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobRun( + request: protos.google.cloud.deploy.v1.IGetJobRunRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobRun( + request?: protos.google.cloud.deploy.v1.IGetJobRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun, + protos.google.cloud.deploy.v1.IGetJobRunRequest | 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.getJobRun(request, options, callback); + } + /** + * Gets the configuration for a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of requested configuration. + * @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 [Config]{@link google.cloud.deploy.v1.Config}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.get_config.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_GetConfig_async + */ + getConfig( + request?: protos.google.cloud.deploy.v1.IGetConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | undefined, + {} | undefined + ] + >; + getConfig( + request: protos.google.cloud.deploy.v1.IGetConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getConfig( + request: protos.google.cloud.deploy.v1.IGetConfigRequest, + callback: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): void; + getConfig( + request?: protos.google.cloud.deploy.v1.IGetConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IConfig, + protos.google.cloud.deploy.v1.IGetConfigRequest | 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.getConfig(request, options, callback); + } + + /** + * Creates a new DeliveryPipeline in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * @param {string} request.deliveryPipelineId + * Required. ID of the `DeliveryPipeline`. + * @param {google.cloud.deploy.v1.DeliveryPipeline} request.deliveryPipeline + * Required. The `DeliveryPipeline` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async + */ + createDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDeliveryPipeline( + request: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDeliveryPipeline( + request: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.ICreateDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createDeliveryPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_async + */ + async checkCreateDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.deploy.v1.DeliveryPipeline} request.deliveryPipeline + * Required. The `DeliveryPipeline` to update. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async + */ + updateDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IUpdateDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'delivery_pipeline.name': request.deliveryPipeline!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateDeliveryPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_async + */ + async checkUpdateDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.DeliveryPipeline, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Deletes a single DeliveryPipeline. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * @param {boolean} [request.validateOnly] + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @param {boolean} [request.force] + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * @param {string} [request.etag] + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async + */ + deleteDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDeliveryPipeline( + request: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDeliveryPipeline( + request?: protos.google.cloud.deploy.v1.IDeleteDeliveryPipelineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteDeliveryPipeline( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteDeliveryPipeline()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_async + */ + async checkDeleteDeliveryPipelineProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteDeliveryPipeline, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Target in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * @param {string} request.targetId + * Required. ID of the `Target`. + * @param {google.cloud.deploy.v1.Target} request.target + * Required. The `Target` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateTarget_async + */ + createTarget( + request?: protos.google.cloud.deploy.v1.ICreateTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTarget( + request: protos.google.cloud.deploy.v1.ICreateTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTarget( + request: protos.google.cloud.deploy.v1.ICreateTargetRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTarget( + request?: protos.google.cloud.deploy.v1.ICreateTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTarget()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateTarget_async + */ + async checkCreateTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.deploy.v1.Target} request.target + * Required. The `Target` to update. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async + */ + updateTarget( + request?: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTarget( + request: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTarget( + request: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTarget( + request?: protos.google.cloud.deploy.v1.IUpdateTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'target.name': request.target!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTarget()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.update_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_UpdateTarget_async + */ + async checkUpdateTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Target, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Deletes a single Target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * @param {boolean} [request.validateOnly] + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @param {string} [request.etag] + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.delete_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async + */ + deleteTarget( + request?: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTarget( + request: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTarget( + request: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTarget( + request?: protos.google.cloud.deploy.v1.IDeleteTargetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteTarget(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTarget()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.delete_target.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_DeleteTarget_async + */ + async checkDeleteTargetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteTarget, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Release in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param {string} request.releaseId + * Required. ID of the `Release`. + * @param {google.cloud.deploy.v1.Release} request.release + * Required. The `Release` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRelease_async + */ + createRelease( + request?: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRelease( + request: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRelease( + request: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRelease( + request?: protos.google.cloud.deploy.v1.ICreateReleaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createRelease(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRelease()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_release.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRelease_async + */ + async checkCreateReleaseProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Release, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createRelease, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Release, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Creates a new Rollout in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param {string} request.rolloutId + * Required. ID of the `Rollout`. + * @param {google.cloud.deploy.v1.Rollout} request.rollout + * Required. The `Rollout` to create. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + */ + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRollout( + request: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + callback: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRollout( + request?: protos.google.cloud.deploy.v1.ICreateRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createRollout(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRollout()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.create_rollout.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_CreateRollout_async + */ + async checkCreateRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.deploy.v1.Rollout, + protos.google.cloud.deploy.v1.OperationMetadata + >; + } + /** + * Lists DeliveryPipelines in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. + * 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 `listDeliveryPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeliveryPipelines( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline[], + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest | null, + protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + ] + >; + listDeliveryPipelines( + request: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): void; + listDeliveryPipelines( + request: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): void; + listDeliveryPipelines( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + | protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IDeliveryPipeline + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IDeliveryPipeline[], + protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest | null, + protos.google.cloud.deploy.v1.IListDeliveryPipelinesResponse + ] + > | 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.listDeliveryPipelines(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 parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline} 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 `listDeliveryPipelinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeliveryPipelinesStream( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + 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['listDeliveryPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeliveryPipelines.createStream( + this.innerApiCalls.listDeliveryPipelines as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDeliveryPipelines`, 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 parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} request.pageSize + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} request.filter + * Filter pipelines to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} request.orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DeliveryPipeline]{@link google.cloud.deploy.v1.DeliveryPipeline}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_delivery_pipelines.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_async + */ + listDeliveryPipelinesAsync( + request?: protos.google.cloud.deploy.v1.IListDeliveryPipelinesRequest, + 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['listDeliveryPipelines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeliveryPipelines.asyncIterate( + this.innerApiCalls['listDeliveryPipelines'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Targets in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Target]{@link google.cloud.deploy.v1.Target}. + * 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 `listTargetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTargets( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget[], + protos.google.cloud.deploy.v1.IListTargetsRequest | null, + protos.google.cloud.deploy.v1.IListTargetsResponse + ] + >; + listTargets( + request: protos.google.cloud.deploy.v1.IListTargetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): void; + listTargets( + request: protos.google.cloud.deploy.v1.IListTargetsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): void; + listTargets( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListTargetsRequest, + protos.google.cloud.deploy.v1.IListTargetsResponse | null | undefined, + protos.google.cloud.deploy.v1.ITarget + > + ): Promise< + [ + protos.google.cloud.deploy.v1.ITarget[], + protos.google.cloud.deploy.v1.IListTargetsRequest | null, + protos.google.cloud.deploy.v1.IListTargetsResponse + ] + > | 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.listTargets(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 parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Target]{@link google.cloud.deploy.v1.Target} 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 `listTargetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTargetsStream( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + 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['listTargets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargets.createStream( + this.innerApiCalls.listTargets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTargets`, 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 parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter targets to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Target]{@link google.cloud.deploy.v1.Target}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_targets.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListTargets_async + */ + listTargetsAsync( + request?: protos.google.cloud.deploy.v1.IListTargetsRequest, + 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['listTargets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargets.asyncIterate( + this.innerApiCalls['listTargets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Releases in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Release]{@link google.cloud.deploy.v1.Release}. + * 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 `listReleasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listReleases( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease[], + protos.google.cloud.deploy.v1.IListReleasesRequest | null, + protos.google.cloud.deploy.v1.IListReleasesResponse + ] + >; + listReleases( + request: protos.google.cloud.deploy.v1.IListReleasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): void; + listReleases( + request: protos.google.cloud.deploy.v1.IListReleasesRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): void; + listReleases( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + | protos.google.cloud.deploy.v1.IListReleasesResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IRelease + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListReleasesRequest, + protos.google.cloud.deploy.v1.IListReleasesResponse | null | undefined, + protos.google.cloud.deploy.v1.IRelease + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRelease[], + protos.google.cloud.deploy.v1.IListReleasesRequest | null, + protos.google.cloud.deploy.v1.IListReleasesResponse + ] + > | 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.listReleases(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 `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Release]{@link google.cloud.deploy.v1.Release} 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 `listReleasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listReleasesStream( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + 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['listReleases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReleases.createStream( + this.innerApiCalls.listReleases as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReleases`, 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 `DeliveryPipeline` which owns this collection of `Release` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter releases to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Release]{@link google.cloud.deploy.v1.Release}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_releases.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListReleases_async + */ + listReleasesAsync( + request?: protos.google.cloud.deploy.v1.IListReleasesRequest, + 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['listReleases']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReleases.asyncIterate( + this.innerApiCalls['listReleases'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Rollouts in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Rollout]{@link google.cloud.deploy.v1.Rollout}. + * 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 `listRolloutsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRollouts( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout[], + protos.google.cloud.deploy.v1.IListRolloutsRequest | null, + protos.google.cloud.deploy.v1.IListRolloutsResponse + ] + >; + listRollouts( + request: protos.google.cloud.deploy.v1.IListRolloutsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): void; + listRollouts( + request: protos.google.cloud.deploy.v1.IListRolloutsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): void; + listRollouts( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + | protos.google.cloud.deploy.v1.IListRolloutsResponse + | null + | undefined, + protos.google.cloud.deploy.v1.IRollout + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListRolloutsRequest, + protos.google.cloud.deploy.v1.IListRolloutsResponse | null | undefined, + protos.google.cloud.deploy.v1.IRollout + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IRollout[], + protos.google.cloud.deploy.v1.IListRolloutsRequest | null, + protos.google.cloud.deploy.v1.IListRolloutsResponse + ] + > | 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.listRollouts(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 `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [Rollout]{@link google.cloud.deploy.v1.Rollout} 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 `listRolloutsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRolloutsStream( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + 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['listRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRollouts.createStream( + this.innerApiCalls.listRollouts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRollouts`, 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 `Release` which owns this collection of `Rollout` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other provided parameters match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Rollout]{@link google.cloud.deploy.v1.Rollout}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_rollouts.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListRollouts_async + */ + listRolloutsAsync( + request?: protos.google.cloud.deploy.v1.IListRolloutsRequest, + 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['listRollouts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRollouts.asyncIterate( + this.innerApiCalls['listRollouts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists JobRuns in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [JobRun]{@link google.cloud.deploy.v1.JobRun}. + * 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 `listJobRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobRuns( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun[], + protos.google.cloud.deploy.v1.IListJobRunsRequest | null, + protos.google.cloud.deploy.v1.IListJobRunsResponse + ] + >; + listJobRuns( + request: protos.google.cloud.deploy.v1.IListJobRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): void; + listJobRuns( + request: protos.google.cloud.deploy.v1.IListJobRunsRequest, + callback: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): void; + listJobRuns( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + >, + callback?: PaginationCallback< + protos.google.cloud.deploy.v1.IListJobRunsRequest, + protos.google.cloud.deploy.v1.IListJobRunsResponse | null | undefined, + protos.google.cloud.deploy.v1.IJobRun + > + ): Promise< + [ + protos.google.cloud.deploy.v1.IJobRun[], + protos.google.cloud.deploy.v1.IListJobRunsRequest | null, + protos.google.cloud.deploy.v1.IListJobRunsResponse + ] + > | 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.listJobRuns(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 `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [JobRun]{@link google.cloud.deploy.v1.JobRun} 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 `listJobRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobRunsStream( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + 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['listJobRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobRuns.createStream( + this.innerApiCalls.listJobRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobRuns`, 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 `Rollout` which owns this collection of `JobRun` objects. + * @param {number} [request.pageSize] + * Optional. The maximum number of `JobRun` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `JobRun` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListJobRuns` call. Provide this + * to retrieve the subsequent page. + * + * When paginating, all other provided parameters match the call that provided + * the page token. + * @param {string} [request.filter] + * Optional. Filter results to be returned. See https://google.aip.dev/160 for more + * details. + * @param {string} [request.orderBy] + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [JobRun]{@link google.cloud.deploy.v1.JobRun}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_deploy.list_job_runs.js + * region_tag:clouddeploy_v1_generated_CloudDeploy_ListJobRuns_async + */ + listJobRunsAsync( + request?: protos.google.cloud.deploy.v1.IListJobRunsRequest, + 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['listJobRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobRuns.asyncIterate( + this.innerApiCalls['listJobRuns'] 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 [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.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 { + 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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.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 { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified build resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} build + * @returns {string} Resource name string. + */ + buildPath(project: string, location: string, build: string) { + return this.pathTemplates.buildPathTemplate.render({ + project: project, + location: location, + build: build, + }); + } + + /** + * Parse the project from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).project; + } + + /** + * Parse the location from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).location; + } + + /** + * Parse the build from Build resource. + * + * @param {string} buildName + * A fully-qualified path representing Build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromBuildName(buildName: string) { + return this.pathTemplates.buildPathTemplate.match(buildName).build; + } + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified config resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + configPath(project: string, location: string) { + return this.pathTemplates.configPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).project; + } + + /** + * Parse the location from Config resource. + * + * @param {string} configName + * A fully-qualified path representing Config resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConfigName(configName: string) { + return this.pathTemplates.configPathTemplate.match(configName).location; + } + + /** + * Return a fully-qualified deliveryPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @returns {string} Resource name string. + */ + deliveryPipelinePath( + project: string, + location: string, + deliveryPipeline: string + ) { + return this.pathTemplates.deliveryPipelinePathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + }); + } + + /** + * Parse the project from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).project; + } + + /** + * Parse the location from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).location; + } + + /** + * Parse the delivery_pipeline from DeliveryPipeline resource. + * + * @param {string} deliveryPipelineName + * A fully-qualified path representing DeliveryPipeline resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromDeliveryPipelineName(deliveryPipelineName: string) { + return this.pathTemplates.deliveryPipelinePathTemplate.match( + deliveryPipelineName + ).delivery_pipeline; + } + + /** + * Return a fully-qualified jobRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @param {string} rollout + * @param {string} job_run + * @returns {string} Resource name string. + */ + jobRunPath( + project: string, + location: string, + deliveryPipeline: string, + release: string, + rollout: string, + jobRun: string + ) { + return this.pathTemplates.jobRunPathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + rollout: rollout, + job_run: jobRun, + }); + } + + /** + * Parse the project from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).project; + } + + /** + * Parse the location from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).location; + } + + /** + * Parse the delivery_pipeline from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName) + .delivery_pipeline; + } + + /** + * Parse the release from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).release; + } + + /** + * Parse the rollout from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the rollout. + */ + matchRolloutFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).rollout; + } + + /** + * Parse the job_run from JobRun resource. + * + * @param {string} jobRunName + * A fully-qualified path representing JobRun resource. + * @returns {string} A string representing the job_run. + */ + matchJobRunFromJobRunName(jobRunName: string) { + return this.pathTemplates.jobRunPathTemplate.match(jobRunName).job_run; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified membership resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} membership + * @returns {string} Resource name string. + */ + membershipPath(project: string, location: string, membership: string) { + return this.pathTemplates.membershipPathTemplate.render({ + project: project, + location: location, + membership: membership, + }); + } + + /** + * Parse the project from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .project; + } + + /** + * Parse the location from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .location; + } + + /** + * Parse the membership from Membership resource. + * + * @param {string} membershipName + * A fully-qualified path representing Membership resource. + * @returns {string} A string representing the membership. + */ + matchMembershipFromMembershipName(membershipName: string) { + return this.pathTemplates.membershipPathTemplate.match(membershipName) + .membership; + } + + /** + * 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 release resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @returns {string} Resource name string. + */ + releasePath( + project: string, + location: string, + deliveryPipeline: string, + release: string + ) { + return this.pathTemplates.releasePathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + }); + } + + /** + * Parse the project from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).project; + } + + /** + * Parse the location from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).location; + } + + /** + * Parse the delivery_pipeline from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName) + .delivery_pipeline; + } + + /** + * Parse the release from Release resource. + * + * @param {string} releaseName + * A fully-qualified path representing Release resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromReleaseName(releaseName: string) { + return this.pathTemplates.releasePathTemplate.match(releaseName).release; + } + + /** + * Return a fully-qualified rollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} delivery_pipeline + * @param {string} release + * @param {string} rollout + * @returns {string} Resource name string. + */ + rolloutPath( + project: string, + location: string, + deliveryPipeline: string, + release: string, + rollout: string + ) { + return this.pathTemplates.rolloutPathTemplate.render({ + project: project, + location: location, + delivery_pipeline: deliveryPipeline, + release: release, + rollout: rollout, + }); + } + + /** + * Parse the project from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).project; + } + + /** + * Parse the location from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).location; + } + + /** + * Parse the delivery_pipeline from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the delivery_pipeline. + */ + matchDeliveryPipelineFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName) + .delivery_pipeline; + } + + /** + * Parse the release from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the release. + */ + matchReleaseFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).release; + } + + /** + * Parse the rollout from Rollout resource. + * + * @param {string} rolloutName + * A fully-qualified path representing Rollout resource. + * @returns {string} A string representing the rollout. + */ + matchRolloutFromRolloutName(rolloutName: string) { + return this.pathTemplates.rolloutPathTemplate.match(rolloutName).rollout; + } + + /** + * Return a fully-qualified target resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} target + * @returns {string} Resource name string. + */ + targetPath(project: string, location: string, target: string) { + return this.pathTemplates.targetPathTemplate.render({ + project: project, + location: location, + target: target, + }); + } + + /** + * Parse the project from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).project; + } + + /** + * Parse the location from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).location; + } + + /** + * Parse the target from Target resource. + * + * @param {string} targetName + * A fully-qualified path representing Target resource. + * @returns {string} A string representing the target. + */ + matchTargetFromTargetName(targetName: string) { + return this.pathTemplates.targetPathTemplate.match(targetName).target; + } + + /** + * Return a fully-qualified workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project: string, location: string, workerPool: string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .worker_pool; + } + + /** + * 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.cloudDeployStub && !this._terminated) { + return this.cloudDeployStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json new file mode 100644 index 000000000000..b859d23be005 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_client_config.json @@ -0,0 +1,148 @@ +{ + "interfaces": { + "google.cloud.deploy.v1.CloudDeploy": { + "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 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "ListDeliveryPipelines": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTargets": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetTarget": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTarget": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReleases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRelease": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateRelease": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AbandonRelease": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApproveRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRollouts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "CreateRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RetryJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobRuns": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetJobRun": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "GetConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + } + } + } + } +} diff --git a/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json new file mode 100644 index 000000000000..fcfe1749c316 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/cloud_deploy_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/deploy/v1/cloud_deploy.proto", + "../../protos/google/cloud/deploy/v1/deliverypipeline_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/jobrun_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/log_enums.proto", + "../../protos/google/cloud/deploy/v1/release_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/release_render_payload.proto", + "../../protos/google/cloud/deploy/v1/rollout_notification_payload.proto", + "../../protos/google/cloud/deploy/v1/target_notification_payload.proto" +] diff --git a/packages/google-cloud-deploy/src/v1/gapic_metadata.json b/packages/google-cloud-deploy/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..6dceb363634a --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/gapic_metadata.json @@ -0,0 +1,263 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.deploy.v1", + "libraryPackage": "@google-cloud/deploy", + "services": { + "CloudDeploy": { + "clients": { + "grpc": { + "libraryClient": "CloudDeployClient", + "rpcs": { + "GetDeliveryPipeline": { + "methods": [ + "getDeliveryPipeline" + ] + }, + "GetTarget": { + "methods": [ + "getTarget" + ] + }, + "GetRelease": { + "methods": [ + "getRelease" + ] + }, + "AbandonRelease": { + "methods": [ + "abandonRelease" + ] + }, + "ApproveRollout": { + "methods": [ + "approveRollout" + ] + }, + "GetRollout": { + "methods": [ + "getRollout" + ] + }, + "RetryJob": { + "methods": [ + "retryJob" + ] + }, + "GetJobRun": { + "methods": [ + "getJobRun" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "CreateDeliveryPipeline": { + "methods": [ + "createDeliveryPipeline" + ] + }, + "UpdateDeliveryPipeline": { + "methods": [ + "updateDeliveryPipeline" + ] + }, + "DeleteDeliveryPipeline": { + "methods": [ + "deleteDeliveryPipeline" + ] + }, + "CreateTarget": { + "methods": [ + "createTarget" + ] + }, + "UpdateTarget": { + "methods": [ + "updateTarget" + ] + }, + "DeleteTarget": { + "methods": [ + "deleteTarget" + ] + }, + "CreateRelease": { + "methods": [ + "createRelease" + ] + }, + "CreateRollout": { + "methods": [ + "createRollout" + ] + }, + "ListDeliveryPipelines": { + "methods": [ + "listDeliveryPipelines", + "listDeliveryPipelinesStream", + "listDeliveryPipelinesAsync" + ] + }, + "ListTargets": { + "methods": [ + "listTargets", + "listTargetsStream", + "listTargetsAsync" + ] + }, + "ListReleases": { + "methods": [ + "listReleases", + "listReleasesStream", + "listReleasesAsync" + ] + }, + "ListRollouts": { + "methods": [ + "listRollouts", + "listRolloutsStream", + "listRolloutsAsync" + ] + }, + "ListJobRuns": { + "methods": [ + "listJobRuns", + "listJobRunsStream", + "listJobRunsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudDeployClient", + "rpcs": { + "GetDeliveryPipeline": { + "methods": [ + "getDeliveryPipeline" + ] + }, + "GetTarget": { + "methods": [ + "getTarget" + ] + }, + "GetRelease": { + "methods": [ + "getRelease" + ] + }, + "AbandonRelease": { + "methods": [ + "abandonRelease" + ] + }, + "ApproveRollout": { + "methods": [ + "approveRollout" + ] + }, + "GetRollout": { + "methods": [ + "getRollout" + ] + }, + "RetryJob": { + "methods": [ + "retryJob" + ] + }, + "GetJobRun": { + "methods": [ + "getJobRun" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "CreateDeliveryPipeline": { + "methods": [ + "createDeliveryPipeline" + ] + }, + "UpdateDeliveryPipeline": { + "methods": [ + "updateDeliveryPipeline" + ] + }, + "DeleteDeliveryPipeline": { + "methods": [ + "deleteDeliveryPipeline" + ] + }, + "CreateTarget": { + "methods": [ + "createTarget" + ] + }, + "UpdateTarget": { + "methods": [ + "updateTarget" + ] + }, + "DeleteTarget": { + "methods": [ + "deleteTarget" + ] + }, + "CreateRelease": { + "methods": [ + "createRelease" + ] + }, + "CreateRollout": { + "methods": [ + "createRollout" + ] + }, + "ListDeliveryPipelines": { + "methods": [ + "listDeliveryPipelines", + "listDeliveryPipelinesStream", + "listDeliveryPipelinesAsync" + ] + }, + "ListTargets": { + "methods": [ + "listTargets", + "listTargetsStream", + "listTargetsAsync" + ] + }, + "ListReleases": { + "methods": [ + "listReleases", + "listReleasesStream", + "listReleasesAsync" + ] + }, + "ListRollouts": { + "methods": [ + "listRollouts", + "listRolloutsStream", + "listRolloutsAsync" + ] + }, + "ListJobRuns": { + "methods": [ + "listJobRuns", + "listJobRunsStream", + "listJobRunsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-deploy/src/v1/index.ts b/packages/google-cloud-deploy/src/v1/index.ts new file mode 100644 index 000000000000..7f00861da8f0 --- /dev/null +++ b/packages/google-cloud-deploy/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {CloudDeployClient} from './cloud_deploy_client'; diff --git a/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.js b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..e49888e86411 --- /dev/null +++ b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const deploy = require('@google-cloud/deploy'); + +function main() { + const cloudDeployClient = new deploy.CloudDeployClient(); +} + +main(); diff --git a/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..b1c846e6dc1c --- /dev/null +++ b/packages/google-cloud-deploy/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {CloudDeployClient} from '@google-cloud/deploy'; + +// check that the client class type name can be used +function doStuffWithCloudDeployClient(client: CloudDeployClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudDeployClient = new CloudDeployClient(); + doStuffWithCloudDeployClient(cloudDeployClient); +} + +main(); diff --git a/packages/google-cloud-deploy/system-test/install.ts b/packages/google-cloud-deploy/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-deploy/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts new file mode 100644 index 000000000000..a383c7a807c6 --- /dev/null +++ b/packages/google-cloud-deploy/test/gapic_cloud_deploy_v1.ts @@ -0,0 +1,6139 @@ +// Copyright 2022 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 clouddeployModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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.CloudDeployClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = clouddeployModule.v1.CloudDeployClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = clouddeployModule.v1.CloudDeployClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = clouddeployModule.v1.CloudDeployClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clouddeployModule.v1.CloudDeployClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudDeployStub, undefined); + await client.initialize(); + assert(client.cloudDeployStub); + }); + + it('has close method for the initialized client', done => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudDeployStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudDeployStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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('getDeliveryPipeline', () => { + it('invokes getDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ); + client.innerApiCalls.getDeliveryPipeline = + stubSimpleCall(expectedResponse); + const [response] = await client.getDeliveryPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ); + client.innerApiCalls.getDeliveryPipeline = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeliveryPipeline( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeliveryPipeline | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeliveryPipeline = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDeliveryPipeline(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeliveryPipeline with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeliveryPipeline(request), expectedError); + }); + }); + + describe('getTarget', () => { + it('invokes getTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Target() + ); + client.innerApiCalls.getTarget = stubSimpleCall(expectedResponse); + const [response] = await client.getTarget(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Target() + ); + client.innerApiCalls.getTarget = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTarget( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.ITarget | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTarget = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTarget with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTarget(request), expectedError); + }); + }); + + describe('getRelease', () => { + it('invokes getRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Release() + ); + client.innerApiCalls.getRelease = stubSimpleCall(expectedResponse); + const [response] = await client.getRelease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Release() + ); + client.innerApiCalls.getRelease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRelease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRelease | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRelease = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRelease with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRelease(request), expectedError); + }); + }); + + describe('abandonRelease', () => { + it('invokes abandonRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseResponse() + ); + client.innerApiCalls.abandonRelease = stubSimpleCall(expectedResponse); + const [response] = await client.abandonRelease(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseResponse() + ); + client.innerApiCalls.abandonRelease = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.abandonRelease( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IAbandonReleaseResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.abandonRelease = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.abandonRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.abandonRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes abandonRelease with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.AbandonReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.AbandonReleaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.abandonRelease(request), expectedError); + }); + }); + + describe('approveRollout', () => { + it('invokes approveRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutResponse() + ); + client.innerApiCalls.approveRollout = stubSimpleCall(expectedResponse); + const [response] = await client.approveRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutResponse() + ); + client.innerApiCalls.approveRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.approveRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IApproveRolloutResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.approveRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.approveRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveRollout with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ApproveRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ApproveRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.approveRollout(request), expectedError); + }); + }); + + describe('getRollout', () => { + it('invokes getRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Rollout() + ); + client.innerApiCalls.getRollout = stubSimpleCall(expectedResponse); + const [response] = await client.getRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Rollout() + ); + client.innerApiCalls.getRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRollout | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRollout with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRollout(request), expectedError); + }); + }); + + describe('retryJob', () => { + it('invokes retryJob without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobResponse() + ); + client.innerApiCalls.retryJob = stubSimpleCall(expectedResponse); + const [response] = await client.retryJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobResponse() + ); + client.innerApiCalls.retryJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retryJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRetryJobResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedHeaderRequestParams = `rollout=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retryJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retryJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryJob with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.RetryJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.RetryJobRequest', + ['rollout'] + ); + request.rollout = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.retryJob(request), expectedError); + }); + }); + + describe('getJobRun', () => { + it('invokes getJobRun without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.JobRun() + ); + client.innerApiCalls.getJobRun = stubSimpleCall(expectedResponse); + const [response] = await client.getJobRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.JobRun() + ); + client.innerApiCalls.getJobRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IJobRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJobRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobRun with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetJobRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetJobRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJobRun(request), expectedError); + }); + }); + + describe('getConfig', () => { + it('invokes getConfig without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Config() + ); + client.innerApiCalls.getConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.deploy.v1.Config() + ); + client.innerApiCalls.getConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConfig with closed client', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.GetConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.GetConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConfig(request), expectedError); + }); + }); + + describe('createDeliveryPipeline', () => { + it('invokes createDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateDeliveryPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDeliveryPipeline', () => { + it('invokes updateDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IDeliveryPipeline, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest() + ); + request.deliveryPipeline ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateDeliveryPipelineRequest', + ['deliveryPipeline', 'name'] + ); + request.deliveryPipeline.name = defaultValue1; + const expectedHeaderRequestParams = `delivery_pipeline.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDeliveryPipeline', () => { + it('invokes deleteDeliveryPipeline without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeliveryPipeline = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDeliveryPipeline(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeliveryPipeline = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeliveryPipeline( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeliveryPipeline = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteDeliveryPipeline(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeliveryPipeline with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteDeliveryPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeliveryPipeline = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDeliveryPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeliveryPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDeliveryPipelineProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDeliveryPipelineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDeliveryPipelineProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteDeliveryPipelineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTarget', () => { + it('invokes createTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateTargetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTarget', () => { + it('invokes updateTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.ITarget, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.UpdateTargetRequest() + ); + request.target ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.UpdateTargetRequest', + ['target', 'name'] + ); + request.target.name = defaultValue1; + const expectedHeaderRequestParams = `target.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTarget', () => { + it('invokes deleteTarget without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTarget = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTarget(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTarget = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTarget( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTarget = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTarget(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTarget with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.DeleteTargetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.DeleteTargetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTarget = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTarget(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTarget as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTargetProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTargetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTargetProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteTargetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRelease', () => { + it('invokes createRelease without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRelease = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRelease(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRelease = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRelease( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IRelease, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRelease = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRelease(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRelease with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateReleaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateReleaseRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRelease = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRelease(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRelease as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateReleaseProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateReleaseProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateReleaseProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateReleaseProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createRollout', () => { + it('invokes createRollout without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRollout = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRollout(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRollout = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRollout( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.deploy.v1.IRollout, + protos.google.cloud.deploy.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout with call error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRollout = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRollout(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRollout with LRO error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.CreateRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.CreateRolloutRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRollout = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRollout(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRolloutProgress without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateRolloutProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRolloutProgress with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateRolloutProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDeliveryPipelines', () => { + it('invokes listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCall(expectedResponse); + const [response] = await client.listDeliveryPipelines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.innerApiCalls.listDeliveryPipelines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeliveryPipelines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IDeliveryPipeline[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeliveryPipelines = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listDeliveryPipelines(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeliveryPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeliveryPipelinesStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + 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.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeliveryPipelinesStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeliveryPipelinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.DeliveryPipeline[] = []; + stream.on( + 'data', + (response: protos.google.cloud.deploy.v1.DeliveryPipeline) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDeliveryPipelines, request) + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + generateSampleMessage( + new protos.google.cloud.deploy.v1.DeliveryPipeline() + ), + ]; + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + const iterable = client.listDeliveryPipelinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeliveryPipelines with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListDeliveryPipelinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListDeliveryPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeliveryPipelines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeliveryPipelinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IDeliveryPipeline[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDeliveryPipelines + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTargets', () => { + it('invokes listTargets without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = stubSimpleCall(expectedResponse); + const [response] = await client.listTargets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.innerApiCalls.listTargets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTargets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.ITarget[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargets with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTargets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTargets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.descriptors.page.listTargets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTargetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + 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.listTargets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargets, request) + ); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTargetsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTargetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Target[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Target) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargets, request) + ); + assert( + (client.descriptors.page.listTargets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargets without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Target()), + ]; + client.descriptors.page.listTargets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + const iterable = client.listTargetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTargets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargets with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListTargetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListTargetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTargetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.ITarget[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTargets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listTargets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listReleases', () => { + it('invokes listReleases without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.innerApiCalls.listReleases = stubSimpleCall(expectedResponse); + const [response] = await client.listReleases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleases without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.innerApiCalls.listReleases = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReleases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRelease[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleases with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReleases = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReleases(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReleases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReleasesStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.descriptors.page.listReleases.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReleasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + 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.listReleases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReleases, request) + ); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReleasesStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReleases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listReleasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Release[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Release) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReleases, request) + ); + assert( + (client.descriptors.page.listReleases.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReleases without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Release()), + ]; + client.descriptors.page.listReleases.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + const iterable = client.listReleasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReleases.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReleases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReleases with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListReleasesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListReleasesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReleases.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReleasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IRelease[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReleases.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReleases.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRollouts', () => { + it('invokes listRollouts without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.innerApiCalls.listRollouts = stubSimpleCall(expectedResponse); + const [response] = await client.listRollouts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRollouts without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.innerApiCalls.listRollouts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRollouts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IRollout[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRollouts with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRollouts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRollouts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRollouts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRolloutsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.descriptors.page.listRollouts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Rollout[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Rollout) => { + 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.listRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRollouts, request) + ); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRolloutsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRollouts.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRolloutsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.Rollout[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.Rollout) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRollouts, request) + ); + assert( + (client.descriptors.page.listRollouts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRollouts without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + generateSampleMessage(new protos.google.cloud.deploy.v1.Rollout()), + ]; + client.descriptors.page.listRollouts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IRollout[] = []; + const iterable = client.listRolloutsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRollouts with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListRolloutsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListRolloutsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRollouts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRolloutsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IRollout[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRollouts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRollouts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listJobRuns', () => { + it('invokes listJobRuns without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.innerApiCalls.listJobRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listJobRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRuns without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.innerApiCalls.listJobRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.deploy.v1.IJobRun[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRuns with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listJobRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobRunsStream without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.descriptors.page.listJobRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.JobRun[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.JobRun) => { + 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.listJobRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobRuns, request) + ); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobRunsStream with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobRuns.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.deploy.v1.JobRun[] = []; + stream.on('data', (response: protos.google.cloud.deploy.v1.JobRun) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobRuns, request) + ); + assert( + (client.descriptors.page.listJobRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobRuns without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + generateSampleMessage(new protos.google.cloud.deploy.v1.JobRun()), + ]; + client.descriptors.page.listJobRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.deploy.v1.IJobRun[] = []; + const iterable = client.listJobRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobRuns with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.deploy.v1.ListJobRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.deploy.v1.ListJobRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobRuns.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.deploy.v1.IJobRun[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobRuns.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listJobRuns.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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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 clouddeployModule.v1.CloudDeployClient({ + 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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('build', () => { + const fakePath = '/rendered/path/build'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + build: 'buildValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.buildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.buildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('buildPath', () => { + const result = client.buildPath( + 'projectValue', + 'locationValue', + 'buildValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.buildPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBuildName', () => { + const result = client.matchProjectFromBuildName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBuildName', () => { + const result = client.matchLocationFromBuildName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromBuildName', () => { + const result = client.matchBuildFromBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + (client.pathTemplates.buildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cluster', () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('config', () => { + const fakePath = '/rendered/path/config'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.configPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.configPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('configPath', () => { + const result = client.configPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.configPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConfigName', () => { + const result = client.matchProjectFromConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConfigName', () => { + const result = client.matchLocationFromConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.configPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deliveryPipeline', () => { + const fakePath = '/rendered/path/deliveryPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deliveryPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deliveryPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deliveryPipelinePath', () => { + const result = client.deliveryPipelinePath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deliveryPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeliveryPipelineName', () => { + const result = client.matchProjectFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeliveryPipelineName', () => { + const result = client.matchLocationFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromDeliveryPipelineName', () => { + const result = + client.matchDeliveryPipelineFromDeliveryPipelineName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.deliveryPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('jobRun', () => { + const fakePath = '/rendered/path/jobRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + rollout: 'rolloutValue', + job_run: 'jobRunValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobRunPath', () => { + const result = client.jobRunPath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue', + 'rolloutValue', + 'jobRunValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobRunName', () => { + const result = client.matchProjectFromJobRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobRunName', () => { + const result = client.matchLocationFromJobRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromJobRunName', () => { + const result = client.matchDeliveryPipelineFromJobRunName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromJobRunName', () => { + const result = client.matchReleaseFromJobRunName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRolloutFromJobRunName', () => { + const result = client.matchRolloutFromJobRunName(fakePath); + assert.strictEqual(result, 'rolloutValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobRunFromJobRunName', () => { + const result = client.matchJobRunFromJobRunName(fakePath); + assert.strictEqual(result, 'jobRunValue'); + assert( + (client.pathTemplates.jobRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('membership', () => { + const fakePath = '/rendered/path/membership'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + membership: 'membershipValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.membershipPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.membershipPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('membershipPath', () => { + const result = client.membershipPath( + 'projectValue', + 'locationValue', + 'membershipValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.membershipPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMembershipName', () => { + const result = client.matchProjectFromMembershipName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMembershipName', () => { + const result = client.matchLocationFromMembershipName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMembershipFromMembershipName', () => { + const result = client.matchMembershipFromMembershipName(fakePath); + assert.strictEqual(result, 'membershipValue'); + assert( + (client.pathTemplates.membershipPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + 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('release', () => { + const fakePath = '/rendered/path/release'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.releasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.releasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('releasePath', () => { + const result = client.releasePath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.releasePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReleaseName', () => { + const result = client.matchProjectFromReleaseName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReleaseName', () => { + const result = client.matchLocationFromReleaseName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromReleaseName', () => { + const result = client.matchDeliveryPipelineFromReleaseName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromReleaseName', () => { + const result = client.matchReleaseFromReleaseName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.releasePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('rollout', () => { + const fakePath = '/rendered/path/rollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + delivery_pipeline: 'deliveryPipelineValue', + release: 'releaseValue', + rollout: 'rolloutValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.rolloutPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.rolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('rolloutPath', () => { + const result = client.rolloutPath( + 'projectValue', + 'locationValue', + 'deliveryPipelineValue', + 'releaseValue', + 'rolloutValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.rolloutPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRolloutName', () => { + const result = client.matchProjectFromRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRolloutName', () => { + const result = client.matchLocationFromRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeliveryPipelineFromRolloutName', () => { + const result = client.matchDeliveryPipelineFromRolloutName(fakePath); + assert.strictEqual(result, 'deliveryPipelineValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReleaseFromRolloutName', () => { + const result = client.matchReleaseFromRolloutName(fakePath); + assert.strictEqual(result, 'releaseValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRolloutFromRolloutName', () => { + const result = client.matchRolloutFromRolloutName(fakePath); + assert.strictEqual(result, 'rolloutValue'); + assert( + (client.pathTemplates.rolloutPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('target', () => { + const fakePath = '/rendered/path/target'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + target: 'targetValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.targetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.targetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('targetPath', () => { + const result = client.targetPath( + 'projectValue', + 'locationValue', + 'targetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.targetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTargetName', () => { + const result = client.matchProjectFromTargetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTargetName', () => { + const result = client.matchLocationFromTargetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTargetFromTargetName', () => { + const result = client.matchTargetFromTargetName(fakePath); + assert.strictEqual(result, 'targetValue'); + assert( + (client.pathTemplates.targetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workerPool', () => { + const fakePath = '/rendered/path/workerPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + worker_pool: 'workerPoolValue', + }; + const client = new clouddeployModule.v1.CloudDeployClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath( + 'projectValue', + 'locationValue', + 'workerPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'workerPoolValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-deploy/tsconfig.json b/packages/google-cloud-deploy/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-deploy/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/packages/google-cloud-deploy/webpack.config.js b/packages/google-cloud-deploy/webpack.config.js new file mode 100644 index 000000000000..68d3b06f32d5 --- /dev/null +++ b/packages/google-cloud-deploy/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: 'CloudDeploy', + filename: './cloud-deploy.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/packages/google-cloud-gkeconnect-gateway/.OwlBot.yaml b/packages/google-cloud-gkeconnect-gateway/.OwlBot.yaml new file mode 100644 index 000000000000..f71f879592f2 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/gkeconnect/gateway/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-gkeconnect-gateway/$1 diff --git a/packages/google-cloud-gkeconnect-gateway/.eslintignore b/packages/google-cloud-gkeconnect-gateway/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-gkeconnect-gateway/.eslintrc.json b/packages/google-cloud-gkeconnect-gateway/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-gkeconnect-gateway/.gitattributes b/packages/google-cloud-gkeconnect-gateway/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-gkeconnect-gateway/.gitignore b/packages/google-cloud-gkeconnect-gateway/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.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/packages/google-cloud-gkeconnect-gateway/.jsdoc.js b/packages/google-cloud-gkeconnect-gateway/.jsdoc.js new file mode 100644 index 000000000000..fe9b8630ce4a --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/gke-connect-gateway', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-gkeconnect-gateway/.mocharc.js b/packages/google-cloud-gkeconnect-gateway/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-gkeconnect-gateway/.nycrc b/packages/google-cloud-gkeconnect-gateway/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-gkeconnect-gateway/.prettierignore b/packages/google-cloud-gkeconnect-gateway/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-gkeconnect-gateway/.prettierrc.js b/packages/google-cloud-gkeconnect-gateway/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-gkeconnect-gateway/.repo-metadata.json b/packages/google-cloud-gkeconnect-gateway/.repo-metadata.json new file mode 100644 index 000000000000..425eaab7ccba --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "connectgateway", + "name_pretty": "GKE Connect Gateway", + "product_documentation": "https://cloud.google.com/anthos/multicluster-management/gateway", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/gke-connect-gateway/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/gke-connect-gateway", + "api_id": "connectgateway.googleapis.com", + "default_version": "v1beta1", + "requires_billing": true, + "api_shortname": "connectgateway", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md b/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md new file mode 100644 index 000000000000..ab09f9a0934f --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/CHANGELOG.md @@ -0,0 +1,80 @@ +# Changelog + +## [2.0.3](https://github.com/googleapis/nodejs-gke-connect-gateway/compare/v2.0.2...v2.0.3) (2022-09-14) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#87](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/87)) ([99112c8](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/99112c89e562b257cae232cc38d7769d77f04731)) + +## [2.0.2](https://github.com/googleapis/nodejs-gke-connect-gateway/compare/v2.0.1...v2.0.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#86](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/86)) ([29669fe](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/29669fee06b214a8619b9815283f8778a82a5aac)) +* Better support for fallback mode ([#81](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/81)) ([9d83c4a](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/9d83c4a3a1f0b8b431d7a7b89d22405a8a26be04)) +* Change import long to require ([#82](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/82)) ([cf69a4e](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/cf69a4e8dff40dc0eeead51a746eeab1ed9efa12)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/1553)) ([#85](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/85)) ([a7cc874](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/a7cc87499841e940cc4298cbf620e45a4831238d)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/1546)) ([#84](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/84)) ([3d0a7dd](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/3d0a7dd8d308c9ff53b969f5ef91f5f836751343)) + +## [2.0.1](https://github.com/googleapis/nodejs-gke-connect-gateway/compare/v2.0.0...v2.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#75](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/75)) ([aa8cdc8](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/aa8cdc8607b44eea8bcc6b7065c01818857a8d70)) + +## [2.0.0](https://github.com/googleapis/nodejs-gke-connect-gateway/compare/v1.1.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#70) + +### Build System + +* update library to use Node 12 ([#70](https://github.com/googleapis/nodejs-gke-connect-gateway/issues/70)) ([7417416](https://github.com/googleapis/nodejs-gke-connect-gateway/commit/741741665d6dbdfe70e51ed0f181e8791bac4716)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-gke-connect-gateway/compare/v1.0.3...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#23](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/23)) ([4041bbd](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/4041bbd7361a8aecfb86a886d0c7661db52c2e31)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-gke-connect-gateway/compare/v1.0.2...v1.0.3) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#20](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/20)) ([f8731f3](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/f8731f3b957562977f70e7de6b6737ffbffa81d1)) +* **deps:** google-gax v2.24.1 ([#22](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/22)) ([2613add](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/2613add6ed97059ef8e76e333c885d69afa4365c)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-gke-connect-gateway/compare/v1.0.1...v1.0.2) (2021-07-22) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator ([0592deb](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/0592deb506d1ec6493c25c110b1ba45d20f188b5)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-gke-connect-gateway/compare/v1.0.0...v1.0.1) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#8](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/8)) ([eeedac9](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/eeedac9d30407e6fccee6e149246c63dfb9d4b3e)) + +## 1.0.0 (2021-06-30) + + +### Features + +* add generated files ([172b8b6](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/172b8b6717fdc76f2d92c21ba9d12417795d03f3)) +* initial samples and tests ([#6](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/6)) ([ada7497](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/ada7497a6a5881c2a5b686e16f3a744d5f34a969)) +* initial stub of library ([82755d9](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/82755d93262e35bed9aae0693efcc47df4b3b5dc)) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#5](https://www.github.com/googleapis/nodejs-gke-connect-gateway/issues/5)) ([d1257a8](https://www.github.com/googleapis/nodejs-gke-connect-gateway/commit/d1257a83a04171b6ec0e8fe1196cb3fb160b9161)) diff --git a/packages/google-cloud-gkeconnect-gateway/CODE_OF_CONDUCT.md b/packages/google-cloud-gkeconnect-gateway/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-gkeconnect-gateway/CONTRIBUTING.md b/packages/google-cloud-gkeconnect-gateway/CONTRIBUTING.md new file mode 100644 index 000000000000..1489648d4cc4 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the GKE Connect Gateway API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=connectgateway.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-gkeconnect-gateway/LICENSE b/packages/google-cloud-gkeconnect-gateway/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-gkeconnect-gateway/README.md b/packages/google-cloud-gkeconnect-gateway/README.md new file mode 100644 index 000000000000..b66af932528e --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/README.md @@ -0,0 +1,152 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [GKE Connect Gateway: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/gke-connect-gateway.svg)](https://www.npmjs.org/package/@google-cloud/gke-connect-gateway) + + + + +apigateway client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [GKE Connect Gateway Node.js Client API Reference][client-docs] +* [GKE Connect Gateway Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the GKE Connect Gateway API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/gke-connect-gateway +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway'); + +// Creates a client +new GatewayServiceClient(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Gateway_service.delete_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js,samples/README.md) | +| Gateway_service.get_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js,samples/README.md) | +| Gateway_service.patch_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js,samples/README.md) | +| Gateway_service.post_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js,samples/README.md) | +| Gateway_service.put_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js,samples/README.md) | + + + +The [GKE Connect Gateway Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/gke-connect-gateway@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/gke-connect-gateway/latest +[product-docs]: https://cloud.google.com/anthos/multicluster-management/gateway +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=connectgateway.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-gkeconnect-gateway/linkinator.config.json b/packages/google-cloud-gkeconnect-gateway/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-gkeconnect-gateway/package.json b/packages/google-cloud-gkeconnect-gateway/package.json new file mode 100644 index 000000000000..9c110ffa26e8 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/gke-connect-gateway", + "version": "2.0.3", + "description": "apigateway client for Node.js", + "repository": "googleapis/nodejs-gke-connect-gateway", + "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 apigateway", + "apigateway", + "apigateway service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto new file mode 100644 index 000000000000..6e13893ca7a1 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto @@ -0,0 +1,75 @@ +// 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 +// +// 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.cloud.gkeconnect.gateway.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/httpbody.proto"; + +option csharp_namespace = "Google.Cloud.GkeConnect.Gateway.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/gkeconnect/gateway/v1beta1;gateway"; +option java_multiple_files = true; +option java_outer_classname = "GatewayProto"; +option java_package = "com.google.cloud.gkeconnect.gateway.v1beta1"; +option php_namespace = "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1"; +option ruby_package = "Google::Cloud::GkeConnect::Gateway::V1beta1"; + +// Gateway service is a public API which works as a Kubernetes resource model +// proxy between end users and registered Kubernetes clusters. Each RPC in this +// service matches with an HTTP verb. End user will initiate kubectl commands +// against the Gateway service, and Gateway service will forward user requests +// to clusters. +service GatewayService { + option (google.api.default_host) = "connectgateway.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // GetResource performs an HTTP GET request on the Kubernetes API Server. + rpc GetResource(google.api.HttpBody) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1beta1/**" + }; + } + + // PostResource performs an HTTP POST on the Kubernetes API Server. + rpc PostResource(google.api.HttpBody) returns (google.api.HttpBody) { + option (google.api.http) = { + post: "/v1beta1/**" + }; + } + + // DeleteResource performs an HTTP DELETE on the Kubernetes API Server. + rpc DeleteResource(google.api.HttpBody) returns (google.api.HttpBody) { + option (google.api.http) = { + delete: "/v1beta1/**" + }; + } + + // PutResource performs an HTTP PUT on the Kubernetes API Server. + rpc PutResource(google.api.HttpBody) returns (google.api.HttpBody) { + option (google.api.http) = { + put: "/v1beta1/**" + }; + } + + // PatchResource performs an HTTP PATCH on the Kubernetes API Server. + rpc PatchResource(google.api.HttpBody) returns (google.api.HttpBody) { + option (google.api.http) = { + patch: "/v1beta1/**" + }; + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts b/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts new file mode 100644 index 000000000000..5355fd9a8b15 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.d.ts @@ -0,0 +1,4075 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace gkeconnect. */ + namespace gkeconnect { + + /** Namespace gateway. */ + namespace gateway { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a GatewayService */ + class GatewayService extends $protobuf.rpc.Service { + + /** + * Constructs a new GatewayService 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 GatewayService 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): GatewayService; + + /** + * Calls GetResource. + * @param request HttpBody message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public getResource(request: google.api.IHttpBody, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResourceCallback): void; + + /** + * Calls GetResource. + * @param request HttpBody message or plain object + * @returns Promise + */ + public getResource(request: google.api.IHttpBody): Promise; + + /** + * Calls PostResource. + * @param request HttpBody message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public postResource(request: google.api.IHttpBody, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResourceCallback): void; + + /** + * Calls PostResource. + * @param request HttpBody message or plain object + * @returns Promise + */ + public postResource(request: google.api.IHttpBody): Promise; + + /** + * Calls DeleteResource. + * @param request HttpBody message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public deleteResource(request: google.api.IHttpBody, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResourceCallback): void; + + /** + * Calls DeleteResource. + * @param request HttpBody message or plain object + * @returns Promise + */ + public deleteResource(request: google.api.IHttpBody): Promise; + + /** + * Calls PutResource. + * @param request HttpBody message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public putResource(request: google.api.IHttpBody, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResourceCallback): void; + + /** + * Calls PutResource. + * @param request HttpBody message or plain object + * @returns Promise + */ + public putResource(request: google.api.IHttpBody): Promise; + + /** + * Calls PatchResource. + * @param request HttpBody message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public patchResource(request: google.api.IHttpBody, callback: google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResourceCallback): void; + + /** + * Calls PatchResource. + * @param request HttpBody message or plain object + * @returns Promise + */ + public patchResource(request: google.api.IHttpBody): Promise; + } + + namespace GatewayService { + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|getResource}. + * @param error Error, if any + * @param [response] HttpBody + */ + type GetResourceCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|postResource}. + * @param error Error, if any + * @param [response] HttpBody + */ + type PostResourceCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|deleteResource}. + * @param error Error, if any + * @param [response] HttpBody + */ + type DeleteResourceCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|putResource}. + * @param error Error, if any + * @param [response] HttpBody + */ + type PutResourceCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|patchResource}. + * @param error Error, if any + * @param [response] HttpBody + */ + type PatchResourceCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + } + } + } + } + } + + /** 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 HttpBody. */ + interface IHttpBody { + + /** HttpBody contentType */ + contentType?: (string|null); + + /** HttpBody data */ + data?: (Uint8Array|string|null); + + /** HttpBody extensions */ + extensions?: (google.protobuf.IAny[]|null); + } + + /** Represents a HttpBody. */ + class HttpBody implements IHttpBody { + + /** + * Constructs a new HttpBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpBody); + + /** HttpBody contentType. */ + public contentType: string; + + /** HttpBody data. */ + public data: (Uint8Array|string); + + /** HttpBody extensions. */ + public extensions: google.protobuf.IAny[]; + + /** + * Creates a new HttpBody instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpBody instance + */ + public static create(properties?: google.api.IHttpBody): google.api.HttpBody; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpBody + * @throws {Error} If the payload is not 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.HttpBody; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpBody + * @throws {Error} If the payload 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.HttpBody; + + /** + * Verifies a HttpBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpBody + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpBody; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @param message HttpBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpBody + * @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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 phpGenericServices. */ + public phpGenericServices: 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.js b/packages/google-cloud-gkeconnect-gateway/protos/protos.js new file mode 100644 index 000000000000..23c8e0913674 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.js @@ -0,0 +1,10930 @@ +// Copyright 2022 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_gke_connect_gateway_protos || ($protobuf.roots._google_cloud_gke_connect_gateway_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.gkeconnect = (function() { + + /** + * Namespace gkeconnect. + * @memberof google.cloud + * @namespace + */ + var gkeconnect = {}; + + gkeconnect.gateway = (function() { + + /** + * Namespace gateway. + * @memberof google.cloud.gkeconnect + * @namespace + */ + var gateway = {}; + + gateway.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.gkeconnect.gateway + * @namespace + */ + var v1beta1 = {}; + + v1beta1.GatewayService = (function() { + + /** + * Constructs a new GatewayService service. + * @memberof google.cloud.gkeconnect.gateway.v1beta1 + * @classdesc Represents a GatewayService + * @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 GatewayService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GatewayService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GatewayService; + + /** + * Creates new GatewayService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @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 {GatewayService} RPC service. Useful where requests and/or responses are streamed. + */ + GatewayService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|getResource}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @typedef GetResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls GetResource. + * @function getResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResourceCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayService.prototype.getResource = function getResource(request, callback) { + return this.rpcCall(getResource, $root.google.api.HttpBody, $root.google.api.HttpBody, request, callback); + }, "name", { value: "GetResource" }); + + /** + * Calls GetResource. + * @function getResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|postResource}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @typedef PostResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls PostResource. + * @function postResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResourceCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayService.prototype.postResource = function postResource(request, callback) { + return this.rpcCall(postResource, $root.google.api.HttpBody, $root.google.api.HttpBody, request, callback); + }, "name", { value: "PostResource" }); + + /** + * Calls PostResource. + * @function postResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|deleteResource}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @typedef DeleteResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls DeleteResource. + * @function deleteResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResourceCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayService.prototype.deleteResource = function deleteResource(request, callback) { + return this.rpcCall(deleteResource, $root.google.api.HttpBody, $root.google.api.HttpBody, request, callback); + }, "name", { value: "DeleteResource" }); + + /** + * Calls DeleteResource. + * @function deleteResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|putResource}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @typedef PutResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls PutResource. + * @function putResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResourceCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayService.prototype.putResource = function putResource(request, callback) { + return this.rpcCall(putResource, $root.google.api.HttpBody, $root.google.api.HttpBody, request, callback); + }, "name", { value: "PutResource" }); + + /** + * Calls PutResource. + * @function putResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gkeconnect.gateway.v1beta1.GatewayService|patchResource}. + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @typedef PatchResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls PatchResource. + * @function patchResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @param {google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResourceCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GatewayService.prototype.patchResource = function patchResource(request, callback) { + return this.rpcCall(patchResource, $root.google.api.HttpBody, $root.google.api.HttpBody, request, callback); + }, "name", { value: "PatchResource" }); + + /** + * Calls PatchResource. + * @function patchResource + * @memberof google.cloud.gkeconnect.gateway.v1beta1.GatewayService + * @instance + * @param {google.api.IHttpBody} request HttpBody message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GatewayService; + })(); + + return v1beta1; + })(); + + return gateway; + })(); + + return gkeconnect; + })(); + + return cloud; + })(); + + 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.HttpBody = (function() { + + /** + * Properties of a HttpBody. + * @memberof google.api + * @interface IHttpBody + * @property {string|null} [contentType] HttpBody contentType + * @property {Uint8Array|null} [data] HttpBody data + * @property {Array.|null} [extensions] HttpBody extensions + */ + + /** + * Constructs a new HttpBody. + * @memberof google.api + * @classdesc Represents a HttpBody. + * @implements IHttpBody + * @constructor + * @param {google.api.IHttpBody=} [properties] Properties to set + */ + function HttpBody(properties) { + this.extensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpBody contentType. + * @member {string} contentType + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.contentType = ""; + + /** + * HttpBody data. + * @member {Uint8Array} data + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.data = $util.newBuffer([]); + + /** + * HttpBody extensions. + * @member {Array.} extensions + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.extensions = $util.emptyArray; + + /** + * Creates a new HttpBody instance using the specified properties. + * @function create + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody=} [properties] Properties to set + * @returns {google.api.HttpBody} HttpBody instance + */ + HttpBody.create = function create(properties) { + return new HttpBody(properties); + }; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encode + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.extensions != null && message.extensions.length) + for (var i = 0; i < message.extensions.length; ++i) + $root.google.protobuf.Any.encode(message.extensions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decode = function 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.HttpBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + case 3: { + if (!(message.extensions && message.extensions.length)) + message.extensions = []; + message.extensions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpBody message. + * @function verify + * @memberof google.api.HttpBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string 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.extensions != null && message.hasOwnProperty("extensions")) { + if (!Array.isArray(message.extensions)) + return "extensions: array expected"; + for (var i = 0; i < message.extensions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensions[i]); + if (error) + return "extensions." + error; + } + } + return null; + }; + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpBody + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpBody} HttpBody + */ + HttpBody.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpBody) + return object; + var message = new $root.google.api.HttpBody(); + if (object.contentType != null) + message.contentType = String(object.contentType); + 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.extensions) { + if (!Array.isArray(object.extensions)) + throw TypeError(".google.api.HttpBody.extensions: array expected"); + message.extensions = []; + for (var i = 0; i < object.extensions.length; ++i) { + if (typeof object.extensions[i] !== "object") + throw TypeError(".google.api.HttpBody.extensions: object expected"); + message.extensions[i] = $root.google.protobuf.Any.fromObject(object.extensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpBody + * @static + * @param {google.api.HttpBody} message HttpBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extensions = []; + if (options.defaults) { + object.contentType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + 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; + if (message.extensions && message.extensions.length) { + object.extensions = []; + for (var j = 0; j < message.extensions.length; ++j) + object.extensions[j] = $root.google.protobuf.Any.toObject(message.extensions[j], options); + } + return object; + }; + + /** + * Converts this HttpBody to JSON. + * @function toJSON + * @memberof google.api.HttpBody + * @instance + * @returns {Object.} JSON object + */ + HttpBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpBody + * @function getTypeUrl + * @memberof google.api.HttpBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpBody"; + }; + + return HttpBody; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} 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; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} 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.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} 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) { + 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) { + 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-gkeconnect-gateway/protos/protos.json b/packages/google-cloud-gkeconnect-gateway/protos/protos.json new file mode 100644 index 000000000000..65b66014583f --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/protos/protos.json @@ -0,0 +1,1188 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "gkeconnect": { + "nested": { + "gateway": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.GkeConnect.Gateway.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/gkeconnect/gateway/v1beta1;gateway", + "java_multiple_files": true, + "java_outer_classname": "GatewayProto", + "java_package": "com.google.cloud.gkeconnect.gateway.v1beta1", + "php_namespace": "Google\\Cloud\\GkeConnect\\Gateway\\V1beta1", + "ruby_package": "Google::Cloud::GkeConnect::Gateway::V1beta1" + }, + "nested": { + "GatewayService": { + "options": { + "(google.api.default_host)": "connectgateway.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetResource": { + "requestType": "google.api.HttpBody", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1beta1/**" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/**" + } + } + ] + }, + "PostResource": { + "requestType": "google.api.HttpBody", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).post": "/v1beta1/**" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/**" + } + } + ] + }, + "DeleteResource": { + "requestType": "google.api.HttpBody", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).delete": "/v1beta1/**" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/**" + } + } + ] + }, + "PutResource": { + "requestType": "google.api.HttpBody", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).put": "/v1beta1/**" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1beta1/**" + } + } + ] + }, + "PatchResource": { + "requestType": "google.api.HttpBody", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).patch": "/v1beta1/**" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/**" + } + } + ] + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/httpbody;httpbody", + "java_multiple_files": true, + "java_outer_classname": "HttpBodyProto", + "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" + }, + "HttpBody": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + }, + "extensions": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-gkeconnect-gateway/samples/README.md b/packages/google-cloud-gkeconnect-gateway/samples/README.md new file mode 100644 index 000000000000..04000cd00f68 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/README.md @@ -0,0 +1,158 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [GKE Connect Gateway: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Gateway_service.delete_resource](#gateway_service.delete_resource) + * [Gateway_service.get_resource](#gateway_service.get_resource) + * [Gateway_service.patch_resource](#gateway_service.patch_resource) + * [Gateway_service.post_resource](#gateway_service.post_resource) + * [Gateway_service.put_resource](#gateway_service.put_resource) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Gateway_service.delete_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js` + + +----- + + + + +### Gateway_service.get_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js` + + +----- + + + + +### Gateway_service.patch_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js` + + +----- + + + + +### Gateway_service.post_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js` + + +----- + + + + +### Gateway_service.put_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/anthos/multicluster-management/gateway diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js new file mode 100644 index 000000000000..b19fd6eaf1dc --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.delete_resource.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START connectgateway_v1beta1_generated_GatewayService_DeleteResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + // const contentType = 'abc123' + /** + * The HTTP request/response body as raw binary. + */ + // const data = 'Buffer.from('string')' + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + // const extensions = 1234 + + // Imports the Gateway library + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayServiceClient(); + + async function callDeleteResource() { + // Construct request + const request = { + }; + + // Run request + const response = await gatewayClient.deleteResource(request); + console.log(response); + } + + callDeleteResource(); + // [END connectgateway_v1beta1_generated_GatewayService_DeleteResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js new file mode 100644 index 000000000000..76aeef2367f7 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.get_resource.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START connectgateway_v1beta1_generated_GatewayService_GetResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + // const contentType = 'abc123' + /** + * The HTTP request/response body as raw binary. + */ + // const data = 'Buffer.from('string')' + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + // const extensions = 1234 + + // Imports the Gateway library + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayServiceClient(); + + async function callGetResource() { + // Construct request + const request = { + }; + + // Run request + const response = await gatewayClient.getResource(request); + console.log(response); + } + + callGetResource(); + // [END connectgateway_v1beta1_generated_GatewayService_GetResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js new file mode 100644 index 000000000000..3faabc9f5f2f --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.patch_resource.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START connectgateway_v1beta1_generated_GatewayService_PatchResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + // const contentType = 'abc123' + /** + * The HTTP request/response body as raw binary. + */ + // const data = 'Buffer.from('string')' + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + // const extensions = 1234 + + // Imports the Gateway library + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayServiceClient(); + + async function callPatchResource() { + // Construct request + const request = { + }; + + // Run request + const response = await gatewayClient.patchResource(request); + console.log(response); + } + + callPatchResource(); + // [END connectgateway_v1beta1_generated_GatewayService_PatchResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js new file mode 100644 index 000000000000..fb86e8d8611d --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.post_resource.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START connectgateway_v1beta1_generated_GatewayService_PostResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + // const contentType = 'abc123' + /** + * The HTTP request/response body as raw binary. + */ + // const data = 'Buffer.from('string')' + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + // const extensions = 1234 + + // Imports the Gateway library + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayServiceClient(); + + async function callPostResource() { + // Construct request + const request = { + }; + + // Run request + const response = await gatewayClient.postResource(request); + console.log(response); + } + + callPostResource(); + // [END connectgateway_v1beta1_generated_GatewayService_PostResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js new file mode 100644 index 000000000000..2c848e0df321 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/gateway_service.put_resource.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main() { + // [START connectgateway_v1beta1_generated_GatewayService_PutResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + // const contentType = 'abc123' + /** + * The HTTP request/response body as raw binary. + */ + // const data = 'Buffer.from('string')' + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + // const extensions = 1234 + + // Imports the Gateway library + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1; + + // Instantiates a client + const gatewayClient = new GatewayServiceClient(); + + async function callPutResource() { + // Construct request + const request = { + }; + + // Run request + const response = await gatewayClient.putResource(request); + console.log(response); + } + + callPutResource(); + // [END connectgateway_v1beta1_generated_GatewayService_PutResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json new file mode 100644 index 000000000000..33fc2d3fa0b9 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/generated/v1beta1/snippet_metadata.google.cloud.gkeconnect.gateway.v1beta1.json @@ -0,0 +1,255 @@ +{ + "clientLibrary": { + "name": "nodejs-gateway", + "version": "2.0.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gkeconnect.gateway.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "connectgateway_v1beta1_generated_GatewayService_GetResource_async", + "title": "GatewayService getResource Sample", + "origin": "API_DEFINITION", + "description": " GetResource performs an HTTP GET request on the Kubernetes API Server.", + "canonical": true, + "file": "gateway_service.get_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResource", + "async": true, + "parameters": [ + { + "name": "content_type", + "type": "TYPE_STRING" + }, + { + "name": "data", + "type": "TYPE_BYTES" + }, + { + "name": "extensions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "GatewayServiceClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + }, + "method": { + "shortName": "GetResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.GetResource", + "service": { + "shortName": "GatewayService", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + } + } + } + }, + { + "regionTag": "connectgateway_v1beta1_generated_GatewayService_PostResource_async", + "title": "GatewayService postResource Sample", + "origin": "API_DEFINITION", + "description": " PostResource performs an HTTP POST on the Kubernetes API Server.", + "canonical": true, + "file": "gateway_service.post_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PostResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResource", + "async": true, + "parameters": [ + { + "name": "content_type", + "type": "TYPE_STRING" + }, + { + "name": "data", + "type": "TYPE_BYTES" + }, + { + "name": "extensions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "GatewayServiceClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + }, + "method": { + "shortName": "PostResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PostResource", + "service": { + "shortName": "GatewayService", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + } + } + } + }, + { + "regionTag": "connectgateway_v1beta1_generated_GatewayService_DeleteResource_async", + "title": "GatewayService deleteResource Sample", + "origin": "API_DEFINITION", + "description": " DeleteResource performs an HTTP DELETE on the Kubernetes API Server.", + "canonical": true, + "file": "gateway_service.delete_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResource", + "async": true, + "parameters": [ + { + "name": "content_type", + "type": "TYPE_STRING" + }, + { + "name": "data", + "type": "TYPE_BYTES" + }, + { + "name": "extensions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "GatewayServiceClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + }, + "method": { + "shortName": "DeleteResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.DeleteResource", + "service": { + "shortName": "GatewayService", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + } + } + } + }, + { + "regionTag": "connectgateway_v1beta1_generated_GatewayService_PutResource_async", + "title": "GatewayService putResource Sample", + "origin": "API_DEFINITION", + "description": " PutResource performs an HTTP PUT on the Kubernetes API Server.", + "canonical": true, + "file": "gateway_service.put_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PutResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResource", + "async": true, + "parameters": [ + { + "name": "content_type", + "type": "TYPE_STRING" + }, + { + "name": "data", + "type": "TYPE_BYTES" + }, + { + "name": "extensions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "GatewayServiceClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + }, + "method": { + "shortName": "PutResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PutResource", + "service": { + "shortName": "GatewayService", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + } + } + } + }, + { + "regionTag": "connectgateway_v1beta1_generated_GatewayService_PatchResource_async", + "title": "GatewayService patchResource Sample", + "origin": "API_DEFINITION", + "description": " PatchResource performs an HTTP PATCH on the Kubernetes API Server.", + "canonical": true, + "file": "gateway_service.patch_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PatchResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResource", + "async": true, + "parameters": [ + { + "name": "content_type", + "type": "TYPE_STRING" + }, + { + "name": "data", + "type": "TYPE_BYTES" + }, + { + "name": "extensions", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "GatewayServiceClient", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayServiceClient" + }, + "method": { + "shortName": "PatchResource", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService.PatchResource", + "service": { + "shortName": "GatewayService", + "fullName": "google.cloud.gkeconnect.gateway.v1beta1.GatewayService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gkeconnect-gateway/samples/package.json b/packages/google-cloud-gkeconnect-gateway/samples/package.json new file mode 100644 index 000000000000..6fbbadfd143a --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-connect-gateway", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/gke-connect-gateway": "^2.0.3" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0" + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js b/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js new file mode 100644 index 000000000000..aa414d03f2d8 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/quickstart.js @@ -0,0 +1,34 @@ +// 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. +// + +'use strict'; + +async function main() { + // [START nodejs_connect_gateway_quickstart] + // Imports the Google Cloud client library + + const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway'); + + // Creates a client + new GatewayServiceClient(); + // [END nodejs_connect_gateway_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js b/packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js new file mode 100644 index 000000000000..77215edc24ef --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/samples/test/quickstart.js @@ -0,0 +1,35 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const stdout = execSync('node ./quickstart.js', {cwd}); + assert.equal(stdout, false); + }); +}); diff --git a/packages/google-cloud-gkeconnect-gateway/src/index.ts b/packages/google-cloud-gkeconnect-gateway/src/index.ts new file mode 100644 index 000000000000..8a4bcebbfa43 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; + +const GatewayServiceClient = v1beta1.GatewayServiceClient; +type GatewayServiceClient = v1beta1.GatewayServiceClient; + +export {v1beta1, GatewayServiceClient}; +export default {v1beta1, GatewayServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..5c3d96707e3b --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.gkeconnect.gateway.v1beta1", + "libraryPackage": "@google-cloud/gke-connect-gateway", + "services": { + "GatewayService": { + "clients": { + "grpc": { + "libraryClient": "GatewayServiceClient", + "rpcs": { + "GetResource": { + "methods": [ + "getResource" + ] + }, + "PostResource": { + "methods": [ + "postResource" + ] + }, + "DeleteResource": { + "methods": [ + "deleteResource" + ] + }, + "PutResource": { + "methods": [ + "putResource" + ] + }, + "PatchResource": { + "methods": [ + "patchResource" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GatewayServiceClient", + "rpcs": { + "GetResource": { + "methods": [ + "getResource" + ] + }, + "PostResource": { + "methods": [ + "postResource" + ] + }, + "DeleteResource": { + "methods": [ + "deleteResource" + ] + }, + "PutResource": { + "methods": [ + "putResource" + ] + }, + "PatchResource": { + "methods": [ + "patchResource" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client.ts b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client.ts new file mode 100644 index 000000000000..ce2d66f902e6 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client.ts @@ -0,0 +1,750 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/gateway_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './gateway_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Gateway service is a public API which works as a Kubernetes resource model + * proxy between end users and registered Kubernetes clusters. Each RPC in this + * service matches with an HTTP verb. End user will initiate kubectl commands + * against the Gateway service, and Gateway service will forward user requests + * to clusters. + * @class + * @memberof v1beta1 + */ +export class GatewayServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + gatewayServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GatewayServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 GatewayServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof GatewayServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gkeconnect.gateway.v1beta1.GatewayService', + 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.gatewayServiceStub) { + return this.gatewayServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gkeconnect.gateway.v1beta1.GatewayService. + this.gatewayServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gkeconnect.gateway.v1beta1.GatewayService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gkeconnect.gateway.v1beta1 + .GatewayService, + 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 gatewayServiceStubMethods = [ + 'getResource', + 'postResource', + 'deleteResource', + 'putResource', + 'patchResource', + ]; + for (const methodName of gatewayServiceStubMethods) { + const callPromise = this.gatewayServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gatewayServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'connectgateway.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'connectgateway.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * GetResource performs an HTTP GET request on the Kubernetes API Server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.contentType + * The HTTP Content-Type header value specifying the content type of the body. + * @param {Buffer} request.data + * The HTTP request/response body as raw binary. + * @param {number[]} request.extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * @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 [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_service.get_resource.js + * region_tag:connectgateway_v1beta1_generated_GatewayService_GetResource_async + */ + getResource( + request?: protos.google.api.IHttpBody, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | undefined, + {} | undefined + ] + >; + getResource( + request: protos.google.api.IHttpBody, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + getResource( + request: protos.google.api.IHttpBody, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + getResource( + request?: protos.google.api.IHttpBody, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | 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 || {}; + this.initialize(); + return this.innerApiCalls.getResource(request, options, callback); + } + /** + * PostResource performs an HTTP POST on the Kubernetes API Server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.contentType + * The HTTP Content-Type header value specifying the content type of the body. + * @param {Buffer} request.data + * The HTTP request/response body as raw binary. + * @param {number[]} request.extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * @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 [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_service.post_resource.js + * region_tag:connectgateway_v1beta1_generated_GatewayService_PostResource_async + */ + postResource( + request?: protos.google.api.IHttpBody, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | undefined, + {} | undefined + ] + >; + postResource( + request: protos.google.api.IHttpBody, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + postResource( + request: protos.google.api.IHttpBody, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + postResource( + request?: protos.google.api.IHttpBody, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | 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 || {}; + this.initialize(); + return this.innerApiCalls.postResource(request, options, callback); + } + /** + * DeleteResource performs an HTTP DELETE on the Kubernetes API Server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.contentType + * The HTTP Content-Type header value specifying the content type of the body. + * @param {Buffer} request.data + * The HTTP request/response body as raw binary. + * @param {number[]} request.extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * @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 [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_service.delete_resource.js + * region_tag:connectgateway_v1beta1_generated_GatewayService_DeleteResource_async + */ + deleteResource( + request?: protos.google.api.IHttpBody, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | undefined, + {} | undefined + ] + >; + deleteResource( + request: protos.google.api.IHttpBody, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + deleteResource( + request: protos.google.api.IHttpBody, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + deleteResource( + request?: protos.google.api.IHttpBody, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | 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 || {}; + this.initialize(); + return this.innerApiCalls.deleteResource(request, options, callback); + } + /** + * PutResource performs an HTTP PUT on the Kubernetes API Server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.contentType + * The HTTP Content-Type header value specifying the content type of the body. + * @param {Buffer} request.data + * The HTTP request/response body as raw binary. + * @param {number[]} request.extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * @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 [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_service.put_resource.js + * region_tag:connectgateway_v1beta1_generated_GatewayService_PutResource_async + */ + putResource( + request?: protos.google.api.IHttpBody, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | undefined, + {} | undefined + ] + >; + putResource( + request: protos.google.api.IHttpBody, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + putResource( + request: protos.google.api.IHttpBody, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + putResource( + request?: protos.google.api.IHttpBody, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | 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 || {}; + this.initialize(); + return this.innerApiCalls.putResource(request, options, callback); + } + /** + * PatchResource performs an HTTP PATCH on the Kubernetes API Server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.contentType + * The HTTP Content-Type header value specifying the content type of the body. + * @param {Buffer} request.data + * The HTTP request/response body as raw binary. + * @param {number[]} request.extensions + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * @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 [HttpBody]{@link google.api.HttpBody}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/gateway_service.patch_resource.js + * region_tag:connectgateway_v1beta1_generated_GatewayService_PatchResource_async + */ + patchResource( + request?: protos.google.api.IHttpBody, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | undefined, + {} | undefined + ] + >; + patchResource( + request: protos.google.api.IHttpBody, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + patchResource( + request: protos.google.api.IHttpBody, + callback: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): void; + patchResource( + request?: protos.google.api.IHttpBody, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + protos.google.api.IHttpBody | 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 || {}; + this.initialize(); + return this.innerApiCalls.patchResource(request, options, callback); + } + + /** + * 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.gatewayServiceStub && !this._terminated) { + return this.gatewayServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client_config.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client_config.json new file mode 100644 index 000000000000..d733656e755f --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.gkeconnect.gateway.v1beta1.GatewayService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "GetResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PostResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PutResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PatchResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_proto_list.json b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_proto_list.json new file mode 100644 index 000000000000..634a5e135a84 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/gateway_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/gkeconnect/gateway/v1beta1/gateway.proto" +] diff --git a/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts new file mode 100644 index 000000000000..8d9d6e0b87fd --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {GatewayServiceClient} from './gateway_service_client'; diff --git a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..ae15a5b0b747 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const gateway = require('@google-cloud/gke-connect-gateway'); + +function main() { + const gatewayServiceClient = new gateway.GatewayServiceClient(); +} + +main(); diff --git a/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..dbad3f4602b9 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {GatewayServiceClient} from '@google-cloud/gke-connect-gateway'; + +// check that the client class type name can be used +function doStuffWithGatewayServiceClient(client: GatewayServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const gatewayServiceClient = new GatewayServiceClient(); + doStuffWithGatewayServiceClient(gatewayServiceClient); +} + +main(); diff --git a/packages/google-cloud-gkeconnect-gateway/system-test/install.ts b/packages/google-cloud-gkeconnect-gateway/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts new file mode 100644 index 000000000000..27f360b9ec4a --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/test/gapic_gateway_service_v1beta1.ts @@ -0,0 +1,526 @@ +// Copyright 2022 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 gatewayserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1beta1.GatewayServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gatewayserviceModule.v1beta1.GatewayServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gatewayserviceModule.v1beta1.GatewayServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = gatewayserviceModule.v1beta1.GatewayServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayServiceStub, undefined); + await client.initialize(); + assert(client.gatewayServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.gatewayServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gatewayServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + 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 gatewayserviceModule.v1beta1.GatewayServiceClient({ + 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('getResource', () => { + it('invokes getResource without error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getResource = stubSimpleCall(expectedResponse); + const [response] = await client.getResource(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes getResource without error using callback', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getResource( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes getResource with error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('expected'); + client.innerApiCalls.getResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getResource(request), expectedError); + }); + + it('invokes getResource with closed client', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getResource(request), expectedError); + }); + }); + + describe('postResource', () => { + it('invokes postResource without error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.postResource = stubSimpleCall(expectedResponse); + const [response] = await client.postResource(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes postResource without error using callback', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.postResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.postResource( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes postResource with error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('expected'); + client.innerApiCalls.postResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.postResource(request), expectedError); + }); + + it('invokes postResource with closed client', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.postResource(request), expectedError); + }); + }); + + describe('deleteResource', () => { + it('invokes deleteResource without error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.deleteResource = stubSimpleCall(expectedResponse); + const [response] = await client.deleteResource(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes deleteResource without error using callback', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.deleteResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteResource( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes deleteResource with error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteResource(request), expectedError); + }); + + it('invokes deleteResource with closed client', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteResource(request), expectedError); + }); + }); + + describe('putResource', () => { + it('invokes putResource without error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.putResource = stubSimpleCall(expectedResponse); + const [response] = await client.putResource(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes putResource without error using callback', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.putResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.putResource( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes putResource with error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('expected'); + client.innerApiCalls.putResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.putResource(request), expectedError); + }); + + it('invokes putResource with closed client', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.putResource(request), expectedError); + }); + }); + + describe('patchResource', () => { + it('invokes patchResource without error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.patchResource = stubSimpleCall(expectedResponse); + const [response] = await client.patchResource(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes patchResource without error using callback', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.patchResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchResource( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes patchResource with error', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('expected'); + client.innerApiCalls.patchResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.patchResource(request), expectedError); + }); + + it('invokes patchResource with closed client', async () => { + const client = new gatewayserviceModule.v1beta1.GatewayServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.api.HttpBody()); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.patchResource(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-gkeconnect-gateway/tsconfig.json b/packages/google-cloud-gkeconnect-gateway/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/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/packages/google-cloud-gkeconnect-gateway/webpack.config.js b/packages/google-cloud-gkeconnect-gateway/webpack.config.js new file mode 100644 index 000000000000..fdb6f3218890 --- /dev/null +++ b/packages/google-cloud-gkeconnect-gateway/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: 'GatewayService', + filename: './gateway-service.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/packages/google-cloud-language/.OwlBot.yaml b/packages/google-cloud-language/.OwlBot.yaml new file mode 100644 index 000000000000..b31158ec8a96 --- /dev/null +++ b/packages/google-cloud-language/.OwlBot.yaml @@ -0,0 +1,21 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/language/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-language/$1 + diff --git a/packages/google-cloud-language/.eslintignore b/packages/google-cloud-language/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-language/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-language/.eslintrc.json b/packages/google-cloud-language/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-language/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-language/.gitattributes b/packages/google-cloud-language/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-language/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-language/.gitignore b/packages/google-cloud-language/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-language/.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/packages/google-cloud-language/.jsdoc.js b/packages/google-cloud-language/.jsdoc.js new file mode 100644 index 000000000000..7961113291cd --- /dev/null +++ b/packages/google-cloud-language/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/language', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-language/.mocharc.js b/packages/google-cloud-language/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-language/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-language/.nycrc b/packages/google-cloud-language/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-language/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-language/.prettierignore b/packages/google-cloud-language/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-language/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-language/.prettierrc.js b/packages/google-cloud-language/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-language/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-language/.readme-partials.yml b/packages/google-cloud-language/.readme-partials.yml new file mode 100644 index 000000000000..972b7ecd6091 --- /dev/null +++ b/packages/google-cloud-language/.readme-partials.yml @@ -0,0 +1,4 @@ +introduction: |- + [Cloud Natural Language API](https://cloud.google.com/natural-language/docs) provides natural + language understanding technologies to developers, including sentiment analysis, entity + analysis, and syntax analysis. This API is part of the larger Cloud Machine Learning API family. diff --git a/packages/google-cloud-language/.repo-metadata.json b/packages/google-cloud-language/.repo-metadata.json new file mode 100644 index 000000000000..d3bebc8638ca --- /dev/null +++ b/packages/google-cloud-language/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "default_version": "v1", + "release_level": "stable", + "requires_billing": true, + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/language/latest", + "codeowner_team": "@googleapis/ml-apis", + "language": "nodejs", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559753", + "product_documentation": "https://cloud.google.com/natural-language/docs/", + "name": "language", + "distribution_name": "@google-cloud/language", + "name_pretty": "Natural Language", + "api_id": "language.googleapis.com", + "repo": "googleapis/google-cloud-node", + "api_shortname": "language", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-language/CHANGELOG.md b/packages/google-cloud-language/CHANGELOG.md new file mode 100644 index 000000000000..a3d7c1cde0ad --- /dev/null +++ b/packages/google-cloud-language/CHANGELOG.md @@ -0,0 +1,543 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/language?activeTab=versions + +## [5.1.0](https://github.com/googleapis/nodejs-language/compare/v5.0.2...v5.1.0) (2022-09-21) + + +### Features + +* Add support for V1 and V2 classification models for the V1Beta2 API ([#697](https://github.com/googleapis/nodejs-language/issues/697)) ([3b87da3](https://github.com/googleapis/nodejs-language/commit/3b87da3a09e4d4fff02e235d3f1f70841906696d)) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#691](https://github.com/googleapis/nodejs-language/issues/691)) ([b5a177d](https://github.com/googleapis/nodejs-language/commit/b5a177d9c6a82ef012ab18c463c796444a34fe1b)) + +## [5.0.2](https://github.com/googleapis/nodejs-language/compare/v5.0.1...v5.0.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#688](https://github.com/googleapis/nodejs-language/issues/688)) ([a6427f0](https://github.com/googleapis/nodejs-language/commit/a6427f0b488ff09172b0dd3303f26a58b2d9cfde)) +* Better support for fallback mode ([#683](https://github.com/googleapis/nodejs-language/issues/683)) ([f97d4ec](https://github.com/googleapis/nodejs-language/commit/f97d4ec5197cb4571235d28cca13eda2c5ad1243)) +* Change import long to require ([#684](https://github.com/googleapis/nodejs-language/issues/684)) ([dfa3ad2](https://github.com/googleapis/nodejs-language/commit/dfa3ad26f1090aac180406dfd8692b5e15fa87f5)) +* **deps:** Update dependency @google-cloud/automl to v3 ([#672](https://github.com/googleapis/nodejs-language/issues/672)) ([4385333](https://github.com/googleapis/nodejs-language/commit/4385333ed516e98cf5ea44bb1aa133cc7eebb203)) +* **deps:** Update dependency mathjs to v11 ([#679](https://github.com/googleapis/nodejs-language/issues/679)) ([ba23db6](https://github.com/googleapis/nodejs-language/commit/ba23db66808c202b2494019264a6246e66d5f58a)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-language/issues/1553)) ([#687](https://github.com/googleapis/nodejs-language/issues/687)) ([f3c627d](https://github.com/googleapis/nodejs-language/commit/f3c627d25b3a25ac20ae8b61f44ec236202cfb53)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-language/issues/1546)) ([#686](https://github.com/googleapis/nodejs-language/issues/686)) ([9a47a8d](https://github.com/googleapis/nodejs-language/commit/9a47a8d29f4df3a6ba428b462ac6a255eab28ab1)) + +## [5.0.1](https://github.com/googleapis/nodejs-language/compare/v5.0.0...v5.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#673](https://github.com/googleapis/nodejs-language/issues/673)) ([6767804](https://github.com/googleapis/nodejs-language/commit/67678040029a2cdfe1ed1a7488ec2c8ba5920db8)) + +## [5.0.0](https://github.com/googleapis/nodejs-language/compare/v4.3.2...v5.0.0) (2022-06-10) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#666) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/storage to v6 ([#668](https://github.com/googleapis/nodejs-language/issues/668)) ([4120d2d](https://github.com/googleapis/nodejs-language/commit/4120d2d1da4ce6bd99bd51c5ee180929007d7051)) + + +### Build System + +* update library to use Node 12 ([#666](https://github.com/googleapis/nodejs-language/issues/666)) ([c6edf4a](https://github.com/googleapis/nodejs-language/commit/c6edf4a10b43c2706de89d5d553fb9f74b59ee98)) + +### [4.3.2](https://www.github.com/googleapis/nodejs-language/compare/v4.3.1...v4.3.2) (2021-11-10) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v10 ([#630](https://www.github.com/googleapis/nodejs-language/issues/630)) ([24a189d](https://www.github.com/googleapis/nodejs-language/commit/24a189d1cd2dc68f772f2530684612b4d6ebc2ec)) + +### [4.3.1](https://www.github.com/googleapis/nodejs-language/compare/v4.3.0...v4.3.1) (2021-09-03) + + +### Bug Fixes + +* **build:** migrate to main branch ([#614](https://www.github.com/googleapis/nodejs-language/issues/614)) ([703d479](https://www.github.com/googleapis/nodejs-language/commit/703d47916ba915a0b173dd702c8558e7fedb8a77)) + +## [4.3.0](https://www.github.com/googleapis/nodejs-language/compare/v4.2.9...v4.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#610](https://www.github.com/googleapis/nodejs-language/issues/610)) ([461baca](https://www.github.com/googleapis/nodejs-language/commit/461bacad4c1c2216e39622b3f82ef634a3665956)) + +### [4.2.9](https://www.github.com/googleapis/nodejs-language/compare/v4.2.8...v4.2.9) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#608](https://www.github.com/googleapis/nodejs-language/issues/608)) ([81d9fa1](https://www.github.com/googleapis/nodejs-language/commit/81d9fa1ff73ea6129d85bcf071cadd3946b9bdd7)) + +### [4.2.8](https://www.github.com/googleapis/nodejs-language/compare/v4.2.7...v4.2.8) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#600](https://www.github.com/googleapis/nodejs-language/issues/600)) ([9f31d3f](https://www.github.com/googleapis/nodejs-language/commit/9f31d3f510c1628d610633d4ec749abdf66d73f3)) + +### [4.2.7](https://www.github.com/googleapis/nodejs-language/compare/v4.2.6...v4.2.7) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#598](https://www.github.com/googleapis/nodejs-language/issues/598)) ([47f9295](https://www.github.com/googleapis/nodejs-language/commit/47f9295ae17d4f9f87c32a40276eb1588f2cca55)) + +### [4.2.6](https://www.github.com/googleapis/nodejs-language/compare/v4.2.5...v4.2.6) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#595](https://www.github.com/googleapis/nodejs-language/issues/595)) ([3ac3cfb](https://www.github.com/googleapis/nodejs-language/commit/3ac3cfb8d0ce0ba055502e07178764555d020622)) + +### [4.2.5](https://www.github.com/googleapis/nodejs-language/compare/v4.2.4...v4.2.5) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#588](https://www.github.com/googleapis/nodejs-language/issues/588)) ([878d365](https://www.github.com/googleapis/nodejs-language/commit/878d365dd0fba24ac58dcc80939e250c77d8cb53)) + +### [4.2.4](https://www.github.com/googleapis/nodejs-language/compare/v4.2.3...v4.2.4) (2021-05-29) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#579](https://www.github.com/googleapis/nodejs-language/issues/579)) ([3ab88da](https://www.github.com/googleapis/nodejs-language/commit/3ab88daffd13aeab99689ccccfe3ec29f8ec89cd)) + +### [4.2.3](https://www.github.com/googleapis/nodejs-language/compare/v4.2.2...v4.2.3) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#569](https://www.github.com/googleapis/nodejs-language/issues/569)) ([70b3883](https://www.github.com/googleapis/nodejs-language/commit/70b3883797cc61f6ef314f19e75930f0c0193dff)) +* use require() to load JSON protos ([#572](https://www.github.com/googleapis/nodejs-language/issues/572)) ([e3efed9](https://www.github.com/googleapis/nodejs-language/commit/e3efed93fb7dab7236b9ba4effdcda915327fd1d)) + +### [4.2.2](https://www.github.com/googleapis/nodejs-language/compare/v4.2.1...v4.2.2) (2021-03-07) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v9 ([#537](https://www.github.com/googleapis/nodejs-language/issues/537)) ([794f530](https://www.github.com/googleapis/nodejs-language/commit/794f530137cc79c9d834befbeaeef70e9d414bd5)) + +### [4.2.1](https://www.github.com/googleapis/nodejs-language/compare/v4.2.0...v4.2.1) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#528](https://www.github.com/googleapis/nodejs-language/issues/528)) ([f689a4e](https://www.github.com/googleapis/nodejs-language/commit/f689a4e03818471731509f12c9049b7cc6c849cd)) + +## [4.2.0](https://www.github.com/googleapis/nodejs-language/compare/v4.1.1...v4.2.0) (2020-10-16) + + +### Features + +* Fix proto comments for language API inorder for docs parsing to work correctly. ([#514](https://www.github.com/googleapis/nodejs-language/issues/514)) ([eda55b8](https://www.github.com/googleapis/nodejs-language/commit/eda55b8a371ec0e8b025e6d44a77da4c3d27db22)) + +### [4.1.1](https://www.github.com/googleapis/nodejs-language/compare/v4.1.0...v4.1.1) (2020-09-12) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#509](https://www.github.com/googleapis/nodejs-language/issues/509)) ([3ab34d3](https://www.github.com/googleapis/nodejs-language/commit/3ab34d3d464b66948c616b1f00dae061a48e57e3)) +* move system and samples test from Node 10 to Node 12 ([#503](https://www.github.com/googleapis/nodejs-language/issues/503)) ([df948af](https://www.github.com/googleapis/nodejs-language/commit/df948affcc41bc6cf171bda6e3834db32fa22aa3)) + +## [4.1.0](https://www.github.com/googleapis/nodejs-language/compare/v4.0.1...v4.1.0) (2020-06-13) + + +### Features + +* move ts target to es2018 from es2016 ([#471](https://www.github.com/googleapis/nodejs-language/issues/471)) ([df4d71c](https://www.github.com/googleapis/nodejs-language/commit/df4d71c7a3c6a4b02fb48ee5cfed76f795a446ea)) + + +### Bug Fixes + +* ensure gax is usable from electron ([#475](https://www.github.com/googleapis/nodejs-language/issues/475)) ([6fb93c9](https://www.github.com/googleapis/nodejs-language/commit/6fb93c9158aefc2be3541c6cb753621960314daf)) + +### [4.0.1](https://www.github.com/googleapis/nodejs-language/compare/v4.0.0...v4.0.1) (2020-06-04) + + +### Bug Fixes + +* regenerate unit tests ([#461](https://www.github.com/googleapis/nodejs-language/issues/461)) ([84b62fd](https://www.github.com/googleapis/nodejs-language/commit/84b62fdebba9b81746d0bceb993ff0e967c9ce5e)) +* synth.py clean up for multiple version ([#463](https://www.github.com/googleapis/nodejs-language/issues/463)) ([b63d9fc](https://www.github.com/googleapis/nodejs-language/commit/b63d9fc53a0287c5d4c4c626d91b520bd0b28cd4)) +* **deps:** update dependency @google-cloud/storage to v5 ([#466](https://www.github.com/googleapis/nodejs-language/issues/466)) ([552a560](https://www.github.com/googleapis/nodejs-language/commit/552a5603738ac73b6d6018272efa5697ad01aa10)) +* **deps:** update dependency mathjs to v7 ([#464](https://www.github.com/googleapis/nodejs-language/issues/464)) ([0d706b2](https://www.github.com/googleapis/nodejs-language/commit/0d706b2080a6e8a4026e425e7c4b7e5e1968e359)) + +## [4.0.0](https://www.github.com/googleapis/nodejs-language/compare/v3.8.0...v4.0.0) (2020-04-13) + + +### ⚠ BREAKING CHANGES + +* drop node8 support (#405) + +### Features + +* deferred client initialization ([#384](https://www.github.com/googleapis/nodejs-language/issues/384)) ([b329a1c](https://www.github.com/googleapis/nodejs-language/commit/b329a1cb7c78902fc7855ef6a3a880cde2c1c83e)) +* drop node8 support ([#405](https://www.github.com/googleapis/nodejs-language/issues/405)) ([520811c](https://www.github.com/googleapis/nodejs-language/commit/520811cd008551366dfbda0912aba29bbf5a82e4)) + + +### Bug Fixes + +* remove eslint, update gax, fix generated protos, run the generator ([#447](https://www.github.com/googleapis/nodejs-language/issues/447)) ([5ed5344](https://www.github.com/googleapis/nodejs-language/commit/5ed53445f168d6d406dea1207d75541efd795086)) + +## [3.8.0](https://www.github.com/googleapis/nodejs-language/compare/v3.7.2...v3.8.0) (2020-02-28) + + +### Features + +* export protos in src/index.ts ([482fb10](https://www.github.com/googleapis/nodejs-language/commit/482fb10bc1d4f01bd3de38a0301cda2a2efb491d)) + +### [3.7.2](https://www.github.com/googleapis/nodejs-language/compare/v3.7.1...v3.7.2) (2020-02-10) + + +### Bug Fixes + +* adds encodingType to analyzeSyntax* sampless ([#364](https://www.github.com/googleapis/nodejs-language/issues/364)) ([5bb849a](https://www.github.com/googleapis/nodejs-language/commit/5bb849a3a563f4d138e280b87a5b5ae1069e7a00)) + +### [3.7.1](https://www.github.com/googleapis/nodejs-language/compare/v3.7.0...v3.7.1) (2020-01-29) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([#353](https://www.github.com/googleapis/nodejs-language/issues/353)) ([bc20af5](https://www.github.com/googleapis/nodejs-language/commit/bc20af562dd29a0a1b3663e40062e70d07760185)) + +## [3.7.0](https://www.github.com/googleapis/nodejs-language/compare/v3.6.3...v3.7.0) (2020-01-03) + + +### Features + +* move library to typescript code generation ([#338](https://www.github.com/googleapis/nodejs-language/issues/338)) ([8317b02](https://www.github.com/googleapis/nodejs-language/commit/8317b02ad94724b3eee93895131e89cc9dc1e5cd)) + + +### Bug Fixes + +* closing a client twice throws error earlier ([9bf7e7c](https://www.github.com/googleapis/nodejs-language/commit/9bf7e7cbe0e34bbb49f920882a06e6739e7075d9)) + +### [3.6.3](https://www.github.com/googleapis/nodejs-language/compare/v3.6.2...v3.6.3) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([d93b13e](https://www.github.com/googleapis/nodejs-language/commit/d93b13e7fe29e093ff1e2af134098113a06dab00)) +* correct AutoML Natural Language region tags to match with all other languages. ([#335](https://www.github.com/googleapis/nodejs-language/issues/335)) ([e20276a](https://www.github.com/googleapis/nodejs-language/commit/e20276a70d0008cd2776191467a1a58b373be6f3)) + +### [3.6.2](https://www.github.com/googleapis/nodejs-language/compare/v3.6.1...v3.6.2) (2019-11-18) + + +### Bug Fixes + +* **deps:** update dependency yargs to v15 ([#328](https://www.github.com/googleapis/nodejs-language/issues/328)) ([f035a45](https://www.github.com/googleapis/nodejs-language/commit/f035a4596f5b48d44289474fb7f46432be3a6123)) + +### [3.6.1](https://www.github.com/googleapis/nodejs-language/compare/v3.6.0...v3.6.1) (2019-11-14) + + +### Bug Fixes + +* import long into proto ts declaration file ([#323](https://www.github.com/googleapis/nodejs-language/issues/323)) ([d327d99](https://www.github.com/googleapis/nodejs-language/commit/d327d997c78ea2ec76fa6ca75fe94097965b7b71)) +* **docs:** snippets are now replaced in jsdoc comments ([#322](https://www.github.com/googleapis/nodejs-language/issues/322)) ([e316d9a](https://www.github.com/googleapis/nodejs-language/commit/e316d9a69de76c673ce273fe72b692e2e29a3756)) + +## [3.6.0](https://www.github.com/googleapis/nodejs-language/compare/v3.5.1...v3.6.0) (2019-11-05) + + +### Features + +* added endpoint samples and updated docs for language api ([#315](https://www.github.com/googleapis/nodejs-language/issues/315)) ([0a01ee5](https://www.github.com/googleapis/nodejs-language/commit/0a01ee571464a042a2bd953ee2f7a45fd189d7ce)) + +### [3.5.1](https://www.github.com/googleapis/nodejs-language/compare/v3.5.0...v3.5.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#313](https://www.github.com/googleapis/nodejs-language/issues/313)) ([8aeff90](https://www.github.com/googleapis/nodejs-language/commit/8aeff908bb5a1315d9e46f4b057bee3d20dc4f61)) +* **deps:** update dependency @google-cloud/storage to v4 ([#311](https://www.github.com/googleapis/nodejs-language/issues/311)) ([7178243](https://www.github.com/googleapis/nodejs-language/commit/71782436efbb3e987d8a3b31f2e5b3a485b777b2)) + +## [3.5.0](https://www.github.com/googleapis/nodejs-language/compare/v3.4.0...v3.5.0) (2019-10-09) + + +### Bug Fixes + +* update analyze.v1.js ([#306](https://www.github.com/googleapis/nodejs-language/issues/306)) ([1624e83](https://www.github.com/googleapis/nodejs-language/commit/1624e83)) +* use compatible version of google-gax ([2edf66e](https://www.github.com/googleapis/nodejs-language/commit/2edf66e)) + + +### Features + +* introduces additional message types ([#302](https://www.github.com/googleapis/nodejs-language/issues/302)) ([b094572](https://www.github.com/googleapis/nodejs-language/commit/b094572)) + +## [3.4.0](https://www.github.com/googleapis/nodejs-language/compare/v3.3.0...v3.4.0) (2019-09-26) + + +### Bug Fixes + +* **deps:** update dependency google-gax to ^1.6.1 ([#299](https://www.github.com/googleapis/nodejs-language/issues/299)) ([976bfab](https://www.github.com/googleapis/nodejs-language/commit/976bfab)) + + +### Features + +* .d.ts for protos ([#296](https://www.github.com/googleapis/nodejs-language/issues/296)) ([c279ff1](https://www.github.com/googleapis/nodejs-language/commit/c279ff1)) + +## [3.3.0](https://www.github.com/googleapis/nodejs-language/compare/v3.2.6...v3.3.0) (2019-09-16) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([bf2363e](https://www.github.com/googleapis/nodejs-language/commit/bf2363e)) +* use process versions object for client header ([#287](https://www.github.com/googleapis/nodejs-language/issues/287)) ([ee18e83](https://www.github.com/googleapis/nodejs-language/commit/ee18e83)) + + +### Features + +* load protos from JSON, grpc-fallback support ([354d98d](https://www.github.com/googleapis/nodejs-language/commit/354d98d)) + +### [3.2.6](https://www.github.com/googleapis/nodejs-language/compare/v3.2.5...v3.2.6) (2019-08-03) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([#282](https://www.github.com/googleapis/nodejs-language/issues/282)) ([c358df9](https://www.github.com/googleapis/nodejs-language/commit/c358df9)) + +### [3.2.5](https://www.github.com/googleapis/nodejs-language/compare/v3.2.4...v3.2.5) (2019-07-26) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/storage to v3 ([#275](https://www.github.com/googleapis/nodejs-language/issues/275)) ([aa7eeaa](https://www.github.com/googleapis/nodejs-language/commit/aa7eeaa)) + +### [3.2.4](https://www.github.com/googleapis/nodejs-language/compare/v3.2.3...v3.2.4) (2019-07-23) + + +### Bug Fixes + +* **deps:** drop unused dependency lodash.merge ([2e53ead](https://www.github.com/googleapis/nodejs-language/commit/2e53ead)) + +### [3.2.3](https://www.github.com/googleapis/nodejs-language/compare/v3.2.2...v3.2.3) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#267](https://www.github.com/googleapis/nodejs-language/issues/267)) ([d7d8440](https://www.github.com/googleapis/nodejs-language/commit/d7d8440)) + +### [3.2.2](https://www.github.com/googleapis/nodejs-language/compare/v3.2.1...v3.2.2) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#263](https://www.github.com/googleapis/nodejs-language/issues/263)) ([7bbc8a2](https://www.github.com/googleapis/nodejs-language/commit/7bbc8a2)) + +### [3.2.1](https://www.github.com/googleapis/nodejs-language/compare/v3.2.0...v3.2.1) (2019-06-11) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v6 ([#261](https://www.github.com/googleapis/nodejs-language/issues/261)) ([eeb2847](https://www.github.com/googleapis/nodejs-language/commit/eeb2847)) + +## [3.2.0](https://www.github.com/googleapis/nodejs-language/compare/v3.1.0...v3.2.0) (2019-06-06) + + +### Features + +* add .repo-metadata.json and generate README ([#255](https://www.github.com/googleapis/nodejs-language/issues/255)) ([0853696](https://www.github.com/googleapis/nodejs-language/commit/0853696)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-language/compare/v3.0.0...v3.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#256](https://www.github.com/googleapis/nodejs-language/issues/256)) ([48ac8fd](https://www.github.com/googleapis/nodejs-language/commit/48ac8fd)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-language/compare/v2.1.0...v3.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#232) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/automl to ^0.2.0 ([#223](https://www.github.com/googleapis/nodejs-language/issues/223)) ([1fe903a](https://www.github.com/googleapis/nodejs-language/commit/1fe903a)) +* DEADLINE_EXCEEDED error is no longer retried ([a32713f](https://www.github.com/googleapis/nodejs-language/commit/a32713f)) +* DEADLINE_EXCEEDED is idempotent ([#241](https://www.github.com/googleapis/nodejs-language/issues/241)) ([dbd417f](https://www.github.com/googleapis/nodejs-language/commit/dbd417f)) +* improve docstrings, and add more field validation ([#224](https://www.github.com/googleapis/nodejs-language/issues/224)) ([ed2c692](https://www.github.com/googleapis/nodejs-language/commit/ed2c692)) +* **deps:** update dependency @google-cloud/automl to v1 ([#242](https://www.github.com/googleapis/nodejs-language/issues/242)) ([c7e4797](https://www.github.com/googleapis/nodejs-language/commit/c7e4797)) +* **deps:** update dependency google-gax to ^0.26.0 ([#230](https://www.github.com/googleapis/nodejs-language/issues/230)) ([5b8af98](https://www.github.com/googleapis/nodejs-language/commit/5b8af98)) +* **deps:** update dependency google-gax to v1 ([#240](https://www.github.com/googleapis/nodejs-language/issues/240)) ([54660e1](https://www.github.com/googleapis/nodejs-language/commit/54660e1)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#232](https://www.github.com/googleapis/nodejs-language/issues/232)) ([ec540f3](https://www.github.com/googleapis/nodejs-language/commit/ec540f3)) + +## v2.1.0 + +03-22-2019 10:34 PDT + +### New Features +- feat: add additional entity types ([#220](https://github.com/googleapis/nodejs-language/pull/220)) + +### Internal / Testing Changes +- chore: publish to npm using wombat ([#218](https://github.com/googleapis/nodejs-language/pull/218)) +- build: use per-repo npm publish token ([#216](https://github.com/googleapis/nodejs-language/pull/216)) + +## v2.0.2 + +03-14-2019 07:43 PDT + +### Bug Fixes +- fix: throw on invalid credentials ([#204](https://github.com/googleapis/nodejs-language/pull/204)) + +### Documentation +- docs: update comments on protos ([#208](https://github.com/googleapis/nodejs-language/pull/208)) +- docs: update links in contrib guide ([#206](https://github.com/googleapis/nodejs-language/pull/206)) +- docs: update contributing path in README ([#200](https://github.com/googleapis/nodejs-language/pull/200)) +- docs: move CONTRIBUTING.md to root ([#199](https://github.com/googleapis/nodejs-language/pull/199)) +- docs: add lint/fix example to contributing guide ([#197](https://github.com/googleapis/nodejs-language/pull/197)) + +### Internal / Testing Changes +- chore: update require statement code style +- build: Add docuploader credentials to node publish jobs ([#211](https://github.com/googleapis/nodejs-language/pull/211)) +- build: use node10 to run samples-test, system-test etc ([#210](https://github.com/googleapis/nodejs-language/pull/210)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 ([#207](https://github.com/googleapis/nodejs-language/pull/207)) +- build: use linkinator for docs test ([#205](https://github.com/googleapis/nodejs-language/pull/205)) +- fix(deps): update dependency yargs to v13 ([#203](https://github.com/googleapis/nodejs-language/pull/203)) +- build: create docs test npm scripts ([#202](https://github.com/googleapis/nodejs-language/pull/202)) +- build: test using @grpc/grpc-js in CI ([#201](https://github.com/googleapis/nodejs-language/pull/201)) + +## v2.0.1 + +01-31-2019 23:11 PST + +### Implementation Changes +- refactor: reordered gRPC message types + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#195](https://github.com/googleapis/nodejs-language/pull/195)) +- fix(deps): update dependency google-gax to ^0.24.0 ([#193](https://github.com/googleapis/nodejs-language/pull/193)) +- fix(deps): update dependency google-gax to ^0.23.0 ([#189](https://github.com/googleapis/nodejs-language/pull/189)) +- fix(deps): update dependency google-gax to ^0.22.0 ([#162](https://github.com/googleapis/nodejs-language/pull/162)) + +### Documentation +- docs: update the readme ([#172](https://github.com/googleapis/nodejs-language/pull/172)) +- docs: update readme badges ([#171](https://github.com/googleapis/nodejs-language/pull/171)) +- docs(samples): updated samples code to use async await ([#154](https://github.com/googleapis/nodejs-language/pull/154)) +- Language Automl samples ([#126](https://github.com/googleapis/nodejs-language/pull/126)) + +### Internal / Testing Changes +- chore(deps): update dependency eslint-config-prettier to v4 ([#194](https://github.com/googleapis/nodejs-language/pull/194)) +- build: ignore googleapis.com in doc link check ([#192](https://github.com/googleapis/nodejs-language/pull/192)) +- chore: sync gapic files +- build: check broken links in generated docs ([#187](https://github.com/googleapis/nodejs-language/pull/187)) +- refactor: modernize the sample tests ([#185](https://github.com/googleapis/nodejs-language/pull/185)) +- chore(build): inject yoshi automation key ([#183](https://github.com/googleapis/nodejs-language/pull/183)) +- chore: update nyc and eslint configs ([#182](https://github.com/googleapis/nodejs-language/pull/182)) +- chore: fix publish.sh permission +x ([#180](https://github.com/googleapis/nodejs-language/pull/180)) +- fix(build): fix Kokoro release script ([#179](https://github.com/googleapis/nodejs-language/pull/179)) +- build: add Kokoro configs for autorelease ([#178](https://github.com/googleapis/nodejs-language/pull/178)) +- chore: always nyc report before calling codecov ([#175](https://github.com/googleapis/nodejs-language/pull/175)) +- chore: nyc ignore build/test by default ([#174](https://github.com/googleapis/nodejs-language/pull/174)) +- fix(build): fix system key decryption ([#169](https://github.com/googleapis/nodejs-language/pull/169)) +- chore: add synth.metadata +- chore: update eslintignore config ([#161](https://github.com/googleapis/nodejs-language/pull/161)) +- chore(deps): update @google-cloud/nodejs-repo-tools to v3 ([#160](https://github.com/googleapis/nodejs-language/pull/160)) +- chore: udpate lint configs ([#158](https://github.com/googleapis/nodejs-language/pull/158)) +- chore: drop contributors from multiple places ([#159](https://github.com/googleapis/nodejs-language/pull/159)) +- chore: use latest npm on Windows ([#156](https://github.com/googleapis/nodejs-language/pull/156)) +- chore: update CircleCI config ([#155](https://github.com/googleapis/nodejs-language/pull/155)) +- chore: include build in eslintignore ([#151](https://github.com/googleapis/nodejs-language/pull/151)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#147](https://github.com/googleapis/nodejs-language/pull/147)) +- chore: update issue templates ([#146](https://github.com/googleapis/nodejs-language/pull/146)) +- chore: remove old issue template ([#144](https://github.com/googleapis/nodejs-language/pull/144)) +- build: run tests on node11 ([#143](https://github.com/googleapis/nodejs-language/pull/143)) +- chores(build): do not collect sponge.xml from windows builds ([#142](https://github.com/googleapis/nodejs-language/pull/142)) +- chores(build): run codecov on continuous builds ([#141](https://github.com/googleapis/nodejs-language/pull/141)) +- chore: update new issue template ([#140](https://github.com/googleapis/nodejs-language/pull/140)) +- chore(deps): update dependency sinon to v7 ([#134](https://github.com/googleapis/nodejs-language/pull/134)) +- build: fix codecov uploading on Kokoro ([#135](https://github.com/googleapis/nodejs-language/pull/135)) +- Update kokoro config ([#132](https://github.com/googleapis/nodejs-language/pull/132)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#131](https://github.com/googleapis/nodejs-language/pull/131)) + +## v2.0.0 + +### Breaking changes +- fix: drop support for node.js 4.x and 9.x ([#73](https://github.com/googleapis/nodejs-language/pull/73)) + +### New Features + +### Dependencies +- fix(deps): update dependency google-gax to ^0.20.0 ([#117](https://github.com/googleapis/nodejs-language/pull/117)) +- fix(deps): update dependency google-gax to ^0.19.0 ([#103](https://github.com/googleapis/nodejs-language/pull/103)) +- fix(deps): update dependency google-gax to ^0.18.0 ([#89](https://github.com/googleapis/nodejs-language/pull/89)) +- fix: update dependencies ([#57](https://github.com/googleapis/nodejs-language/pull/57)) + +### Documentation +- samples: updates all _file_gcs to _gcs ([#102](https://github.com/googleapis/nodejs-language/pull/102)) +- samples: Language region tag update ([#101](https://github.com/googleapis/nodejs-language/pull/101)) +- fix: update sample to use a long enough string for classify-text ([#97](https://github.com/googleapis/nodejs-language/pull/97)) + +### Internal / Testing Changes +- Update kokoro config ([#125](https://github.com/googleapis/nodejs-language/pull/125)) +- test: remove appveyor config ([#124](https://github.com/googleapis/nodejs-language/pull/124)) +- Update the CI config ([#123](https://github.com/googleapis/nodejs-language/pull/123)) +- Enable prefer-const in the eslint config ([#121](https://github.com/googleapis/nodejs-language/pull/121)) +- Enable no-var in eslint ([#120](https://github.com/googleapis/nodejs-language/pull/120)) +- Use mocha for sample tests ([#119](https://github.com/googleapis/nodejs-language/pull/119)) +- Switch to let/const ([#118](https://github.com/googleapis/nodejs-language/pull/118)) +- Update CI config ([#115](https://github.com/googleapis/nodejs-language/pull/115)) +- Update synth and storage ([#113](https://github.com/googleapis/nodejs-language/pull/113)) +- Retry npm install in CI ([#112](https://github.com/googleapis/nodejs-language/pull/112)) +- Update kokoro config ([#108](https://github.com/googleapis/nodejs-language/pull/108)) +- Update kokoro config ([#107](https://github.com/googleapis/nodejs-language/pull/107)) +- chore(deps): update dependency nyc to v13 ([#106](https://github.com/googleapis/nodejs-language/pull/106)) +- Update the CI config ([#105](https://github.com/googleapis/nodejs-language/pull/105)) +- chore: make the CircleCI config consistent +- chore(deps): update dependency eslint-config-prettier to v3 ([#98](https://github.com/googleapis/nodejs-language/pull/98)) +- chore: do not use npm ci ([#96](https://github.com/googleapis/nodejs-language/pull/96)) +- chore: ignore package-lock.json ([#93](https://github.com/googleapis/nodejs-language/pull/93)) +- chore(deps): lock file maintenance ([#92](https://github.com/googleapis/nodejs-language/pull/92)) +- chore: update renovate config ([#91](https://github.com/googleapis/nodejs-language/pull/91)) +- remove that whitespace ([#90](https://github.com/googleapis/nodejs-language/pull/90)) +- Update CircleCI config ([#88](https://github.com/googleapis/nodejs-language/pull/88)) +- chore: add node templates to synth.py ([#84](https://github.com/googleapis/nodejs-language/pull/84)) +- chore(deps): lock file maintenance ([#87](https://github.com/googleapis/nodejs-language/pull/87)) +- chore: move mocha options to mocha.opts ([#85](https://github.com/googleapis/nodejs-language/pull/85)) +- chore: require node 8 for samples ([#86](https://github.com/googleapis/nodejs-language/pull/86)) +- chore(deps): lock file maintenance ([#83](https://github.com/googleapis/nodejs-language/pull/83)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#80](https://github.com/googleapis/nodejs-language/pull/80)) +- test: use strictEqual in tests ([#81](https://github.com/googleapis/nodejs-language/pull/81)) +- chore(deps): lock file maintenance ([#79](https://github.com/googleapis/nodejs-language/pull/79)) +- chore(build): use `npm ci` instead of `npm install` ([#76](https://github.com/googleapis/nodejs-language/pull/76)) +- chore(deps): lock file maintenance ([#75](https://github.com/googleapis/nodejs-language/pull/75)) +- chore(deps): lock file maintenance ([#74](https://github.com/googleapis/nodejs-language/pull/74)) +- chore(deps): lock file maintenance ([#72](https://github.com/googleapis/nodejs-language/pull/72)) +- chore(deps): lock file maintenance ([#71](https://github.com/googleapis/nodejs-language/pull/71)) +- chore(deps): lock file maintenance ([#70](https://github.com/googleapis/nodejs-language/pull/70)) +- chore(deps): lock file maintenance ([#69](https://github.com/googleapis/nodejs-language/pull/69)) +- fix(deps): update dependency yargs to v12 ([#68](https://github.com/googleapis/nodejs-language/pull/68)) +- update google-gax and add synth.py ([#64](https://github.com/googleapis/nodejs-language/pull/64)) +- chore(deps): update dependency sinon to v6.0.1 ([#65](https://github.com/googleapis/nodejs-language/pull/65)) +- Configure Renovate ([#58](https://github.com/googleapis/nodejs-language/pull/58)) +- refactor: drop repo-tool as an exec wrapper ([#62](https://github.com/googleapis/nodejs-language/pull/62)) +- chore: update sample lockfiles ([#61](https://github.com/googleapis/nodejs-language/pull/61)) +- fix: update linking for samples ([#60](https://github.com/googleapis/nodejs-language/pull/60)) +- chore(package): update eslint to version 5.0.0 ([#59](https://github.com/googleapis/nodejs-language/pull/59)) +- chore(package): update nyc to version 12.0.2 ([#55](https://github.com/googleapis/nodejs-language/pull/55)) +- chore: lock files maintenance ([#53](https://github.com/googleapis/nodejs-language/pull/53)) +- chore: timeout for system test ([#51](https://github.com/googleapis/nodejs-language/pull/51)) +- chore: lock files maintenance ([#50](https://github.com/googleapis/nodejs-language/pull/50)) +- chore: test on node10 ([#49](https://github.com/googleapis/nodejs-language/pull/49)) +- chore: lock files maintenance ([#48](https://github.com/googleapis/nodejs-language/pull/48)) +- chore: one more workaround for repo-tools EPERM ([#46](https://github.com/googleapis/nodejs-language/pull/46)) +- chore: workaround for repo-tools EPERM ([#45](https://github.com/googleapis/nodejs-language/pull/45)) +- chore: make samples depend on the current version ([#44](https://github.com/googleapis/nodejs-language/pull/44)) +- chore: setup nighty build in CircleCI ([#43](https://github.com/googleapis/nodejs-language/pull/43)) diff --git a/packages/google-cloud-language/CODE_OF_CONDUCT.md b/packages/google-cloud-language/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-language/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-language/CONTRIBUTING.md b/packages/google-cloud-language/CONTRIBUTING.md new file mode 100644 index 000000000000..9bfc7279b484 --- /dev/null +++ b/packages/google-cloud-language/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Natural Language API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=language.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-language/LICENSE b/packages/google-cloud-language/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-language/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-language/README.md b/packages/google-cloud-language/README.md new file mode 100644 index 000000000000..1795ffbc339e --- /dev/null +++ b/packages/google-cloud-language/README.md @@ -0,0 +1,177 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Natural Language: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/language.svg)](https://www.npmjs.org/package/@google-cloud/language) + + + + +Google Cloud Natural Language API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Natural Language Node.js Client API Reference][client-docs] +* [Natural Language Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Natural Language API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/language +``` + + +### Using the client library + +```javascript +async function quickstart() { + // Imports the Google Cloud client library + const language = require('@google-cloud/language'); + + // Instantiates a client + const client = new language.LanguageServiceClient(); + + // The text to analyze + const text = 'Hello, world!'; + + const document = { + content: text, + type: 'PLAIN_TEXT', + }; + + // Detects the sentiment of the text + const [result] = await client.analyzeSentiment({document: document}); + const sentiment = result.documentSentiment; + + console.log(`Text: ${text}`); + console.log(`Sentiment score: ${sentiment.score}`); + console.log(`Sentiment magnitude: ${sentiment.magnitude}`); +} + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js,samples/README.md) | +| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js,samples/README.md) | +| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js,samples/README.md) | +| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js,samples/README.md) | +| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js,samples/README.md) | +| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js,samples/README.md) | +| Language_service.analyze_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js,samples/README.md) | +| Language_service.analyze_entity_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js,samples/README.md) | +| Language_service.analyze_sentiment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js,samples/README.md) | +| Language_service.analyze_syntax | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js,samples/README.md) | +| Language_service.annotate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js,samples/README.md) | +| Language_service.classify_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Natural Language Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/language@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/language/latest +[product-docs]: https://cloud.google.com/natural-language/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=language.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-language/api-extractor.json b/packages/google-cloud-language/api-extractor.json new file mode 100644 index 000000000000..de228294b237 --- /dev/null +++ b/packages/google-cloud-language/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-language/linkinator.config.json b/packages/google-cloud-language/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-language/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-language/package.json b/packages/google-cloud-language/package.json new file mode 100644 index 000000000000..18e11b51ead5 --- /dev/null +++ b/packages/google-cloud-language/package.json @@ -0,0 +1,71 @@ +{ + "name": "@google-cloud/language", + "description": "Google Cloud Natural Language API client for Node.js", + "version": "5.1.0", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-language", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src", + "AUTHORS", + "CONTRIBUTORS", + "LICENSE" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google language", + "language", + "Google Cloud Natural Language API" + ], + "scripts": { + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "fix": "gts fix", + "docs-test": "linkinator docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "predocs-test": "npm run docs", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "codecov": "^3.0.2", + "gts": "^3.0.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto b/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto new file mode 100644 index 000000000000..4dae89745bf4 --- /dev/null +++ b/packages/google-cloud-language/protos/google/cloud/language/v1/language_service.proto @@ -0,0 +1,1175 @@ +// Copyright 2022 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.cloud.language.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/language/v1;language"; +option java_multiple_files = true; +option java_outer_classname = "LanguageServiceProto"; +option java_package = "com.google.cloud.language.v1"; + +// Provides text analysis operations such as sentiment analysis and entity +// recognition. +service LanguageService { + option (google.api.default_host) = "language.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-language," + "https://www.googleapis.com/auth/cloud-platform"; + + // Analyzes the sentiment of the provided text. + rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { + option (google.api.http) = { + post: "/v1/documents:analyzeSentiment" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { + option (google.api.http) = { + post: "/v1/documents:analyzeEntities" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { + option (google.api.http) = { + post: "/v1/documents:analyzeEntitySentiment" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) { + option (google.api.http) = { + post: "/v1/documents:analyzeSyntax" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Classifies a document into categories. + rpc ClassifyText(ClassifyTextRequest) returns (ClassifyTextResponse) { + option (google.api.http) = { + post: "/v1/documents:classifyText" + body: "*" + }; + option (google.api.method_signature) = "document"; + } + + // A convenience method that provides all the features that analyzeSentiment, + // analyzeEntities, and analyzeSyntax provide in one call. + rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) { + option (google.api.http) = { + post: "/v1/documents:annotateText" + body: "*" + }; + option (google.api.method_signature) = "document,features,encoding_type"; + option (google.api.method_signature) = "document,features"; + } +} + +// Represents the input to API methods. +message Document { + // The document types enum. + enum Type { + // The content type is not specified. + TYPE_UNSPECIFIED = 0; + + // Plain text + PLAIN_TEXT = 1; + + // HTML + HTML = 2; + } + + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + Type type = 1; + + // The source of the document: a string containing the content or a + // Google Cloud Storage URI. + oneof source { + // The content of the input in string format. + // Cloud audit logging exempt since it is based on user data. + string content = 2; + + // The Google Cloud Storage URI where the file content is located. + // This URI must be of the form: gs://bucket_name/object_name. For more + // details, see https://cloud.google.com/storage/docs/reference-uris. + // NOTE: Cloud Storage object versioning is not supported. + string gcs_content_uri = 3; + } + + // The language of the document (if not specified, the language is + // automatically detected). Both ISO and BCP-47 language codes are + // accepted.
+ // [Language + // Support](https://cloud.google.com/natural-language/docs/languages) lists + // currently supported languages for each API method. If the language (either + // specified by the caller or automatically detected) is not supported by the + // called API method, an `INVALID_ARGUMENT` error is returned. + string language = 4; +} + +// Represents a sentence in the input document. +message Sentence { + // The sentence text. + TextSpan text = 1; + + // For calls to [AnalyzeSentiment][] or if + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. + Sentiment sentiment = 2; +} + +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + +// Represents a phrase in the text that is a known entity, such as +// a person, an organization, or location. The API associates information, such +// as salience and mentions, with entities. +message Entity { + // The type of the entity. For most entity types, the associated metadata is a + // Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table + // below lists the associated fields for entities that have different + // metadata. + enum Type { + // Unknown + UNKNOWN = 0; + + // Person + PERSON = 1; + + // Location + LOCATION = 2; + + // Organization + ORGANIZATION = 3; + + // Event + EVENT = 4; + + // Artwork + WORK_OF_ART = 5; + + // Consumer product + CONSUMER_GOOD = 6; + + // Other types of entities + OTHER = 7; + + // Phone number + // + // The metadata lists the phone number, formatted according to local + // convention, plus whichever additional elements appear in the text: + // + // * `number` - the actual number, broken down into sections as per local + // convention + // * `national_prefix` - country code, if detected + // * `area_code` - region or area code, if detected + // * `extension` - phone extension (to be dialed after connection), if + // detected + PHONE_NUMBER = 9; + + // Address + // + // The metadata identifies the street number and locality plus whichever + // additional elements appear in the text: + // + // * `street_number` - street number + // * `locality` - city or town + // * `street_name` - street/route name, if detected + // * `postal_code` - postal code, if detected + // * `country` - country, if detected< + // * `broad_region` - administrative area, such as the state, if detected + // * `narrow_region` - smaller administrative area, such as county, if + // detected + // * `sublocality` - used in Asian addresses to demark a district within a + // city, if detected + ADDRESS = 10; + + // Date + // + // The metadata identifies the components of the date: + // + // * `year` - four digit year, if detected + // * `month` - two digit month number, if detected + // * `day` - two digit day number, if detected + DATE = 11; + + // Number + // + // The metadata is the number itself. + NUMBER = 12; + + // Price + // + // The metadata identifies the `value` and `currency`. + PRICE = 13; + } + + // The representative name for the entity. + string name = 1; + + // The entity type. + Type type = 2; + + // Metadata associated with the entity. + // + // For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) + // and Knowledge Graph MID (`mid`), if they are available. For the metadata + // associated with other entity types, see the Type table below. + map metadata = 3; + + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + float salience = 4; + + // The mentions of this entity in the input document. The API currently + // supports proper noun mentions. + repeated EntityMention mentions = 5; + + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the aggregate sentiment expressed for this + // entity in the provided document. + Sentiment sentiment = 6; +} + +// Represents the smallest syntactic building block of the text. +message Token { + // The token text. + TextSpan text = 1; + + // Parts of speech tag for this token. + PartOfSpeech part_of_speech = 2; + + // Dependency tree parse for this token. + DependencyEdge dependency_edge = 3; + + // [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. + string lemma = 4; +} + +// Represents the feeling associated with the entire text or entities in +// the text. +message Sentiment { + // A non-negative number in the [0, +inf) range, which represents + // the absolute magnitude of sentiment regardless of score (positive or + // negative). + float magnitude = 2; + + // Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + float score = 3; +} + +// Represents part of speech information for a token. Parts of speech +// are as defined in +// http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf +message PartOfSpeech { + // The part of speech tags enum. + enum Tag { + // Unknown + UNKNOWN = 0; + + // Adjective + ADJ = 1; + + // Adposition (preposition and postposition) + ADP = 2; + + // Adverb + ADV = 3; + + // Conjunction + CONJ = 4; + + // Determiner + DET = 5; + + // Noun (common and proper) + NOUN = 6; + + // Cardinal number + NUM = 7; + + // Pronoun + PRON = 8; + + // Particle or other function word + PRT = 9; + + // Punctuation + PUNCT = 10; + + // Verb (all tenses and modes) + VERB = 11; + + // Other: foreign words, typos, abbreviations + X = 12; + + // Affix + AFFIX = 13; + } + + // The characteristic of a verb that expresses time flow during an event. + enum Aspect { + // Aspect is not applicable in the analyzed language or is not predicted. + ASPECT_UNKNOWN = 0; + + // Perfective + PERFECTIVE = 1; + + // Imperfective + IMPERFECTIVE = 2; + + // Progressive + PROGRESSIVE = 3; + } + + // The grammatical function performed by a noun or pronoun in a phrase, + // clause, or sentence. In some languages, other parts of speech, such as + // adjective and determiner, take case inflection in agreement with the noun. + enum Case { + // Case is not applicable in the analyzed language or is not predicted. + CASE_UNKNOWN = 0; + + // Accusative + ACCUSATIVE = 1; + + // Adverbial + ADVERBIAL = 2; + + // Complementive + COMPLEMENTIVE = 3; + + // Dative + DATIVE = 4; + + // Genitive + GENITIVE = 5; + + // Instrumental + INSTRUMENTAL = 6; + + // Locative + LOCATIVE = 7; + + // Nominative + NOMINATIVE = 8; + + // Oblique + OBLIQUE = 9; + + // Partitive + PARTITIVE = 10; + + // Prepositional + PREPOSITIONAL = 11; + + // Reflexive + REFLEXIVE_CASE = 12; + + // Relative + RELATIVE_CASE = 13; + + // Vocative + VOCATIVE = 14; + } + + // Depending on the language, Form can be categorizing different forms of + // verbs, adjectives, adverbs, etc. For example, categorizing inflected + // endings of verbs and adjectives or distinguishing between short and long + // forms of adjectives and participles + enum Form { + // Form is not applicable in the analyzed language or is not predicted. + FORM_UNKNOWN = 0; + + // Adnomial + ADNOMIAL = 1; + + // Auxiliary + AUXILIARY = 2; + + // Complementizer + COMPLEMENTIZER = 3; + + // Final ending + FINAL_ENDING = 4; + + // Gerund + GERUND = 5; + + // Realis + REALIS = 6; + + // Irrealis + IRREALIS = 7; + + // Short form + SHORT = 8; + + // Long form + LONG = 9; + + // Order form + ORDER = 10; + + // Specific form + SPECIFIC = 11; + } + + // Gender classes of nouns reflected in the behaviour of associated words. + enum Gender { + // Gender is not applicable in the analyzed language or is not predicted. + GENDER_UNKNOWN = 0; + + // Feminine + FEMININE = 1; + + // Masculine + MASCULINE = 2; + + // Neuter + NEUTER = 3; + } + + // The grammatical feature of verbs, used for showing modality and attitude. + enum Mood { + // Mood is not applicable in the analyzed language or is not predicted. + MOOD_UNKNOWN = 0; + + // Conditional + CONDITIONAL_MOOD = 1; + + // Imperative + IMPERATIVE = 2; + + // Indicative + INDICATIVE = 3; + + // Interrogative + INTERROGATIVE = 4; + + // Jussive + JUSSIVE = 5; + + // Subjunctive + SUBJUNCTIVE = 6; + } + + // Count distinctions. + enum Number { + // Number is not applicable in the analyzed language or is not predicted. + NUMBER_UNKNOWN = 0; + + // Singular + SINGULAR = 1; + + // Plural + PLURAL = 2; + + // Dual + DUAL = 3; + } + + // The distinction between the speaker, second person, third person, etc. + enum Person { + // Person is not applicable in the analyzed language or is not predicted. + PERSON_UNKNOWN = 0; + + // First + FIRST = 1; + + // Second + SECOND = 2; + + // Third + THIRD = 3; + + // Reflexive + REFLEXIVE_PERSON = 4; + } + + // This category shows if the token is part of a proper name. + enum Proper { + // Proper is not applicable in the analyzed language or is not predicted. + PROPER_UNKNOWN = 0; + + // Proper + PROPER = 1; + + // Not proper + NOT_PROPER = 2; + } + + // Reciprocal features of a pronoun. + enum Reciprocity { + // Reciprocity is not applicable in the analyzed language or is not + // predicted. + RECIPROCITY_UNKNOWN = 0; + + // Reciprocal + RECIPROCAL = 1; + + // Non-reciprocal + NON_RECIPROCAL = 2; + } + + // Time reference. + enum Tense { + // Tense is not applicable in the analyzed language or is not predicted. + TENSE_UNKNOWN = 0; + + // Conditional + CONDITIONAL_TENSE = 1; + + // Future + FUTURE = 2; + + // Past + PAST = 3; + + // Present + PRESENT = 4; + + // Imperfect + IMPERFECT = 5; + + // Pluperfect + PLUPERFECT = 6; + } + + // The relationship between the action that a verb expresses and the + // participants identified by its arguments. + enum Voice { + // Voice is not applicable in the analyzed language or is not predicted. + VOICE_UNKNOWN = 0; + + // Active + ACTIVE = 1; + + // Causative + CAUSATIVE = 2; + + // Passive + PASSIVE = 3; + } + + // The part of speech tag. + Tag tag = 1; + + // The grammatical aspect. + Aspect aspect = 2; + + // The grammatical case. + Case case = 3; + + // The grammatical form. + Form form = 4; + + // The grammatical gender. + Gender gender = 5; + + // The grammatical mood. + Mood mood = 6; + + // The grammatical number. + Number number = 7; + + // The grammatical person. + Person person = 8; + + // The grammatical properness. + Proper proper = 9; + + // The grammatical reciprocity. + Reciprocity reciprocity = 10; + + // The grammatical tense. + Tense tense = 11; + + // The grammatical voice. + Voice voice = 12; +} + +// Represents dependency parse tree information for a token. (For more +// information on dependency labels, see +// http://www.aclweb.org/anthology/P13-2017 +message DependencyEdge { + // The parse label enum for the token. + enum Label { + // Unknown + UNKNOWN = 0; + + // Abbreviation modifier + ABBREV = 1; + + // Adjectival complement + ACOMP = 2; + + // Adverbial clause modifier + ADVCL = 3; + + // Adverbial modifier + ADVMOD = 4; + + // Adjectival modifier of an NP + AMOD = 5; + + // Appositional modifier of an NP + APPOS = 6; + + // Attribute dependent of a copular verb + ATTR = 7; + + // Auxiliary (non-main) verb + AUX = 8; + + // Passive auxiliary + AUXPASS = 9; + + // Coordinating conjunction + CC = 10; + + // Clausal complement of a verb or adjective + CCOMP = 11; + + // Conjunct + CONJ = 12; + + // Clausal subject + CSUBJ = 13; + + // Clausal passive subject + CSUBJPASS = 14; + + // Dependency (unable to determine) + DEP = 15; + + // Determiner + DET = 16; + + // Discourse + DISCOURSE = 17; + + // Direct object + DOBJ = 18; + + // Expletive + EXPL = 19; + + // Goes with (part of a word in a text not well edited) + GOESWITH = 20; + + // Indirect object + IOBJ = 21; + + // Marker (word introducing a subordinate clause) + MARK = 22; + + // Multi-word expression + MWE = 23; + + // Multi-word verbal expression + MWV = 24; + + // Negation modifier + NEG = 25; + + // Noun compound modifier + NN = 26; + + // Noun phrase used as an adverbial modifier + NPADVMOD = 27; + + // Nominal subject + NSUBJ = 28; + + // Passive nominal subject + NSUBJPASS = 29; + + // Numeric modifier of a noun + NUM = 30; + + // Element of compound number + NUMBER = 31; + + // Punctuation mark + P = 32; + + // Parataxis relation + PARATAXIS = 33; + + // Participial modifier + PARTMOD = 34; + + // The complement of a preposition is a clause + PCOMP = 35; + + // Object of a preposition + POBJ = 36; + + // Possession modifier + POSS = 37; + + // Postverbal negative particle + POSTNEG = 38; + + // Predicate complement + PRECOMP = 39; + + // Preconjunt + PRECONJ = 40; + + // Predeterminer + PREDET = 41; + + // Prefix + PREF = 42; + + // Prepositional modifier + PREP = 43; + + // The relationship between a verb and verbal morpheme + PRONL = 44; + + // Particle + PRT = 45; + + // Associative or possessive marker + PS = 46; + + // Quantifier phrase modifier + QUANTMOD = 47; + + // Relative clause modifier + RCMOD = 48; + + // Complementizer in relative clause + RCMODREL = 49; + + // Ellipsis without a preceding predicate + RDROP = 50; + + // Referent + REF = 51; + + // Remnant + REMNANT = 52; + + // Reparandum + REPARANDUM = 53; + + // Root + ROOT = 54; + + // Suffix specifying a unit of number + SNUM = 55; + + // Suffix + SUFF = 56; + + // Temporal modifier + TMOD = 57; + + // Topic marker + TOPIC = 58; + + // Clause headed by an infinite form of the verb that modifies a noun + VMOD = 59; + + // Vocative + VOCATIVE = 60; + + // Open clausal complement + XCOMP = 61; + + // Name suffix + SUFFIX = 62; + + // Name title + TITLE = 63; + + // Adverbial phrase modifier + ADVPHMOD = 64; + + // Causative auxiliary + AUXCAUS = 65; + + // Helper auxiliary + AUXVV = 66; + + // Rentaishi (Prenominal modifier) + DTMOD = 67; + + // Foreign words + FOREIGN = 68; + + // Keyword + KW = 69; + + // List for chains of comparable items + LIST = 70; + + // Nominalized clause + NOMC = 71; + + // Nominalized clausal subject + NOMCSUBJ = 72; + + // Nominalized clausal passive + NOMCSUBJPASS = 73; + + // Compound of numeric modifier + NUMC = 74; + + // Copula + COP = 75; + + // Dislocated relation (for fronted/topicalized elements) + DISLOCATED = 76; + + // Aspect marker + ASP = 77; + + // Genitive modifier + GMOD = 78; + + // Genitive object + GOBJ = 79; + + // Infinitival modifier + INFMOD = 80; + + // Measure + MES = 81; + + // Nominal complement of a noun + NCOMP = 82; + } + + // Represents the head of this token in the dependency tree. + // This is the index of the token which has an arc going to this token. + // The index is the position of the token in the array of tokens returned + // by the API method. If this token is a root token, then the + // `head_token_index` is its own index. + int32 head_token_index = 1; + + // The parse label for the token. + Label label = 2; +} + +// Represents a mention for an entity in the text. Currently, proper noun +// mentions are supported. +message EntityMention { + // The supported types of mentions. + enum Type { + // Unknown + TYPE_UNKNOWN = 0; + + // Proper name + PROPER = 1; + + // Common noun (or noun compound) + COMMON = 2; + } + + // The mention text. + TextSpan text = 1; + + // The type of the entity mention. + Type type = 2; + + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the sentiment expressed for this mention of + // the entity in the provided document. + Sentiment sentiment = 3; +} + +// Represents an output piece of text. +message TextSpan { + // The content of the output text. + string content = 1; + + // The API calculates the beginning offset of the content in the original + // document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request. + int32 begin_offset = 2; +} + +// Represents a category returned from the text classifier. +message ClassificationCategory { + // The name of the category representing the document, from the [predefined + // taxonomy](https://cloud.google.com/natural-language/docs/categories). + string name = 1; + + // The classifier's confidence of the category. Number represents how certain + // the classifier is that this category represents the given text. + float confidence = 2; +} + +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model { + + } + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + +// The sentiment analysis request message. +message AnalyzeSentimentRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate sentence offsets. + EncodingType encoding_type = 2; +} + +// The sentiment analysis response message. +message AnalyzeSentimentResponse { + // The overall sentiment of the input document. + Sentiment document_sentiment = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + string language = 2; + + // The sentiment for all the sentences in the document. + repeated Sentence sentences = 3; +} + +// The entity-level sentiment analysis request message. +message AnalyzeEntitySentimentRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The entity-level sentiment analysis response message. +message AnalyzeEntitySentimentResponse { + // The recognized entities in the input document with associated sentiments. + repeated Entity entities = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + string language = 2; +} + +// The entity analysis request message. +message AnalyzeEntitiesRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The entity analysis response message. +message AnalyzeEntitiesResponse { + // The recognized entities in the input document. + repeated Entity entities = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + string language = 2; +} + +// The syntax analysis request message. +message AnalyzeSyntaxRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The syntax analysis response message. +message AnalyzeSyntaxResponse { + // Sentences in the input document. + repeated Sentence sentences = 1; + + // Tokens, along with their syntactic information, in the input document. + repeated Token tokens = 2; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + string language = 3; +} + +// The document classification request message. +message ClassifyTextRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; +} + +// The document classification response message. +message ClassifyTextResponse { + // Categories representing the input document. + repeated ClassificationCategory categories = 1; +} + +// The request message for the text annotation API, which can perform multiple +// analysis types (sentiment, entities, and syntax) in one call. +message AnnotateTextRequest { + // All available features for sentiment, syntax, and semantic analysis. + // Setting each one to true will enable that specific analysis for the input. + message Features { + // Extract syntax information. + bool extract_syntax = 1; + + // Extract entities. + bool extract_entities = 2; + + // Extract document-level sentiment. + bool extract_document_sentiment = 3; + + // Extract entities and their associated sentiment. + bool extract_entity_sentiment = 4; + + // Classify the full document into categories. + bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; + } + + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The enabled features. + Features features = 2 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 3; +} + +// The text annotations response message. +message AnnotateTextResponse { + // Sentences in the input document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax]. + repeated Sentence sentences = 1; + + // Tokens, along with their syntactic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax]. + repeated Token tokens = 2; + + // Entities, along with their semantic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities]. + repeated Entity entities = 3; + + // The overall sentiment for the document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]. + Sentiment document_sentiment = 4; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + string language = 5; + + // Categories identified in the input document. + repeated ClassificationCategory categories = 6; +} diff --git a/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto b/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto new file mode 100644 index 000000000000..3e6a9f8290ec --- /dev/null +++ b/packages/google-cloud-language/protos/google/cloud/language/v1beta2/language_service.proto @@ -0,0 +1,1199 @@ +// Copyright 2022 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.cloud.language.v1beta2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/language/v1beta2;language"; +option java_multiple_files = true; +option java_outer_classname = "LanguageServiceProto"; +option java_package = "com.google.cloud.language.v1beta2"; + +// Provides text analysis operations such as sentiment analysis and entity +// recognition. +service LanguageService { + option (google.api.default_host) = "language.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-language," + "https://www.googleapis.com/auth/cloud-platform"; + + // Analyzes the sentiment of the provided text. + rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:analyzeSentiment" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Finds named entities (currently proper names and common nouns) in the text + // along with entity types, salience, mentions for each entity, and + // other properties. + rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:analyzeEntities" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes + // sentiment associated with each entity and its mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:analyzeEntitySentiment" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Analyzes the syntax of the text and provides sentence boundaries and + // tokenization along with part of speech tags, dependency trees, and other + // properties. + rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:analyzeSyntax" + body: "*" + }; + option (google.api.method_signature) = "document,encoding_type"; + option (google.api.method_signature) = "document"; + } + + // Classifies a document into categories. + rpc ClassifyText(ClassifyTextRequest) returns (ClassifyTextResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:classifyText" + body: "*" + }; + option (google.api.method_signature) = "document"; + } + + // A convenience method that provides all syntax, sentiment, entity, and + // classification features in one call. + rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) { + option (google.api.http) = { + post: "/v1beta2/documents:annotateText" + body: "*" + }; + option (google.api.method_signature) = "document,features,encoding_type"; + option (google.api.method_signature) = "document,features"; + } +} + +// Represents the input to API methods. +message Document { + // The document types enum. + enum Type { + // The content type is not specified. + TYPE_UNSPECIFIED = 0; + + // Plain text + PLAIN_TEXT = 1; + + // HTML + HTML = 2; + } + + // Ways of handling boilerplate detected in the document + enum BoilerplateHandling { + // The boilerplate handling is not specified. + BOILERPLATE_HANDLING_UNSPECIFIED = 0; + + // Do not analyze detected boilerplate. Reference web URI is required for + // detecting boilerplate. + SKIP_BOILERPLATE = 1; + + // Treat boilerplate the same as content. + KEEP_BOILERPLATE = 2; + } + + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, + // returns an `INVALID_ARGUMENT` error. + Type type = 1; + + // The source of the document: a string containing the content or a + // Google Cloud Storage URI. + oneof source { + // The content of the input in string format. + // Cloud audit logging exempt since it is based on user data. + string content = 2; + + // The Google Cloud Storage URI where the file content is located. + // This URI must be of the form: gs://bucket_name/object_name. For more + // details, see https://cloud.google.com/storage/docs/reference-uris. + // NOTE: Cloud Storage object versioning is not supported. + string gcs_content_uri = 3; + } + + // The language of the document (if not specified, the language is + // automatically detected). Both ISO and BCP-47 language codes are + // accepted.
+ // [Language + // Support](https://cloud.google.com/natural-language/docs/languages) lists + // currently supported languages for each API method. If the language (either + // specified by the caller or automatically detected) is not supported by the + // called API method, an `INVALID_ARGUMENT` error is returned. + string language = 4; + + // The web URI where the document comes from. This URI is not used for + // fetching the content, but as a hint for analyzing the document. + string reference_web_uri = 5; + + // Indicates how detected boilerplate(e.g. advertisements, copyright + // declarations, banners) should be handled for this document. If not + // specified, boilerplate will be treated the same as content. + BoilerplateHandling boilerplate_handling = 6; +} + +// Represents a sentence in the input document. +message Sentence { + // The sentence text. + TextSpan text = 1; + + // For calls to [AnalyzeSentiment][] or if + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to + // true, this field will contain the sentiment for the sentence. + Sentiment sentiment = 2; +} + +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + +// Represents a phrase in the text that is a known entity, such as +// a person, an organization, or location. The API associates information, such +// as salience and mentions, with entities. +message Entity { + // The type of the entity. For most entity types, the associated metadata is a + // Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table + // below lists the associated fields for entities that have different + // metadata. + enum Type { + // Unknown + UNKNOWN = 0; + + // Person + PERSON = 1; + + // Location + LOCATION = 2; + + // Organization + ORGANIZATION = 3; + + // Event + EVENT = 4; + + // Artwork + WORK_OF_ART = 5; + + // Consumer product + CONSUMER_GOOD = 6; + + // Other types of entities + OTHER = 7; + + // Phone number + // + // The metadata lists the phone number, formatted according to local + // convention, plus whichever additional elements appear in the text: + // + // * `number` - the actual number, broken down into sections as per local + // convention + // * `national_prefix` - country code, if detected + // * `area_code` - region or area code, if detected + // * `extension` - phone extension (to be dialed after connection), if + // detected + PHONE_NUMBER = 9; + + // Address + // + // The metadata identifies the street number and locality plus whichever + // additional elements appear in the text: + // + // * `street_number` - street number + // * `locality` - city or town + // * `street_name` - street/route name, if detected + // * `postal_code` - postal code, if detected + // * `country` - country, if detected< + // * `broad_region` - administrative area, such as the state, if detected + // * `narrow_region` - smaller administrative area, such as county, if + // detected + // * `sublocality` - used in Asian addresses to demark a district within a + // city, if detected + ADDRESS = 10; + + // Date + // + // The metadata identifies the components of the date: + // + // * `year` - four digit year, if detected + // * `month` - two digit month number, if detected + // * `day` - two digit day number, if detected + DATE = 11; + + // Number + // + // The metadata is the number itself. + NUMBER = 12; + + // Price + // + // The metadata identifies the `value` and `currency`. + PRICE = 13; + } + + // The representative name for the entity. + string name = 1; + + // The entity type. + Type type = 2; + + // Metadata associated with the entity. + // + // For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) + // and Knowledge Graph MID (`mid`), if they are available. For the metadata + // associated with other entity types, see the Type table below. + map metadata = 3; + + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + float salience = 4; + + // The mentions of this entity in the input document. The API currently + // supports proper noun mentions. + repeated EntityMention mentions = 5; + + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the aggregate sentiment expressed for this + // entity in the provided document. + Sentiment sentiment = 6; +} + +// Represents the smallest syntactic building block of the text. +message Token { + // The token text. + TextSpan text = 1; + + // Parts of speech tag for this token. + PartOfSpeech part_of_speech = 2; + + // Dependency tree parse for this token. + DependencyEdge dependency_edge = 3; + + // [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. + string lemma = 4; +} + +// Represents the feeling associated with the entire text or entities in +// the text. +// Next ID: 6 +message Sentiment { + // A non-negative number in the [0, +inf) range, which represents + // the absolute magnitude of sentiment regardless of score (positive or + // negative). + float magnitude = 2; + + // Sentiment score between -1.0 (negative sentiment) and 1.0 + // (positive sentiment). + float score = 3; +} + +// Represents part of speech information for a token. +message PartOfSpeech { + // The part of speech tags enum. + enum Tag { + // Unknown + UNKNOWN = 0; + + // Adjective + ADJ = 1; + + // Adposition (preposition and postposition) + ADP = 2; + + // Adverb + ADV = 3; + + // Conjunction + CONJ = 4; + + // Determiner + DET = 5; + + // Noun (common and proper) + NOUN = 6; + + // Cardinal number + NUM = 7; + + // Pronoun + PRON = 8; + + // Particle or other function word + PRT = 9; + + // Punctuation + PUNCT = 10; + + // Verb (all tenses and modes) + VERB = 11; + + // Other: foreign words, typos, abbreviations + X = 12; + + // Affix + AFFIX = 13; + } + + // The characteristic of a verb that expresses time flow during an event. + enum Aspect { + // Aspect is not applicable in the analyzed language or is not predicted. + ASPECT_UNKNOWN = 0; + + // Perfective + PERFECTIVE = 1; + + // Imperfective + IMPERFECTIVE = 2; + + // Progressive + PROGRESSIVE = 3; + } + + // The grammatical function performed by a noun or pronoun in a phrase, + // clause, or sentence. In some languages, other parts of speech, such as + // adjective and determiner, take case inflection in agreement with the noun. + enum Case { + // Case is not applicable in the analyzed language or is not predicted. + CASE_UNKNOWN = 0; + + // Accusative + ACCUSATIVE = 1; + + // Adverbial + ADVERBIAL = 2; + + // Complementive + COMPLEMENTIVE = 3; + + // Dative + DATIVE = 4; + + // Genitive + GENITIVE = 5; + + // Instrumental + INSTRUMENTAL = 6; + + // Locative + LOCATIVE = 7; + + // Nominative + NOMINATIVE = 8; + + // Oblique + OBLIQUE = 9; + + // Partitive + PARTITIVE = 10; + + // Prepositional + PREPOSITIONAL = 11; + + // Reflexive + REFLEXIVE_CASE = 12; + + // Relative + RELATIVE_CASE = 13; + + // Vocative + VOCATIVE = 14; + } + + // Depending on the language, Form can be categorizing different forms of + // verbs, adjectives, adverbs, etc. For example, categorizing inflected + // endings of verbs and adjectives or distinguishing between short and long + // forms of adjectives and participles + enum Form { + // Form is not applicable in the analyzed language or is not predicted. + FORM_UNKNOWN = 0; + + // Adnomial + ADNOMIAL = 1; + + // Auxiliary + AUXILIARY = 2; + + // Complementizer + COMPLEMENTIZER = 3; + + // Final ending + FINAL_ENDING = 4; + + // Gerund + GERUND = 5; + + // Realis + REALIS = 6; + + // Irrealis + IRREALIS = 7; + + // Short form + SHORT = 8; + + // Long form + LONG = 9; + + // Order form + ORDER = 10; + + // Specific form + SPECIFIC = 11; + } + + // Gender classes of nouns reflected in the behaviour of associated words. + enum Gender { + // Gender is not applicable in the analyzed language or is not predicted. + GENDER_UNKNOWN = 0; + + // Feminine + FEMININE = 1; + + // Masculine + MASCULINE = 2; + + // Neuter + NEUTER = 3; + } + + // The grammatical feature of verbs, used for showing modality and attitude. + enum Mood { + // Mood is not applicable in the analyzed language or is not predicted. + MOOD_UNKNOWN = 0; + + // Conditional + CONDITIONAL_MOOD = 1; + + // Imperative + IMPERATIVE = 2; + + // Indicative + INDICATIVE = 3; + + // Interrogative + INTERROGATIVE = 4; + + // Jussive + JUSSIVE = 5; + + // Subjunctive + SUBJUNCTIVE = 6; + } + + // Count distinctions. + enum Number { + // Number is not applicable in the analyzed language or is not predicted. + NUMBER_UNKNOWN = 0; + + // Singular + SINGULAR = 1; + + // Plural + PLURAL = 2; + + // Dual + DUAL = 3; + } + + // The distinction between the speaker, second person, third person, etc. + enum Person { + // Person is not applicable in the analyzed language or is not predicted. + PERSON_UNKNOWN = 0; + + // First + FIRST = 1; + + // Second + SECOND = 2; + + // Third + THIRD = 3; + + // Reflexive + REFLEXIVE_PERSON = 4; + } + + // This category shows if the token is part of a proper name. + enum Proper { + // Proper is not applicable in the analyzed language or is not predicted. + PROPER_UNKNOWN = 0; + + // Proper + PROPER = 1; + + // Not proper + NOT_PROPER = 2; + } + + // Reciprocal features of a pronoun. + enum Reciprocity { + // Reciprocity is not applicable in the analyzed language or is not + // predicted. + RECIPROCITY_UNKNOWN = 0; + + // Reciprocal + RECIPROCAL = 1; + + // Non-reciprocal + NON_RECIPROCAL = 2; + } + + // Time reference. + enum Tense { + // Tense is not applicable in the analyzed language or is not predicted. + TENSE_UNKNOWN = 0; + + // Conditional + CONDITIONAL_TENSE = 1; + + // Future + FUTURE = 2; + + // Past + PAST = 3; + + // Present + PRESENT = 4; + + // Imperfect + IMPERFECT = 5; + + // Pluperfect + PLUPERFECT = 6; + } + + // The relationship between the action that a verb expresses and the + // participants identified by its arguments. + enum Voice { + // Voice is not applicable in the analyzed language or is not predicted. + VOICE_UNKNOWN = 0; + + // Active + ACTIVE = 1; + + // Causative + CAUSATIVE = 2; + + // Passive + PASSIVE = 3; + } + + // The part of speech tag. + Tag tag = 1; + + // The grammatical aspect. + Aspect aspect = 2; + + // The grammatical case. + Case case = 3; + + // The grammatical form. + Form form = 4; + + // The grammatical gender. + Gender gender = 5; + + // The grammatical mood. + Mood mood = 6; + + // The grammatical number. + Number number = 7; + + // The grammatical person. + Person person = 8; + + // The grammatical properness. + Proper proper = 9; + + // The grammatical reciprocity. + Reciprocity reciprocity = 10; + + // The grammatical tense. + Tense tense = 11; + + // The grammatical voice. + Voice voice = 12; +} + +// Represents dependency parse tree information for a token. +message DependencyEdge { + // The parse label enum for the token. + enum Label { + // Unknown + UNKNOWN = 0; + + // Abbreviation modifier + ABBREV = 1; + + // Adjectival complement + ACOMP = 2; + + // Adverbial clause modifier + ADVCL = 3; + + // Adverbial modifier + ADVMOD = 4; + + // Adjectival modifier of an NP + AMOD = 5; + + // Appositional modifier of an NP + APPOS = 6; + + // Attribute dependent of a copular verb + ATTR = 7; + + // Auxiliary (non-main) verb + AUX = 8; + + // Passive auxiliary + AUXPASS = 9; + + // Coordinating conjunction + CC = 10; + + // Clausal complement of a verb or adjective + CCOMP = 11; + + // Conjunct + CONJ = 12; + + // Clausal subject + CSUBJ = 13; + + // Clausal passive subject + CSUBJPASS = 14; + + // Dependency (unable to determine) + DEP = 15; + + // Determiner + DET = 16; + + // Discourse + DISCOURSE = 17; + + // Direct object + DOBJ = 18; + + // Expletive + EXPL = 19; + + // Goes with (part of a word in a text not well edited) + GOESWITH = 20; + + // Indirect object + IOBJ = 21; + + // Marker (word introducing a subordinate clause) + MARK = 22; + + // Multi-word expression + MWE = 23; + + // Multi-word verbal expression + MWV = 24; + + // Negation modifier + NEG = 25; + + // Noun compound modifier + NN = 26; + + // Noun phrase used as an adverbial modifier + NPADVMOD = 27; + + // Nominal subject + NSUBJ = 28; + + // Passive nominal subject + NSUBJPASS = 29; + + // Numeric modifier of a noun + NUM = 30; + + // Element of compound number + NUMBER = 31; + + // Punctuation mark + P = 32; + + // Parataxis relation + PARATAXIS = 33; + + // Participial modifier + PARTMOD = 34; + + // The complement of a preposition is a clause + PCOMP = 35; + + // Object of a preposition + POBJ = 36; + + // Possession modifier + POSS = 37; + + // Postverbal negative particle + POSTNEG = 38; + + // Predicate complement + PRECOMP = 39; + + // Preconjunt + PRECONJ = 40; + + // Predeterminer + PREDET = 41; + + // Prefix + PREF = 42; + + // Prepositional modifier + PREP = 43; + + // The relationship between a verb and verbal morpheme + PRONL = 44; + + // Particle + PRT = 45; + + // Associative or possessive marker + PS = 46; + + // Quantifier phrase modifier + QUANTMOD = 47; + + // Relative clause modifier + RCMOD = 48; + + // Complementizer in relative clause + RCMODREL = 49; + + // Ellipsis without a preceding predicate + RDROP = 50; + + // Referent + REF = 51; + + // Remnant + REMNANT = 52; + + // Reparandum + REPARANDUM = 53; + + // Root + ROOT = 54; + + // Suffix specifying a unit of number + SNUM = 55; + + // Suffix + SUFF = 56; + + // Temporal modifier + TMOD = 57; + + // Topic marker + TOPIC = 58; + + // Clause headed by an infinite form of the verb that modifies a noun + VMOD = 59; + + // Vocative + VOCATIVE = 60; + + // Open clausal complement + XCOMP = 61; + + // Name suffix + SUFFIX = 62; + + // Name title + TITLE = 63; + + // Adverbial phrase modifier + ADVPHMOD = 64; + + // Causative auxiliary + AUXCAUS = 65; + + // Helper auxiliary + AUXVV = 66; + + // Rentaishi (Prenominal modifier) + DTMOD = 67; + + // Foreign words + FOREIGN = 68; + + // Keyword + KW = 69; + + // List for chains of comparable items + LIST = 70; + + // Nominalized clause + NOMC = 71; + + // Nominalized clausal subject + NOMCSUBJ = 72; + + // Nominalized clausal passive + NOMCSUBJPASS = 73; + + // Compound of numeric modifier + NUMC = 74; + + // Copula + COP = 75; + + // Dislocated relation (for fronted/topicalized elements) + DISLOCATED = 76; + + // Aspect marker + ASP = 77; + + // Genitive modifier + GMOD = 78; + + // Genitive object + GOBJ = 79; + + // Infinitival modifier + INFMOD = 80; + + // Measure + MES = 81; + + // Nominal complement of a noun + NCOMP = 82; + } + + // Represents the head of this token in the dependency tree. + // This is the index of the token which has an arc going to this token. + // The index is the position of the token in the array of tokens returned + // by the API method. If this token is a root token, then the + // `head_token_index` is its own index. + int32 head_token_index = 1; + + // The parse label for the token. + Label label = 2; +} + +// Represents a mention for an entity in the text. Currently, proper noun +// mentions are supported. +message EntityMention { + // The supported types of mentions. + enum Type { + // Unknown + TYPE_UNKNOWN = 0; + + // Proper name + PROPER = 1; + + // Common noun (or noun compound) + COMMON = 2; + } + + // The mention text. + TextSpan text = 1; + + // The type of the entity mention. + Type type = 2; + + // For calls to [AnalyzeEntitySentiment][] or if + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to + // true, this field will contain the sentiment expressed for this mention of + // the entity in the provided document. + Sentiment sentiment = 3; +} + +// Represents an output piece of text. +message TextSpan { + // The content of the output text. + string content = 1; + + // The API calculates the beginning offset of the content in the original + // document according to the [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the API request. + int32 begin_offset = 2; +} + +// Represents a category returned from the text classifier. +message ClassificationCategory { + // The name of the category representing the document, from the [predefined + // taxonomy](https://cloud.google.com/natural-language/docs/categories). + string name = 1; + + // The classifier's confidence of the category. Number represents how certain + // the classifier is that this category represents the given text. + float confidence = 2; +} + +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model { + + } + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + +// The sentiment analysis request message. +message AnalyzeSentimentRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate sentence offsets for the + // sentence sentiment. + EncodingType encoding_type = 2; +} + +// The sentiment analysis response message. +message AnalyzeSentimentResponse { + // The overall sentiment of the input document. + Sentiment document_sentiment = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + string language = 2; + + // The sentiment for all the sentences in the document. + repeated Sentence sentences = 3; +} + +// The entity-level sentiment analysis request message. +message AnalyzeEntitySentimentRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The entity-level sentiment analysis response message. +message AnalyzeEntitySentimentResponse { + // The recognized entities in the input document with associated sentiments. + repeated Entity entities = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + string language = 2; +} + +// The entity analysis request message. +message AnalyzeEntitiesRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The entity analysis response message. +message AnalyzeEntitiesResponse { + // The recognized entities in the input document. + repeated Entity entities = 1; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + string language = 2; +} + +// The syntax analysis request message. +message AnalyzeSyntaxRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 2; +} + +// The syntax analysis response message. +message AnalyzeSyntaxResponse { + // Sentences in the input document. + repeated Sentence sentences = 1; + + // Tokens, along with their syntactic information, in the input document. + repeated Token tokens = 2; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + string language = 3; +} + +// The document classification request message. +message ClassifyTextRequest { + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; +} + +// The document classification response message. +message ClassifyTextResponse { + // Categories representing the input document. + repeated ClassificationCategory categories = 1; +} + +// The request message for the text annotation API, which can perform multiple +// analysis types (sentiment, entities, and syntax) in one call. +message AnnotateTextRequest { + // All available features for sentiment, syntax, and semantic analysis. + // Setting each one to true will enable that specific analysis for the input. + // Next ID: 11 + message Features { + // Extract syntax information. + bool extract_syntax = 1; + + // Extract entities. + bool extract_entities = 2; + + // Extract document-level sentiment. + bool extract_document_sentiment = 3; + + // Extract entities and their associated sentiment. + bool extract_entity_sentiment = 4; + + // Classify the full document into categories. If this is true, + // the API will use the default model which classifies into a + // [predefined + // taxonomy](https://cloud.google.com/natural-language/docs/categories). + bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; + } + + // Required. Input document. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The enabled features. + Features features = 2 [(google.api.field_behavior) = REQUIRED]; + + // The encoding type used by the API to calculate offsets. + EncodingType encoding_type = 3; +} + +// The text annotations response message. +message AnnotateTextResponse { + // Sentences in the input document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax]. + repeated Sentence sentences = 1; + + // Tokens, along with their syntactic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax]. + repeated Token tokens = 2; + + // Entities, along with their semantic information, in the input document. + // Populated if the user enables + // [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities]. + repeated Entity entities = 3; + + // The overall sentiment for the document. Populated if the user enables + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment]. + Sentiment document_sentiment = 4; + + // The language of the text, which will be the same as the language specified + // in the request or, if not specified, the automatically-detected language. + // See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details. + string language = 5; + + // Categories identified in the input document. + repeated ClassificationCategory categories = 6; +} diff --git a/packages/google-cloud-language/protos/protos.d.ts b/packages/google-cloud-language/protos/protos.d.ts new file mode 100644 index 000000000000..2783b9278ae5 --- /dev/null +++ b/packages/google-cloud-language/protos/protos.d.ts @@ -0,0 +1,10322 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace language. */ + namespace language { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a LanguageService */ + class LanguageService extends $protobuf.rpc.Service { + + /** + * Constructs a new LanguageService 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 LanguageService 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): LanguageService; + + /** + * Calls AnalyzeSentiment. + * @param request AnalyzeSentimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse + */ + public analyzeSentiment(request: google.cloud.language.v1.IAnalyzeSentimentRequest, callback: google.cloud.language.v1.LanguageService.AnalyzeSentimentCallback): void; + + /** + * Calls AnalyzeSentiment. + * @param request AnalyzeSentimentRequest message or plain object + * @returns Promise + */ + public analyzeSentiment(request: google.cloud.language.v1.IAnalyzeSentimentRequest): Promise; + + /** + * Calls AnalyzeEntities. + * @param request AnalyzeEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse + */ + public analyzeEntities(request: google.cloud.language.v1.IAnalyzeEntitiesRequest, callback: google.cloud.language.v1.LanguageService.AnalyzeEntitiesCallback): void; + + /** + * Calls AnalyzeEntities. + * @param request AnalyzeEntitiesRequest message or plain object + * @returns Promise + */ + public analyzeEntities(request: google.cloud.language.v1.IAnalyzeEntitiesRequest): Promise; + + /** + * Calls AnalyzeEntitySentiment. + * @param request AnalyzeEntitySentimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse + */ + public analyzeEntitySentiment(request: google.cloud.language.v1.IAnalyzeEntitySentimentRequest, callback: google.cloud.language.v1.LanguageService.AnalyzeEntitySentimentCallback): void; + + /** + * Calls AnalyzeEntitySentiment. + * @param request AnalyzeEntitySentimentRequest message or plain object + * @returns Promise + */ + public analyzeEntitySentiment(request: google.cloud.language.v1.IAnalyzeEntitySentimentRequest): Promise; + + /** + * Calls AnalyzeSyntax. + * @param request AnalyzeSyntaxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse + */ + public analyzeSyntax(request: google.cloud.language.v1.IAnalyzeSyntaxRequest, callback: google.cloud.language.v1.LanguageService.AnalyzeSyntaxCallback): void; + + /** + * Calls AnalyzeSyntax. + * @param request AnalyzeSyntaxRequest message or plain object + * @returns Promise + */ + public analyzeSyntax(request: google.cloud.language.v1.IAnalyzeSyntaxRequest): Promise; + + /** + * Calls ClassifyText. + * @param request ClassifyTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClassifyTextResponse + */ + public classifyText(request: google.cloud.language.v1.IClassifyTextRequest, callback: google.cloud.language.v1.LanguageService.ClassifyTextCallback): void; + + /** + * Calls ClassifyText. + * @param request ClassifyTextRequest message or plain object + * @returns Promise + */ + public classifyText(request: google.cloud.language.v1.IClassifyTextRequest): Promise; + + /** + * Calls AnnotateText. + * @param request AnnotateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotateTextResponse + */ + public annotateText(request: google.cloud.language.v1.IAnnotateTextRequest, callback: google.cloud.language.v1.LanguageService.AnnotateTextCallback): void; + + /** + * Calls AnnotateText. + * @param request AnnotateTextRequest message or plain object + * @returns Promise + */ + public annotateText(request: google.cloud.language.v1.IAnnotateTextRequest): Promise; + } + + namespace LanguageService { + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeSentiment}. + * @param error Error, if any + * @param [response] AnalyzeSentimentResponse + */ + type AnalyzeSentimentCallback = (error: (Error|null), response?: google.cloud.language.v1.AnalyzeSentimentResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeEntities}. + * @param error Error, if any + * @param [response] AnalyzeEntitiesResponse + */ + type AnalyzeEntitiesCallback = (error: (Error|null), response?: google.cloud.language.v1.AnalyzeEntitiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeEntitySentiment}. + * @param error Error, if any + * @param [response] AnalyzeEntitySentimentResponse + */ + type AnalyzeEntitySentimentCallback = (error: (Error|null), response?: google.cloud.language.v1.AnalyzeEntitySentimentResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeSyntax}. + * @param error Error, if any + * @param [response] AnalyzeSyntaxResponse + */ + type AnalyzeSyntaxCallback = (error: (Error|null), response?: google.cloud.language.v1.AnalyzeSyntaxResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|classifyText}. + * @param error Error, if any + * @param [response] ClassifyTextResponse + */ + type ClassifyTextCallback = (error: (Error|null), response?: google.cloud.language.v1.ClassifyTextResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|annotateText}. + * @param error Error, if any + * @param [response] AnnotateTextResponse + */ + type AnnotateTextCallback = (error: (Error|null), response?: google.cloud.language.v1.AnnotateTextResponse) => void; + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document type */ + type?: (google.cloud.language.v1.Document.Type|keyof typeof google.cloud.language.v1.Document.Type|null); + + /** Document content */ + content?: (string|null); + + /** Document gcsContentUri */ + gcsContentUri?: (string|null); + + /** Document language */ + language?: (string|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IDocument); + + /** Document type. */ + public type: (google.cloud.language.v1.Document.Type|keyof typeof google.cloud.language.v1.Document.Type); + + /** Document content. */ + public content?: (string|null); + + /** Document gcsContentUri. */ + public gcsContentUri?: (string|null); + + /** Document language. */ + public language: string; + + /** Document source. */ + public source?: ("content"|"gcsContentUri"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.language.v1.IDocument): google.cloud.language.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PLAIN_TEXT = 1, + HTML = 2 + } + } + + /** Properties of a Sentence. */ + interface ISentence { + + /** Sentence text */ + text?: (google.cloud.language.v1.ITextSpan|null); + + /** Sentence sentiment */ + sentiment?: (google.cloud.language.v1.ISentiment|null); + } + + /** Represents a Sentence. */ + class Sentence implements ISentence { + + /** + * Constructs a new Sentence. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.ISentence); + + /** Sentence text. */ + public text?: (google.cloud.language.v1.ITextSpan|null); + + /** Sentence sentiment. */ + public sentiment?: (google.cloud.language.v1.ISentiment|null); + + /** + * Creates a new Sentence instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentence instance + */ + public static create(properties?: google.cloud.language.v1.ISentence): google.cloud.language.v1.Sentence; + + /** + * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1.Sentence.verify|verify} messages. + * @param message Sentence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.ISentence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1.Sentence.verify|verify} messages. + * @param message Sentence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.ISentence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sentence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.Sentence; + + /** + * Decodes a Sentence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.Sentence; + + /** + * Verifies a Sentence message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sentence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentence + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.Sentence; + + /** + * Creates a plain object from a Sentence message. Also converts values to other types if specified. + * @param message Sentence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.Sentence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sentence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sentence + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EncodingType enum. */ + enum EncodingType { + NONE = 0, + UTF8 = 1, + UTF16 = 2, + UTF32 = 3 + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity name */ + name?: (string|null); + + /** Entity type */ + type?: (google.cloud.language.v1.Entity.Type|keyof typeof google.cloud.language.v1.Entity.Type|null); + + /** Entity metadata */ + metadata?: ({ [k: string]: string }|null); + + /** Entity salience */ + salience?: (number|null); + + /** Entity mentions */ + mentions?: (google.cloud.language.v1.IEntityMention[]|null); + + /** Entity sentiment */ + sentiment?: (google.cloud.language.v1.ISentiment|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IEntity); + + /** Entity name. */ + public name: string; + + /** Entity type. */ + public type: (google.cloud.language.v1.Entity.Type|keyof typeof google.cloud.language.v1.Entity.Type); + + /** Entity metadata. */ + public metadata: { [k: string]: string }; + + /** Entity salience. */ + public salience: number; + + /** Entity mentions. */ + public mentions: google.cloud.language.v1.IEntityMention[]; + + /** Entity sentiment. */ + public sentiment?: (google.cloud.language.v1.ISentiment|null); + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.language.v1.IEntity): google.cloud.language.v1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entity { + + /** Type enum. */ + enum Type { + UNKNOWN = 0, + PERSON = 1, + LOCATION = 2, + ORGANIZATION = 3, + EVENT = 4, + WORK_OF_ART = 5, + CONSUMER_GOOD = 6, + OTHER = 7, + PHONE_NUMBER = 9, + ADDRESS = 10, + DATE = 11, + NUMBER = 12, + PRICE = 13 + } + } + + /** Properties of a Token. */ + interface IToken { + + /** Token text */ + text?: (google.cloud.language.v1.ITextSpan|null); + + /** Token partOfSpeech */ + partOfSpeech?: (google.cloud.language.v1.IPartOfSpeech|null); + + /** Token dependencyEdge */ + dependencyEdge?: (google.cloud.language.v1.IDependencyEdge|null); + + /** Token lemma */ + lemma?: (string|null); + } + + /** Represents a Token. */ + class Token implements IToken { + + /** + * Constructs a new Token. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IToken); + + /** Token text. */ + public text?: (google.cloud.language.v1.ITextSpan|null); + + /** Token partOfSpeech. */ + public partOfSpeech?: (google.cloud.language.v1.IPartOfSpeech|null); + + /** Token dependencyEdge. */ + public dependencyEdge?: (google.cloud.language.v1.IDependencyEdge|null); + + /** Token lemma. */ + public lemma: string; + + /** + * Creates a new Token instance using the specified properties. + * @param [properties] Properties to set + * @returns Token instance + */ + public static create(properties?: google.cloud.language.v1.IToken): google.cloud.language.v1.Token; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Token message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.Token; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.Token; + + /** + * Verifies a Token message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Token message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Token + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.Token; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @param message Token + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.Token, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Token to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Token + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Sentiment. */ + interface ISentiment { + + /** Sentiment magnitude */ + magnitude?: (number|null); + + /** Sentiment score */ + score?: (number|null); + } + + /** Represents a Sentiment. */ + class Sentiment implements ISentiment { + + /** + * Constructs a new Sentiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.ISentiment); + + /** Sentiment magnitude. */ + public magnitude: number; + + /** Sentiment score. */ + public score: number; + + /** + * Creates a new Sentiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentiment instance + */ + public static create(properties?: google.cloud.language.v1.ISentiment): google.cloud.language.v1.Sentiment; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.Sentiment; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.Sentiment; + + /** + * Verifies a Sentiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.Sentiment; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @param message Sentiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sentiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sentiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartOfSpeech. */ + interface IPartOfSpeech { + + /** PartOfSpeech tag */ + tag?: (google.cloud.language.v1.PartOfSpeech.Tag|keyof typeof google.cloud.language.v1.PartOfSpeech.Tag|null); + + /** PartOfSpeech aspect */ + aspect?: (google.cloud.language.v1.PartOfSpeech.Aspect|keyof typeof google.cloud.language.v1.PartOfSpeech.Aspect|null); + + /** PartOfSpeech case */ + "case"?: (google.cloud.language.v1.PartOfSpeech.Case|keyof typeof google.cloud.language.v1.PartOfSpeech.Case|null); + + /** PartOfSpeech form */ + form?: (google.cloud.language.v1.PartOfSpeech.Form|keyof typeof google.cloud.language.v1.PartOfSpeech.Form|null); + + /** PartOfSpeech gender */ + gender?: (google.cloud.language.v1.PartOfSpeech.Gender|keyof typeof google.cloud.language.v1.PartOfSpeech.Gender|null); + + /** PartOfSpeech mood */ + mood?: (google.cloud.language.v1.PartOfSpeech.Mood|keyof typeof google.cloud.language.v1.PartOfSpeech.Mood|null); + + /** PartOfSpeech number */ + number?: (google.cloud.language.v1.PartOfSpeech.Number|keyof typeof google.cloud.language.v1.PartOfSpeech.Number|null); + + /** PartOfSpeech person */ + person?: (google.cloud.language.v1.PartOfSpeech.Person|keyof typeof google.cloud.language.v1.PartOfSpeech.Person|null); + + /** PartOfSpeech proper */ + proper?: (google.cloud.language.v1.PartOfSpeech.Proper|keyof typeof google.cloud.language.v1.PartOfSpeech.Proper|null); + + /** PartOfSpeech reciprocity */ + reciprocity?: (google.cloud.language.v1.PartOfSpeech.Reciprocity|keyof typeof google.cloud.language.v1.PartOfSpeech.Reciprocity|null); + + /** PartOfSpeech tense */ + tense?: (google.cloud.language.v1.PartOfSpeech.Tense|keyof typeof google.cloud.language.v1.PartOfSpeech.Tense|null); + + /** PartOfSpeech voice */ + voice?: (google.cloud.language.v1.PartOfSpeech.Voice|keyof typeof google.cloud.language.v1.PartOfSpeech.Voice|null); + } + + /** Represents a PartOfSpeech. */ + class PartOfSpeech implements IPartOfSpeech { + + /** + * Constructs a new PartOfSpeech. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IPartOfSpeech); + + /** PartOfSpeech tag. */ + public tag: (google.cloud.language.v1.PartOfSpeech.Tag|keyof typeof google.cloud.language.v1.PartOfSpeech.Tag); + + /** PartOfSpeech aspect. */ + public aspect: (google.cloud.language.v1.PartOfSpeech.Aspect|keyof typeof google.cloud.language.v1.PartOfSpeech.Aspect); + + /** PartOfSpeech case. */ + public case: (google.cloud.language.v1.PartOfSpeech.Case|keyof typeof google.cloud.language.v1.PartOfSpeech.Case); + + /** PartOfSpeech form. */ + public form: (google.cloud.language.v1.PartOfSpeech.Form|keyof typeof google.cloud.language.v1.PartOfSpeech.Form); + + /** PartOfSpeech gender. */ + public gender: (google.cloud.language.v1.PartOfSpeech.Gender|keyof typeof google.cloud.language.v1.PartOfSpeech.Gender); + + /** PartOfSpeech mood. */ + public mood: (google.cloud.language.v1.PartOfSpeech.Mood|keyof typeof google.cloud.language.v1.PartOfSpeech.Mood); + + /** PartOfSpeech number. */ + public number: (google.cloud.language.v1.PartOfSpeech.Number|keyof typeof google.cloud.language.v1.PartOfSpeech.Number); + + /** PartOfSpeech person. */ + public person: (google.cloud.language.v1.PartOfSpeech.Person|keyof typeof google.cloud.language.v1.PartOfSpeech.Person); + + /** PartOfSpeech proper. */ + public proper: (google.cloud.language.v1.PartOfSpeech.Proper|keyof typeof google.cloud.language.v1.PartOfSpeech.Proper); + + /** PartOfSpeech reciprocity. */ + public reciprocity: (google.cloud.language.v1.PartOfSpeech.Reciprocity|keyof typeof google.cloud.language.v1.PartOfSpeech.Reciprocity); + + /** PartOfSpeech tense. */ + public tense: (google.cloud.language.v1.PartOfSpeech.Tense|keyof typeof google.cloud.language.v1.PartOfSpeech.Tense); + + /** PartOfSpeech voice. */ + public voice: (google.cloud.language.v1.PartOfSpeech.Voice|keyof typeof google.cloud.language.v1.PartOfSpeech.Voice); + + /** + * Creates a new PartOfSpeech instance using the specified properties. + * @param [properties] Properties to set + * @returns PartOfSpeech instance + */ + public static create(properties?: google.cloud.language.v1.IPartOfSpeech): google.cloud.language.v1.PartOfSpeech; + + /** + * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1.PartOfSpeech.verify|verify} messages. + * @param message PartOfSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IPartOfSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1.PartOfSpeech.verify|verify} messages. + * @param message PartOfSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IPartOfSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.PartOfSpeech; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.PartOfSpeech; + + /** + * Verifies a PartOfSpeech message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartOfSpeech + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.PartOfSpeech; + + /** + * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. + * @param message PartOfSpeech + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.PartOfSpeech, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartOfSpeech to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartOfSpeech + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartOfSpeech { + + /** Tag enum. */ + enum Tag { + UNKNOWN = 0, + ADJ = 1, + ADP = 2, + ADV = 3, + CONJ = 4, + DET = 5, + NOUN = 6, + NUM = 7, + PRON = 8, + PRT = 9, + PUNCT = 10, + VERB = 11, + X = 12, + AFFIX = 13 + } + + /** Aspect enum. */ + enum Aspect { + ASPECT_UNKNOWN = 0, + PERFECTIVE = 1, + IMPERFECTIVE = 2, + PROGRESSIVE = 3 + } + + /** Case enum. */ + enum Case { + CASE_UNKNOWN = 0, + ACCUSATIVE = 1, + ADVERBIAL = 2, + COMPLEMENTIVE = 3, + DATIVE = 4, + GENITIVE = 5, + INSTRUMENTAL = 6, + LOCATIVE = 7, + NOMINATIVE = 8, + OBLIQUE = 9, + PARTITIVE = 10, + PREPOSITIONAL = 11, + REFLEXIVE_CASE = 12, + RELATIVE_CASE = 13, + VOCATIVE = 14 + } + + /** Form enum. */ + enum Form { + FORM_UNKNOWN = 0, + ADNOMIAL = 1, + AUXILIARY = 2, + COMPLEMENTIZER = 3, + FINAL_ENDING = 4, + GERUND = 5, + REALIS = 6, + IRREALIS = 7, + SHORT = 8, + LONG = 9, + ORDER = 10, + SPECIFIC = 11 + } + + /** Gender enum. */ + enum Gender { + GENDER_UNKNOWN = 0, + FEMININE = 1, + MASCULINE = 2, + NEUTER = 3 + } + + /** Mood enum. */ + enum Mood { + MOOD_UNKNOWN = 0, + CONDITIONAL_MOOD = 1, + IMPERATIVE = 2, + INDICATIVE = 3, + INTERROGATIVE = 4, + JUSSIVE = 5, + SUBJUNCTIVE = 6 + } + + /** Number enum. */ + enum Number { + NUMBER_UNKNOWN = 0, + SINGULAR = 1, + PLURAL = 2, + DUAL = 3 + } + + /** Person enum. */ + enum Person { + PERSON_UNKNOWN = 0, + FIRST = 1, + SECOND = 2, + THIRD = 3, + REFLEXIVE_PERSON = 4 + } + + /** Proper enum. */ + enum Proper { + PROPER_UNKNOWN = 0, + PROPER = 1, + NOT_PROPER = 2 + } + + /** Reciprocity enum. */ + enum Reciprocity { + RECIPROCITY_UNKNOWN = 0, + RECIPROCAL = 1, + NON_RECIPROCAL = 2 + } + + /** Tense enum. */ + enum Tense { + TENSE_UNKNOWN = 0, + CONDITIONAL_TENSE = 1, + FUTURE = 2, + PAST = 3, + PRESENT = 4, + IMPERFECT = 5, + PLUPERFECT = 6 + } + + /** Voice enum. */ + enum Voice { + VOICE_UNKNOWN = 0, + ACTIVE = 1, + CAUSATIVE = 2, + PASSIVE = 3 + } + } + + /** Properties of a DependencyEdge. */ + interface IDependencyEdge { + + /** DependencyEdge headTokenIndex */ + headTokenIndex?: (number|null); + + /** DependencyEdge label */ + label?: (google.cloud.language.v1.DependencyEdge.Label|keyof typeof google.cloud.language.v1.DependencyEdge.Label|null); + } + + /** Represents a DependencyEdge. */ + class DependencyEdge implements IDependencyEdge { + + /** + * Constructs a new DependencyEdge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IDependencyEdge); + + /** DependencyEdge headTokenIndex. */ + public headTokenIndex: number; + + /** DependencyEdge label. */ + public label: (google.cloud.language.v1.DependencyEdge.Label|keyof typeof google.cloud.language.v1.DependencyEdge.Label); + + /** + * Creates a new DependencyEdge instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyEdge instance + */ + public static create(properties?: google.cloud.language.v1.IDependencyEdge): google.cloud.language.v1.DependencyEdge; + + /** + * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1.DependencyEdge.verify|verify} messages. + * @param message DependencyEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IDependencyEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1.DependencyEdge.verify|verify} messages. + * @param message DependencyEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IDependencyEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.DependencyEdge; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.DependencyEdge; + + /** + * Verifies a DependencyEdge message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyEdge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.DependencyEdge; + + /** + * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * @param message DependencyEdge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.DependencyEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyEdge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyEdge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DependencyEdge { + + /** Label enum. */ + enum Label { + UNKNOWN = 0, + ABBREV = 1, + ACOMP = 2, + ADVCL = 3, + ADVMOD = 4, + AMOD = 5, + APPOS = 6, + ATTR = 7, + AUX = 8, + AUXPASS = 9, + CC = 10, + CCOMP = 11, + CONJ = 12, + CSUBJ = 13, + CSUBJPASS = 14, + DEP = 15, + DET = 16, + DISCOURSE = 17, + DOBJ = 18, + EXPL = 19, + GOESWITH = 20, + IOBJ = 21, + MARK = 22, + MWE = 23, + MWV = 24, + NEG = 25, + NN = 26, + NPADVMOD = 27, + NSUBJ = 28, + NSUBJPASS = 29, + NUM = 30, + NUMBER = 31, + P = 32, + PARATAXIS = 33, + PARTMOD = 34, + PCOMP = 35, + POBJ = 36, + POSS = 37, + POSTNEG = 38, + PRECOMP = 39, + PRECONJ = 40, + PREDET = 41, + PREF = 42, + PREP = 43, + PRONL = 44, + PRT = 45, + PS = 46, + QUANTMOD = 47, + RCMOD = 48, + RCMODREL = 49, + RDROP = 50, + REF = 51, + REMNANT = 52, + REPARANDUM = 53, + ROOT = 54, + SNUM = 55, + SUFF = 56, + TMOD = 57, + TOPIC = 58, + VMOD = 59, + VOCATIVE = 60, + XCOMP = 61, + SUFFIX = 62, + TITLE = 63, + ADVPHMOD = 64, + AUXCAUS = 65, + AUXVV = 66, + DTMOD = 67, + FOREIGN = 68, + KW = 69, + LIST = 70, + NOMC = 71, + NOMCSUBJ = 72, + NOMCSUBJPASS = 73, + NUMC = 74, + COP = 75, + DISLOCATED = 76, + ASP = 77, + GMOD = 78, + GOBJ = 79, + INFMOD = 80, + MES = 81, + NCOMP = 82 + } + } + + /** Properties of an EntityMention. */ + interface IEntityMention { + + /** EntityMention text */ + text?: (google.cloud.language.v1.ITextSpan|null); + + /** EntityMention type */ + type?: (google.cloud.language.v1.EntityMention.Type|keyof typeof google.cloud.language.v1.EntityMention.Type|null); + + /** EntityMention sentiment */ + sentiment?: (google.cloud.language.v1.ISentiment|null); + } + + /** Represents an EntityMention. */ + class EntityMention implements IEntityMention { + + /** + * Constructs a new EntityMention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IEntityMention); + + /** EntityMention text. */ + public text?: (google.cloud.language.v1.ITextSpan|null); + + /** EntityMention type. */ + public type: (google.cloud.language.v1.EntityMention.Type|keyof typeof google.cloud.language.v1.EntityMention.Type); + + /** EntityMention sentiment. */ + public sentiment?: (google.cloud.language.v1.ISentiment|null); + + /** + * Creates a new EntityMention instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityMention instance + */ + public static create(properties?: google.cloud.language.v1.IEntityMention): google.cloud.language.v1.EntityMention; + + /** + * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1.EntityMention.verify|verify} messages. + * @param message EntityMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IEntityMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1.EntityMention.verify|verify} messages. + * @param message EntityMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IEntityMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityMention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.EntityMention; + + /** + * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.EntityMention; + + /** + * Verifies an EntityMention message. + * @param message Plain 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 EntityMention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityMention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.EntityMention; + + /** + * Creates a plain object from an EntityMention message. Also converts values to other types if specified. + * @param message EntityMention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.EntityMention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityMention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityMention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityMention { + + /** Type enum. */ + enum Type { + TYPE_UNKNOWN = 0, + PROPER = 1, + COMMON = 2 + } + } + + /** Properties of a TextSpan. */ + interface ITextSpan { + + /** TextSpan content */ + content?: (string|null); + + /** TextSpan beginOffset */ + beginOffset?: (number|null); + } + + /** Represents a TextSpan. */ + class TextSpan implements ITextSpan { + + /** + * Constructs a new TextSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.ITextSpan); + + /** TextSpan content. */ + public content: string; + + /** TextSpan beginOffset. */ + public beginOffset: number; + + /** + * Creates a new TextSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSpan instance + */ + public static create(properties?: google.cloud.language.v1.ITextSpan): google.cloud.language.v1.TextSpan; + + /** + * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1.TextSpan.verify|verify} messages. + * @param message TextSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.ITextSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1.TextSpan.verify|verify} messages. + * @param message TextSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.ITextSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.TextSpan; + + /** + * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.TextSpan; + + /** + * Verifies a TextSpan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSpan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.TextSpan; + + /** + * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * @param message TextSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.TextSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationCategory. */ + interface IClassificationCategory { + + /** ClassificationCategory name */ + name?: (string|null); + + /** ClassificationCategory confidence */ + confidence?: (number|null); + } + + /** Represents a ClassificationCategory. */ + class ClassificationCategory implements IClassificationCategory { + + /** + * Constructs a new ClassificationCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IClassificationCategory); + + /** ClassificationCategory name. */ + public name: string; + + /** ClassificationCategory confidence. */ + public confidence: number; + + /** + * Creates a new ClassificationCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationCategory instance + */ + public static create(properties?: google.cloud.language.v1.IClassificationCategory): google.cloud.language.v1.ClassificationCategory; + + /** + * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1.ClassificationCategory.verify|verify} messages. + * @param message ClassificationCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IClassificationCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationCategory.verify|verify} messages. + * @param message ClassificationCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IClassificationCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassificationCategory; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassificationCategory; + + /** + * Verifies a ClassificationCategory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassificationCategory; + + /** + * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. + * @param message ClassificationCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassificationCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationModelOptions. */ + interface IClassificationModelOptions { + + /** ClassificationModelOptions v1Model */ + v1Model?: (google.cloud.language.v1.ClassificationModelOptions.IV1Model|null); + + /** ClassificationModelOptions v2Model */ + v2Model?: (google.cloud.language.v1.ClassificationModelOptions.IV2Model|null); + } + + /** Represents a ClassificationModelOptions. */ + class ClassificationModelOptions implements IClassificationModelOptions { + + /** + * Constructs a new ClassificationModelOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IClassificationModelOptions); + + /** ClassificationModelOptions v1Model. */ + public v1Model?: (google.cloud.language.v1.ClassificationModelOptions.IV1Model|null); + + /** ClassificationModelOptions v2Model. */ + public v2Model?: (google.cloud.language.v1.ClassificationModelOptions.IV2Model|null); + + /** ClassificationModelOptions modelType. */ + public modelType?: ("v1Model"|"v2Model"); + + /** + * Creates a new ClassificationModelOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationModelOptions instance + */ + public static create(properties?: google.cloud.language.v1.IClassificationModelOptions): google.cloud.language.v1.ClassificationModelOptions; + + /** + * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.verify|verify} messages. + * @param message ClassificationModelOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IClassificationModelOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.verify|verify} messages. + * @param message ClassificationModelOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IClassificationModelOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassificationModelOptions; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassificationModelOptions; + + /** + * Verifies a ClassificationModelOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationModelOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassificationModelOptions; + + /** + * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. + * @param message ClassificationModelOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassificationModelOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationModelOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationModelOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationModelOptions { + + /** Properties of a V1Model. */ + interface IV1Model { + } + + /** Represents a V1Model. */ + class V1Model implements IV1Model { + + /** + * Constructs a new V1Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.ClassificationModelOptions.IV1Model); + + /** + * Creates a new V1Model instance using the specified properties. + * @param [properties] Properties to set + * @returns V1Model instance + */ + public static create(properties?: google.cloud.language.v1.ClassificationModelOptions.IV1Model): google.cloud.language.v1.ClassificationModelOptions.V1Model; + + /** + * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V1Model.verify|verify} messages. + * @param message V1Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.ClassificationModelOptions.IV1Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V1Model.verify|verify} messages. + * @param message V1Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.ClassificationModelOptions.IV1Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a V1Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassificationModelOptions.V1Model; + + /** + * Decodes a V1Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassificationModelOptions.V1Model; + + /** + * Verifies a V1Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a V1Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns V1Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassificationModelOptions.V1Model; + + /** + * Creates a plain object from a V1Model message. Also converts values to other types if specified. + * @param message V1Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassificationModelOptions.V1Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this V1Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for V1Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a V2Model. */ + interface IV2Model { + + /** V2Model contentCategoriesVersion */ + contentCategoriesVersion?: (google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion|keyof typeof google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null); + } + + /** Represents a V2Model. */ + class V2Model implements IV2Model { + + /** + * Constructs a new V2Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.ClassificationModelOptions.IV2Model); + + /** V2Model contentCategoriesVersion. */ + public contentCategoriesVersion: (google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion|keyof typeof google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion); + + /** + * Creates a new V2Model instance using the specified properties. + * @param [properties] Properties to set + * @returns V2Model instance + */ + public static create(properties?: google.cloud.language.v1.ClassificationModelOptions.IV2Model): google.cloud.language.v1.ClassificationModelOptions.V2Model; + + /** + * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V2Model.verify|verify} messages. + * @param message V2Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.ClassificationModelOptions.IV2Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V2Model.verify|verify} messages. + * @param message V2Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.ClassificationModelOptions.IV2Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a V2Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassificationModelOptions.V2Model; + + /** + * Decodes a V2Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassificationModelOptions.V2Model; + + /** + * Verifies a V2Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a V2Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns V2Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassificationModelOptions.V2Model; + + /** + * Creates a plain object from a V2Model message. Also converts values to other types if specified. + * @param message V2Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassificationModelOptions.V2Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this V2Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for V2Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace V2Model { + + /** ContentCategoriesVersion enum. */ + enum ContentCategoriesVersion { + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0, + V1 = 1, + V2 = 2 + } + } + } + + /** Properties of an AnalyzeSentimentRequest. */ + interface IAnalyzeSentimentRequest { + + /** AnalyzeSentimentRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeSentimentRequest encodingType */ + encodingType?: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType|null); + } + + /** Represents an AnalyzeSentimentRequest. */ + class AnalyzeSentimentRequest implements IAnalyzeSentimentRequest { + + /** + * Constructs a new AnalyzeSentimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeSentimentRequest); + + /** AnalyzeSentimentRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeSentimentRequest encodingType. */ + public encodingType: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType); + + /** + * Creates a new AnalyzeSentimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSentimentRequest instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeSentimentRequest): google.cloud.language.v1.AnalyzeSentimentRequest; + + /** + * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentRequest.verify|verify} messages. + * @param message AnalyzeSentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeSentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentRequest.verify|verify} messages. + * @param message AnalyzeSentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeSentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeSentimentRequest; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeSentimentRequest; + + /** + * Verifies an AnalyzeSentimentRequest message. + * @param message Plain 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 AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSentimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeSentimentRequest; + + /** + * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. + * @param message AnalyzeSentimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeSentimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSentimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSentimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSentimentResponse. */ + interface IAnalyzeSentimentResponse { + + /** AnalyzeSentimentResponse documentSentiment */ + documentSentiment?: (google.cloud.language.v1.ISentiment|null); + + /** AnalyzeSentimentResponse language */ + language?: (string|null); + + /** AnalyzeSentimentResponse sentences */ + sentences?: (google.cloud.language.v1.ISentence[]|null); + } + + /** Represents an AnalyzeSentimentResponse. */ + class AnalyzeSentimentResponse implements IAnalyzeSentimentResponse { + + /** + * Constructs a new AnalyzeSentimentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeSentimentResponse); + + /** AnalyzeSentimentResponse documentSentiment. */ + public documentSentiment?: (google.cloud.language.v1.ISentiment|null); + + /** AnalyzeSentimentResponse language. */ + public language: string; + + /** AnalyzeSentimentResponse sentences. */ + public sentences: google.cloud.language.v1.ISentence[]; + + /** + * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSentimentResponse instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeSentimentResponse): google.cloud.language.v1.AnalyzeSentimentResponse; + + /** + * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentResponse.verify|verify} messages. + * @param message AnalyzeSentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeSentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentResponse.verify|verify} messages. + * @param message AnalyzeSentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeSentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeSentimentResponse; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeSentimentResponse; + + /** + * Verifies an AnalyzeSentimentResponse message. + * @param message Plain 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 AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSentimentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeSentimentResponse; + + /** + * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * @param message AnalyzeSentimentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeSentimentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSentimentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSentimentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitySentimentRequest. */ + interface IAnalyzeEntitySentimentRequest { + + /** AnalyzeEntitySentimentRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeEntitySentimentRequest encodingType */ + encodingType?: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType|null); + } + + /** Represents an AnalyzeEntitySentimentRequest. */ + class AnalyzeEntitySentimentRequest implements IAnalyzeEntitySentimentRequest { + + /** + * Constructs a new AnalyzeEntitySentimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeEntitySentimentRequest); + + /** AnalyzeEntitySentimentRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeEntitySentimentRequest encodingType. */ + public encodingType: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType); + + /** + * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitySentimentRequest instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeEntitySentimentRequest): google.cloud.language.v1.AnalyzeEntitySentimentRequest; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @param message AnalyzeEntitySentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeEntitySentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @param message AnalyzeEntitySentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeEntitySentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeEntitySentimentRequest; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeEntitySentimentRequest; + + /** + * Verifies an AnalyzeEntitySentimentRequest message. + * @param message Plain 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 AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitySentimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeEntitySentimentRequest; + + /** + * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. + * @param message AnalyzeEntitySentimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeEntitySentimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitySentimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitySentimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitySentimentResponse. */ + interface IAnalyzeEntitySentimentResponse { + + /** AnalyzeEntitySentimentResponse entities */ + entities?: (google.cloud.language.v1.IEntity[]|null); + + /** AnalyzeEntitySentimentResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeEntitySentimentResponse. */ + class AnalyzeEntitySentimentResponse implements IAnalyzeEntitySentimentResponse { + + /** + * Constructs a new AnalyzeEntitySentimentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeEntitySentimentResponse); + + /** AnalyzeEntitySentimentResponse entities. */ + public entities: google.cloud.language.v1.IEntity[]; + + /** AnalyzeEntitySentimentResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitySentimentResponse instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeEntitySentimentResponse): google.cloud.language.v1.AnalyzeEntitySentimentResponse; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @param message AnalyzeEntitySentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeEntitySentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @param message AnalyzeEntitySentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeEntitySentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeEntitySentimentResponse; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeEntitySentimentResponse; + + /** + * Verifies an AnalyzeEntitySentimentResponse message. + * @param message Plain 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 AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitySentimentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeEntitySentimentResponse; + + /** + * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. + * @param message AnalyzeEntitySentimentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeEntitySentimentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitySentimentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitySentimentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitiesRequest. */ + interface IAnalyzeEntitiesRequest { + + /** AnalyzeEntitiesRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeEntitiesRequest encodingType */ + encodingType?: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType|null); + } + + /** Represents an AnalyzeEntitiesRequest. */ + class AnalyzeEntitiesRequest implements IAnalyzeEntitiesRequest { + + /** + * Constructs a new AnalyzeEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeEntitiesRequest); + + /** AnalyzeEntitiesRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeEntitiesRequest encodingType. */ + public encodingType: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType); + + /** + * Creates a new AnalyzeEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitiesRequest instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeEntitiesRequest): google.cloud.language.v1.AnalyzeEntitiesRequest; + + /** + * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesRequest.verify|verify} messages. + * @param message AnalyzeEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesRequest.verify|verify} messages. + * @param message AnalyzeEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeEntitiesRequest; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeEntitiesRequest; + + /** + * Verifies an AnalyzeEntitiesRequest message. + * @param message Plain 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 AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeEntitiesRequest; + + /** + * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. + * @param message AnalyzeEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitiesResponse. */ + interface IAnalyzeEntitiesResponse { + + /** AnalyzeEntitiesResponse entities */ + entities?: (google.cloud.language.v1.IEntity[]|null); + + /** AnalyzeEntitiesResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeEntitiesResponse. */ + class AnalyzeEntitiesResponse implements IAnalyzeEntitiesResponse { + + /** + * Constructs a new AnalyzeEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeEntitiesResponse); + + /** AnalyzeEntitiesResponse entities. */ + public entities: google.cloud.language.v1.IEntity[]; + + /** AnalyzeEntitiesResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitiesResponse instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeEntitiesResponse): google.cloud.language.v1.AnalyzeEntitiesResponse; + + /** + * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesResponse.verify|verify} messages. + * @param message AnalyzeEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesResponse.verify|verify} messages. + * @param message AnalyzeEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeEntitiesResponse; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeEntitiesResponse; + + /** + * Verifies an AnalyzeEntitiesResponse message. + * @param message Plain 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 AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeEntitiesResponse; + + /** + * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. + * @param message AnalyzeEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSyntaxRequest. */ + interface IAnalyzeSyntaxRequest { + + /** AnalyzeSyntaxRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeSyntaxRequest encodingType */ + encodingType?: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType|null); + } + + /** Represents an AnalyzeSyntaxRequest. */ + class AnalyzeSyntaxRequest implements IAnalyzeSyntaxRequest { + + /** + * Constructs a new AnalyzeSyntaxRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeSyntaxRequest); + + /** AnalyzeSyntaxRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** AnalyzeSyntaxRequest encodingType. */ + public encodingType: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType); + + /** + * Creates a new AnalyzeSyntaxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSyntaxRequest instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeSyntaxRequest): google.cloud.language.v1.AnalyzeSyntaxRequest; + + /** + * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxRequest.verify|verify} messages. + * @param message AnalyzeSyntaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeSyntaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxRequest.verify|verify} messages. + * @param message AnalyzeSyntaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeSyntaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeSyntaxRequest; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeSyntaxRequest; + + /** + * Verifies an AnalyzeSyntaxRequest message. + * @param message Plain 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 AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSyntaxRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeSyntaxRequest; + + /** + * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. + * @param message AnalyzeSyntaxRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeSyntaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSyntaxRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSyntaxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSyntaxResponse. */ + interface IAnalyzeSyntaxResponse { + + /** AnalyzeSyntaxResponse sentences */ + sentences?: (google.cloud.language.v1.ISentence[]|null); + + /** AnalyzeSyntaxResponse tokens */ + tokens?: (google.cloud.language.v1.IToken[]|null); + + /** AnalyzeSyntaxResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeSyntaxResponse. */ + class AnalyzeSyntaxResponse implements IAnalyzeSyntaxResponse { + + /** + * Constructs a new AnalyzeSyntaxResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnalyzeSyntaxResponse); + + /** AnalyzeSyntaxResponse sentences. */ + public sentences: google.cloud.language.v1.ISentence[]; + + /** AnalyzeSyntaxResponse tokens. */ + public tokens: google.cloud.language.v1.IToken[]; + + /** AnalyzeSyntaxResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeSyntaxResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSyntaxResponse instance + */ + public static create(properties?: google.cloud.language.v1.IAnalyzeSyntaxResponse): google.cloud.language.v1.AnalyzeSyntaxResponse; + + /** + * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxResponse.verify|verify} messages. + * @param message AnalyzeSyntaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnalyzeSyntaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxResponse.verify|verify} messages. + * @param message AnalyzeSyntaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnalyzeSyntaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnalyzeSyntaxResponse; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnalyzeSyntaxResponse; + + /** + * Verifies an AnalyzeSyntaxResponse message. + * @param message Plain 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 AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSyntaxResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnalyzeSyntaxResponse; + + /** + * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. + * @param message AnalyzeSyntaxResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnalyzeSyntaxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSyntaxResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSyntaxResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassifyTextRequest. */ + interface IClassifyTextRequest { + + /** ClassifyTextRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** ClassifyTextRequest classificationModelOptions */ + classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); + } + + /** Represents a ClassifyTextRequest. */ + class ClassifyTextRequest implements IClassifyTextRequest { + + /** + * Constructs a new ClassifyTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IClassifyTextRequest); + + /** ClassifyTextRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** ClassifyTextRequest classificationModelOptions. */ + public classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); + + /** + * Creates a new ClassifyTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassifyTextRequest instance + */ + public static create(properties?: google.cloud.language.v1.IClassifyTextRequest): google.cloud.language.v1.ClassifyTextRequest; + + /** + * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1.ClassifyTextRequest.verify|verify} messages. + * @param message ClassifyTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IClassifyTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassifyTextRequest.verify|verify} messages. + * @param message ClassifyTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IClassifyTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassifyTextRequest; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassifyTextRequest; + + /** + * Verifies a ClassifyTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassifyTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassifyTextRequest; + + /** + * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. + * @param message ClassifyTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassifyTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassifyTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassifyTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassifyTextResponse. */ + interface IClassifyTextResponse { + + /** ClassifyTextResponse categories */ + categories?: (google.cloud.language.v1.IClassificationCategory[]|null); + } + + /** Represents a ClassifyTextResponse. */ + class ClassifyTextResponse implements IClassifyTextResponse { + + /** + * Constructs a new ClassifyTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IClassifyTextResponse); + + /** ClassifyTextResponse categories. */ + public categories: google.cloud.language.v1.IClassificationCategory[]; + + /** + * Creates a new ClassifyTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassifyTextResponse instance + */ + public static create(properties?: google.cloud.language.v1.IClassifyTextResponse): google.cloud.language.v1.ClassifyTextResponse; + + /** + * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1.ClassifyTextResponse.verify|verify} messages. + * @param message ClassifyTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IClassifyTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassifyTextResponse.verify|verify} messages. + * @param message ClassifyTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IClassifyTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.ClassifyTextResponse; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.ClassifyTextResponse; + + /** + * Verifies a ClassifyTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassifyTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.ClassifyTextResponse; + + /** + * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. + * @param message ClassifyTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.ClassifyTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassifyTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassifyTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateTextRequest. */ + interface IAnnotateTextRequest { + + /** AnnotateTextRequest document */ + document?: (google.cloud.language.v1.IDocument|null); + + /** AnnotateTextRequest features */ + features?: (google.cloud.language.v1.AnnotateTextRequest.IFeatures|null); + + /** AnnotateTextRequest encodingType */ + encodingType?: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType|null); + } + + /** Represents an AnnotateTextRequest. */ + class AnnotateTextRequest implements IAnnotateTextRequest { + + /** + * Constructs a new AnnotateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnnotateTextRequest); + + /** AnnotateTextRequest document. */ + public document?: (google.cloud.language.v1.IDocument|null); + + /** AnnotateTextRequest features. */ + public features?: (google.cloud.language.v1.AnnotateTextRequest.IFeatures|null); + + /** AnnotateTextRequest encodingType. */ + public encodingType: (google.cloud.language.v1.EncodingType|keyof typeof google.cloud.language.v1.EncodingType); + + /** + * Creates a new AnnotateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateTextRequest instance + */ + public static create(properties?: google.cloud.language.v1.IAnnotateTextRequest): google.cloud.language.v1.AnnotateTextRequest; + + /** + * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * @param message AnnotateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnnotateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * @param message AnnotateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnnotateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnnotateTextRequest; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnnotateTextRequest; + + /** + * Verifies an AnnotateTextRequest message. + * @param message Plain 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 AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnnotateTextRequest; + + /** + * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. + * @param message AnnotateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnnotateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnnotateTextRequest { + + /** Properties of a Features. */ + interface IFeatures { + + /** Features extractSyntax */ + extractSyntax?: (boolean|null); + + /** Features extractEntities */ + extractEntities?: (boolean|null); + + /** Features extractDocumentSentiment */ + extractDocumentSentiment?: (boolean|null); + + /** Features extractEntitySentiment */ + extractEntitySentiment?: (boolean|null); + + /** Features classifyText */ + classifyText?: (boolean|null); + + /** Features classificationModelOptions */ + classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); + } + + /** Represents a Features. */ + class Features implements IFeatures { + + /** + * Constructs a new Features. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.AnnotateTextRequest.IFeatures); + + /** Features extractSyntax. */ + public extractSyntax: boolean; + + /** Features extractEntities. */ + public extractEntities: boolean; + + /** Features extractDocumentSentiment. */ + public extractDocumentSentiment: boolean; + + /** Features extractEntitySentiment. */ + public extractEntitySentiment: boolean; + + /** Features classifyText. */ + public classifyText: boolean; + + /** Features classificationModelOptions. */ + public classificationModelOptions?: (google.cloud.language.v1.IClassificationModelOptions|null); + + /** + * Creates a new Features instance using the specified properties. + * @param [properties] Properties to set + * @returns Features instance + */ + public static create(properties?: google.cloud.language.v1.AnnotateTextRequest.IFeatures): google.cloud.language.v1.AnnotateTextRequest.Features; + + /** + * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @param message Features message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.AnnotateTextRequest.IFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @param message Features message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.AnnotateTextRequest.IFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Features message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnnotateTextRequest.Features; + + /** + * Decodes a Features message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnnotateTextRequest.Features; + + /** + * Verifies a Features message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Features message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Features + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnnotateTextRequest.Features; + + /** + * Creates a plain object from a Features message. Also converts values to other types if specified. + * @param message Features + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnnotateTextRequest.Features, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Features to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Features + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnnotateTextResponse. */ + interface IAnnotateTextResponse { + + /** AnnotateTextResponse sentences */ + sentences?: (google.cloud.language.v1.ISentence[]|null); + + /** AnnotateTextResponse tokens */ + tokens?: (google.cloud.language.v1.IToken[]|null); + + /** AnnotateTextResponse entities */ + entities?: (google.cloud.language.v1.IEntity[]|null); + + /** AnnotateTextResponse documentSentiment */ + documentSentiment?: (google.cloud.language.v1.ISentiment|null); + + /** AnnotateTextResponse language */ + language?: (string|null); + + /** AnnotateTextResponse categories */ + categories?: (google.cloud.language.v1.IClassificationCategory[]|null); + } + + /** Represents an AnnotateTextResponse. */ + class AnnotateTextResponse implements IAnnotateTextResponse { + + /** + * Constructs a new AnnotateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1.IAnnotateTextResponse); + + /** AnnotateTextResponse sentences. */ + public sentences: google.cloud.language.v1.ISentence[]; + + /** AnnotateTextResponse tokens. */ + public tokens: google.cloud.language.v1.IToken[]; + + /** AnnotateTextResponse entities. */ + public entities: google.cloud.language.v1.IEntity[]; + + /** AnnotateTextResponse documentSentiment. */ + public documentSentiment?: (google.cloud.language.v1.ISentiment|null); + + /** AnnotateTextResponse language. */ + public language: string; + + /** AnnotateTextResponse categories. */ + public categories: google.cloud.language.v1.IClassificationCategory[]; + + /** + * Creates a new AnnotateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateTextResponse instance + */ + public static create(properties?: google.cloud.language.v1.IAnnotateTextResponse): google.cloud.language.v1.AnnotateTextResponse; + + /** + * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * @param message AnnotateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1.IAnnotateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * @param message AnnotateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1.IAnnotateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1.AnnotateTextResponse; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1.AnnotateTextResponse; + + /** + * Verifies an AnnotateTextResponse message. + * @param message Plain 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 AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1.AnnotateTextResponse; + + /** + * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. + * @param message AnnotateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1.AnnotateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta2. */ + namespace v1beta2 { + + /** Represents a LanguageService */ + class LanguageService extends $protobuf.rpc.Service { + + /** + * Constructs a new LanguageService 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 LanguageService 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): LanguageService; + + /** + * Calls AnalyzeSentiment. + * @param request AnalyzeSentimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse + */ + public analyzeSentiment(request: google.cloud.language.v1beta2.IAnalyzeSentimentRequest, callback: google.cloud.language.v1beta2.LanguageService.AnalyzeSentimentCallback): void; + + /** + * Calls AnalyzeSentiment. + * @param request AnalyzeSentimentRequest message or plain object + * @returns Promise + */ + public analyzeSentiment(request: google.cloud.language.v1beta2.IAnalyzeSentimentRequest): Promise; + + /** + * Calls AnalyzeEntities. + * @param request AnalyzeEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse + */ + public analyzeEntities(request: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, callback: google.cloud.language.v1beta2.LanguageService.AnalyzeEntitiesCallback): void; + + /** + * Calls AnalyzeEntities. + * @param request AnalyzeEntitiesRequest message or plain object + * @returns Promise + */ + public analyzeEntities(request: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest): Promise; + + /** + * Calls AnalyzeEntitySentiment. + * @param request AnalyzeEntitySentimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse + */ + public analyzeEntitySentiment(request: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, callback: google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentimentCallback): void; + + /** + * Calls AnalyzeEntitySentiment. + * @param request AnalyzeEntitySentimentRequest message or plain object + * @returns Promise + */ + public analyzeEntitySentiment(request: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest): Promise; + + /** + * Calls AnalyzeSyntax. + * @param request AnalyzeSyntaxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse + */ + public analyzeSyntax(request: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, callback: google.cloud.language.v1beta2.LanguageService.AnalyzeSyntaxCallback): void; + + /** + * Calls AnalyzeSyntax. + * @param request AnalyzeSyntaxRequest message or plain object + * @returns Promise + */ + public analyzeSyntax(request: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest): Promise; + + /** + * Calls ClassifyText. + * @param request ClassifyTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClassifyTextResponse + */ + public classifyText(request: google.cloud.language.v1beta2.IClassifyTextRequest, callback: google.cloud.language.v1beta2.LanguageService.ClassifyTextCallback): void; + + /** + * Calls ClassifyText. + * @param request ClassifyTextRequest message or plain object + * @returns Promise + */ + public classifyText(request: google.cloud.language.v1beta2.IClassifyTextRequest): Promise; + + /** + * Calls AnnotateText. + * @param request AnnotateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotateTextResponse + */ + public annotateText(request: google.cloud.language.v1beta2.IAnnotateTextRequest, callback: google.cloud.language.v1beta2.LanguageService.AnnotateTextCallback): void; + + /** + * Calls AnnotateText. + * @param request AnnotateTextRequest message or plain object + * @returns Promise + */ + public annotateText(request: google.cloud.language.v1beta2.IAnnotateTextRequest): Promise; + } + + namespace LanguageService { + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSentiment}. + * @param error Error, if any + * @param [response] AnalyzeSentimentResponse + */ + type AnalyzeSentimentCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.AnalyzeSentimentResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntities}. + * @param error Error, if any + * @param [response] AnalyzeEntitiesResponse + */ + type AnalyzeEntitiesCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.AnalyzeEntitiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntitySentiment}. + * @param error Error, if any + * @param [response] AnalyzeEntitySentimentResponse + */ + type AnalyzeEntitySentimentCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSyntax}. + * @param error Error, if any + * @param [response] AnalyzeSyntaxResponse + */ + type AnalyzeSyntaxCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.AnalyzeSyntaxResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|classifyText}. + * @param error Error, if any + * @param [response] ClassifyTextResponse + */ + type ClassifyTextCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.ClassifyTextResponse) => void; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|annotateText}. + * @param error Error, if any + * @param [response] AnnotateTextResponse + */ + type AnnotateTextCallback = (error: (Error|null), response?: google.cloud.language.v1beta2.AnnotateTextResponse) => void; + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document type */ + type?: (google.cloud.language.v1beta2.Document.Type|keyof typeof google.cloud.language.v1beta2.Document.Type|null); + + /** Document content */ + content?: (string|null); + + /** Document gcsContentUri */ + gcsContentUri?: (string|null); + + /** Document language */ + language?: (string|null); + + /** Document referenceWebUri */ + referenceWebUri?: (string|null); + + /** Document boilerplateHandling */ + boilerplateHandling?: (google.cloud.language.v1beta2.Document.BoilerplateHandling|keyof typeof google.cloud.language.v1beta2.Document.BoilerplateHandling|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IDocument); + + /** Document type. */ + public type: (google.cloud.language.v1beta2.Document.Type|keyof typeof google.cloud.language.v1beta2.Document.Type); + + /** Document content. */ + public content?: (string|null); + + /** Document gcsContentUri. */ + public gcsContentUri?: (string|null); + + /** Document language. */ + public language: string; + + /** Document referenceWebUri. */ + public referenceWebUri: string; + + /** Document boilerplateHandling. */ + public boilerplateHandling: (google.cloud.language.v1beta2.Document.BoilerplateHandling|keyof typeof google.cloud.language.v1beta2.Document.BoilerplateHandling); + + /** Document source. */ + public source?: ("content"|"gcsContentUri"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.language.v1beta2.IDocument): google.cloud.language.v1beta2.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PLAIN_TEXT = 1, + HTML = 2 + } + + /** BoilerplateHandling enum. */ + enum BoilerplateHandling { + BOILERPLATE_HANDLING_UNSPECIFIED = 0, + SKIP_BOILERPLATE = 1, + KEEP_BOILERPLATE = 2 + } + } + + /** Properties of a Sentence. */ + interface ISentence { + + /** Sentence text */ + text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** Sentence sentiment */ + sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + } + + /** Represents a Sentence. */ + class Sentence implements ISentence { + + /** + * Constructs a new Sentence. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.ISentence); + + /** Sentence text. */ + public text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** Sentence sentiment. */ + public sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** + * Creates a new Sentence instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentence instance + */ + public static create(properties?: google.cloud.language.v1beta2.ISentence): google.cloud.language.v1beta2.Sentence; + + /** + * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. + * @param message Sentence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.ISentence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. + * @param message Sentence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.ISentence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sentence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.Sentence; + + /** + * Decodes a Sentence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.Sentence; + + /** + * Verifies a Sentence message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sentence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentence + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.Sentence; + + /** + * Creates a plain object from a Sentence message. Also converts values to other types if specified. + * @param message Sentence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.Sentence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sentence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sentence + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EncodingType enum. */ + enum EncodingType { + NONE = 0, + UTF8 = 1, + UTF16 = 2, + UTF32 = 3 + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity name */ + name?: (string|null); + + /** Entity type */ + type?: (google.cloud.language.v1beta2.Entity.Type|keyof typeof google.cloud.language.v1beta2.Entity.Type|null); + + /** Entity metadata */ + metadata?: ({ [k: string]: string }|null); + + /** Entity salience */ + salience?: (number|null); + + /** Entity mentions */ + mentions?: (google.cloud.language.v1beta2.IEntityMention[]|null); + + /** Entity sentiment */ + sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IEntity); + + /** Entity name. */ + public name: string; + + /** Entity type. */ + public type: (google.cloud.language.v1beta2.Entity.Type|keyof typeof google.cloud.language.v1beta2.Entity.Type); + + /** Entity metadata. */ + public metadata: { [k: string]: string }; + + /** Entity salience. */ + public salience: number; + + /** Entity mentions. */ + public mentions: google.cloud.language.v1beta2.IEntityMention[]; + + /** Entity sentiment. */ + public sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.language.v1beta2.IEntity): google.cloud.language.v1beta2.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entity { + + /** Type enum. */ + enum Type { + UNKNOWN = 0, + PERSON = 1, + LOCATION = 2, + ORGANIZATION = 3, + EVENT = 4, + WORK_OF_ART = 5, + CONSUMER_GOOD = 6, + OTHER = 7, + PHONE_NUMBER = 9, + ADDRESS = 10, + DATE = 11, + NUMBER = 12, + PRICE = 13 + } + } + + /** Properties of a Token. */ + interface IToken { + + /** Token text */ + text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** Token partOfSpeech */ + partOfSpeech?: (google.cloud.language.v1beta2.IPartOfSpeech|null); + + /** Token dependencyEdge */ + dependencyEdge?: (google.cloud.language.v1beta2.IDependencyEdge|null); + + /** Token lemma */ + lemma?: (string|null); + } + + /** Represents a Token. */ + class Token implements IToken { + + /** + * Constructs a new Token. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IToken); + + /** Token text. */ + public text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** Token partOfSpeech. */ + public partOfSpeech?: (google.cloud.language.v1beta2.IPartOfSpeech|null); + + /** Token dependencyEdge. */ + public dependencyEdge?: (google.cloud.language.v1beta2.IDependencyEdge|null); + + /** Token lemma. */ + public lemma: string; + + /** + * Creates a new Token instance using the specified properties. + * @param [properties] Properties to set + * @returns Token instance + */ + public static create(properties?: google.cloud.language.v1beta2.IToken): google.cloud.language.v1beta2.Token; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * @param message Token message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Token message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.Token; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.Token; + + /** + * Verifies a Token message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Token message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Token + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.Token; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @param message Token + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.Token, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Token to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Token + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Sentiment. */ + interface ISentiment { + + /** Sentiment magnitude */ + magnitude?: (number|null); + + /** Sentiment score */ + score?: (number|null); + } + + /** Represents a Sentiment. */ + class Sentiment implements ISentiment { + + /** + * Constructs a new Sentiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.ISentiment); + + /** Sentiment magnitude. */ + public magnitude: number; + + /** Sentiment score. */ + public score: number; + + /** + * Creates a new Sentiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentiment instance + */ + public static create(properties?: google.cloud.language.v1beta2.ISentiment): google.cloud.language.v1beta2.Sentiment; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.Sentiment; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.Sentiment; + + /** + * Verifies a Sentiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.Sentiment; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @param message Sentiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sentiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sentiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartOfSpeech. */ + interface IPartOfSpeech { + + /** PartOfSpeech tag */ + tag?: (google.cloud.language.v1beta2.PartOfSpeech.Tag|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Tag|null); + + /** PartOfSpeech aspect */ + aspect?: (google.cloud.language.v1beta2.PartOfSpeech.Aspect|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Aspect|null); + + /** PartOfSpeech case */ + "case"?: (google.cloud.language.v1beta2.PartOfSpeech.Case|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Case|null); + + /** PartOfSpeech form */ + form?: (google.cloud.language.v1beta2.PartOfSpeech.Form|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Form|null); + + /** PartOfSpeech gender */ + gender?: (google.cloud.language.v1beta2.PartOfSpeech.Gender|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Gender|null); + + /** PartOfSpeech mood */ + mood?: (google.cloud.language.v1beta2.PartOfSpeech.Mood|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Mood|null); + + /** PartOfSpeech number */ + number?: (google.cloud.language.v1beta2.PartOfSpeech.Number|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Number|null); + + /** PartOfSpeech person */ + person?: (google.cloud.language.v1beta2.PartOfSpeech.Person|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Person|null); + + /** PartOfSpeech proper */ + proper?: (google.cloud.language.v1beta2.PartOfSpeech.Proper|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Proper|null); + + /** PartOfSpeech reciprocity */ + reciprocity?: (google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|null); + + /** PartOfSpeech tense */ + tense?: (google.cloud.language.v1beta2.PartOfSpeech.Tense|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Tense|null); + + /** PartOfSpeech voice */ + voice?: (google.cloud.language.v1beta2.PartOfSpeech.Voice|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Voice|null); + } + + /** Represents a PartOfSpeech. */ + class PartOfSpeech implements IPartOfSpeech { + + /** + * Constructs a new PartOfSpeech. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IPartOfSpeech); + + /** PartOfSpeech tag. */ + public tag: (google.cloud.language.v1beta2.PartOfSpeech.Tag|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Tag); + + /** PartOfSpeech aspect. */ + public aspect: (google.cloud.language.v1beta2.PartOfSpeech.Aspect|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Aspect); + + /** PartOfSpeech case. */ + public case: (google.cloud.language.v1beta2.PartOfSpeech.Case|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Case); + + /** PartOfSpeech form. */ + public form: (google.cloud.language.v1beta2.PartOfSpeech.Form|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Form); + + /** PartOfSpeech gender. */ + public gender: (google.cloud.language.v1beta2.PartOfSpeech.Gender|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Gender); + + /** PartOfSpeech mood. */ + public mood: (google.cloud.language.v1beta2.PartOfSpeech.Mood|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Mood); + + /** PartOfSpeech number. */ + public number: (google.cloud.language.v1beta2.PartOfSpeech.Number|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Number); + + /** PartOfSpeech person. */ + public person: (google.cloud.language.v1beta2.PartOfSpeech.Person|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Person); + + /** PartOfSpeech proper. */ + public proper: (google.cloud.language.v1beta2.PartOfSpeech.Proper|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Proper); + + /** PartOfSpeech reciprocity. */ + public reciprocity: (google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Reciprocity); + + /** PartOfSpeech tense. */ + public tense: (google.cloud.language.v1beta2.PartOfSpeech.Tense|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Tense); + + /** PartOfSpeech voice. */ + public voice: (google.cloud.language.v1beta2.PartOfSpeech.Voice|keyof typeof google.cloud.language.v1beta2.PartOfSpeech.Voice); + + /** + * Creates a new PartOfSpeech instance using the specified properties. + * @param [properties] Properties to set + * @returns PartOfSpeech instance + */ + public static create(properties?: google.cloud.language.v1beta2.IPartOfSpeech): google.cloud.language.v1beta2.PartOfSpeech; + + /** + * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @param message PartOfSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IPartOfSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @param message PartOfSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IPartOfSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.PartOfSpeech; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.PartOfSpeech; + + /** + * Verifies a PartOfSpeech message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartOfSpeech + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.PartOfSpeech; + + /** + * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. + * @param message PartOfSpeech + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.PartOfSpeech, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartOfSpeech to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartOfSpeech + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartOfSpeech { + + /** Tag enum. */ + enum Tag { + UNKNOWN = 0, + ADJ = 1, + ADP = 2, + ADV = 3, + CONJ = 4, + DET = 5, + NOUN = 6, + NUM = 7, + PRON = 8, + PRT = 9, + PUNCT = 10, + VERB = 11, + X = 12, + AFFIX = 13 + } + + /** Aspect enum. */ + enum Aspect { + ASPECT_UNKNOWN = 0, + PERFECTIVE = 1, + IMPERFECTIVE = 2, + PROGRESSIVE = 3 + } + + /** Case enum. */ + enum Case { + CASE_UNKNOWN = 0, + ACCUSATIVE = 1, + ADVERBIAL = 2, + COMPLEMENTIVE = 3, + DATIVE = 4, + GENITIVE = 5, + INSTRUMENTAL = 6, + LOCATIVE = 7, + NOMINATIVE = 8, + OBLIQUE = 9, + PARTITIVE = 10, + PREPOSITIONAL = 11, + REFLEXIVE_CASE = 12, + RELATIVE_CASE = 13, + VOCATIVE = 14 + } + + /** Form enum. */ + enum Form { + FORM_UNKNOWN = 0, + ADNOMIAL = 1, + AUXILIARY = 2, + COMPLEMENTIZER = 3, + FINAL_ENDING = 4, + GERUND = 5, + REALIS = 6, + IRREALIS = 7, + SHORT = 8, + LONG = 9, + ORDER = 10, + SPECIFIC = 11 + } + + /** Gender enum. */ + enum Gender { + GENDER_UNKNOWN = 0, + FEMININE = 1, + MASCULINE = 2, + NEUTER = 3 + } + + /** Mood enum. */ + enum Mood { + MOOD_UNKNOWN = 0, + CONDITIONAL_MOOD = 1, + IMPERATIVE = 2, + INDICATIVE = 3, + INTERROGATIVE = 4, + JUSSIVE = 5, + SUBJUNCTIVE = 6 + } + + /** Number enum. */ + enum Number { + NUMBER_UNKNOWN = 0, + SINGULAR = 1, + PLURAL = 2, + DUAL = 3 + } + + /** Person enum. */ + enum Person { + PERSON_UNKNOWN = 0, + FIRST = 1, + SECOND = 2, + THIRD = 3, + REFLEXIVE_PERSON = 4 + } + + /** Proper enum. */ + enum Proper { + PROPER_UNKNOWN = 0, + PROPER = 1, + NOT_PROPER = 2 + } + + /** Reciprocity enum. */ + enum Reciprocity { + RECIPROCITY_UNKNOWN = 0, + RECIPROCAL = 1, + NON_RECIPROCAL = 2 + } + + /** Tense enum. */ + enum Tense { + TENSE_UNKNOWN = 0, + CONDITIONAL_TENSE = 1, + FUTURE = 2, + PAST = 3, + PRESENT = 4, + IMPERFECT = 5, + PLUPERFECT = 6 + } + + /** Voice enum. */ + enum Voice { + VOICE_UNKNOWN = 0, + ACTIVE = 1, + CAUSATIVE = 2, + PASSIVE = 3 + } + } + + /** Properties of a DependencyEdge. */ + interface IDependencyEdge { + + /** DependencyEdge headTokenIndex */ + headTokenIndex?: (number|null); + + /** DependencyEdge label */ + label?: (google.cloud.language.v1beta2.DependencyEdge.Label|keyof typeof google.cloud.language.v1beta2.DependencyEdge.Label|null); + } + + /** Represents a DependencyEdge. */ + class DependencyEdge implements IDependencyEdge { + + /** + * Constructs a new DependencyEdge. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IDependencyEdge); + + /** DependencyEdge headTokenIndex. */ + public headTokenIndex: number; + + /** DependencyEdge label. */ + public label: (google.cloud.language.v1beta2.DependencyEdge.Label|keyof typeof google.cloud.language.v1beta2.DependencyEdge.Label); + + /** + * Creates a new DependencyEdge instance using the specified properties. + * @param [properties] Properties to set + * @returns DependencyEdge instance + */ + public static create(properties?: google.cloud.language.v1beta2.IDependencyEdge): google.cloud.language.v1beta2.DependencyEdge; + + /** + * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @param message DependencyEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IDependencyEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @param message DependencyEdge message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IDependencyEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.DependencyEdge; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.DependencyEdge; + + /** + * Verifies a DependencyEdge message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DependencyEdge + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.DependencyEdge; + + /** + * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * @param message DependencyEdge + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.DependencyEdge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DependencyEdge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DependencyEdge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DependencyEdge { + + /** Label enum. */ + enum Label { + UNKNOWN = 0, + ABBREV = 1, + ACOMP = 2, + ADVCL = 3, + ADVMOD = 4, + AMOD = 5, + APPOS = 6, + ATTR = 7, + AUX = 8, + AUXPASS = 9, + CC = 10, + CCOMP = 11, + CONJ = 12, + CSUBJ = 13, + CSUBJPASS = 14, + DEP = 15, + DET = 16, + DISCOURSE = 17, + DOBJ = 18, + EXPL = 19, + GOESWITH = 20, + IOBJ = 21, + MARK = 22, + MWE = 23, + MWV = 24, + NEG = 25, + NN = 26, + NPADVMOD = 27, + NSUBJ = 28, + NSUBJPASS = 29, + NUM = 30, + NUMBER = 31, + P = 32, + PARATAXIS = 33, + PARTMOD = 34, + PCOMP = 35, + POBJ = 36, + POSS = 37, + POSTNEG = 38, + PRECOMP = 39, + PRECONJ = 40, + PREDET = 41, + PREF = 42, + PREP = 43, + PRONL = 44, + PRT = 45, + PS = 46, + QUANTMOD = 47, + RCMOD = 48, + RCMODREL = 49, + RDROP = 50, + REF = 51, + REMNANT = 52, + REPARANDUM = 53, + ROOT = 54, + SNUM = 55, + SUFF = 56, + TMOD = 57, + TOPIC = 58, + VMOD = 59, + VOCATIVE = 60, + XCOMP = 61, + SUFFIX = 62, + TITLE = 63, + ADVPHMOD = 64, + AUXCAUS = 65, + AUXVV = 66, + DTMOD = 67, + FOREIGN = 68, + KW = 69, + LIST = 70, + NOMC = 71, + NOMCSUBJ = 72, + NOMCSUBJPASS = 73, + NUMC = 74, + COP = 75, + DISLOCATED = 76, + ASP = 77, + GMOD = 78, + GOBJ = 79, + INFMOD = 80, + MES = 81, + NCOMP = 82 + } + } + + /** Properties of an EntityMention. */ + interface IEntityMention { + + /** EntityMention text */ + text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** EntityMention type */ + type?: (google.cloud.language.v1beta2.EntityMention.Type|keyof typeof google.cloud.language.v1beta2.EntityMention.Type|null); + + /** EntityMention sentiment */ + sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + } + + /** Represents an EntityMention. */ + class EntityMention implements IEntityMention { + + /** + * Constructs a new EntityMention. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IEntityMention); + + /** EntityMention text. */ + public text?: (google.cloud.language.v1beta2.ITextSpan|null); + + /** EntityMention type. */ + public type: (google.cloud.language.v1beta2.EntityMention.Type|keyof typeof google.cloud.language.v1beta2.EntityMention.Type); + + /** EntityMention sentiment. */ + public sentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** + * Creates a new EntityMention instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityMention instance + */ + public static create(properties?: google.cloud.language.v1beta2.IEntityMention): google.cloud.language.v1beta2.EntityMention; + + /** + * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @param message EntityMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IEntityMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @param message EntityMention message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IEntityMention, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityMention message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.EntityMention; + + /** + * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.EntityMention; + + /** + * Verifies an EntityMention message. + * @param message Plain 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 EntityMention message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityMention + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.EntityMention; + + /** + * Creates a plain object from an EntityMention message. Also converts values to other types if specified. + * @param message EntityMention + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.EntityMention, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityMention to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityMention + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityMention { + + /** Type enum. */ + enum Type { + TYPE_UNKNOWN = 0, + PROPER = 1, + COMMON = 2 + } + } + + /** Properties of a TextSpan. */ + interface ITextSpan { + + /** TextSpan content */ + content?: (string|null); + + /** TextSpan beginOffset */ + beginOffset?: (number|null); + } + + /** Represents a TextSpan. */ + class TextSpan implements ITextSpan { + + /** + * Constructs a new TextSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.ITextSpan); + + /** TextSpan content. */ + public content: string; + + /** TextSpan beginOffset. */ + public beginOffset: number; + + /** + * Creates a new TextSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSpan instance + */ + public static create(properties?: google.cloud.language.v1beta2.ITextSpan): google.cloud.language.v1beta2.TextSpan; + + /** + * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @param message TextSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.ITextSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @param message TextSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.ITextSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.TextSpan; + + /** + * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.TextSpan; + + /** + * Verifies a TextSpan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSpan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.TextSpan; + + /** + * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * @param message TextSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.TextSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationCategory. */ + interface IClassificationCategory { + + /** ClassificationCategory name */ + name?: (string|null); + + /** ClassificationCategory confidence */ + confidence?: (number|null); + } + + /** Represents a ClassificationCategory. */ + class ClassificationCategory implements IClassificationCategory { + + /** + * Constructs a new ClassificationCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IClassificationCategory); + + /** ClassificationCategory name. */ + public name: string; + + /** ClassificationCategory confidence. */ + public confidence: number; + + /** + * Creates a new ClassificationCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationCategory instance + */ + public static create(properties?: google.cloud.language.v1beta2.IClassificationCategory): google.cloud.language.v1beta2.ClassificationCategory; + + /** + * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. + * @param message ClassificationCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IClassificationCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. + * @param message ClassificationCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IClassificationCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassificationCategory; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassificationCategory; + + /** + * Verifies a ClassificationCategory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassificationCategory; + + /** + * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. + * @param message ClassificationCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassificationCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationModelOptions. */ + interface IClassificationModelOptions { + + /** ClassificationModelOptions v1Model */ + v1Model?: (google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null); + + /** ClassificationModelOptions v2Model */ + v2Model?: (google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null); + } + + /** Represents a ClassificationModelOptions. */ + class ClassificationModelOptions implements IClassificationModelOptions { + + /** + * Constructs a new ClassificationModelOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IClassificationModelOptions); + + /** ClassificationModelOptions v1Model. */ + public v1Model?: (google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null); + + /** ClassificationModelOptions v2Model. */ + public v2Model?: (google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null); + + /** ClassificationModelOptions modelType. */ + public modelType?: ("v1Model"|"v2Model"); + + /** + * Creates a new ClassificationModelOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationModelOptions instance + */ + public static create(properties?: google.cloud.language.v1beta2.IClassificationModelOptions): google.cloud.language.v1beta2.ClassificationModelOptions; + + /** + * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * @param message ClassificationModelOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IClassificationModelOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * @param message ClassificationModelOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IClassificationModelOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassificationModelOptions; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassificationModelOptions; + + /** + * Verifies a ClassificationModelOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationModelOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassificationModelOptions; + + /** + * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. + * @param message ClassificationModelOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassificationModelOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationModelOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationModelOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationModelOptions { + + /** Properties of a V1Model. */ + interface IV1Model { + } + + /** Represents a V1Model. */ + class V1Model implements IV1Model { + + /** + * Constructs a new V1Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model); + + /** + * Creates a new V1Model instance using the specified properties. + * @param [properties] Properties to set + * @returns V1Model instance + */ + public static create(properties?: google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model): google.cloud.language.v1beta2.ClassificationModelOptions.V1Model; + + /** + * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @param message V1Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @param message V1Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a V1Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassificationModelOptions.V1Model; + + /** + * Decodes a V1Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassificationModelOptions.V1Model; + + /** + * Verifies a V1Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a V1Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns V1Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassificationModelOptions.V1Model; + + /** + * Creates a plain object from a V1Model message. Also converts values to other types if specified. + * @param message V1Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this V1Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for V1Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a V2Model. */ + interface IV2Model { + + /** V2Model contentCategoriesVersion */ + contentCategoriesVersion?: (google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|keyof typeof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null); + } + + /** Represents a V2Model. */ + class V2Model implements IV2Model { + + /** + * Constructs a new V2Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model); + + /** V2Model contentCategoriesVersion. */ + public contentCategoriesVersion: (google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|keyof typeof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion); + + /** + * Creates a new V2Model instance using the specified properties. + * @param [properties] Properties to set + * @returns V2Model instance + */ + public static create(properties?: google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model): google.cloud.language.v1beta2.ClassificationModelOptions.V2Model; + + /** + * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @param message V2Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @param message V2Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a V2Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassificationModelOptions.V2Model; + + /** + * Decodes a V2Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassificationModelOptions.V2Model; + + /** + * Verifies a V2Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a V2Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns V2Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassificationModelOptions.V2Model; + + /** + * Creates a plain object from a V2Model message. Also converts values to other types if specified. + * @param message V2Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this V2Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for V2Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace V2Model { + + /** ContentCategoriesVersion enum. */ + enum ContentCategoriesVersion { + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0, + V1 = 1, + V2 = 2 + } + } + } + + /** Properties of an AnalyzeSentimentRequest. */ + interface IAnalyzeSentimentRequest { + + /** AnalyzeSentimentRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeSentimentRequest encodingType */ + encodingType?: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType|null); + } + + /** Represents an AnalyzeSentimentRequest. */ + class AnalyzeSentimentRequest implements IAnalyzeSentimentRequest { + + /** + * Constructs a new AnalyzeSentimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeSentimentRequest); + + /** AnalyzeSentimentRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeSentimentRequest encodingType. */ + public encodingType: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType); + + /** + * Creates a new AnalyzeSentimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSentimentRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeSentimentRequest): google.cloud.language.v1beta2.AnalyzeSentimentRequest; + + /** + * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * @param message AnalyzeSentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeSentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * @param message AnalyzeSentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeSentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeSentimentRequest; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeSentimentRequest; + + /** + * Verifies an AnalyzeSentimentRequest message. + * @param message Plain 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 AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSentimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeSentimentRequest; + + /** + * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. + * @param message AnalyzeSentimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeSentimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSentimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSentimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSentimentResponse. */ + interface IAnalyzeSentimentResponse { + + /** AnalyzeSentimentResponse documentSentiment */ + documentSentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** AnalyzeSentimentResponse language */ + language?: (string|null); + + /** AnalyzeSentimentResponse sentences */ + sentences?: (google.cloud.language.v1beta2.ISentence[]|null); + } + + /** Represents an AnalyzeSentimentResponse. */ + class AnalyzeSentimentResponse implements IAnalyzeSentimentResponse { + + /** + * Constructs a new AnalyzeSentimentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeSentimentResponse); + + /** AnalyzeSentimentResponse documentSentiment. */ + public documentSentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** AnalyzeSentimentResponse language. */ + public language: string; + + /** AnalyzeSentimentResponse sentences. */ + public sentences: google.cloud.language.v1beta2.ISentence[]; + + /** + * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSentimentResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeSentimentResponse): google.cloud.language.v1beta2.AnalyzeSentimentResponse; + + /** + * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @param message AnalyzeSentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeSentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @param message AnalyzeSentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeSentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeSentimentResponse; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeSentimentResponse; + + /** + * Verifies an AnalyzeSentimentResponse message. + * @param message Plain 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 AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSentimentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeSentimentResponse; + + /** + * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * @param message AnalyzeSentimentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeSentimentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSentimentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSentimentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitySentimentRequest. */ + interface IAnalyzeEntitySentimentRequest { + + /** AnalyzeEntitySentimentRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeEntitySentimentRequest encodingType */ + encodingType?: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType|null); + } + + /** Represents an AnalyzeEntitySentimentRequest. */ + class AnalyzeEntitySentimentRequest implements IAnalyzeEntitySentimentRequest { + + /** + * Constructs a new AnalyzeEntitySentimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest); + + /** AnalyzeEntitySentimentRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeEntitySentimentRequest encodingType. */ + public encodingType: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType); + + /** + * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitySentimentRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest): google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @param message AnalyzeEntitySentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @param message AnalyzeEntitySentimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; + + /** + * Verifies an AnalyzeEntitySentimentRequest message. + * @param message Plain 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 AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitySentimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest; + + /** + * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. + * @param message AnalyzeEntitySentimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitySentimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitySentimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitySentimentResponse. */ + interface IAnalyzeEntitySentimentResponse { + + /** AnalyzeEntitySentimentResponse entities */ + entities?: (google.cloud.language.v1beta2.IEntity[]|null); + + /** AnalyzeEntitySentimentResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeEntitySentimentResponse. */ + class AnalyzeEntitySentimentResponse implements IAnalyzeEntitySentimentResponse { + + /** + * Constructs a new AnalyzeEntitySentimentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse); + + /** AnalyzeEntitySentimentResponse entities. */ + public entities: google.cloud.language.v1beta2.IEntity[]; + + /** AnalyzeEntitySentimentResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitySentimentResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse): google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @param message AnalyzeEntitySentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @param message AnalyzeEntitySentimentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; + + /** + * Verifies an AnalyzeEntitySentimentResponse message. + * @param message Plain 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 AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitySentimentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse; + + /** + * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. + * @param message AnalyzeEntitySentimentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitySentimentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitySentimentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitiesRequest. */ + interface IAnalyzeEntitiesRequest { + + /** AnalyzeEntitiesRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeEntitiesRequest encodingType */ + encodingType?: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType|null); + } + + /** Represents an AnalyzeEntitiesRequest. */ + class AnalyzeEntitiesRequest implements IAnalyzeEntitiesRequest { + + /** + * Constructs a new AnalyzeEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest); + + /** AnalyzeEntitiesRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeEntitiesRequest encodingType. */ + public encodingType: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType); + + /** + * Creates a new AnalyzeEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitiesRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest): google.cloud.language.v1beta2.AnalyzeEntitiesRequest; + + /** + * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * @param message AnalyzeEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * @param message AnalyzeEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeEntitiesRequest; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeEntitiesRequest; + + /** + * Verifies an AnalyzeEntitiesRequest message. + * @param message Plain 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 AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeEntitiesRequest; + + /** + * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. + * @param message AnalyzeEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeEntitiesResponse. */ + interface IAnalyzeEntitiesResponse { + + /** AnalyzeEntitiesResponse entities */ + entities?: (google.cloud.language.v1beta2.IEntity[]|null); + + /** AnalyzeEntitiesResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeEntitiesResponse. */ + class AnalyzeEntitiesResponse implements IAnalyzeEntitiesResponse { + + /** + * Constructs a new AnalyzeEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeEntitiesResponse); + + /** AnalyzeEntitiesResponse entities. */ + public entities: google.cloud.language.v1beta2.IEntity[]; + + /** AnalyzeEntitiesResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeEntitiesResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeEntitiesResponse): google.cloud.language.v1beta2.AnalyzeEntitiesResponse; + + /** + * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * @param message AnalyzeEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * @param message AnalyzeEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeEntitiesResponse; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeEntitiesResponse; + + /** + * Verifies an AnalyzeEntitiesResponse message. + * @param message Plain 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 AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeEntitiesResponse; + + /** + * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. + * @param message AnalyzeEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeEntitiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSyntaxRequest. */ + interface IAnalyzeSyntaxRequest { + + /** AnalyzeSyntaxRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeSyntaxRequest encodingType */ + encodingType?: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType|null); + } + + /** Represents an AnalyzeSyntaxRequest. */ + class AnalyzeSyntaxRequest implements IAnalyzeSyntaxRequest { + + /** + * Constructs a new AnalyzeSyntaxRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest); + + /** AnalyzeSyntaxRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnalyzeSyntaxRequest encodingType. */ + public encodingType: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType); + + /** + * Creates a new AnalyzeSyntaxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSyntaxRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest): google.cloud.language.v1beta2.AnalyzeSyntaxRequest; + + /** + * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * @param message AnalyzeSyntaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * @param message AnalyzeSyntaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeSyntaxRequest; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeSyntaxRequest; + + /** + * Verifies an AnalyzeSyntaxRequest message. + * @param message Plain 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 AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSyntaxRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeSyntaxRequest; + + /** + * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. + * @param message AnalyzeSyntaxRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeSyntaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSyntaxRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSyntaxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeSyntaxResponse. */ + interface IAnalyzeSyntaxResponse { + + /** AnalyzeSyntaxResponse sentences */ + sentences?: (google.cloud.language.v1beta2.ISentence[]|null); + + /** AnalyzeSyntaxResponse tokens */ + tokens?: (google.cloud.language.v1beta2.IToken[]|null); + + /** AnalyzeSyntaxResponse language */ + language?: (string|null); + } + + /** Represents an AnalyzeSyntaxResponse. */ + class AnalyzeSyntaxResponse implements IAnalyzeSyntaxResponse { + + /** + * Constructs a new AnalyzeSyntaxResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnalyzeSyntaxResponse); + + /** AnalyzeSyntaxResponse sentences. */ + public sentences: google.cloud.language.v1beta2.ISentence[]; + + /** AnalyzeSyntaxResponse tokens. */ + public tokens: google.cloud.language.v1beta2.IToken[]; + + /** AnalyzeSyntaxResponse language. */ + public language: string; + + /** + * Creates a new AnalyzeSyntaxResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeSyntaxResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnalyzeSyntaxResponse): google.cloud.language.v1beta2.AnalyzeSyntaxResponse; + + /** + * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * @param message AnalyzeSyntaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * @param message AnalyzeSyntaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnalyzeSyntaxResponse; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnalyzeSyntaxResponse; + + /** + * Verifies an AnalyzeSyntaxResponse message. + * @param message Plain 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 AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeSyntaxResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnalyzeSyntaxResponse; + + /** + * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. + * @param message AnalyzeSyntaxResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnalyzeSyntaxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeSyntaxResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeSyntaxResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassifyTextRequest. */ + interface IClassifyTextRequest { + + /** ClassifyTextRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** ClassifyTextRequest classificationModelOptions */ + classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); + } + + /** Represents a ClassifyTextRequest. */ + class ClassifyTextRequest implements IClassifyTextRequest { + + /** + * Constructs a new ClassifyTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IClassifyTextRequest); + + /** ClassifyTextRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** ClassifyTextRequest classificationModelOptions. */ + public classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); + + /** + * Creates a new ClassifyTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassifyTextRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IClassifyTextRequest): google.cloud.language.v1beta2.ClassifyTextRequest; + + /** + * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * @param message ClassifyTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IClassifyTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * @param message ClassifyTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IClassifyTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassifyTextRequest; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassifyTextRequest; + + /** + * Verifies a ClassifyTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassifyTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassifyTextRequest; + + /** + * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. + * @param message ClassifyTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassifyTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassifyTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassifyTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassifyTextResponse. */ + interface IClassifyTextResponse { + + /** ClassifyTextResponse categories */ + categories?: (google.cloud.language.v1beta2.IClassificationCategory[]|null); + } + + /** Represents a ClassifyTextResponse. */ + class ClassifyTextResponse implements IClassifyTextResponse { + + /** + * Constructs a new ClassifyTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IClassifyTextResponse); + + /** ClassifyTextResponse categories. */ + public categories: google.cloud.language.v1beta2.IClassificationCategory[]; + + /** + * Creates a new ClassifyTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassifyTextResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IClassifyTextResponse): google.cloud.language.v1beta2.ClassifyTextResponse; + + /** + * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * @param message ClassifyTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IClassifyTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * @param message ClassifyTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IClassifyTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.ClassifyTextResponse; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.ClassifyTextResponse; + + /** + * Verifies a ClassifyTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassifyTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.ClassifyTextResponse; + + /** + * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. + * @param message ClassifyTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.ClassifyTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassifyTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassifyTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateTextRequest. */ + interface IAnnotateTextRequest { + + /** AnnotateTextRequest document */ + document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnnotateTextRequest features */ + features?: (google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures|null); + + /** AnnotateTextRequest encodingType */ + encodingType?: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType|null); + } + + /** Represents an AnnotateTextRequest. */ + class AnnotateTextRequest implements IAnnotateTextRequest { + + /** + * Constructs a new AnnotateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnnotateTextRequest); + + /** AnnotateTextRequest document. */ + public document?: (google.cloud.language.v1beta2.IDocument|null); + + /** AnnotateTextRequest features. */ + public features?: (google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures|null); + + /** AnnotateTextRequest encodingType. */ + public encodingType: (google.cloud.language.v1beta2.EncodingType|keyof typeof google.cloud.language.v1beta2.EncodingType); + + /** + * Creates a new AnnotateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateTextRequest instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnnotateTextRequest): google.cloud.language.v1beta2.AnnotateTextRequest; + + /** + * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.verify|verify} messages. + * @param message AnnotateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnnotateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.verify|verify} messages. + * @param message AnnotateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnnotateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnnotateTextRequest; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnnotateTextRequest; + + /** + * Verifies an AnnotateTextRequest message. + * @param message Plain 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 AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnnotateTextRequest; + + /** + * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. + * @param message AnnotateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnnotateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnnotateTextRequest { + + /** Properties of a Features. */ + interface IFeatures { + + /** Features extractSyntax */ + extractSyntax?: (boolean|null); + + /** Features extractEntities */ + extractEntities?: (boolean|null); + + /** Features extractDocumentSentiment */ + extractDocumentSentiment?: (boolean|null); + + /** Features extractEntitySentiment */ + extractEntitySentiment?: (boolean|null); + + /** Features classifyText */ + classifyText?: (boolean|null); + + /** Features classificationModelOptions */ + classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); + } + + /** Represents a Features. */ + class Features implements IFeatures { + + /** + * Constructs a new Features. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures); + + /** Features extractSyntax. */ + public extractSyntax: boolean; + + /** Features extractEntities. */ + public extractEntities: boolean; + + /** Features extractDocumentSentiment. */ + public extractDocumentSentiment: boolean; + + /** Features extractEntitySentiment. */ + public extractEntitySentiment: boolean; + + /** Features classifyText. */ + public classifyText: boolean; + + /** Features classificationModelOptions. */ + public classificationModelOptions?: (google.cloud.language.v1beta2.IClassificationModelOptions|null); + + /** + * Creates a new Features instance using the specified properties. + * @param [properties] Properties to set + * @returns Features instance + */ + public static create(properties?: google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures): google.cloud.language.v1beta2.AnnotateTextRequest.Features; + + /** + * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.Features.verify|verify} messages. + * @param message Features message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.Features.verify|verify} messages. + * @param message Features message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Features message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnnotateTextRequest.Features; + + /** + * Decodes a Features message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnnotateTextRequest.Features; + + /** + * Verifies a Features message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Features message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Features + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnnotateTextRequest.Features; + + /** + * Creates a plain object from a Features message. Also converts values to other types if specified. + * @param message Features + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnnotateTextRequest.Features, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Features to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Features + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnnotateTextResponse. */ + interface IAnnotateTextResponse { + + /** AnnotateTextResponse sentences */ + sentences?: (google.cloud.language.v1beta2.ISentence[]|null); + + /** AnnotateTextResponse tokens */ + tokens?: (google.cloud.language.v1beta2.IToken[]|null); + + /** AnnotateTextResponse entities */ + entities?: (google.cloud.language.v1beta2.IEntity[]|null); + + /** AnnotateTextResponse documentSentiment */ + documentSentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** AnnotateTextResponse language */ + language?: (string|null); + + /** AnnotateTextResponse categories */ + categories?: (google.cloud.language.v1beta2.IClassificationCategory[]|null); + } + + /** Represents an AnnotateTextResponse. */ + class AnnotateTextResponse implements IAnnotateTextResponse { + + /** + * Constructs a new AnnotateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.language.v1beta2.IAnnotateTextResponse); + + /** AnnotateTextResponse sentences. */ + public sentences: google.cloud.language.v1beta2.ISentence[]; + + /** AnnotateTextResponse tokens. */ + public tokens: google.cloud.language.v1beta2.IToken[]; + + /** AnnotateTextResponse entities. */ + public entities: google.cloud.language.v1beta2.IEntity[]; + + /** AnnotateTextResponse documentSentiment. */ + public documentSentiment?: (google.cloud.language.v1beta2.ISentiment|null); + + /** AnnotateTextResponse language. */ + public language: string; + + /** AnnotateTextResponse categories. */ + public categories: google.cloud.language.v1beta2.IClassificationCategory[]; + + /** + * Creates a new AnnotateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateTextResponse instance + */ + public static create(properties?: google.cloud.language.v1beta2.IAnnotateTextResponse): google.cloud.language.v1beta2.AnnotateTextResponse; + + /** + * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextResponse.verify|verify} messages. + * @param message AnnotateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.language.v1beta2.IAnnotateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextResponse.verify|verify} messages. + * @param message AnnotateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.language.v1beta2.IAnnotateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.language.v1beta2.AnnotateTextResponse; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.language.v1beta2.AnnotateTextResponse; + + /** + * Verifies an AnnotateTextResponse message. + * @param message Plain 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 AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.language.v1beta2.AnnotateTextResponse; + + /** + * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. + * @param message AnnotateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.language.v1beta2.AnnotateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 phpGenericServices. */ + public phpGenericServices: 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 + } + } + } + } +} diff --git a/packages/google-cloud-language/protos/protos.js b/packages/google-cloud-language/protos/protos.js new file mode 100644 index 000000000000..e50960bb002b --- /dev/null +++ b/packages/google-cloud-language/protos/protos.js @@ -0,0 +1,28042 @@ +// Copyright 2022 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_language_protos || ($protobuf.roots._google_cloud_language_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.language = (function() { + + /** + * Namespace language. + * @memberof google.cloud + * @namespace + */ + var language = {}; + + language.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.language + * @namespace + */ + var v1 = {}; + + v1.LanguageService = (function() { + + /** + * Constructs a new LanguageService service. + * @memberof google.cloud.language.v1 + * @classdesc Represents a LanguageService + * @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 LanguageService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LanguageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LanguageService; + + /** + * Creates new LanguageService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.language.v1.LanguageService + * @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 {LanguageService} RPC service. Useful where requests and/or responses are streamed. + */ + LanguageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeSentiment}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef AnalyzeSentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.AnalyzeSentimentResponse} [response] AnalyzeSentimentResponse + */ + + /** + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.AnalyzeSentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeSentiment = function analyzeSentiment(request, callback) { + return this.rpcCall(analyzeSentiment, $root.google.cloud.language.v1.AnalyzeSentimentRequest, $root.google.cloud.language.v1.AnalyzeSentimentResponse, request, callback); + }, "name", { value: "AnalyzeSentiment" }); + + /** + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeEntities}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef AnalyzeEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.AnalyzeEntitiesResponse} [response] AnalyzeEntitiesResponse + */ + + /** + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.AnalyzeEntitiesCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeEntities = function analyzeEntities(request, callback) { + return this.rpcCall(analyzeEntities, $root.google.cloud.language.v1.AnalyzeEntitiesRequest, $root.google.cloud.language.v1.AnalyzeEntitiesResponse, request, callback); + }, "name", { value: "AnalyzeEntities" }); + + /** + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeEntitySentiment}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef AnalyzeEntitySentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.AnalyzeEntitySentimentResponse} [response] AnalyzeEntitySentimentResponse + */ + + /** + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.AnalyzeEntitySentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeEntitySentiment = function analyzeEntitySentiment(request, callback) { + return this.rpcCall(analyzeEntitySentiment, $root.google.cloud.language.v1.AnalyzeEntitySentimentRequest, $root.google.cloud.language.v1.AnalyzeEntitySentimentResponse, request, callback); + }, "name", { value: "AnalyzeEntitySentiment" }); + + /** + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|analyzeSyntax}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef AnalyzeSyntaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.AnalyzeSyntaxResponse} [response] AnalyzeSyntaxResponse + */ + + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.AnalyzeSyntaxCallback} callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeSyntax = function analyzeSyntax(request, callback) { + return this.rpcCall(analyzeSyntax, $root.google.cloud.language.v1.AnalyzeSyntaxRequest, $root.google.cloud.language.v1.AnalyzeSyntaxResponse, request, callback); + }, "name", { value: "AnalyzeSyntax" }); + + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|classifyText}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef ClassifyTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.ClassifyTextResponse} [response] ClassifyTextResponse + */ + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.ClassifyTextCallback} callback Node-style callback called with the error, if any, and ClassifyTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.classifyText = function classifyText(request, callback) { + return this.rpcCall(classifyText, $root.google.cloud.language.v1.ClassifyTextRequest, $root.google.cloud.language.v1.ClassifyTextResponse, request, callback); + }, "name", { value: "ClassifyText" }); + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1.LanguageService|annotateText}. + * @memberof google.cloud.language.v1.LanguageService + * @typedef AnnotateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1.AnnotateTextResponse} [response] AnnotateTextResponse + */ + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @param {google.cloud.language.v1.LanguageService.AnnotateTextCallback} callback Node-style callback called with the error, if any, and AnnotateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.annotateText = function annotateText(request, callback) { + return this.rpcCall(annotateText, $root.google.cloud.language.v1.AnnotateTextRequest, $root.google.cloud.language.v1.AnnotateTextResponse, request, callback); + }, "name", { value: "AnnotateText" }); + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1.LanguageService + * @instance + * @param {google.cloud.language.v1.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LanguageService; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.language.v1 + * @interface IDocument + * @property {google.cloud.language.v1.Document.Type|null} [type] Document type + * @property {string|null} [content] Document content + * @property {string|null} [gcsContentUri] Document gcsContentUri + * @property {string|null} [language] Document language + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.language.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.language.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document type. + * @member {google.cloud.language.v1.Document.Type} type + * @memberof google.cloud.language.v1.Document + * @instance + */ + Document.prototype.type = 0; + + /** + * Document content. + * @member {string|null|undefined} content + * @memberof google.cloud.language.v1.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document gcsContentUri. + * @member {string|null|undefined} gcsContentUri + * @memberof google.cloud.language.v1.Document + * @instance + */ + Document.prototype.gcsContentUri = null; + + /** + * Document language. + * @member {string} language + * @memberof google.cloud.language.v1.Document + * @instance + */ + Document.prototype.language = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document source. + * @member {"content"|"gcsContentUri"|undefined} source + * @memberof google.cloud.language.v1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content", "gcsContentUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.Document + * @static + * @param {google.cloud.language.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.language.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.Document + * @static + * @param {google.cloud.language.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.gcsContentUri != null && Object.hasOwnProperty.call(message, "gcsContentUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsContentUri); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.language); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.Document + * @static + * @param {google.cloud.language.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.gcsContentUri = reader.string(); + break; + } + case 4: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.language.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsContentUri)) + return "gcsContentUri: string expected"; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.Document) + return object; + var message = new $root.google.cloud.language.v1.Document(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PLAIN_TEXT": + case 1: + message.type = 1; + break; + case "HTML": + case 2: + message.type = 2; + break; + } + if (object.content != null) + message.content = String(object.content); + if (object.gcsContentUri != null) + message.gcsContentUri = String(object.gcsContentUri); + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.Document + * @static + * @param {google.cloud.language.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.language = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1.Document.Type[message.type] : message.type; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + object.gcsContentUri = message.gcsContentUri; + if (options.oneofs) + object.source = "gcsContentUri"; + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.language.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.Document"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1.Document.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PLAIN_TEXT=1 PLAIN_TEXT value + * @property {number} HTML=2 HTML value + */ + Document.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PLAIN_TEXT"] = 1; + values[valuesById[2] = "HTML"] = 2; + return values; + })(); + + return Document; + })(); + + v1.Sentence = (function() { + + /** + * Properties of a Sentence. + * @memberof google.cloud.language.v1 + * @interface ISentence + * @property {google.cloud.language.v1.ITextSpan|null} [text] Sentence text + * @property {google.cloud.language.v1.ISentiment|null} [sentiment] Sentence sentiment + */ + + /** + * Constructs a new Sentence. + * @memberof google.cloud.language.v1 + * @classdesc Represents a Sentence. + * @implements ISentence + * @constructor + * @param {google.cloud.language.v1.ISentence=} [properties] Properties to set + */ + function Sentence(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]]; + } + + /** + * Sentence text. + * @member {google.cloud.language.v1.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1.Sentence + * @instance + */ + Sentence.prototype.text = null; + + /** + * Sentence sentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1.Sentence + * @instance + */ + Sentence.prototype.sentiment = null; + + /** + * Creates a new Sentence instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {google.cloud.language.v1.ISentence=} [properties] Properties to set + * @returns {google.cloud.language.v1.Sentence} Sentence instance + */ + Sentence.create = function create(properties) { + return new Sentence(properties); + }; + + /** + * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1.Sentence.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {google.cloud.language.v1.ISentence} message Sentence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.sentiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1.Sentence.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {google.cloud.language.v1.ISentence} message Sentence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sentence message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.Sentence} Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.Sentence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sentence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.Sentence} Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sentence message. + * @function verify + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates a Sentence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.Sentence} Sentence + */ + Sentence.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.Sentence) + return object; + var message = new $root.google.cloud.language.v1.Sentence(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1.Sentence.text: object expected"); + message.text = $root.google.cloud.language.v1.TextSpan.fromObject(object.text); + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1.Sentence.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from a Sentence message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {google.cloud.language.v1.Sentence} message Sentence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.sentiment = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1.TextSpan.toObject(message.text, options); + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this Sentence to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.Sentence + * @instance + * @returns {Object.} JSON object + */ + Sentence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sentence + * @function getTypeUrl + * @memberof google.cloud.language.v1.Sentence + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sentence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.Sentence"; + }; + + return Sentence; + })(); + + /** + * EncodingType enum. + * @name google.cloud.language.v1.EncodingType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} UTF8=1 UTF8 value + * @property {number} UTF16=2 UTF16 value + * @property {number} UTF32=3 UTF32 value + */ + v1.EncodingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "UTF8"] = 1; + values[valuesById[2] = "UTF16"] = 2; + values[valuesById[3] = "UTF32"] = 3; + return values; + })(); + + v1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.language.v1 + * @interface IEntity + * @property {string|null} [name] Entity name + * @property {google.cloud.language.v1.Entity.Type|null} [type] Entity type + * @property {Object.|null} [metadata] Entity metadata + * @property {number|null} [salience] Entity salience + * @property {Array.|null} [mentions] Entity mentions + * @property {google.cloud.language.v1.ISentiment|null} [sentiment] Entity sentiment + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.language.v1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.language.v1.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.metadata = {}; + this.mentions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity name. + * @member {string} name + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.name = ""; + + /** + * Entity type. + * @member {google.cloud.language.v1.Entity.Type} type + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.type = 0; + + /** + * Entity metadata. + * @member {Object.} metadata + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.metadata = $util.emptyObject; + + /** + * Entity salience. + * @member {number} salience + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.salience = 0; + + /** + * Entity mentions. + * @member {Array.} mentions + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.mentions = $util.emptyArray; + + /** + * Entity sentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1.Entity + * @instance + */ + Entity.prototype.sentiment = null; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.Entity + * @static + * @param {google.cloud.language.v1.IEntity=} [properties] Properties to set + * @returns {google.cloud.language.v1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.Entity + * @static + * @param {google.cloud.language.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.salience != null && Object.hasOwnProperty.call(message, "salience")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.salience); + if (message.mentions != null && message.mentions.length) + for (var i = 0; i < message.mentions.length; ++i) + $root.google.cloud.language.v1.EntityMention.encode(message.mentions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.sentiment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.Entity + * @static + * @param {google.cloud.language.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.Entity(), key, value; + 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: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 4: { + message.salience = reader.float(); + break; + } + case 5: { + if (!(message.mentions && message.mentions.length)) + message.mentions = []; + message.mentions.push($root.google.cloud.language.v1.EntityMention.decode(reader, reader.uint32())); + break; + } + case 6: { + message.sentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.language.v1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.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: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.salience != null && message.hasOwnProperty("salience")) + if (typeof message.salience !== "number") + return "salience: number expected"; + if (message.mentions != null && message.hasOwnProperty("mentions")) { + if (!Array.isArray(message.mentions)) + return "mentions: array expected"; + for (var i = 0; i < message.mentions.length; ++i) { + var error = $root.google.cloud.language.v1.EntityMention.verify(message.mentions[i]); + if (error) + return "mentions." + error; + } + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.Entity) + return object; + var message = new $root.google.cloud.language.v1.Entity(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "PERSON": + case 1: + message.type = 1; + break; + case "LOCATION": + case 2: + message.type = 2; + break; + case "ORGANIZATION": + case 3: + message.type = 3; + break; + case "EVENT": + case 4: + message.type = 4; + break; + case "WORK_OF_ART": + case 5: + message.type = 5; + break; + case "CONSUMER_GOOD": + case 6: + message.type = 6; + break; + case "OTHER": + case 7: + message.type = 7; + break; + case "PHONE_NUMBER": + case 9: + message.type = 9; + break; + case "ADDRESS": + case 10: + message.type = 10; + break; + case "DATE": + case 11: + message.type = 11; + break; + case "NUMBER": + case 12: + message.type = 12; + break; + case "PRICE": + case 13: + message.type = 13; + break; + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.language.v1.Entity.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.salience != null) + message.salience = Number(object.salience); + if (object.mentions) { + if (!Array.isArray(object.mentions)) + throw TypeError(".google.cloud.language.v1.Entity.mentions: array expected"); + message.mentions = []; + for (var i = 0; i < object.mentions.length; ++i) { + if (typeof object.mentions[i] !== "object") + throw TypeError(".google.cloud.language.v1.Entity.mentions: object expected"); + message.mentions[i] = $root.google.cloud.language.v1.EntityMention.fromObject(object.mentions[i]); + } + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1.Entity.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.Entity + * @static + * @param {google.cloud.language.v1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mentions = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "UNKNOWN" : 0; + object.salience = 0; + object.sentiment = 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.cloud.language.v1.Entity.Type[message.type] : message.type; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.salience != null && message.hasOwnProperty("salience")) + object.salience = options.json && !isFinite(message.salience) ? String(message.salience) : message.salience; + if (message.mentions && message.mentions.length) { + object.mentions = []; + for (var j = 0; j < message.mentions.length; ++j) + object.mentions[j] = $root.google.cloud.language.v1.EntityMention.toObject(message.mentions[j], options); + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.language.v1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.Entity"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1.Entity.Type + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PERSON=1 PERSON value + * @property {number} LOCATION=2 LOCATION value + * @property {number} ORGANIZATION=3 ORGANIZATION value + * @property {number} EVENT=4 EVENT value + * @property {number} WORK_OF_ART=5 WORK_OF_ART value + * @property {number} CONSUMER_GOOD=6 CONSUMER_GOOD value + * @property {number} OTHER=7 OTHER value + * @property {number} PHONE_NUMBER=9 PHONE_NUMBER value + * @property {number} ADDRESS=10 ADDRESS value + * @property {number} DATE=11 DATE value + * @property {number} NUMBER=12 NUMBER value + * @property {number} PRICE=13 PRICE value + */ + Entity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PERSON"] = 1; + values[valuesById[2] = "LOCATION"] = 2; + values[valuesById[3] = "ORGANIZATION"] = 3; + values[valuesById[4] = "EVENT"] = 4; + values[valuesById[5] = "WORK_OF_ART"] = 5; + values[valuesById[6] = "CONSUMER_GOOD"] = 6; + values[valuesById[7] = "OTHER"] = 7; + values[valuesById[9] = "PHONE_NUMBER"] = 9; + values[valuesById[10] = "ADDRESS"] = 10; + values[valuesById[11] = "DATE"] = 11; + values[valuesById[12] = "NUMBER"] = 12; + values[valuesById[13] = "PRICE"] = 13; + return values; + })(); + + return Entity; + })(); + + v1.Token = (function() { + + /** + * Properties of a Token. + * @memberof google.cloud.language.v1 + * @interface IToken + * @property {google.cloud.language.v1.ITextSpan|null} [text] Token text + * @property {google.cloud.language.v1.IPartOfSpeech|null} [partOfSpeech] Token partOfSpeech + * @property {google.cloud.language.v1.IDependencyEdge|null} [dependencyEdge] Token dependencyEdge + * @property {string|null} [lemma] Token lemma + */ + + /** + * Constructs a new Token. + * @memberof google.cloud.language.v1 + * @classdesc Represents a Token. + * @implements IToken + * @constructor + * @param {google.cloud.language.v1.IToken=} [properties] Properties to set + */ + function Token(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]]; + } + + /** + * Token text. + * @member {google.cloud.language.v1.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1.Token + * @instance + */ + Token.prototype.text = null; + + /** + * Token partOfSpeech. + * @member {google.cloud.language.v1.IPartOfSpeech|null|undefined} partOfSpeech + * @memberof google.cloud.language.v1.Token + * @instance + */ + Token.prototype.partOfSpeech = null; + + /** + * Token dependencyEdge. + * @member {google.cloud.language.v1.IDependencyEdge|null|undefined} dependencyEdge + * @memberof google.cloud.language.v1.Token + * @instance + */ + Token.prototype.dependencyEdge = null; + + /** + * Token lemma. + * @member {string} lemma + * @memberof google.cloud.language.v1.Token + * @instance + */ + Token.prototype.lemma = ""; + + /** + * Creates a new Token instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.Token + * @static + * @param {google.cloud.language.v1.IToken=} [properties] Properties to set + * @returns {google.cloud.language.v1.Token} Token instance + */ + Token.create = function create(properties) { + return new Token(properties); + }; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1.Token.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.Token + * @static + * @param {google.cloud.language.v1.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partOfSpeech != null && Object.hasOwnProperty.call(message, "partOfSpeech")) + $root.google.cloud.language.v1.PartOfSpeech.encode(message.partOfSpeech, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dependencyEdge != null && Object.hasOwnProperty.call(message, "dependencyEdge")) + $root.google.cloud.language.v1.DependencyEdge.encode(message.dependencyEdge, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lemma != null && Object.hasOwnProperty.call(message, "lemma")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.lemma); + return writer; + }; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1.Token.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.Token + * @static + * @param {google.cloud.language.v1.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Token message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.Token(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.partOfSpeech = $root.google.cloud.language.v1.PartOfSpeech.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dependencyEdge = $root.google.cloud.language.v1.DependencyEdge.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lemma = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Token message. + * @function verify + * @memberof google.cloud.language.v1.Token + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Token.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) { + var error = $root.google.cloud.language.v1.PartOfSpeech.verify(message.partOfSpeech); + if (error) + return "partOfSpeech." + error; + } + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) { + var error = $root.google.cloud.language.v1.DependencyEdge.verify(message.dependencyEdge); + if (error) + return "dependencyEdge." + error; + } + if (message.lemma != null && message.hasOwnProperty("lemma")) + if (!$util.isString(message.lemma)) + return "lemma: string expected"; + return null; + }; + + /** + * Creates a Token message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.Token + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.Token} Token + */ + Token.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.Token) + return object; + var message = new $root.google.cloud.language.v1.Token(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1.Token.text: object expected"); + message.text = $root.google.cloud.language.v1.TextSpan.fromObject(object.text); + } + if (object.partOfSpeech != null) { + if (typeof object.partOfSpeech !== "object") + throw TypeError(".google.cloud.language.v1.Token.partOfSpeech: object expected"); + message.partOfSpeech = $root.google.cloud.language.v1.PartOfSpeech.fromObject(object.partOfSpeech); + } + if (object.dependencyEdge != null) { + if (typeof object.dependencyEdge !== "object") + throw TypeError(".google.cloud.language.v1.Token.dependencyEdge: object expected"); + message.dependencyEdge = $root.google.cloud.language.v1.DependencyEdge.fromObject(object.dependencyEdge); + } + if (object.lemma != null) + message.lemma = String(object.lemma); + return message; + }; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.Token + * @static + * @param {google.cloud.language.v1.Token} message Token + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Token.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.partOfSpeech = null; + object.dependencyEdge = null; + object.lemma = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1.TextSpan.toObject(message.text, options); + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) + object.partOfSpeech = $root.google.cloud.language.v1.PartOfSpeech.toObject(message.partOfSpeech, options); + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) + object.dependencyEdge = $root.google.cloud.language.v1.DependencyEdge.toObject(message.dependencyEdge, options); + if (message.lemma != null && message.hasOwnProperty("lemma")) + object.lemma = message.lemma; + return object; + }; + + /** + * Converts this Token to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.Token + * @instance + * @returns {Object.} JSON object + */ + Token.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Token + * @function getTypeUrl + * @memberof google.cloud.language.v1.Token + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.Token"; + }; + + return Token; + })(); + + v1.Sentiment = (function() { + + /** + * Properties of a Sentiment. + * @memberof google.cloud.language.v1 + * @interface ISentiment + * @property {number|null} [magnitude] Sentiment magnitude + * @property {number|null} [score] Sentiment score + */ + + /** + * Constructs a new Sentiment. + * @memberof google.cloud.language.v1 + * @classdesc Represents a Sentiment. + * @implements ISentiment + * @constructor + * @param {google.cloud.language.v1.ISentiment=} [properties] Properties to set + */ + function Sentiment(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]]; + } + + /** + * Sentiment magnitude. + * @member {number} magnitude + * @memberof google.cloud.language.v1.Sentiment + * @instance + */ + Sentiment.prototype.magnitude = 0; + + /** + * Sentiment score. + * @member {number} score + * @memberof google.cloud.language.v1.Sentiment + * @instance + */ + Sentiment.prototype.score = 0; + + /** + * Creates a new Sentiment instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {google.cloud.language.v1.ISentiment=} [properties] Properties to set + * @returns {google.cloud.language.v1.Sentiment} Sentiment instance + */ + Sentiment.create = function create(properties) { + return new Sentiment(properties); + }; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1.Sentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {google.cloud.language.v1.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + return writer; + }; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1.Sentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {google.cloud.language.v1.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.Sentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.magnitude = reader.float(); + break; + } + case 3: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sentiment message. + * @function verify + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.Sentiment} Sentiment + */ + Sentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.Sentiment) + return object; + var message = new $root.google.cloud.language.v1.Sentiment(); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {google.cloud.language.v1.Sentiment} message Sentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.magnitude = 0; + object.score = 0; + } + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this Sentiment to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.Sentiment + * @instance + * @returns {Object.} JSON object + */ + Sentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sentiment + * @function getTypeUrl + * @memberof google.cloud.language.v1.Sentiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.Sentiment"; + }; + + return Sentiment; + })(); + + v1.PartOfSpeech = (function() { + + /** + * Properties of a PartOfSpeech. + * @memberof google.cloud.language.v1 + * @interface IPartOfSpeech + * @property {google.cloud.language.v1.PartOfSpeech.Tag|null} [tag] PartOfSpeech tag + * @property {google.cloud.language.v1.PartOfSpeech.Aspect|null} [aspect] PartOfSpeech aspect + * @property {google.cloud.language.v1.PartOfSpeech.Case|null} ["case"] PartOfSpeech case + * @property {google.cloud.language.v1.PartOfSpeech.Form|null} [form] PartOfSpeech form + * @property {google.cloud.language.v1.PartOfSpeech.Gender|null} [gender] PartOfSpeech gender + * @property {google.cloud.language.v1.PartOfSpeech.Mood|null} [mood] PartOfSpeech mood + * @property {google.cloud.language.v1.PartOfSpeech.Number|null} [number] PartOfSpeech number + * @property {google.cloud.language.v1.PartOfSpeech.Person|null} [person] PartOfSpeech person + * @property {google.cloud.language.v1.PartOfSpeech.Proper|null} [proper] PartOfSpeech proper + * @property {google.cloud.language.v1.PartOfSpeech.Reciprocity|null} [reciprocity] PartOfSpeech reciprocity + * @property {google.cloud.language.v1.PartOfSpeech.Tense|null} [tense] PartOfSpeech tense + * @property {google.cloud.language.v1.PartOfSpeech.Voice|null} [voice] PartOfSpeech voice + */ + + /** + * Constructs a new PartOfSpeech. + * @memberof google.cloud.language.v1 + * @classdesc Represents a PartOfSpeech. + * @implements IPartOfSpeech + * @constructor + * @param {google.cloud.language.v1.IPartOfSpeech=} [properties] Properties to set + */ + function PartOfSpeech(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]]; + } + + /** + * PartOfSpeech tag. + * @member {google.cloud.language.v1.PartOfSpeech.Tag} tag + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.tag = 0; + + /** + * PartOfSpeech aspect. + * @member {google.cloud.language.v1.PartOfSpeech.Aspect} aspect + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.aspect = 0; + + /** + * PartOfSpeech case. + * @member {google.cloud.language.v1.PartOfSpeech.Case} case + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype["case"] = 0; + + /** + * PartOfSpeech form. + * @member {google.cloud.language.v1.PartOfSpeech.Form} form + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.form = 0; + + /** + * PartOfSpeech gender. + * @member {google.cloud.language.v1.PartOfSpeech.Gender} gender + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.gender = 0; + + /** + * PartOfSpeech mood. + * @member {google.cloud.language.v1.PartOfSpeech.Mood} mood + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.mood = 0; + + /** + * PartOfSpeech number. + * @member {google.cloud.language.v1.PartOfSpeech.Number} number + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.number = 0; + + /** + * PartOfSpeech person. + * @member {google.cloud.language.v1.PartOfSpeech.Person} person + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.person = 0; + + /** + * PartOfSpeech proper. + * @member {google.cloud.language.v1.PartOfSpeech.Proper} proper + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.proper = 0; + + /** + * PartOfSpeech reciprocity. + * @member {google.cloud.language.v1.PartOfSpeech.Reciprocity} reciprocity + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.reciprocity = 0; + + /** + * PartOfSpeech tense. + * @member {google.cloud.language.v1.PartOfSpeech.Tense} tense + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.tense = 0; + + /** + * PartOfSpeech voice. + * @member {google.cloud.language.v1.PartOfSpeech.Voice} voice + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.voice = 0; + + /** + * Creates a new PartOfSpeech instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {google.cloud.language.v1.IPartOfSpeech=} [properties] Properties to set + * @returns {google.cloud.language.v1.PartOfSpeech} PartOfSpeech instance + */ + PartOfSpeech.create = function create(properties) { + return new PartOfSpeech(properties); + }; + + /** + * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1.PartOfSpeech.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {google.cloud.language.v1.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tag); + if (message.aspect != null && Object.hasOwnProperty.call(message, "aspect")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.aspect); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message["case"]); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.form); + if (message.gender != null && Object.hasOwnProperty.call(message, "gender")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.gender); + if (message.mood != null && Object.hasOwnProperty.call(message, "mood")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.mood); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.number); + if (message.person != null && Object.hasOwnProperty.call(message, "person")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.person); + if (message.proper != null && Object.hasOwnProperty.call(message, "proper")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.proper); + if (message.reciprocity != null && Object.hasOwnProperty.call(message, "reciprocity")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.reciprocity); + if (message.tense != null && Object.hasOwnProperty.call(message, "tense")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.tense); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.voice); + return writer; + }; + + /** + * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1.PartOfSpeech.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {google.cloud.language.v1.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.PartOfSpeech} PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartOfSpeech.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.PartOfSpeech(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tag = reader.int32(); + break; + } + case 2: { + message.aspect = reader.int32(); + break; + } + case 3: { + message["case"] = reader.int32(); + break; + } + case 4: { + message.form = reader.int32(); + break; + } + case 5: { + message.gender = reader.int32(); + break; + } + case 6: { + message.mood = reader.int32(); + break; + } + case 7: { + message.number = reader.int32(); + break; + } + case 8: { + message.person = reader.int32(); + break; + } + case 9: { + message.proper = reader.int32(); + break; + } + case 10: { + message.reciprocity = reader.int32(); + break; + } + case 11: { + message.tense = reader.int32(); + break; + } + case 12: { + message.voice = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.PartOfSpeech} PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartOfSpeech.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartOfSpeech message. + * @function verify + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartOfSpeech.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + switch (message.tag) { + default: + return "tag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.aspect != null && message.hasOwnProperty("aspect")) + switch (message.aspect) { + default: + return "aspect: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message["case"] != null && message.hasOwnProperty("case")) + switch (message["case"]) { + default: + return "case: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.form != null && message.hasOwnProperty("form")) + switch (message.form) { + default: + return "form: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.gender != null && message.hasOwnProperty("gender")) + switch (message.gender) { + default: + return "gender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mood != null && message.hasOwnProperty("mood")) + switch (message.mood) { + default: + return "mood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.number != null && message.hasOwnProperty("number")) + switch (message.number) { + default: + return "number: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.person != null && message.hasOwnProperty("person")) + switch (message.person) { + default: + return "person: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.proper != null && message.hasOwnProperty("proper")) + switch (message.proper) { + default: + return "proper: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + switch (message.reciprocity) { + default: + return "reciprocity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tense != null && message.hasOwnProperty("tense")) + switch (message.tense) { + default: + return "tense: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.voice != null && message.hasOwnProperty("voice")) + switch (message.voice) { + default: + return "voice: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.PartOfSpeech} PartOfSpeech + */ + PartOfSpeech.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.PartOfSpeech) + return object; + var message = new $root.google.cloud.language.v1.PartOfSpeech(); + switch (object.tag) { + case "UNKNOWN": + case 0: + message.tag = 0; + break; + case "ADJ": + case 1: + message.tag = 1; + break; + case "ADP": + case 2: + message.tag = 2; + break; + case "ADV": + case 3: + message.tag = 3; + break; + case "CONJ": + case 4: + message.tag = 4; + break; + case "DET": + case 5: + message.tag = 5; + break; + case "NOUN": + case 6: + message.tag = 6; + break; + case "NUM": + case 7: + message.tag = 7; + break; + case "PRON": + case 8: + message.tag = 8; + break; + case "PRT": + case 9: + message.tag = 9; + break; + case "PUNCT": + case 10: + message.tag = 10; + break; + case "VERB": + case 11: + message.tag = 11; + break; + case "X": + case 12: + message.tag = 12; + break; + case "AFFIX": + case 13: + message.tag = 13; + break; + } + switch (object.aspect) { + case "ASPECT_UNKNOWN": + case 0: + message.aspect = 0; + break; + case "PERFECTIVE": + case 1: + message.aspect = 1; + break; + case "IMPERFECTIVE": + case 2: + message.aspect = 2; + break; + case "PROGRESSIVE": + case 3: + message.aspect = 3; + break; + } + switch (object["case"]) { + case "CASE_UNKNOWN": + case 0: + message["case"] = 0; + break; + case "ACCUSATIVE": + case 1: + message["case"] = 1; + break; + case "ADVERBIAL": + case 2: + message["case"] = 2; + break; + case "COMPLEMENTIVE": + case 3: + message["case"] = 3; + break; + case "DATIVE": + case 4: + message["case"] = 4; + break; + case "GENITIVE": + case 5: + message["case"] = 5; + break; + case "INSTRUMENTAL": + case 6: + message["case"] = 6; + break; + case "LOCATIVE": + case 7: + message["case"] = 7; + break; + case "NOMINATIVE": + case 8: + message["case"] = 8; + break; + case "OBLIQUE": + case 9: + message["case"] = 9; + break; + case "PARTITIVE": + case 10: + message["case"] = 10; + break; + case "PREPOSITIONAL": + case 11: + message["case"] = 11; + break; + case "REFLEXIVE_CASE": + case 12: + message["case"] = 12; + break; + case "RELATIVE_CASE": + case 13: + message["case"] = 13; + break; + case "VOCATIVE": + case 14: + message["case"] = 14; + break; + } + switch (object.form) { + case "FORM_UNKNOWN": + case 0: + message.form = 0; + break; + case "ADNOMIAL": + case 1: + message.form = 1; + break; + case "AUXILIARY": + case 2: + message.form = 2; + break; + case "COMPLEMENTIZER": + case 3: + message.form = 3; + break; + case "FINAL_ENDING": + case 4: + message.form = 4; + break; + case "GERUND": + case 5: + message.form = 5; + break; + case "REALIS": + case 6: + message.form = 6; + break; + case "IRREALIS": + case 7: + message.form = 7; + break; + case "SHORT": + case 8: + message.form = 8; + break; + case "LONG": + case 9: + message.form = 9; + break; + case "ORDER": + case 10: + message.form = 10; + break; + case "SPECIFIC": + case 11: + message.form = 11; + break; + } + switch (object.gender) { + case "GENDER_UNKNOWN": + case 0: + message.gender = 0; + break; + case "FEMININE": + case 1: + message.gender = 1; + break; + case "MASCULINE": + case 2: + message.gender = 2; + break; + case "NEUTER": + case 3: + message.gender = 3; + break; + } + switch (object.mood) { + case "MOOD_UNKNOWN": + case 0: + message.mood = 0; + break; + case "CONDITIONAL_MOOD": + case 1: + message.mood = 1; + break; + case "IMPERATIVE": + case 2: + message.mood = 2; + break; + case "INDICATIVE": + case 3: + message.mood = 3; + break; + case "INTERROGATIVE": + case 4: + message.mood = 4; + break; + case "JUSSIVE": + case 5: + message.mood = 5; + break; + case "SUBJUNCTIVE": + case 6: + message.mood = 6; + break; + } + switch (object.number) { + case "NUMBER_UNKNOWN": + case 0: + message.number = 0; + break; + case "SINGULAR": + case 1: + message.number = 1; + break; + case "PLURAL": + case 2: + message.number = 2; + break; + case "DUAL": + case 3: + message.number = 3; + break; + } + switch (object.person) { + case "PERSON_UNKNOWN": + case 0: + message.person = 0; + break; + case "FIRST": + case 1: + message.person = 1; + break; + case "SECOND": + case 2: + message.person = 2; + break; + case "THIRD": + case 3: + message.person = 3; + break; + case "REFLEXIVE_PERSON": + case 4: + message.person = 4; + break; + } + switch (object.proper) { + case "PROPER_UNKNOWN": + case 0: + message.proper = 0; + break; + case "PROPER": + case 1: + message.proper = 1; + break; + case "NOT_PROPER": + case 2: + message.proper = 2; + break; + } + switch (object.reciprocity) { + case "RECIPROCITY_UNKNOWN": + case 0: + message.reciprocity = 0; + break; + case "RECIPROCAL": + case 1: + message.reciprocity = 1; + break; + case "NON_RECIPROCAL": + case 2: + message.reciprocity = 2; + break; + } + switch (object.tense) { + case "TENSE_UNKNOWN": + case 0: + message.tense = 0; + break; + case "CONDITIONAL_TENSE": + case 1: + message.tense = 1; + break; + case "FUTURE": + case 2: + message.tense = 2; + break; + case "PAST": + case 3: + message.tense = 3; + break; + case "PRESENT": + case 4: + message.tense = 4; + break; + case "IMPERFECT": + case 5: + message.tense = 5; + break; + case "PLUPERFECT": + case 6: + message.tense = 6; + break; + } + switch (object.voice) { + case "VOICE_UNKNOWN": + case 0: + message.voice = 0; + break; + case "ACTIVE": + case 1: + message.voice = 1; + break; + case "CAUSATIVE": + case 2: + message.voice = 2; + break; + case "PASSIVE": + case 3: + message.voice = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {google.cloud.language.v1.PartOfSpeech} message PartOfSpeech + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartOfSpeech.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = options.enums === String ? "UNKNOWN" : 0; + object.aspect = options.enums === String ? "ASPECT_UNKNOWN" : 0; + object["case"] = options.enums === String ? "CASE_UNKNOWN" : 0; + object.form = options.enums === String ? "FORM_UNKNOWN" : 0; + object.gender = options.enums === String ? "GENDER_UNKNOWN" : 0; + object.mood = options.enums === String ? "MOOD_UNKNOWN" : 0; + object.number = options.enums === String ? "NUMBER_UNKNOWN" : 0; + object.person = options.enums === String ? "PERSON_UNKNOWN" : 0; + object.proper = options.enums === String ? "PROPER_UNKNOWN" : 0; + object.reciprocity = options.enums === String ? "RECIPROCITY_UNKNOWN" : 0; + object.tense = options.enums === String ? "TENSE_UNKNOWN" : 0; + object.voice = options.enums === String ? "VOICE_UNKNOWN" : 0; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Tag[message.tag] : message.tag; + if (message.aspect != null && message.hasOwnProperty("aspect")) + object.aspect = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Aspect[message.aspect] : message.aspect; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Case[message["case"]] : message["case"]; + if (message.form != null && message.hasOwnProperty("form")) + object.form = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Form[message.form] : message.form; + if (message.gender != null && message.hasOwnProperty("gender")) + object.gender = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Gender[message.gender] : message.gender; + if (message.mood != null && message.hasOwnProperty("mood")) + object.mood = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Mood[message.mood] : message.mood; + if (message.number != null && message.hasOwnProperty("number")) + object.number = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Number[message.number] : message.number; + if (message.person != null && message.hasOwnProperty("person")) + object.person = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Person[message.person] : message.person; + if (message.proper != null && message.hasOwnProperty("proper")) + object.proper = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Proper[message.proper] : message.proper; + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + object.reciprocity = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Reciprocity[message.reciprocity] : message.reciprocity; + if (message.tense != null && message.hasOwnProperty("tense")) + object.tense = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Tense[message.tense] : message.tense; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = options.enums === String ? $root.google.cloud.language.v1.PartOfSpeech.Voice[message.voice] : message.voice; + return object; + }; + + /** + * Converts this PartOfSpeech to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.PartOfSpeech + * @instance + * @returns {Object.} JSON object + */ + PartOfSpeech.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartOfSpeech + * @function getTypeUrl + * @memberof google.cloud.language.v1.PartOfSpeech + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartOfSpeech.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.PartOfSpeech"; + }; + + /** + * Tag enum. + * @name google.cloud.language.v1.PartOfSpeech.Tag + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ADJ=1 ADJ value + * @property {number} ADP=2 ADP value + * @property {number} ADV=3 ADV value + * @property {number} CONJ=4 CONJ value + * @property {number} DET=5 DET value + * @property {number} NOUN=6 NOUN value + * @property {number} NUM=7 NUM value + * @property {number} PRON=8 PRON value + * @property {number} PRT=9 PRT value + * @property {number} PUNCT=10 PUNCT value + * @property {number} VERB=11 VERB value + * @property {number} X=12 X value + * @property {number} AFFIX=13 AFFIX value + */ + PartOfSpeech.Tag = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ADJ"] = 1; + values[valuesById[2] = "ADP"] = 2; + values[valuesById[3] = "ADV"] = 3; + values[valuesById[4] = "CONJ"] = 4; + values[valuesById[5] = "DET"] = 5; + values[valuesById[6] = "NOUN"] = 6; + values[valuesById[7] = "NUM"] = 7; + values[valuesById[8] = "PRON"] = 8; + values[valuesById[9] = "PRT"] = 9; + values[valuesById[10] = "PUNCT"] = 10; + values[valuesById[11] = "VERB"] = 11; + values[valuesById[12] = "X"] = 12; + values[valuesById[13] = "AFFIX"] = 13; + return values; + })(); + + /** + * Aspect enum. + * @name google.cloud.language.v1.PartOfSpeech.Aspect + * @enum {number} + * @property {number} ASPECT_UNKNOWN=0 ASPECT_UNKNOWN value + * @property {number} PERFECTIVE=1 PERFECTIVE value + * @property {number} IMPERFECTIVE=2 IMPERFECTIVE value + * @property {number} PROGRESSIVE=3 PROGRESSIVE value + */ + PartOfSpeech.Aspect = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ASPECT_UNKNOWN"] = 0; + values[valuesById[1] = "PERFECTIVE"] = 1; + values[valuesById[2] = "IMPERFECTIVE"] = 2; + values[valuesById[3] = "PROGRESSIVE"] = 3; + return values; + })(); + + /** + * Case enum. + * @name google.cloud.language.v1.PartOfSpeech.Case + * @enum {number} + * @property {number} CASE_UNKNOWN=0 CASE_UNKNOWN value + * @property {number} ACCUSATIVE=1 ACCUSATIVE value + * @property {number} ADVERBIAL=2 ADVERBIAL value + * @property {number} COMPLEMENTIVE=3 COMPLEMENTIVE value + * @property {number} DATIVE=4 DATIVE value + * @property {number} GENITIVE=5 GENITIVE value + * @property {number} INSTRUMENTAL=6 INSTRUMENTAL value + * @property {number} LOCATIVE=7 LOCATIVE value + * @property {number} NOMINATIVE=8 NOMINATIVE value + * @property {number} OBLIQUE=9 OBLIQUE value + * @property {number} PARTITIVE=10 PARTITIVE value + * @property {number} PREPOSITIONAL=11 PREPOSITIONAL value + * @property {number} REFLEXIVE_CASE=12 REFLEXIVE_CASE value + * @property {number} RELATIVE_CASE=13 RELATIVE_CASE value + * @property {number} VOCATIVE=14 VOCATIVE value + */ + PartOfSpeech.Case = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CASE_UNKNOWN"] = 0; + values[valuesById[1] = "ACCUSATIVE"] = 1; + values[valuesById[2] = "ADVERBIAL"] = 2; + values[valuesById[3] = "COMPLEMENTIVE"] = 3; + values[valuesById[4] = "DATIVE"] = 4; + values[valuesById[5] = "GENITIVE"] = 5; + values[valuesById[6] = "INSTRUMENTAL"] = 6; + values[valuesById[7] = "LOCATIVE"] = 7; + values[valuesById[8] = "NOMINATIVE"] = 8; + values[valuesById[9] = "OBLIQUE"] = 9; + values[valuesById[10] = "PARTITIVE"] = 10; + values[valuesById[11] = "PREPOSITIONAL"] = 11; + values[valuesById[12] = "REFLEXIVE_CASE"] = 12; + values[valuesById[13] = "RELATIVE_CASE"] = 13; + values[valuesById[14] = "VOCATIVE"] = 14; + return values; + })(); + + /** + * Form enum. + * @name google.cloud.language.v1.PartOfSpeech.Form + * @enum {number} + * @property {number} FORM_UNKNOWN=0 FORM_UNKNOWN value + * @property {number} ADNOMIAL=1 ADNOMIAL value + * @property {number} AUXILIARY=2 AUXILIARY value + * @property {number} COMPLEMENTIZER=3 COMPLEMENTIZER value + * @property {number} FINAL_ENDING=4 FINAL_ENDING value + * @property {number} GERUND=5 GERUND value + * @property {number} REALIS=6 REALIS value + * @property {number} IRREALIS=7 IRREALIS value + * @property {number} SHORT=8 SHORT value + * @property {number} LONG=9 LONG value + * @property {number} ORDER=10 ORDER value + * @property {number} SPECIFIC=11 SPECIFIC value + */ + PartOfSpeech.Form = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORM_UNKNOWN"] = 0; + values[valuesById[1] = "ADNOMIAL"] = 1; + values[valuesById[2] = "AUXILIARY"] = 2; + values[valuesById[3] = "COMPLEMENTIZER"] = 3; + values[valuesById[4] = "FINAL_ENDING"] = 4; + values[valuesById[5] = "GERUND"] = 5; + values[valuesById[6] = "REALIS"] = 6; + values[valuesById[7] = "IRREALIS"] = 7; + values[valuesById[8] = "SHORT"] = 8; + values[valuesById[9] = "LONG"] = 9; + values[valuesById[10] = "ORDER"] = 10; + values[valuesById[11] = "SPECIFIC"] = 11; + return values; + })(); + + /** + * Gender enum. + * @name google.cloud.language.v1.PartOfSpeech.Gender + * @enum {number} + * @property {number} GENDER_UNKNOWN=0 GENDER_UNKNOWN value + * @property {number} FEMININE=1 FEMININE value + * @property {number} MASCULINE=2 MASCULINE value + * @property {number} NEUTER=3 NEUTER value + */ + PartOfSpeech.Gender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENDER_UNKNOWN"] = 0; + values[valuesById[1] = "FEMININE"] = 1; + values[valuesById[2] = "MASCULINE"] = 2; + values[valuesById[3] = "NEUTER"] = 3; + return values; + })(); + + /** + * Mood enum. + * @name google.cloud.language.v1.PartOfSpeech.Mood + * @enum {number} + * @property {number} MOOD_UNKNOWN=0 MOOD_UNKNOWN value + * @property {number} CONDITIONAL_MOOD=1 CONDITIONAL_MOOD value + * @property {number} IMPERATIVE=2 IMPERATIVE value + * @property {number} INDICATIVE=3 INDICATIVE value + * @property {number} INTERROGATIVE=4 INTERROGATIVE value + * @property {number} JUSSIVE=5 JUSSIVE value + * @property {number} SUBJUNCTIVE=6 SUBJUNCTIVE value + */ + PartOfSpeech.Mood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MOOD_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_MOOD"] = 1; + values[valuesById[2] = "IMPERATIVE"] = 2; + values[valuesById[3] = "INDICATIVE"] = 3; + values[valuesById[4] = "INTERROGATIVE"] = 4; + values[valuesById[5] = "JUSSIVE"] = 5; + values[valuesById[6] = "SUBJUNCTIVE"] = 6; + return values; + })(); + + /** + * Number enum. + * @name google.cloud.language.v1.PartOfSpeech.Number + * @enum {number} + * @property {number} NUMBER_UNKNOWN=0 NUMBER_UNKNOWN value + * @property {number} SINGULAR=1 SINGULAR value + * @property {number} PLURAL=2 PLURAL value + * @property {number} DUAL=3 DUAL value + */ + PartOfSpeech.Number = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NUMBER_UNKNOWN"] = 0; + values[valuesById[1] = "SINGULAR"] = 1; + values[valuesById[2] = "PLURAL"] = 2; + values[valuesById[3] = "DUAL"] = 3; + return values; + })(); + + /** + * Person enum. + * @name google.cloud.language.v1.PartOfSpeech.Person + * @enum {number} + * @property {number} PERSON_UNKNOWN=0 PERSON_UNKNOWN value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} REFLEXIVE_PERSON=4 REFLEXIVE_PERSON value + */ + PartOfSpeech.Person = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERSON_UNKNOWN"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "REFLEXIVE_PERSON"] = 4; + return values; + })(); + + /** + * Proper enum. + * @name google.cloud.language.v1.PartOfSpeech.Proper + * @enum {number} + * @property {number} PROPER_UNKNOWN=0 PROPER_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} NOT_PROPER=2 NOT_PROPER value + */ + PartOfSpeech.Proper = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPER_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "NOT_PROPER"] = 2; + return values; + })(); + + /** + * Reciprocity enum. + * @name google.cloud.language.v1.PartOfSpeech.Reciprocity + * @enum {number} + * @property {number} RECIPROCITY_UNKNOWN=0 RECIPROCITY_UNKNOWN value + * @property {number} RECIPROCAL=1 RECIPROCAL value + * @property {number} NON_RECIPROCAL=2 NON_RECIPROCAL value + */ + PartOfSpeech.Reciprocity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECIPROCITY_UNKNOWN"] = 0; + values[valuesById[1] = "RECIPROCAL"] = 1; + values[valuesById[2] = "NON_RECIPROCAL"] = 2; + return values; + })(); + + /** + * Tense enum. + * @name google.cloud.language.v1.PartOfSpeech.Tense + * @enum {number} + * @property {number} TENSE_UNKNOWN=0 TENSE_UNKNOWN value + * @property {number} CONDITIONAL_TENSE=1 CONDITIONAL_TENSE value + * @property {number} FUTURE=2 FUTURE value + * @property {number} PAST=3 PAST value + * @property {number} PRESENT=4 PRESENT value + * @property {number} IMPERFECT=5 IMPERFECT value + * @property {number} PLUPERFECT=6 PLUPERFECT value + */ + PartOfSpeech.Tense = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TENSE_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_TENSE"] = 1; + values[valuesById[2] = "FUTURE"] = 2; + values[valuesById[3] = "PAST"] = 3; + values[valuesById[4] = "PRESENT"] = 4; + values[valuesById[5] = "IMPERFECT"] = 5; + values[valuesById[6] = "PLUPERFECT"] = 6; + return values; + })(); + + /** + * Voice enum. + * @name google.cloud.language.v1.PartOfSpeech.Voice + * @enum {number} + * @property {number} VOICE_UNKNOWN=0 VOICE_UNKNOWN value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CAUSATIVE=2 CAUSATIVE value + * @property {number} PASSIVE=3 PASSIVE value + */ + PartOfSpeech.Voice = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOICE_UNKNOWN"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CAUSATIVE"] = 2; + values[valuesById[3] = "PASSIVE"] = 3; + return values; + })(); + + return PartOfSpeech; + })(); + + v1.DependencyEdge = (function() { + + /** + * Properties of a DependencyEdge. + * @memberof google.cloud.language.v1 + * @interface IDependencyEdge + * @property {number|null} [headTokenIndex] DependencyEdge headTokenIndex + * @property {google.cloud.language.v1.DependencyEdge.Label|null} [label] DependencyEdge label + */ + + /** + * Constructs a new DependencyEdge. + * @memberof google.cloud.language.v1 + * @classdesc Represents a DependencyEdge. + * @implements IDependencyEdge + * @constructor + * @param {google.cloud.language.v1.IDependencyEdge=} [properties] Properties to set + */ + function DependencyEdge(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]]; + } + + /** + * DependencyEdge headTokenIndex. + * @member {number} headTokenIndex + * @memberof google.cloud.language.v1.DependencyEdge + * @instance + */ + DependencyEdge.prototype.headTokenIndex = 0; + + /** + * DependencyEdge label. + * @member {google.cloud.language.v1.DependencyEdge.Label} label + * @memberof google.cloud.language.v1.DependencyEdge + * @instance + */ + DependencyEdge.prototype.label = 0; + + /** + * Creates a new DependencyEdge instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {google.cloud.language.v1.IDependencyEdge=} [properties] Properties to set + * @returns {google.cloud.language.v1.DependencyEdge} DependencyEdge instance + */ + DependencyEdge.create = function create(properties) { + return new DependencyEdge(properties); + }; + + /** + * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1.DependencyEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {google.cloud.language.v1.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headTokenIndex != null && Object.hasOwnProperty.call(message, "headTokenIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headTokenIndex); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.label); + return writer; + }; + + /** + * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1.DependencyEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {google.cloud.language.v1.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.DependencyEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headTokenIndex = reader.int32(); + break; + } + case 2: { + message.label = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyEdge message. + * @function verify + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyEdge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + if (!$util.isInteger(message.headTokenIndex)) + return "headTokenIndex: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + break; + } + return null; + }; + + /** + * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.DependencyEdge} DependencyEdge + */ + DependencyEdge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.DependencyEdge) + return object; + var message = new $root.google.cloud.language.v1.DependencyEdge(); + if (object.headTokenIndex != null) + message.headTokenIndex = object.headTokenIndex | 0; + switch (object.label) { + case "UNKNOWN": + case 0: + message.label = 0; + break; + case "ABBREV": + case 1: + message.label = 1; + break; + case "ACOMP": + case 2: + message.label = 2; + break; + case "ADVCL": + case 3: + message.label = 3; + break; + case "ADVMOD": + case 4: + message.label = 4; + break; + case "AMOD": + case 5: + message.label = 5; + break; + case "APPOS": + case 6: + message.label = 6; + break; + case "ATTR": + case 7: + message.label = 7; + break; + case "AUX": + case 8: + message.label = 8; + break; + case "AUXPASS": + case 9: + message.label = 9; + break; + case "CC": + case 10: + message.label = 10; + break; + case "CCOMP": + case 11: + message.label = 11; + break; + case "CONJ": + case 12: + message.label = 12; + break; + case "CSUBJ": + case 13: + message.label = 13; + break; + case "CSUBJPASS": + case 14: + message.label = 14; + break; + case "DEP": + case 15: + message.label = 15; + break; + case "DET": + case 16: + message.label = 16; + break; + case "DISCOURSE": + case 17: + message.label = 17; + break; + case "DOBJ": + case 18: + message.label = 18; + break; + case "EXPL": + case 19: + message.label = 19; + break; + case "GOESWITH": + case 20: + message.label = 20; + break; + case "IOBJ": + case 21: + message.label = 21; + break; + case "MARK": + case 22: + message.label = 22; + break; + case "MWE": + case 23: + message.label = 23; + break; + case "MWV": + case 24: + message.label = 24; + break; + case "NEG": + case 25: + message.label = 25; + break; + case "NN": + case 26: + message.label = 26; + break; + case "NPADVMOD": + case 27: + message.label = 27; + break; + case "NSUBJ": + case 28: + message.label = 28; + break; + case "NSUBJPASS": + case 29: + message.label = 29; + break; + case "NUM": + case 30: + message.label = 30; + break; + case "NUMBER": + case 31: + message.label = 31; + break; + case "P": + case 32: + message.label = 32; + break; + case "PARATAXIS": + case 33: + message.label = 33; + break; + case "PARTMOD": + case 34: + message.label = 34; + break; + case "PCOMP": + case 35: + message.label = 35; + break; + case "POBJ": + case 36: + message.label = 36; + break; + case "POSS": + case 37: + message.label = 37; + break; + case "POSTNEG": + case 38: + message.label = 38; + break; + case "PRECOMP": + case 39: + message.label = 39; + break; + case "PRECONJ": + case 40: + message.label = 40; + break; + case "PREDET": + case 41: + message.label = 41; + break; + case "PREF": + case 42: + message.label = 42; + break; + case "PREP": + case 43: + message.label = 43; + break; + case "PRONL": + case 44: + message.label = 44; + break; + case "PRT": + case 45: + message.label = 45; + break; + case "PS": + case 46: + message.label = 46; + break; + case "QUANTMOD": + case 47: + message.label = 47; + break; + case "RCMOD": + case 48: + message.label = 48; + break; + case "RCMODREL": + case 49: + message.label = 49; + break; + case "RDROP": + case 50: + message.label = 50; + break; + case "REF": + case 51: + message.label = 51; + break; + case "REMNANT": + case 52: + message.label = 52; + break; + case "REPARANDUM": + case 53: + message.label = 53; + break; + case "ROOT": + case 54: + message.label = 54; + break; + case "SNUM": + case 55: + message.label = 55; + break; + case "SUFF": + case 56: + message.label = 56; + break; + case "TMOD": + case 57: + message.label = 57; + break; + case "TOPIC": + case 58: + message.label = 58; + break; + case "VMOD": + case 59: + message.label = 59; + break; + case "VOCATIVE": + case 60: + message.label = 60; + break; + case "XCOMP": + case 61: + message.label = 61; + break; + case "SUFFIX": + case 62: + message.label = 62; + break; + case "TITLE": + case 63: + message.label = 63; + break; + case "ADVPHMOD": + case 64: + message.label = 64; + break; + case "AUXCAUS": + case 65: + message.label = 65; + break; + case "AUXVV": + case 66: + message.label = 66; + break; + case "DTMOD": + case 67: + message.label = 67; + break; + case "FOREIGN": + case 68: + message.label = 68; + break; + case "KW": + case 69: + message.label = 69; + break; + case "LIST": + case 70: + message.label = 70; + break; + case "NOMC": + case 71: + message.label = 71; + break; + case "NOMCSUBJ": + case 72: + message.label = 72; + break; + case "NOMCSUBJPASS": + case 73: + message.label = 73; + break; + case "NUMC": + case 74: + message.label = 74; + break; + case "COP": + case 75: + message.label = 75; + break; + case "DISLOCATED": + case 76: + message.label = 76; + break; + case "ASP": + case 77: + message.label = 77; + break; + case "GMOD": + case 78: + message.label = 78; + break; + case "GOBJ": + case 79: + message.label = 79; + break; + case "INFMOD": + case 80: + message.label = 80; + break; + case "MES": + case 81: + message.label = 81; + break; + case "NCOMP": + case 82: + message.label = 82; + break; + } + return message; + }; + + /** + * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {google.cloud.language.v1.DependencyEdge} message DependencyEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.headTokenIndex = 0; + object.label = options.enums === String ? "UNKNOWN" : 0; + } + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + object.headTokenIndex = message.headTokenIndex; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.cloud.language.v1.DependencyEdge.Label[message.label] : message.label; + return object; + }; + + /** + * Converts this DependencyEdge to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.DependencyEdge + * @instance + * @returns {Object.} JSON object + */ + DependencyEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyEdge + * @function getTypeUrl + * @memberof google.cloud.language.v1.DependencyEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.DependencyEdge"; + }; + + /** + * Label enum. + * @name google.cloud.language.v1.DependencyEdge.Label + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ABBREV=1 ABBREV value + * @property {number} ACOMP=2 ACOMP value + * @property {number} ADVCL=3 ADVCL value + * @property {number} ADVMOD=4 ADVMOD value + * @property {number} AMOD=5 AMOD value + * @property {number} APPOS=6 APPOS value + * @property {number} ATTR=7 ATTR value + * @property {number} AUX=8 AUX value + * @property {number} AUXPASS=9 AUXPASS value + * @property {number} CC=10 CC value + * @property {number} CCOMP=11 CCOMP value + * @property {number} CONJ=12 CONJ value + * @property {number} CSUBJ=13 CSUBJ value + * @property {number} CSUBJPASS=14 CSUBJPASS value + * @property {number} DEP=15 DEP value + * @property {number} DET=16 DET value + * @property {number} DISCOURSE=17 DISCOURSE value + * @property {number} DOBJ=18 DOBJ value + * @property {number} EXPL=19 EXPL value + * @property {number} GOESWITH=20 GOESWITH value + * @property {number} IOBJ=21 IOBJ value + * @property {number} MARK=22 MARK value + * @property {number} MWE=23 MWE value + * @property {number} MWV=24 MWV value + * @property {number} NEG=25 NEG value + * @property {number} NN=26 NN value + * @property {number} NPADVMOD=27 NPADVMOD value + * @property {number} NSUBJ=28 NSUBJ value + * @property {number} NSUBJPASS=29 NSUBJPASS value + * @property {number} NUM=30 NUM value + * @property {number} NUMBER=31 NUMBER value + * @property {number} P=32 P value + * @property {number} PARATAXIS=33 PARATAXIS value + * @property {number} PARTMOD=34 PARTMOD value + * @property {number} PCOMP=35 PCOMP value + * @property {number} POBJ=36 POBJ value + * @property {number} POSS=37 POSS value + * @property {number} POSTNEG=38 POSTNEG value + * @property {number} PRECOMP=39 PRECOMP value + * @property {number} PRECONJ=40 PRECONJ value + * @property {number} PREDET=41 PREDET value + * @property {number} PREF=42 PREF value + * @property {number} PREP=43 PREP value + * @property {number} PRONL=44 PRONL value + * @property {number} PRT=45 PRT value + * @property {number} PS=46 PS value + * @property {number} QUANTMOD=47 QUANTMOD value + * @property {number} RCMOD=48 RCMOD value + * @property {number} RCMODREL=49 RCMODREL value + * @property {number} RDROP=50 RDROP value + * @property {number} REF=51 REF value + * @property {number} REMNANT=52 REMNANT value + * @property {number} REPARANDUM=53 REPARANDUM value + * @property {number} ROOT=54 ROOT value + * @property {number} SNUM=55 SNUM value + * @property {number} SUFF=56 SUFF value + * @property {number} TMOD=57 TMOD value + * @property {number} TOPIC=58 TOPIC value + * @property {number} VMOD=59 VMOD value + * @property {number} VOCATIVE=60 VOCATIVE value + * @property {number} XCOMP=61 XCOMP value + * @property {number} SUFFIX=62 SUFFIX value + * @property {number} TITLE=63 TITLE value + * @property {number} ADVPHMOD=64 ADVPHMOD value + * @property {number} AUXCAUS=65 AUXCAUS value + * @property {number} AUXVV=66 AUXVV value + * @property {number} DTMOD=67 DTMOD value + * @property {number} FOREIGN=68 FOREIGN value + * @property {number} KW=69 KW value + * @property {number} LIST=70 LIST value + * @property {number} NOMC=71 NOMC value + * @property {number} NOMCSUBJ=72 NOMCSUBJ value + * @property {number} NOMCSUBJPASS=73 NOMCSUBJPASS value + * @property {number} NUMC=74 NUMC value + * @property {number} COP=75 COP value + * @property {number} DISLOCATED=76 DISLOCATED value + * @property {number} ASP=77 ASP value + * @property {number} GMOD=78 GMOD value + * @property {number} GOBJ=79 GOBJ value + * @property {number} INFMOD=80 INFMOD value + * @property {number} MES=81 MES value + * @property {number} NCOMP=82 NCOMP value + */ + DependencyEdge.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ABBREV"] = 1; + values[valuesById[2] = "ACOMP"] = 2; + values[valuesById[3] = "ADVCL"] = 3; + values[valuesById[4] = "ADVMOD"] = 4; + values[valuesById[5] = "AMOD"] = 5; + values[valuesById[6] = "APPOS"] = 6; + values[valuesById[7] = "ATTR"] = 7; + values[valuesById[8] = "AUX"] = 8; + values[valuesById[9] = "AUXPASS"] = 9; + values[valuesById[10] = "CC"] = 10; + values[valuesById[11] = "CCOMP"] = 11; + values[valuesById[12] = "CONJ"] = 12; + values[valuesById[13] = "CSUBJ"] = 13; + values[valuesById[14] = "CSUBJPASS"] = 14; + values[valuesById[15] = "DEP"] = 15; + values[valuesById[16] = "DET"] = 16; + values[valuesById[17] = "DISCOURSE"] = 17; + values[valuesById[18] = "DOBJ"] = 18; + values[valuesById[19] = "EXPL"] = 19; + values[valuesById[20] = "GOESWITH"] = 20; + values[valuesById[21] = "IOBJ"] = 21; + values[valuesById[22] = "MARK"] = 22; + values[valuesById[23] = "MWE"] = 23; + values[valuesById[24] = "MWV"] = 24; + values[valuesById[25] = "NEG"] = 25; + values[valuesById[26] = "NN"] = 26; + values[valuesById[27] = "NPADVMOD"] = 27; + values[valuesById[28] = "NSUBJ"] = 28; + values[valuesById[29] = "NSUBJPASS"] = 29; + values[valuesById[30] = "NUM"] = 30; + values[valuesById[31] = "NUMBER"] = 31; + values[valuesById[32] = "P"] = 32; + values[valuesById[33] = "PARATAXIS"] = 33; + values[valuesById[34] = "PARTMOD"] = 34; + values[valuesById[35] = "PCOMP"] = 35; + values[valuesById[36] = "POBJ"] = 36; + values[valuesById[37] = "POSS"] = 37; + values[valuesById[38] = "POSTNEG"] = 38; + values[valuesById[39] = "PRECOMP"] = 39; + values[valuesById[40] = "PRECONJ"] = 40; + values[valuesById[41] = "PREDET"] = 41; + values[valuesById[42] = "PREF"] = 42; + values[valuesById[43] = "PREP"] = 43; + values[valuesById[44] = "PRONL"] = 44; + values[valuesById[45] = "PRT"] = 45; + values[valuesById[46] = "PS"] = 46; + values[valuesById[47] = "QUANTMOD"] = 47; + values[valuesById[48] = "RCMOD"] = 48; + values[valuesById[49] = "RCMODREL"] = 49; + values[valuesById[50] = "RDROP"] = 50; + values[valuesById[51] = "REF"] = 51; + values[valuesById[52] = "REMNANT"] = 52; + values[valuesById[53] = "REPARANDUM"] = 53; + values[valuesById[54] = "ROOT"] = 54; + values[valuesById[55] = "SNUM"] = 55; + values[valuesById[56] = "SUFF"] = 56; + values[valuesById[57] = "TMOD"] = 57; + values[valuesById[58] = "TOPIC"] = 58; + values[valuesById[59] = "VMOD"] = 59; + values[valuesById[60] = "VOCATIVE"] = 60; + values[valuesById[61] = "XCOMP"] = 61; + values[valuesById[62] = "SUFFIX"] = 62; + values[valuesById[63] = "TITLE"] = 63; + values[valuesById[64] = "ADVPHMOD"] = 64; + values[valuesById[65] = "AUXCAUS"] = 65; + values[valuesById[66] = "AUXVV"] = 66; + values[valuesById[67] = "DTMOD"] = 67; + values[valuesById[68] = "FOREIGN"] = 68; + values[valuesById[69] = "KW"] = 69; + values[valuesById[70] = "LIST"] = 70; + values[valuesById[71] = "NOMC"] = 71; + values[valuesById[72] = "NOMCSUBJ"] = 72; + values[valuesById[73] = "NOMCSUBJPASS"] = 73; + values[valuesById[74] = "NUMC"] = 74; + values[valuesById[75] = "COP"] = 75; + values[valuesById[76] = "DISLOCATED"] = 76; + values[valuesById[77] = "ASP"] = 77; + values[valuesById[78] = "GMOD"] = 78; + values[valuesById[79] = "GOBJ"] = 79; + values[valuesById[80] = "INFMOD"] = 80; + values[valuesById[81] = "MES"] = 81; + values[valuesById[82] = "NCOMP"] = 82; + return values; + })(); + + return DependencyEdge; + })(); + + v1.EntityMention = (function() { + + /** + * Properties of an EntityMention. + * @memberof google.cloud.language.v1 + * @interface IEntityMention + * @property {google.cloud.language.v1.ITextSpan|null} [text] EntityMention text + * @property {google.cloud.language.v1.EntityMention.Type|null} [type] EntityMention type + * @property {google.cloud.language.v1.ISentiment|null} [sentiment] EntityMention sentiment + */ + + /** + * Constructs a new EntityMention. + * @memberof google.cloud.language.v1 + * @classdesc Represents an EntityMention. + * @implements IEntityMention + * @constructor + * @param {google.cloud.language.v1.IEntityMention=} [properties] Properties to set + */ + function EntityMention(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]]; + } + + /** + * EntityMention text. + * @member {google.cloud.language.v1.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1.EntityMention + * @instance + */ + EntityMention.prototype.text = null; + + /** + * EntityMention type. + * @member {google.cloud.language.v1.EntityMention.Type} type + * @memberof google.cloud.language.v1.EntityMention + * @instance + */ + EntityMention.prototype.type = 0; + + /** + * EntityMention sentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1.EntityMention + * @instance + */ + EntityMention.prototype.sentiment = null; + + /** + * Creates a new EntityMention instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {google.cloud.language.v1.IEntityMention=} [properties] Properties to set + * @returns {google.cloud.language.v1.EntityMention} EntityMention instance + */ + EntityMention.create = function create(properties) { + return new EntityMention(properties); + }; + + /** + * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1.EntityMention.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {google.cloud.language.v1.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.sentiment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1.EntityMention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {google.cloud.language.v1.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.EntityMention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.sentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityMention message. + * @function verify + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityMention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + 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.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates an EntityMention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.EntityMention} EntityMention + */ + EntityMention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.EntityMention) + return object; + var message = new $root.google.cloud.language.v1.EntityMention(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1.EntityMention.text: object expected"); + message.text = $root.google.cloud.language.v1.TextSpan.fromObject(object.text); + } + switch (object.type) { + case "TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "PROPER": + case 1: + message.type = 1; + break; + case "COMMON": + case 2: + message.type = 2; + break; + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1.EntityMention.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from an EntityMention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {google.cloud.language.v1.EntityMention} message EntityMention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityMention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.type = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.sentiment = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1.TextSpan.toObject(message.text, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1.EntityMention.Type[message.type] : message.type; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this EntityMention to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.EntityMention + * @instance + * @returns {Object.} JSON object + */ + EntityMention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityMention + * @function getTypeUrl + * @memberof google.cloud.language.v1.EntityMention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.EntityMention"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1.EntityMention.Type + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} COMMON=2 COMMON value + */ + EntityMention.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "COMMON"] = 2; + return values; + })(); + + return EntityMention; + })(); + + v1.TextSpan = (function() { + + /** + * Properties of a TextSpan. + * @memberof google.cloud.language.v1 + * @interface ITextSpan + * @property {string|null} [content] TextSpan content + * @property {number|null} [beginOffset] TextSpan beginOffset + */ + + /** + * Constructs a new TextSpan. + * @memberof google.cloud.language.v1 + * @classdesc Represents a TextSpan. + * @implements ITextSpan + * @constructor + * @param {google.cloud.language.v1.ITextSpan=} [properties] Properties to set + */ + function TextSpan(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]]; + } + + /** + * TextSpan content. + * @member {string} content + * @memberof google.cloud.language.v1.TextSpan + * @instance + */ + TextSpan.prototype.content = ""; + + /** + * TextSpan beginOffset. + * @member {number} beginOffset + * @memberof google.cloud.language.v1.TextSpan + * @instance + */ + TextSpan.prototype.beginOffset = 0; + + /** + * Creates a new TextSpan instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {google.cloud.language.v1.ITextSpan=} [properties] Properties to set + * @returns {google.cloud.language.v1.TextSpan} TextSpan instance + */ + TextSpan.create = function create(properties) { + return new TextSpan(properties); + }; + + /** + * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1.TextSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {google.cloud.language.v1.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.beginOffset != null && Object.hasOwnProperty.call(message, "beginOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.beginOffset); + return writer; + }; + + /** + * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1.TextSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {google.cloud.language.v1.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSpan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.TextSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.beginOffset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSpan message. + * @function verify + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + if (!$util.isInteger(message.beginOffset)) + return "beginOffset: integer expected"; + return null; + }; + + /** + * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.TextSpan} TextSpan + */ + TextSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.TextSpan) + return object; + var message = new $root.google.cloud.language.v1.TextSpan(); + if (object.content != null) + message.content = String(object.content); + if (object.beginOffset != null) + message.beginOffset = object.beginOffset | 0; + return message; + }; + + /** + * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {google.cloud.language.v1.TextSpan} message TextSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.beginOffset = 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + object.beginOffset = message.beginOffset; + return object; + }; + + /** + * Converts this TextSpan to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.TextSpan + * @instance + * @returns {Object.} JSON object + */ + TextSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSpan + * @function getTypeUrl + * @memberof google.cloud.language.v1.TextSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.TextSpan"; + }; + + return TextSpan; + })(); + + v1.ClassificationCategory = (function() { + + /** + * Properties of a ClassificationCategory. + * @memberof google.cloud.language.v1 + * @interface IClassificationCategory + * @property {string|null} [name] ClassificationCategory name + * @property {number|null} [confidence] ClassificationCategory confidence + */ + + /** + * Constructs a new ClassificationCategory. + * @memberof google.cloud.language.v1 + * @classdesc Represents a ClassificationCategory. + * @implements IClassificationCategory + * @constructor + * @param {google.cloud.language.v1.IClassificationCategory=} [properties] Properties to set + */ + function ClassificationCategory(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]]; + } + + /** + * ClassificationCategory name. + * @member {string} name + * @memberof google.cloud.language.v1.ClassificationCategory + * @instance + */ + ClassificationCategory.prototype.name = ""; + + /** + * ClassificationCategory confidence. + * @member {number} confidence + * @memberof google.cloud.language.v1.ClassificationCategory + * @instance + */ + ClassificationCategory.prototype.confidence = 0; + + /** + * Creates a new ClassificationCategory instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {google.cloud.language.v1.IClassificationCategory=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassificationCategory} ClassificationCategory instance + */ + ClassificationCategory.create = function create(properties) { + return new ClassificationCategory(properties); + }; + + /** + * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1.ClassificationCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {google.cloud.language.v1.IClassificationCategory} message ClassificationCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationCategory.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {google.cloud.language.v1.IClassificationCategory} message ClassificationCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassificationCategory} ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationCategory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassificationCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassificationCategory} ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationCategory message. + * @function verify + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationCategory.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.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassificationCategory} ClassificationCategory + */ + ClassificationCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassificationCategory) + return object; + var message = new $root.google.cloud.language.v1.ClassificationCategory(); + if (object.name != null) + message.name = String(object.name); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {google.cloud.language.v1.ClassificationCategory} message ClassificationCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.confidence = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this ClassificationCategory to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassificationCategory + * @instance + * @returns {Object.} JSON object + */ + ClassificationCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationCategory + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassificationCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassificationCategory"; + }; + + return ClassificationCategory; + })(); + + v1.ClassificationModelOptions = (function() { + + /** + * Properties of a ClassificationModelOptions. + * @memberof google.cloud.language.v1 + * @interface IClassificationModelOptions + * @property {google.cloud.language.v1.ClassificationModelOptions.IV1Model|null} [v1Model] ClassificationModelOptions v1Model + * @property {google.cloud.language.v1.ClassificationModelOptions.IV2Model|null} [v2Model] ClassificationModelOptions v2Model + */ + + /** + * Constructs a new ClassificationModelOptions. + * @memberof google.cloud.language.v1 + * @classdesc Represents a ClassificationModelOptions. + * @implements IClassificationModelOptions + * @constructor + * @param {google.cloud.language.v1.IClassificationModelOptions=} [properties] Properties to set + */ + function ClassificationModelOptions(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]]; + } + + /** + * ClassificationModelOptions v1Model. + * @member {google.cloud.language.v1.ClassificationModelOptions.IV1Model|null|undefined} v1Model + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @instance + */ + ClassificationModelOptions.prototype.v1Model = null; + + /** + * ClassificationModelOptions v2Model. + * @member {google.cloud.language.v1.ClassificationModelOptions.IV2Model|null|undefined} v2Model + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @instance + */ + ClassificationModelOptions.prototype.v2Model = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ClassificationModelOptions modelType. + * @member {"v1Model"|"v2Model"|undefined} modelType + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @instance + */ + Object.defineProperty(ClassificationModelOptions.prototype, "modelType", { + get: $util.oneOfGetter($oneOfFields = ["v1Model", "v2Model"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClassificationModelOptions instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1.IClassificationModelOptions=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassificationModelOptions} ClassificationModelOptions instance + */ + ClassificationModelOptions.create = function create(properties) { + return new ClassificationModelOptions(properties); + }; + + /** + * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationModelOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v1Model != null && Object.hasOwnProperty.call(message, "v1Model")) + $root.google.cloud.language.v1.ClassificationModelOptions.V1Model.encode(message.v1Model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v2Model != null && Object.hasOwnProperty.call(message, "v2Model")) + $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.encode(message.v2Model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationModelOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassificationModelOptions} ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationModelOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassificationModelOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.v1Model = $root.google.cloud.language.v1.ClassificationModelOptions.V1Model.decode(reader, reader.uint32()); + break; + } + case 2: { + message.v2Model = $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassificationModelOptions} ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationModelOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationModelOptions message. + * @function verify + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationModelOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1.ClassificationModelOptions.V1Model.verify(message.v1Model); + if (error) + return "v1Model." + error; + } + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + if (properties.modelType === 1) + return "modelType: multiple values"; + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.verify(message.v2Model); + if (error) + return "v2Model." + error; + } + } + return null; + }; + + /** + * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassificationModelOptions} ClassificationModelOptions + */ + ClassificationModelOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassificationModelOptions) + return object; + var message = new $root.google.cloud.language.v1.ClassificationModelOptions(); + if (object.v1Model != null) { + if (typeof object.v1Model !== "object") + throw TypeError(".google.cloud.language.v1.ClassificationModelOptions.v1Model: object expected"); + message.v1Model = $root.google.cloud.language.v1.ClassificationModelOptions.V1Model.fromObject(object.v1Model); + } + if (object.v2Model != null) { + if (typeof object.v2Model !== "object") + throw TypeError(".google.cloud.language.v1.ClassificationModelOptions.v2Model: object expected"); + message.v2Model = $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.fromObject(object.v2Model); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions} message ClassificationModelOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationModelOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + object.v1Model = $root.google.cloud.language.v1.ClassificationModelOptions.V1Model.toObject(message.v1Model, options); + if (options.oneofs) + object.modelType = "v1Model"; + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + object.v2Model = $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.toObject(message.v2Model, options); + if (options.oneofs) + object.modelType = "v2Model"; + } + return object; + }; + + /** + * Converts this ClassificationModelOptions to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @instance + * @returns {Object.} JSON object + */ + ClassificationModelOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationModelOptions + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationModelOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassificationModelOptions"; + }; + + ClassificationModelOptions.V1Model = (function() { + + /** + * Properties of a V1Model. + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @interface IV1Model + */ + + /** + * Constructs a new V1Model. + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @classdesc Represents a V1Model. + * @implements IV1Model + * @constructor + * @param {google.cloud.language.v1.ClassificationModelOptions.IV1Model=} [properties] Properties to set + */ + function V1Model(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 V1Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV1Model=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassificationModelOptions.V1Model} V1Model instance + */ + V1Model.create = function create(properties) { + return new V1Model(properties); + }; + + /** + * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a V1Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassificationModelOptions.V1Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a V1Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V1Model message. + * @function verify + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V1Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a V1Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassificationModelOptions.V1Model} V1Model + */ + V1Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassificationModelOptions.V1Model) + return object; + return new $root.google.cloud.language.v1.ClassificationModelOptions.V1Model(); + }; + + /** + * Creates a plain object from a V1Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.V1Model} message V1Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V1Model.toObject = function toObject() { + return {}; + }; + + /** + * Converts this V1Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @instance + * @returns {Object.} JSON object + */ + V1Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for V1Model + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassificationModelOptions.V1Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V1Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassificationModelOptions.V1Model"; + }; + + return V1Model; + })(); + + ClassificationModelOptions.V2Model = (function() { + + /** + * Properties of a V2Model. + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @interface IV2Model + * @property {google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null} [contentCategoriesVersion] V2Model contentCategoriesVersion + */ + + /** + * Constructs a new V2Model. + * @memberof google.cloud.language.v1.ClassificationModelOptions + * @classdesc Represents a V2Model. + * @implements IV2Model + * @constructor + * @param {google.cloud.language.v1.ClassificationModelOptions.IV2Model=} [properties] Properties to set + */ + function V2Model(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]]; + } + + /** + * V2Model contentCategoriesVersion. + * @member {google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion} contentCategoriesVersion + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @instance + */ + V2Model.prototype.contentCategoriesVersion = 0; + + /** + * Creates a new V2Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV2Model=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassificationModelOptions.V2Model} V2Model instance + */ + V2Model.create = function create(properties) { + return new V2Model(properties); + }; + + /** + * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentCategoriesVersion != null && Object.hasOwnProperty.call(message, "contentCategoriesVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.contentCategoriesVersion); + return writer; + }; + + /** + * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a V2Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassificationModelOptions.V2Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentCategoriesVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a V2Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V2Model message. + * @function verify + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V2Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + switch (message.contentCategoriesVersion) { + default: + return "contentCategoriesVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a V2Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassificationModelOptions.V2Model} V2Model + */ + V2Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassificationModelOptions.V2Model) + return object; + var message = new $root.google.cloud.language.v1.ClassificationModelOptions.V2Model(); + switch (object.contentCategoriesVersion) { + case "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": + case 0: + message.contentCategoriesVersion = 0; + break; + case "V1": + case 1: + message.contentCategoriesVersion = 1; + break; + case "V2": + case 2: + message.contentCategoriesVersion = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a V2Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1.ClassificationModelOptions.V2Model} message V2Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V2Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contentCategoriesVersion = options.enums === String ? "CONTENT_CATEGORIES_VERSION_UNSPECIFIED" : 0; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + object.contentCategoriesVersion = options.enums === String ? $root.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] : message.contentCategoriesVersion; + return object; + }; + + /** + * Converts this V2Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @instance + * @returns {Object.} JSON object + */ + V2Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for V2Model + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassificationModelOptions.V2Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V2Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassificationModelOptions.V2Model"; + }; + + /** + * ContentCategoriesVersion enum. + * @name google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + * @enum {number} + * @property {number} CONTENT_CATEGORIES_VERSION_UNSPECIFIED=0 CONTENT_CATEGORIES_VERSION_UNSPECIFIED value + * @property {number} V1=1 V1 value + * @property {number} V2=2 V2 value + */ + V2Model.ContentCategoriesVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "V1"] = 1; + values[valuesById[2] = "V2"] = 2; + return values; + })(); + + return V2Model; + })(); + + return ClassificationModelOptions; + })(); + + v1.AnalyzeSentimentRequest = (function() { + + /** + * Properties of an AnalyzeSentimentRequest. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeSentimentRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnalyzeSentimentRequest document + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnalyzeSentimentRequest encodingType + */ + + /** + * Constructs a new AnalyzeSentimentRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeSentimentRequest. + * @implements IAnalyzeSentimentRequest + * @constructor + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest=} [properties] Properties to set + */ + function AnalyzeSentimentRequest(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]]; + } + + /** + * AnalyzeSentimentRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @instance + */ + AnalyzeSentimentRequest.prototype.document = null; + + /** + * AnalyzeSentimentRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @instance + */ + AnalyzeSentimentRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeSentimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeSentimentRequest} AnalyzeSentimentRequest instance + */ + AnalyzeSentimentRequest.create = function create(properties) { + return new AnalyzeSentimentRequest(properties); + }; + + /** + * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeSentimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSentimentRequest message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSentimentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeSentimentRequest} AnalyzeSentimentRequest + */ + AnalyzeSentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeSentimentRequest) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeSentimentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSentimentRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1.AnalyzeSentimentRequest} message AnalyzeSentimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSentimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeSentimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSentimentRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeSentimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeSentimentRequest"; + }; + + return AnalyzeSentimentRequest; + })(); + + v1.AnalyzeSentimentResponse = (function() { + + /** + * Properties of an AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeSentimentResponse + * @property {google.cloud.language.v1.ISentiment|null} [documentSentiment] AnalyzeSentimentResponse documentSentiment + * @property {string|null} [language] AnalyzeSentimentResponse language + * @property {Array.|null} [sentences] AnalyzeSentimentResponse sentences + */ + + /** + * Constructs a new AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeSentimentResponse. + * @implements IAnalyzeSentimentResponse + * @constructor + * @param {google.cloud.language.v1.IAnalyzeSentimentResponse=} [properties] Properties to set + */ + function AnalyzeSentimentResponse(properties) { + this.sentences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeSentimentResponse documentSentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.documentSentiment = null; + + /** + * AnalyzeSentimentResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.language = ""; + + /** + * AnalyzeSentimentResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.sentences = $util.emptyArray; + + /** + * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeSentimentResponse} AnalyzeSentimentResponse instance + */ + AnalyzeSentimentResponse.create = function create(properties) { + return new AnalyzeSentimentResponse(properties); + }; + + /** + * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1.Sentence.encode(message.sentences[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSentimentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeSentimentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.language = reader.string(); + break; + } + case 3: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1.Sentence.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSentimentResponse message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSentimentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeSentimentResponse} AnalyzeSentimentResponse + */ + AnalyzeSentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeSentimentResponse) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeSentimentResponse(); + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSentimentResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.documentSentiment); + } + if (object.language != null) + message.language = String(object.language); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1.AnalyzeSentimentResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSentimentResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1.Sentence.fromObject(object.sentences[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1.AnalyzeSentimentResponse} message AnalyzeSentimentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSentimentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sentences = []; + if (options.defaults) { + object.documentSentiment = null; + object.language = ""; + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.documentSentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1.Sentence.toObject(message.sentences[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeSentimentResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSentimentResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeSentimentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeSentimentResponse"; + }; + + return AnalyzeSentimentResponse; + })(); + + v1.AnalyzeEntitySentimentRequest = (function() { + + /** + * Properties of an AnalyzeEntitySentimentRequest. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeEntitySentimentRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnalyzeEntitySentimentRequest document + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnalyzeEntitySentimentRequest encodingType + */ + + /** + * Constructs a new AnalyzeEntitySentimentRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeEntitySentimentRequest. + * @implements IAnalyzeEntitySentimentRequest + * @constructor + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + */ + function AnalyzeEntitySentimentRequest(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]]; + } + + /** + * AnalyzeEntitySentimentRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @instance + */ + AnalyzeEntitySentimentRequest.prototype.document = null; + + /** + * AnalyzeEntitySentimentRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @instance + */ + AnalyzeEntitySentimentRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest instance + */ + AnalyzeEntitySentimentRequest.create = function create(properties) { + return new AnalyzeEntitySentimentRequest(properties); + }; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeEntitySentimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitySentimentRequest message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitySentimentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + */ + AnalyzeEntitySentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeEntitySentimentRequest) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeEntitySentimentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeEntitySentimentRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1.AnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitySentimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeEntitySentimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitySentimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitySentimentRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitySentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeEntitySentimentRequest"; + }; + + return AnalyzeEntitySentimentRequest; + })(); + + v1.AnalyzeEntitySentimentResponse = (function() { + + /** + * Properties of an AnalyzeEntitySentimentResponse. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeEntitySentimentResponse + * @property {Array.|null} [entities] AnalyzeEntitySentimentResponse entities + * @property {string|null} [language] AnalyzeEntitySentimentResponse language + */ + + /** + * Constructs a new AnalyzeEntitySentimentResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeEntitySentimentResponse. + * @implements IAnalyzeEntitySentimentResponse + * @constructor + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + */ + function AnalyzeEntitySentimentResponse(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeEntitySentimentResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @instance + */ + AnalyzeEntitySentimentResponse.prototype.entities = $util.emptyArray; + + /** + * AnalyzeEntitySentimentResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @instance + */ + AnalyzeEntitySentimentResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse instance + */ + AnalyzeEntitySentimentResponse.create = function create(properties) { + return new AnalyzeEntitySentimentResponse(properties); + }; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeEntitySentimentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1.Entity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitySentimentResponse message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitySentimentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + */ + AnalyzeEntitySentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeEntitySentimentResponse) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeEntitySentimentResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1.AnalyzeEntitySentimentResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeEntitySentimentResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1.Entity.fromObject(object.entities[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1.AnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitySentimentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) + object.language = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1.Entity.toObject(message.entities[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeEntitySentimentResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitySentimentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitySentimentResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeEntitySentimentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitySentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeEntitySentimentResponse"; + }; + + return AnalyzeEntitySentimentResponse; + })(); + + v1.AnalyzeEntitiesRequest = (function() { + + /** + * Properties of an AnalyzeEntitiesRequest. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeEntitiesRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnalyzeEntitiesRequest document + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnalyzeEntitiesRequest encodingType + */ + + /** + * Constructs a new AnalyzeEntitiesRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeEntitiesRequest. + * @implements IAnalyzeEntitiesRequest + * @constructor + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest=} [properties] Properties to set + */ + function AnalyzeEntitiesRequest(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]]; + } + + /** + * AnalyzeEntitiesRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @instance + */ + AnalyzeEntitiesRequest.prototype.document = null; + + /** + * AnalyzeEntitiesRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @instance + */ + AnalyzeEntitiesRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest instance + */ + AnalyzeEntitiesRequest.create = function create(properties) { + return new AnalyzeEntitiesRequest(properties); + }; + + /** + * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitiesRequest message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + */ + AnalyzeEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeEntitiesRequest) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeEntitiesRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeEntitiesRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1.AnalyzeEntitiesRequest} message AnalyzeEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitiesRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeEntitiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeEntitiesRequest"; + }; + + return AnalyzeEntitiesRequest; + })(); + + v1.AnalyzeEntitiesResponse = (function() { + + /** + * Properties of an AnalyzeEntitiesResponse. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeEntitiesResponse + * @property {Array.|null} [entities] AnalyzeEntitiesResponse entities + * @property {string|null} [language] AnalyzeEntitiesResponse language + */ + + /** + * Constructs a new AnalyzeEntitiesResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeEntitiesResponse. + * @implements IAnalyzeEntitiesResponse + * @constructor + * @param {google.cloud.language.v1.IAnalyzeEntitiesResponse=} [properties] Properties to set + */ + function AnalyzeEntitiesResponse(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeEntitiesResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @instance + */ + AnalyzeEntitiesResponse.prototype.entities = $util.emptyArray; + + /** + * AnalyzeEntitiesResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @instance + */ + AnalyzeEntitiesResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse instance + */ + AnalyzeEntitiesResponse.create = function create(properties) { + return new AnalyzeEntitiesResponse(properties); + }; + + /** + * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1.Entity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitiesResponse message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + */ + AnalyzeEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeEntitiesResponse) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeEntitiesResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1.AnalyzeEntitiesResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeEntitiesResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1.Entity.fromObject(object.entities[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1.AnalyzeEntitiesResponse} message AnalyzeEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) + object.language = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1.Entity.toObject(message.entities[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeEntitiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitiesResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeEntitiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeEntitiesResponse"; + }; + + return AnalyzeEntitiesResponse; + })(); + + v1.AnalyzeSyntaxRequest = (function() { + + /** + * Properties of an AnalyzeSyntaxRequest. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeSyntaxRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnalyzeSyntaxRequest document + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnalyzeSyntaxRequest encodingType + */ + + /** + * Constructs a new AnalyzeSyntaxRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeSyntaxRequest. + * @implements IAnalyzeSyntaxRequest + * @constructor + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest=} [properties] Properties to set + */ + function AnalyzeSyntaxRequest(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]]; + } + + /** + * AnalyzeSyntaxRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @instance + */ + AnalyzeSyntaxRequest.prototype.document = null; + + /** + * AnalyzeSyntaxRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @instance + */ + AnalyzeSyntaxRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeSyntaxRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest instance + */ + AnalyzeSyntaxRequest.create = function create(properties) { + return new AnalyzeSyntaxRequest(properties); + }; + + /** + * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeSyntaxRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSyntaxRequest message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSyntaxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + */ + AnalyzeSyntaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeSyntaxRequest) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeSyntaxRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSyntaxRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1.AnalyzeSyntaxRequest} message AnalyzeSyntaxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSyntaxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeSyntaxRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSyntaxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSyntaxRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeSyntaxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSyntaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeSyntaxRequest"; + }; + + return AnalyzeSyntaxRequest; + })(); + + v1.AnalyzeSyntaxResponse = (function() { + + /** + * Properties of an AnalyzeSyntaxResponse. + * @memberof google.cloud.language.v1 + * @interface IAnalyzeSyntaxResponse + * @property {Array.|null} [sentences] AnalyzeSyntaxResponse sentences + * @property {Array.|null} [tokens] AnalyzeSyntaxResponse tokens + * @property {string|null} [language] AnalyzeSyntaxResponse language + */ + + /** + * Constructs a new AnalyzeSyntaxResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnalyzeSyntaxResponse. + * @implements IAnalyzeSyntaxResponse + * @constructor + * @param {google.cloud.language.v1.IAnalyzeSyntaxResponse=} [properties] Properties to set + */ + function AnalyzeSyntaxResponse(properties) { + this.sentences = []; + this.tokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeSyntaxResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.sentences = $util.emptyArray; + + /** + * AnalyzeSyntaxResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.tokens = $util.emptyArray; + + /** + * AnalyzeSyntaxResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeSyntaxResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse instance + */ + AnalyzeSyntaxResponse.create = function create(properties) { + return new AnalyzeSyntaxResponse(properties); + }; + + /** + * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnalyzeSyntaxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnalyzeSyntaxResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1.Sentence.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1.Token.decode(reader, reader.uint32())); + break; + } + case 3: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSyntaxResponse message. + * @function verify + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSyntaxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + */ + AnalyzeSyntaxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnalyzeSyntaxResponse) + return object; + var message = new $root.google.cloud.language.v1.AnalyzeSyntaxResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1.AnalyzeSyntaxResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSyntaxResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1.Sentence.fromObject(object.sentences[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1.AnalyzeSyntaxResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnalyzeSyntaxResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1.Token.fromObject(object.tokens[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1.AnalyzeSyntaxResponse} message AnalyzeSyntaxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSyntaxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + } + if (options.defaults) + object.language = ""; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1.Sentence.toObject(message.sentences[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1.Token.toObject(message.tokens[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeSyntaxResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSyntaxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSyntaxResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnalyzeSyntaxResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSyntaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnalyzeSyntaxResponse"; + }; + + return AnalyzeSyntaxResponse; + })(); + + v1.ClassifyTextRequest = (function() { + + /** + * Properties of a ClassifyTextRequest. + * @memberof google.cloud.language.v1 + * @interface IClassifyTextRequest + * @property {google.cloud.language.v1.IDocument|null} [document] ClassifyTextRequest document + * @property {google.cloud.language.v1.IClassificationModelOptions|null} [classificationModelOptions] ClassifyTextRequest classificationModelOptions + */ + + /** + * Constructs a new ClassifyTextRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents a ClassifyTextRequest. + * @implements IClassifyTextRequest + * @constructor + * @param {google.cloud.language.v1.IClassifyTextRequest=} [properties] Properties to set + */ + function ClassifyTextRequest(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]]; + } + + /** + * ClassifyTextRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @instance + */ + ClassifyTextRequest.prototype.document = null; + + /** + * ClassifyTextRequest classificationModelOptions. + * @member {google.cloud.language.v1.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @instance + */ + ClassifyTextRequest.prototype.classificationModelOptions = null; + + /** + * Creates a new ClassifyTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1.IClassifyTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassifyTextRequest} ClassifyTextRequest instance + */ + ClassifyTextRequest.create = function create(properties) { + return new ClassifyTextRequest(properties); + }; + + /** + * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1.ClassifyTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassifyTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassifyTextRequest} ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassifyTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassifyTextRequest} ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassifyTextRequest message. + * @function verify + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassifyTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } + return null; + }; + + /** + * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassifyTextRequest} ClassifyTextRequest + */ + ClassifyTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassifyTextRequest) + return object; + var message = new $root.google.cloud.language.v1.ClassifyTextRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.ClassifyTextRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1.ClassifyTextRequest.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.fromObject(object.classificationModelOptions); + } + return message; + }; + + /** + * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1.ClassifyTextRequest} message ClassifyTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassifyTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.classificationModelOptions = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + return object; + }; + + /** + * Converts this ClassifyTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @instance + * @returns {Object.} JSON object + */ + ClassifyTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassifyTextRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassifyTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassifyTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassifyTextRequest"; + }; + + return ClassifyTextRequest; + })(); + + v1.ClassifyTextResponse = (function() { + + /** + * Properties of a ClassifyTextResponse. + * @memberof google.cloud.language.v1 + * @interface IClassifyTextResponse + * @property {Array.|null} [categories] ClassifyTextResponse categories + */ + + /** + * Constructs a new ClassifyTextResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents a ClassifyTextResponse. + * @implements IClassifyTextResponse + * @constructor + * @param {google.cloud.language.v1.IClassifyTextResponse=} [properties] Properties to set + */ + function ClassifyTextResponse(properties) { + this.categories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassifyTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @instance + */ + ClassifyTextResponse.prototype.categories = $util.emptyArray; + + /** + * Creates a new ClassifyTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1.IClassifyTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.ClassifyTextResponse} ClassifyTextResponse instance + */ + ClassifyTextResponse.create = function create(properties) { + return new ClassifyTextResponse(properties); + }; + + /** + * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1.ClassifyTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.ClassifyTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.ClassifyTextResponse} ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.ClassifyTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.ClassifyTextResponse} ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassifyTextResponse message. + * @function verify + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassifyTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + return null; + }; + + /** + * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.ClassifyTextResponse} ClassifyTextResponse + */ + ClassifyTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.ClassifyTextResponse) + return object; + var message = new $root.google.cloud.language.v1.ClassifyTextResponse(); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1.ClassifyTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1.ClassifyTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.categories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1.ClassifyTextResponse} message ClassifyTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassifyTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.categories = []; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.categories[j], options); + } + return object; + }; + + /** + * Converts this ClassifyTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @instance + * @returns {Object.} JSON object + */ + ClassifyTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassifyTextResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.ClassifyTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassifyTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.ClassifyTextResponse"; + }; + + return ClassifyTextResponse; + })(); + + v1.AnnotateTextRequest = (function() { + + /** + * Properties of an AnnotateTextRequest. + * @memberof google.cloud.language.v1 + * @interface IAnnotateTextRequest + * @property {google.cloud.language.v1.IDocument|null} [document] AnnotateTextRequest document + * @property {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null} [features] AnnotateTextRequest features + * @property {google.cloud.language.v1.EncodingType|null} [encodingType] AnnotateTextRequest encodingType + */ + + /** + * Constructs a new AnnotateTextRequest. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnnotateTextRequest. + * @implements IAnnotateTextRequest + * @constructor + * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set + */ + function AnnotateTextRequest(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]]; + } + + /** + * AnnotateTextRequest document. + * @member {google.cloud.language.v1.IDocument|null|undefined} document + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.document = null; + + /** + * AnnotateTextRequest features. + * @member {google.cloud.language.v1.AnnotateTextRequest.IFeatures|null|undefined} features + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.features = null; + + /** + * AnnotateTextRequest encodingType. + * @member {google.cloud.language.v1.EncodingType} encodingType + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.encodingType = 0; + + /** + * Creates a new AnnotateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1.IAnnotateTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest instance + */ + AnnotateTextRequest.create = function create(properties) { + return new AnnotateTextRequest(properties); + }; + + /** + * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.cloud.language.v1.AnnotateTextRequest.Features.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.decode(reader, reader.uint32()); + break; + } + case 3: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateTextRequest message. + * @function verify + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.cloud.language.v1.AnnotateTextRequest.Features.verify(message.features); + if (error) + return "features." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnnotateTextRequest} AnnotateTextRequest + */ + AnnotateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest) + return object; + var message = new $root.google.cloud.language.v1.AnnotateTextRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.document: object expected"); + message.document = $root.google.cloud.language.v1.Document.fromObject(object.document); + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.features: object expected"); + message.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.fromObject(object.features); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest} message AnnotateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.features = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1.Document.toObject(message.document, options); + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.cloud.language.v1.AnnotateTextRequest.Features.toObject(message.features, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnnotateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateTextRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest"; + }; + + AnnotateTextRequest.Features = (function() { + + /** + * Properties of a Features. + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @interface IFeatures + * @property {boolean|null} [extractSyntax] Features extractSyntax + * @property {boolean|null} [extractEntities] Features extractEntities + * @property {boolean|null} [extractDocumentSentiment] Features extractDocumentSentiment + * @property {boolean|null} [extractEntitySentiment] Features extractEntitySentiment + * @property {boolean|null} [classifyText] Features classifyText + * @property {google.cloud.language.v1.IClassificationModelOptions|null} [classificationModelOptions] Features classificationModelOptions + */ + + /** + * Constructs a new Features. + * @memberof google.cloud.language.v1.AnnotateTextRequest + * @classdesc Represents a Features. + * @implements IFeatures + * @constructor + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set + */ + function Features(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]]; + } + + /** + * Features extractSyntax. + * @member {boolean} extractSyntax + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractSyntax = false; + + /** + * Features extractEntities. + * @member {boolean} extractEntities + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntities = false; + + /** + * Features extractDocumentSentiment. + * @member {boolean} extractDocumentSentiment + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractDocumentSentiment = false; + + /** + * Features extractEntitySentiment. + * @member {boolean} extractEntitySentiment + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntitySentiment = false; + + /** + * Features classifyText. + * @member {boolean} classifyText + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classifyText = false; + + /** + * Features classificationModelOptions. + * @member {google.cloud.language.v1.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classificationModelOptions = null; + + /** + * Creates a new Features instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features instance + */ + Features.create = function create(properties) { + return new Features(properties); + }; + + /** + * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extractSyntax != null && Object.hasOwnProperty.call(message, "extractSyntax")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.extractSyntax); + if (message.extractEntities != null && Object.hasOwnProperty.call(message, "extractEntities")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.extractEntities); + if (message.extractDocumentSentiment != null && Object.hasOwnProperty.call(message, "extractDocumentSentiment")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.extractDocumentSentiment); + if (message.extractEntitySentiment != null && Object.hasOwnProperty.call(message, "extractEntitySentiment")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.extractEntitySentiment); + if (message.classifyText != null && Object.hasOwnProperty.call(message, "classifyText")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.classifyText); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextRequest.Features.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Features message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extractSyntax = reader.bool(); + break; + } + case 2: { + message.extractEntities = reader.bool(); + break; + } + case 3: { + message.extractDocumentSentiment = reader.bool(); + break; + } + case 4: { + message.extractEntitySentiment = reader.bool(); + break; + } + case 6: { + message.classifyText = reader.bool(); + break; + } + case 10: { + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Features message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Features message. + * @function verify + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Features.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + if (typeof message.extractSyntax !== "boolean") + return "extractSyntax: boolean expected"; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + if (typeof message.extractEntities !== "boolean") + return "extractEntities: boolean expected"; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + if (typeof message.extractDocumentSentiment !== "boolean") + return "extractDocumentSentiment: boolean expected"; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + if (typeof message.extractEntitySentiment !== "boolean") + return "extractEntitySentiment: boolean expected"; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + if (typeof message.classifyText !== "boolean") + return "classifyText: boolean expected"; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } + return null; + }; + + /** + * Creates a Features message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnnotateTextRequest.Features} Features + */ + Features.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextRequest.Features) + return object; + var message = new $root.google.cloud.language.v1.AnnotateTextRequest.Features(); + if (object.extractSyntax != null) + message.extractSyntax = Boolean(object.extractSyntax); + if (object.extractEntities != null) + message.extractEntities = Boolean(object.extractEntities); + if (object.extractDocumentSentiment != null) + message.extractDocumentSentiment = Boolean(object.extractDocumentSentiment); + if (object.extractEntitySentiment != null) + message.extractEntitySentiment = Boolean(object.extractEntitySentiment); + if (object.classifyText != null) + message.classifyText = Boolean(object.classifyText); + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextRequest.Features.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.fromObject(object.classificationModelOptions); + } + return message; + }; + + /** + * Creates a plain object from a Features message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1.AnnotateTextRequest.Features} message Features + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Features.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extractSyntax = false; + object.extractEntities = false; + object.extractDocumentSentiment = false; + object.extractEntitySentiment = false; + object.classifyText = false; + object.classificationModelOptions = null; + } + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + object.extractSyntax = message.extractSyntax; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + object.extractEntities = message.extractEntities; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + object.extractDocumentSentiment = message.extractDocumentSentiment; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + object.extractEntitySentiment = message.extractEntitySentiment; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + object.classifyText = message.classifyText; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + return object; + }; + + /** + * Converts this Features to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @instance + * @returns {Object.} JSON object + */ + Features.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Features + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnnotateTextRequest.Features + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Features.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextRequest.Features"; + }; + + return Features; + })(); + + return AnnotateTextRequest; + })(); + + v1.AnnotateTextResponse = (function() { + + /** + * Properties of an AnnotateTextResponse. + * @memberof google.cloud.language.v1 + * @interface IAnnotateTextResponse + * @property {Array.|null} [sentences] AnnotateTextResponse sentences + * @property {Array.|null} [tokens] AnnotateTextResponse tokens + * @property {Array.|null} [entities] AnnotateTextResponse entities + * @property {google.cloud.language.v1.ISentiment|null} [documentSentiment] AnnotateTextResponse documentSentiment + * @property {string|null} [language] AnnotateTextResponse language + * @property {Array.|null} [categories] AnnotateTextResponse categories + */ + + /** + * Constructs a new AnnotateTextResponse. + * @memberof google.cloud.language.v1 + * @classdesc Represents an AnnotateTextResponse. + * @implements IAnnotateTextResponse + * @constructor + * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set + */ + function AnnotateTextResponse(properties) { + this.sentences = []; + this.tokens = []; + this.entities = []; + this.categories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateTextResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.sentences = $util.emptyArray; + + /** + * AnnotateTextResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.tokens = $util.emptyArray; + + /** + * AnnotateTextResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.entities = $util.emptyArray; + + /** + * AnnotateTextResponse documentSentiment. + * @member {google.cloud.language.v1.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.documentSentiment = null; + + /** + * AnnotateTextResponse language. + * @member {string} language + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.language = ""; + + /** + * AnnotateTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.categories = $util.emptyArray; + + /** + * Creates a new AnnotateTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1.IAnnotateTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse instance + */ + AnnotateTextResponse.create = function create(properties) { + return new AnnotateTextResponse(properties); + }; + + /** + * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.language); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1.AnnotateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1.AnnotateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1.Sentence.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1.Token.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1.Entity.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.language = reader.string(); + break; + } + case 6: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1.ClassificationCategory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateTextResponse message. + * @function verify + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1.ClassificationCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1.AnnotateTextResponse} AnnotateTextResponse + */ + AnnotateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1.AnnotateTextResponse) + return object; + var message = new $root.google.cloud.language.v1.AnnotateTextResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1.Sentence.fromObject(object.sentences[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1.Token.fromObject(object.tokens[i]); + } + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1.Entity.fromObject(object.entities[i]); + } + } + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1.Sentiment.fromObject(object.documentSentiment); + } + if (object.language != null) + message.language = String(object.language); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1.AnnotateTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1.ClassificationCategory.fromObject(object.categories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1.AnnotateTextResponse} message AnnotateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + object.entities = []; + object.categories = []; + } + if (options.defaults) { + object.documentSentiment = null; + object.language = ""; + } + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1.Sentence.toObject(message.sentences[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1.Token.toObject(message.tokens[j], options); + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1.Entity.toObject(message.entities[j], options); + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1.Sentiment.toObject(message.documentSentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1.ClassificationCategory.toObject(message.categories[j], options); + } + return object; + }; + + /** + * Converts this AnnotateTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateTextResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1.AnnotateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1.AnnotateTextResponse"; + }; + + return AnnotateTextResponse; + })(); + + return v1; + })(); + + language.v1beta2 = (function() { + + /** + * Namespace v1beta2. + * @memberof google.cloud.language + * @namespace + */ + var v1beta2 = {}; + + v1beta2.LanguageService = (function() { + + /** + * Constructs a new LanguageService service. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a LanguageService + * @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 LanguageService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LanguageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LanguageService; + + /** + * Creates new LanguageService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.language.v1beta2.LanguageService + * @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 {LanguageService} RPC service. Useful where requests and/or responses are streamed. + */ + LanguageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSentiment}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeSentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} [response] AnalyzeSentimentResponse + */ + + /** + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeSentimentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeSentiment = function analyzeSentiment(request, callback) { + return this.rpcCall(analyzeSentiment, $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse, request, callback); + }, "name", { value: "AnalyzeSentiment" }); + + /** + * Calls AnalyzeSentiment. + * @function analyzeSentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} request AnalyzeSentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntities}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} [response] AnalyzeEntitiesResponse + */ + + /** + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitiesCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitiesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeEntities = function analyzeEntities(request, callback) { + return this.rpcCall(analyzeEntities, $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse, request, callback); + }, "name", { value: "AnalyzeEntities" }); + + /** + * Calls AnalyzeEntities. + * @function analyzeEntities + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} request AnalyzeEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeEntitySentiment}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeEntitySentimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} [response] AnalyzeEntitySentimentResponse + */ + + /** + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentimentCallback} callback Node-style callback called with the error, if any, and AnalyzeEntitySentimentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeEntitySentiment = function analyzeEntitySentiment(request, callback) { + return this.rpcCall(analyzeEntitySentiment, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest, $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse, request, callback); + }, "name", { value: "AnalyzeEntitySentiment" }); + + /** + * Calls AnalyzeEntitySentiment. + * @function analyzeEntitySentiment + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} request AnalyzeEntitySentimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|analyzeSyntax}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnalyzeSyntaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} [response] AnalyzeSyntaxResponse + */ + + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnalyzeSyntaxCallback} callback Node-style callback called with the error, if any, and AnalyzeSyntaxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.analyzeSyntax = function analyzeSyntax(request, callback) { + return this.rpcCall(analyzeSyntax, $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest, $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse, request, callback); + }, "name", { value: "AnalyzeSyntax" }); + + /** + * Calls AnalyzeSyntax. + * @function analyzeSyntax + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} request AnalyzeSyntaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|classifyText}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef ClassifyTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.ClassifyTextResponse} [response] ClassifyTextResponse + */ + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.ClassifyTextCallback} callback Node-style callback called with the error, if any, and ClassifyTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.classifyText = function classifyText(request, callback) { + return this.rpcCall(classifyText, $root.google.cloud.language.v1beta2.ClassifyTextRequest, $root.google.cloud.language.v1beta2.ClassifyTextResponse, request, callback); + }, "name", { value: "ClassifyText" }); + + /** + * Calls ClassifyText. + * @function classifyText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} request ClassifyTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.language.v1beta2.LanguageService|annotateText}. + * @memberof google.cloud.language.v1beta2.LanguageService + * @typedef AnnotateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.language.v1beta2.AnnotateTextResponse} [response] AnnotateTextResponse + */ + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @param {google.cloud.language.v1beta2.LanguageService.AnnotateTextCallback} callback Node-style callback called with the error, if any, and AnnotateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LanguageService.prototype.annotateText = function annotateText(request, callback) { + return this.rpcCall(annotateText, $root.google.cloud.language.v1beta2.AnnotateTextRequest, $root.google.cloud.language.v1beta2.AnnotateTextResponse, request, callback); + }, "name", { value: "AnnotateText" }); + + /** + * Calls AnnotateText. + * @function annotateText + * @memberof google.cloud.language.v1beta2.LanguageService + * @instance + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} request AnnotateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LanguageService; + })(); + + v1beta2.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.language.v1beta2 + * @interface IDocument + * @property {google.cloud.language.v1beta2.Document.Type|null} [type] Document type + * @property {string|null} [content] Document content + * @property {string|null} [gcsContentUri] Document gcsContentUri + * @property {string|null} [language] Document language + * @property {string|null} [referenceWebUri] Document referenceWebUri + * @property {google.cloud.language.v1beta2.Document.BoilerplateHandling|null} [boilerplateHandling] Document boilerplateHandling + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set + */ + function Document(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document type. + * @member {google.cloud.language.v1beta2.Document.Type} type + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.type = 0; + + /** + * Document content. + * @member {string|null|undefined} content + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document gcsContentUri. + * @member {string|null|undefined} gcsContentUri + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.gcsContentUri = null; + + /** + * Document language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.language = ""; + + /** + * Document referenceWebUri. + * @member {string} referenceWebUri + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.referenceWebUri = ""; + + /** + * Document boilerplateHandling. + * @member {google.cloud.language.v1beta2.Document.BoilerplateHandling} boilerplateHandling + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Document.prototype.boilerplateHandling = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document source. + * @member {"content"|"gcsContentUri"|undefined} source + * @memberof google.cloud.language.v1beta2.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["content", "gcsContentUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {google.cloud.language.v1beta2.IDocument=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.gcsContentUri != null && Object.hasOwnProperty.call(message, "gcsContentUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsContentUri); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.language); + if (message.referenceWebUri != null && Object.hasOwnProperty.call(message, "referenceWebUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceWebUri); + if (message.boilerplateHandling != null && Object.hasOwnProperty.call(message, "boilerplateHandling")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.boilerplateHandling); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {google.cloud.language.v1beta2.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.gcsContentUri = reader.string(); + break; + } + case 4: { + message.language = reader.string(); + break; + } + case 5: { + message.referenceWebUri = reader.string(); + break; + } + case 6: { + message.boilerplateHandling = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.content != null && message.hasOwnProperty("content")) { + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.gcsContentUri)) + return "gcsContentUri: string expected"; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) + if (!$util.isString(message.referenceWebUri)) + return "referenceWebUri: string expected"; + if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) + switch (message.boilerplateHandling) { + default: + return "boilerplateHandling: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Document) + return object; + var message = new $root.google.cloud.language.v1beta2.Document(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PLAIN_TEXT": + case 1: + message.type = 1; + break; + case "HTML": + case 2: + message.type = 2; + break; + } + if (object.content != null) + message.content = String(object.content); + if (object.gcsContentUri != null) + message.gcsContentUri = String(object.gcsContentUri); + if (object.language != null) + message.language = String(object.language); + if (object.referenceWebUri != null) + message.referenceWebUri = String(object.referenceWebUri); + switch (object.boilerplateHandling) { + case "BOILERPLATE_HANDLING_UNSPECIFIED": + case 0: + message.boilerplateHandling = 0; + break; + case "SKIP_BOILERPLATE": + case 1: + message.boilerplateHandling = 1; + break; + case "KEEP_BOILERPLATE": + case 2: + message.boilerplateHandling = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {google.cloud.language.v1beta2.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.language = ""; + object.referenceWebUri = ""; + object.boilerplateHandling = options.enums === String ? "BOILERPLATE_HANDLING_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1beta2.Document.Type[message.type] : message.type; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; + } + if (message.gcsContentUri != null && message.hasOwnProperty("gcsContentUri")) { + object.gcsContentUri = message.gcsContentUri; + if (options.oneofs) + object.source = "gcsContentUri"; + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.referenceWebUri != null && message.hasOwnProperty("referenceWebUri")) + object.referenceWebUri = message.referenceWebUri; + if (message.boilerplateHandling != null && message.hasOwnProperty("boilerplateHandling")) + object.boilerplateHandling = options.enums === String ? $root.google.cloud.language.v1beta2.Document.BoilerplateHandling[message.boilerplateHandling] : message.boilerplateHandling; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Document"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1beta2.Document.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PLAIN_TEXT=1 PLAIN_TEXT value + * @property {number} HTML=2 HTML value + */ + Document.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PLAIN_TEXT"] = 1; + values[valuesById[2] = "HTML"] = 2; + return values; + })(); + + /** + * BoilerplateHandling enum. + * @name google.cloud.language.v1beta2.Document.BoilerplateHandling + * @enum {number} + * @property {number} BOILERPLATE_HANDLING_UNSPECIFIED=0 BOILERPLATE_HANDLING_UNSPECIFIED value + * @property {number} SKIP_BOILERPLATE=1 SKIP_BOILERPLATE value + * @property {number} KEEP_BOILERPLATE=2 KEEP_BOILERPLATE value + */ + Document.BoilerplateHandling = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOILERPLATE_HANDLING_UNSPECIFIED"] = 0; + values[valuesById[1] = "SKIP_BOILERPLATE"] = 1; + values[valuesById[2] = "KEEP_BOILERPLATE"] = 2; + return values; + })(); + + return Document; + })(); + + v1beta2.Sentence = (function() { + + /** + * Properties of a Sentence. + * @memberof google.cloud.language.v1beta2 + * @interface ISentence + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Sentence text + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Sentence sentiment + */ + + /** + * Constructs a new Sentence. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a Sentence. + * @implements ISentence + * @constructor + * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set + */ + function Sentence(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]]; + } + + /** + * Sentence text. + * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1beta2.Sentence + * @instance + */ + Sentence.prototype.text = null; + + /** + * Sentence sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.Sentence + * @instance + */ + Sentence.prototype.sentiment = null; + + /** + * Creates a new Sentence instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {google.cloud.language.v1beta2.ISentence=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Sentence} Sentence instance + */ + Sentence.create = function create(properties) { + return new Sentence(properties); + }; + + /** + * Encodes the specified Sentence message. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Sentence message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentence.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {google.cloud.language.v1beta2.ISentence} message Sentence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sentence message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Sentence} Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sentence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Sentence} Sentence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sentence message. + * @function verify + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates a Sentence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Sentence} Sentence + */ + Sentence.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Sentence) + return object; + var message = new $root.google.cloud.language.v1beta2.Sentence(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1beta2.Sentence.text: object expected"); + message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.Sentence.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from a Sentence message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {google.cloud.language.v1beta2.Sentence} message Sentence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.sentiment = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this Sentence to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Sentence + * @instance + * @returns {Object.} JSON object + */ + Sentence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sentence + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Sentence + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sentence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentence"; + }; + + return Sentence; + })(); + + /** + * EncodingType enum. + * @name google.cloud.language.v1beta2.EncodingType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} UTF8=1 UTF8 value + * @property {number} UTF16=2 UTF16 value + * @property {number} UTF32=3 UTF32 value + */ + v1beta2.EncodingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "UTF8"] = 1; + values[valuesById[2] = "UTF16"] = 2; + values[valuesById[3] = "UTF32"] = 3; + return values; + })(); + + v1beta2.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.language.v1beta2 + * @interface IEntity + * @property {string|null} [name] Entity name + * @property {google.cloud.language.v1beta2.Entity.Type|null} [type] Entity type + * @property {Object.|null} [metadata] Entity metadata + * @property {number|null} [salience] Entity salience + * @property {Array.|null} [mentions] Entity mentions + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] Entity sentiment + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.metadata = {}; + this.mentions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity name. + * @member {string} name + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.name = ""; + + /** + * Entity type. + * @member {google.cloud.language.v1beta2.Entity.Type} type + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.type = 0; + + /** + * Entity metadata. + * @member {Object.} metadata + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.metadata = $util.emptyObject; + + /** + * Entity salience. + * @member {number} salience + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.salience = 0; + + /** + * Entity mentions. + * @member {Array.} mentions + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.mentions = $util.emptyArray; + + /** + * Entity sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.Entity + * @instance + */ + Entity.prototype.sentiment = null; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {google.cloud.language.v1beta2.IEntity=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.salience != null && Object.hasOwnProperty.call(message, "salience")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.salience); + if (message.mentions != null && message.mentions.length) + for (var i = 0; i < message.mentions.length; ++i) + $root.google.cloud.language.v1beta2.EntityMention.encode(message.mentions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {google.cloud.language.v1beta2.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Entity(), key, value; + 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: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 4: { + message.salience = reader.float(); + break; + } + case 5: { + if (!(message.mentions && message.mentions.length)) + message.mentions = []; + message.mentions.push($root.google.cloud.language.v1beta2.EntityMention.decode(reader, reader.uint32())); + break; + } + case 6: { + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.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: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.salience != null && message.hasOwnProperty("salience")) + if (typeof message.salience !== "number") + return "salience: number expected"; + if (message.mentions != null && message.hasOwnProperty("mentions")) { + if (!Array.isArray(message.mentions)) + return "mentions: array expected"; + for (var i = 0; i < message.mentions.length; ++i) { + var error = $root.google.cloud.language.v1beta2.EntityMention.verify(message.mentions[i]); + if (error) + return "mentions." + error; + } + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Entity) + return object; + var message = new $root.google.cloud.language.v1beta2.Entity(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "PERSON": + case 1: + message.type = 1; + break; + case "LOCATION": + case 2: + message.type = 2; + break; + case "ORGANIZATION": + case 3: + message.type = 3; + break; + case "EVENT": + case 4: + message.type = 4; + break; + case "WORK_OF_ART": + case 5: + message.type = 5; + break; + case "CONSUMER_GOOD": + case 6: + message.type = 6; + break; + case "OTHER": + case 7: + message.type = 7; + break; + case "PHONE_NUMBER": + case 9: + message.type = 9; + break; + case "ADDRESS": + case 10: + message.type = 10; + break; + case "DATE": + case 11: + message.type = 11; + break; + case "NUMBER": + case 12: + message.type = 12; + break; + case "PRICE": + case 13: + message.type = 13; + break; + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.salience != null) + message.salience = Number(object.salience); + if (object.mentions) { + if (!Array.isArray(object.mentions)) + throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: array expected"); + message.mentions = []; + for (var i = 0; i < object.mentions.length; ++i) { + if (typeof object.mentions[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.mentions: object expected"); + message.mentions[i] = $root.google.cloud.language.v1beta2.EntityMention.fromObject(object.mentions[i]); + } + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.Entity.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {google.cloud.language.v1beta2.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mentions = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "UNKNOWN" : 0; + object.salience = 0; + object.sentiment = 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.cloud.language.v1beta2.Entity.Type[message.type] : message.type; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.salience != null && message.hasOwnProperty("salience")) + object.salience = options.json && !isFinite(message.salience) ? String(message.salience) : message.salience; + if (message.mentions && message.mentions.length) { + object.mentions = []; + for (var j = 0; j < message.mentions.length; ++j) + object.mentions[j] = $root.google.cloud.language.v1beta2.EntityMention.toObject(message.mentions[j], options); + } + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Entity"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1beta2.Entity.Type + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PERSON=1 PERSON value + * @property {number} LOCATION=2 LOCATION value + * @property {number} ORGANIZATION=3 ORGANIZATION value + * @property {number} EVENT=4 EVENT value + * @property {number} WORK_OF_ART=5 WORK_OF_ART value + * @property {number} CONSUMER_GOOD=6 CONSUMER_GOOD value + * @property {number} OTHER=7 OTHER value + * @property {number} PHONE_NUMBER=9 PHONE_NUMBER value + * @property {number} ADDRESS=10 ADDRESS value + * @property {number} DATE=11 DATE value + * @property {number} NUMBER=12 NUMBER value + * @property {number} PRICE=13 PRICE value + */ + Entity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PERSON"] = 1; + values[valuesById[2] = "LOCATION"] = 2; + values[valuesById[3] = "ORGANIZATION"] = 3; + values[valuesById[4] = "EVENT"] = 4; + values[valuesById[5] = "WORK_OF_ART"] = 5; + values[valuesById[6] = "CONSUMER_GOOD"] = 6; + values[valuesById[7] = "OTHER"] = 7; + values[valuesById[9] = "PHONE_NUMBER"] = 9; + values[valuesById[10] = "ADDRESS"] = 10; + values[valuesById[11] = "DATE"] = 11; + values[valuesById[12] = "NUMBER"] = 12; + values[valuesById[13] = "PRICE"] = 13; + return values; + })(); + + return Entity; + })(); + + v1beta2.Token = (function() { + + /** + * Properties of a Token. + * @memberof google.cloud.language.v1beta2 + * @interface IToken + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] Token text + * @property {google.cloud.language.v1beta2.IPartOfSpeech|null} [partOfSpeech] Token partOfSpeech + * @property {google.cloud.language.v1beta2.IDependencyEdge|null} [dependencyEdge] Token dependencyEdge + * @property {string|null} [lemma] Token lemma + */ + + /** + * Constructs a new Token. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a Token. + * @implements IToken + * @constructor + * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set + */ + function Token(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]]; + } + + /** + * Token text. + * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1beta2.Token + * @instance + */ + Token.prototype.text = null; + + /** + * Token partOfSpeech. + * @member {google.cloud.language.v1beta2.IPartOfSpeech|null|undefined} partOfSpeech + * @memberof google.cloud.language.v1beta2.Token + * @instance + */ + Token.prototype.partOfSpeech = null; + + /** + * Token dependencyEdge. + * @member {google.cloud.language.v1beta2.IDependencyEdge|null|undefined} dependencyEdge + * @memberof google.cloud.language.v1beta2.Token + * @instance + */ + Token.prototype.dependencyEdge = null; + + /** + * Token lemma. + * @member {string} lemma + * @memberof google.cloud.language.v1beta2.Token + * @instance + */ + Token.prototype.lemma = ""; + + /** + * Creates a new Token instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {google.cloud.language.v1beta2.IToken=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Token} Token instance + */ + Token.create = function create(properties) { + return new Token(properties); + }; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partOfSpeech != null && Object.hasOwnProperty.call(message, "partOfSpeech")) + $root.google.cloud.language.v1beta2.PartOfSpeech.encode(message.partOfSpeech, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dependencyEdge != null && Object.hasOwnProperty.call(message, "dependencyEdge")) + $root.google.cloud.language.v1beta2.DependencyEdge.encode(message.dependencyEdge, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lemma != null && Object.hasOwnProperty.call(message, "lemma")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.lemma); + return writer; + }; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Token.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {google.cloud.language.v1beta2.IToken} message Token message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Token.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Token message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Token(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lemma = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Token message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Token} Token + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Token.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Token message. + * @function verify + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Token.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) { + var error = $root.google.cloud.language.v1beta2.PartOfSpeech.verify(message.partOfSpeech); + if (error) + return "partOfSpeech." + error; + } + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) { + var error = $root.google.cloud.language.v1beta2.DependencyEdge.verify(message.dependencyEdge); + if (error) + return "dependencyEdge." + error; + } + if (message.lemma != null && message.hasOwnProperty("lemma")) + if (!$util.isString(message.lemma)) + return "lemma: string expected"; + return null; + }; + + /** + * Creates a Token message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Token} Token + */ + Token.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Token) + return object; + var message = new $root.google.cloud.language.v1beta2.Token(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.text: object expected"); + message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); + } + if (object.partOfSpeech != null) { + if (typeof object.partOfSpeech !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.partOfSpeech: object expected"); + message.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.fromObject(object.partOfSpeech); + } + if (object.dependencyEdge != null) { + if (typeof object.dependencyEdge !== "object") + throw TypeError(".google.cloud.language.v1beta2.Token.dependencyEdge: object expected"); + message.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.fromObject(object.dependencyEdge); + } + if (object.lemma != null) + message.lemma = String(object.lemma); + return message; + }; + + /** + * Creates a plain object from a Token message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {google.cloud.language.v1beta2.Token} message Token + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Token.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.partOfSpeech = null; + object.dependencyEdge = null; + object.lemma = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); + if (message.partOfSpeech != null && message.hasOwnProperty("partOfSpeech")) + object.partOfSpeech = $root.google.cloud.language.v1beta2.PartOfSpeech.toObject(message.partOfSpeech, options); + if (message.dependencyEdge != null && message.hasOwnProperty("dependencyEdge")) + object.dependencyEdge = $root.google.cloud.language.v1beta2.DependencyEdge.toObject(message.dependencyEdge, options); + if (message.lemma != null && message.hasOwnProperty("lemma")) + object.lemma = message.lemma; + return object; + }; + + /** + * Converts this Token to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Token + * @instance + * @returns {Object.} JSON object + */ + Token.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Token + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Token + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Token.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Token"; + }; + + return Token; + })(); + + v1beta2.Sentiment = (function() { + + /** + * Properties of a Sentiment. + * @memberof google.cloud.language.v1beta2 + * @interface ISentiment + * @property {number|null} [magnitude] Sentiment magnitude + * @property {number|null} [score] Sentiment score + */ + + /** + * Constructs a new Sentiment. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a Sentiment. + * @implements ISentiment + * @constructor + * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set + */ + function Sentiment(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]]; + } + + /** + * Sentiment magnitude. + * @member {number} magnitude + * @memberof google.cloud.language.v1beta2.Sentiment + * @instance + */ + Sentiment.prototype.magnitude = 0; + + /** + * Sentiment score. + * @member {number} score + * @memberof google.cloud.language.v1beta2.Sentiment + * @instance + */ + Sentiment.prototype.score = 0; + + /** + * Creates a new Sentiment instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment instance + */ + Sentiment.create = function create(properties) { + return new Sentiment(properties); + }; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.score); + return writer; + }; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.Sentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.Sentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.magnitude = reader.float(); + break; + } + case 3: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sentiment message. + * @function verify + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.Sentiment} Sentiment + */ + Sentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.Sentiment) + return object; + var message = new $root.google.cloud.language.v1beta2.Sentiment(); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {google.cloud.language.v1beta2.Sentiment} message Sentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.magnitude = 0; + object.score = 0; + } + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this Sentiment to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.Sentiment + * @instance + * @returns {Object.} JSON object + */ + Sentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sentiment + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.Sentiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.Sentiment"; + }; + + return Sentiment; + })(); + + v1beta2.PartOfSpeech = (function() { + + /** + * Properties of a PartOfSpeech. + * @memberof google.cloud.language.v1beta2 + * @interface IPartOfSpeech + * @property {google.cloud.language.v1beta2.PartOfSpeech.Tag|null} [tag] PartOfSpeech tag + * @property {google.cloud.language.v1beta2.PartOfSpeech.Aspect|null} [aspect] PartOfSpeech aspect + * @property {google.cloud.language.v1beta2.PartOfSpeech.Case|null} ["case"] PartOfSpeech case + * @property {google.cloud.language.v1beta2.PartOfSpeech.Form|null} [form] PartOfSpeech form + * @property {google.cloud.language.v1beta2.PartOfSpeech.Gender|null} [gender] PartOfSpeech gender + * @property {google.cloud.language.v1beta2.PartOfSpeech.Mood|null} [mood] PartOfSpeech mood + * @property {google.cloud.language.v1beta2.PartOfSpeech.Number|null} [number] PartOfSpeech number + * @property {google.cloud.language.v1beta2.PartOfSpeech.Person|null} [person] PartOfSpeech person + * @property {google.cloud.language.v1beta2.PartOfSpeech.Proper|null} [proper] PartOfSpeech proper + * @property {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity|null} [reciprocity] PartOfSpeech reciprocity + * @property {google.cloud.language.v1beta2.PartOfSpeech.Tense|null} [tense] PartOfSpeech tense + * @property {google.cloud.language.v1beta2.PartOfSpeech.Voice|null} [voice] PartOfSpeech voice + */ + + /** + * Constructs a new PartOfSpeech. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a PartOfSpeech. + * @implements IPartOfSpeech + * @constructor + * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set + */ + function PartOfSpeech(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]]; + } + + /** + * PartOfSpeech tag. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Tag} tag + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.tag = 0; + + /** + * PartOfSpeech aspect. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Aspect} aspect + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.aspect = 0; + + /** + * PartOfSpeech case. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Case} case + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype["case"] = 0; + + /** + * PartOfSpeech form. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Form} form + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.form = 0; + + /** + * PartOfSpeech gender. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Gender} gender + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.gender = 0; + + /** + * PartOfSpeech mood. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Mood} mood + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.mood = 0; + + /** + * PartOfSpeech number. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Number} number + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.number = 0; + + /** + * PartOfSpeech person. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Person} person + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.person = 0; + + /** + * PartOfSpeech proper. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Proper} proper + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.proper = 0; + + /** + * PartOfSpeech reciprocity. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Reciprocity} reciprocity + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.reciprocity = 0; + + /** + * PartOfSpeech tense. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Tense} tense + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.tense = 0; + + /** + * PartOfSpeech voice. + * @member {google.cloud.language.v1beta2.PartOfSpeech.Voice} voice + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + */ + PartOfSpeech.prototype.voice = 0; + + /** + * Creates a new PartOfSpeech instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech instance + */ + PartOfSpeech.create = function create(properties) { + return new PartOfSpeech(properties); + }; + + /** + * Encodes the specified PartOfSpeech message. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tag); + if (message.aspect != null && Object.hasOwnProperty.call(message, "aspect")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.aspect); + if (message["case"] != null && Object.hasOwnProperty.call(message, "case")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message["case"]); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.form); + if (message.gender != null && Object.hasOwnProperty.call(message, "gender")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.gender); + if (message.mood != null && Object.hasOwnProperty.call(message, "mood")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.mood); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.number); + if (message.person != null && Object.hasOwnProperty.call(message, "person")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.person); + if (message.proper != null && Object.hasOwnProperty.call(message, "proper")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.proper); + if (message.reciprocity != null && Object.hasOwnProperty.call(message, "reciprocity")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.reciprocity); + if (message.tense != null && Object.hasOwnProperty.call(message, "tense")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.tense); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.voice); + return writer; + }; + + /** + * Encodes the specified PartOfSpeech message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.PartOfSpeech.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.IPartOfSpeech} message PartOfSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartOfSpeech.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartOfSpeech.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tag = reader.int32(); + break; + } + case 2: { + message.aspect = reader.int32(); + break; + } + case 3: { + message["case"] = reader.int32(); + break; + } + case 4: { + message.form = reader.int32(); + break; + } + case 5: { + message.gender = reader.int32(); + break; + } + case 6: { + message.mood = reader.int32(); + break; + } + case 7: { + message.number = reader.int32(); + break; + } + case 8: { + message.person = reader.int32(); + break; + } + case 9: { + message.proper = reader.int32(); + break; + } + case 10: { + message.reciprocity = reader.int32(); + break; + } + case 11: { + message.tense = reader.int32(); + break; + } + case 12: { + message.voice = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartOfSpeech message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartOfSpeech.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartOfSpeech message. + * @function verify + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartOfSpeech.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + switch (message.tag) { + default: + return "tag: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.aspect != null && message.hasOwnProperty("aspect")) + switch (message.aspect) { + default: + return "aspect: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message["case"] != null && message.hasOwnProperty("case")) + switch (message["case"]) { + default: + return "case: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.form != null && message.hasOwnProperty("form")) + switch (message.form) { + default: + return "form: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.gender != null && message.hasOwnProperty("gender")) + switch (message.gender) { + default: + return "gender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mood != null && message.hasOwnProperty("mood")) + switch (message.mood) { + default: + return "mood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.number != null && message.hasOwnProperty("number")) + switch (message.number) { + default: + return "number: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.person != null && message.hasOwnProperty("person")) + switch (message.person) { + default: + return "person: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.proper != null && message.hasOwnProperty("proper")) + switch (message.proper) { + default: + return "proper: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + switch (message.reciprocity) { + default: + return "reciprocity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tense != null && message.hasOwnProperty("tense")) + switch (message.tense) { + default: + return "tense: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.voice != null && message.hasOwnProperty("voice")) + switch (message.voice) { + default: + return "voice: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PartOfSpeech message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.PartOfSpeech} PartOfSpeech + */ + PartOfSpeech.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.PartOfSpeech) + return object; + var message = new $root.google.cloud.language.v1beta2.PartOfSpeech(); + switch (object.tag) { + case "UNKNOWN": + case 0: + message.tag = 0; + break; + case "ADJ": + case 1: + message.tag = 1; + break; + case "ADP": + case 2: + message.tag = 2; + break; + case "ADV": + case 3: + message.tag = 3; + break; + case "CONJ": + case 4: + message.tag = 4; + break; + case "DET": + case 5: + message.tag = 5; + break; + case "NOUN": + case 6: + message.tag = 6; + break; + case "NUM": + case 7: + message.tag = 7; + break; + case "PRON": + case 8: + message.tag = 8; + break; + case "PRT": + case 9: + message.tag = 9; + break; + case "PUNCT": + case 10: + message.tag = 10; + break; + case "VERB": + case 11: + message.tag = 11; + break; + case "X": + case 12: + message.tag = 12; + break; + case "AFFIX": + case 13: + message.tag = 13; + break; + } + switch (object.aspect) { + case "ASPECT_UNKNOWN": + case 0: + message.aspect = 0; + break; + case "PERFECTIVE": + case 1: + message.aspect = 1; + break; + case "IMPERFECTIVE": + case 2: + message.aspect = 2; + break; + case "PROGRESSIVE": + case 3: + message.aspect = 3; + break; + } + switch (object["case"]) { + case "CASE_UNKNOWN": + case 0: + message["case"] = 0; + break; + case "ACCUSATIVE": + case 1: + message["case"] = 1; + break; + case "ADVERBIAL": + case 2: + message["case"] = 2; + break; + case "COMPLEMENTIVE": + case 3: + message["case"] = 3; + break; + case "DATIVE": + case 4: + message["case"] = 4; + break; + case "GENITIVE": + case 5: + message["case"] = 5; + break; + case "INSTRUMENTAL": + case 6: + message["case"] = 6; + break; + case "LOCATIVE": + case 7: + message["case"] = 7; + break; + case "NOMINATIVE": + case 8: + message["case"] = 8; + break; + case "OBLIQUE": + case 9: + message["case"] = 9; + break; + case "PARTITIVE": + case 10: + message["case"] = 10; + break; + case "PREPOSITIONAL": + case 11: + message["case"] = 11; + break; + case "REFLEXIVE_CASE": + case 12: + message["case"] = 12; + break; + case "RELATIVE_CASE": + case 13: + message["case"] = 13; + break; + case "VOCATIVE": + case 14: + message["case"] = 14; + break; + } + switch (object.form) { + case "FORM_UNKNOWN": + case 0: + message.form = 0; + break; + case "ADNOMIAL": + case 1: + message.form = 1; + break; + case "AUXILIARY": + case 2: + message.form = 2; + break; + case "COMPLEMENTIZER": + case 3: + message.form = 3; + break; + case "FINAL_ENDING": + case 4: + message.form = 4; + break; + case "GERUND": + case 5: + message.form = 5; + break; + case "REALIS": + case 6: + message.form = 6; + break; + case "IRREALIS": + case 7: + message.form = 7; + break; + case "SHORT": + case 8: + message.form = 8; + break; + case "LONG": + case 9: + message.form = 9; + break; + case "ORDER": + case 10: + message.form = 10; + break; + case "SPECIFIC": + case 11: + message.form = 11; + break; + } + switch (object.gender) { + case "GENDER_UNKNOWN": + case 0: + message.gender = 0; + break; + case "FEMININE": + case 1: + message.gender = 1; + break; + case "MASCULINE": + case 2: + message.gender = 2; + break; + case "NEUTER": + case 3: + message.gender = 3; + break; + } + switch (object.mood) { + case "MOOD_UNKNOWN": + case 0: + message.mood = 0; + break; + case "CONDITIONAL_MOOD": + case 1: + message.mood = 1; + break; + case "IMPERATIVE": + case 2: + message.mood = 2; + break; + case "INDICATIVE": + case 3: + message.mood = 3; + break; + case "INTERROGATIVE": + case 4: + message.mood = 4; + break; + case "JUSSIVE": + case 5: + message.mood = 5; + break; + case "SUBJUNCTIVE": + case 6: + message.mood = 6; + break; + } + switch (object.number) { + case "NUMBER_UNKNOWN": + case 0: + message.number = 0; + break; + case "SINGULAR": + case 1: + message.number = 1; + break; + case "PLURAL": + case 2: + message.number = 2; + break; + case "DUAL": + case 3: + message.number = 3; + break; + } + switch (object.person) { + case "PERSON_UNKNOWN": + case 0: + message.person = 0; + break; + case "FIRST": + case 1: + message.person = 1; + break; + case "SECOND": + case 2: + message.person = 2; + break; + case "THIRD": + case 3: + message.person = 3; + break; + case "REFLEXIVE_PERSON": + case 4: + message.person = 4; + break; + } + switch (object.proper) { + case "PROPER_UNKNOWN": + case 0: + message.proper = 0; + break; + case "PROPER": + case 1: + message.proper = 1; + break; + case "NOT_PROPER": + case 2: + message.proper = 2; + break; + } + switch (object.reciprocity) { + case "RECIPROCITY_UNKNOWN": + case 0: + message.reciprocity = 0; + break; + case "RECIPROCAL": + case 1: + message.reciprocity = 1; + break; + case "NON_RECIPROCAL": + case 2: + message.reciprocity = 2; + break; + } + switch (object.tense) { + case "TENSE_UNKNOWN": + case 0: + message.tense = 0; + break; + case "CONDITIONAL_TENSE": + case 1: + message.tense = 1; + break; + case "FUTURE": + case 2: + message.tense = 2; + break; + case "PAST": + case 3: + message.tense = 3; + break; + case "PRESENT": + case 4: + message.tense = 4; + break; + case "IMPERFECT": + case 5: + message.tense = 5; + break; + case "PLUPERFECT": + case 6: + message.tense = 6; + break; + } + switch (object.voice) { + case "VOICE_UNKNOWN": + case 0: + message.voice = 0; + break; + case "ACTIVE": + case 1: + message.voice = 1; + break; + case "CAUSATIVE": + case 2: + message.voice = 2; + break; + case "PASSIVE": + case 3: + message.voice = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartOfSpeech message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {google.cloud.language.v1beta2.PartOfSpeech} message PartOfSpeech + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartOfSpeech.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = options.enums === String ? "UNKNOWN" : 0; + object.aspect = options.enums === String ? "ASPECT_UNKNOWN" : 0; + object["case"] = options.enums === String ? "CASE_UNKNOWN" : 0; + object.form = options.enums === String ? "FORM_UNKNOWN" : 0; + object.gender = options.enums === String ? "GENDER_UNKNOWN" : 0; + object.mood = options.enums === String ? "MOOD_UNKNOWN" : 0; + object.number = options.enums === String ? "NUMBER_UNKNOWN" : 0; + object.person = options.enums === String ? "PERSON_UNKNOWN" : 0; + object.proper = options.enums === String ? "PROPER_UNKNOWN" : 0; + object.reciprocity = options.enums === String ? "RECIPROCITY_UNKNOWN" : 0; + object.tense = options.enums === String ? "TENSE_UNKNOWN" : 0; + object.voice = options.enums === String ? "VOICE_UNKNOWN" : 0; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tag[message.tag] : message.tag; + if (message.aspect != null && message.hasOwnProperty("aspect")) + object.aspect = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Aspect[message.aspect] : message.aspect; + if (message["case"] != null && message.hasOwnProperty("case")) + object["case"] = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Case[message["case"]] : message["case"]; + if (message.form != null && message.hasOwnProperty("form")) + object.form = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Form[message.form] : message.form; + if (message.gender != null && message.hasOwnProperty("gender")) + object.gender = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Gender[message.gender] : message.gender; + if (message.mood != null && message.hasOwnProperty("mood")) + object.mood = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Mood[message.mood] : message.mood; + if (message.number != null && message.hasOwnProperty("number")) + object.number = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Number[message.number] : message.number; + if (message.person != null && message.hasOwnProperty("person")) + object.person = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Person[message.person] : message.person; + if (message.proper != null && message.hasOwnProperty("proper")) + object.proper = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Proper[message.proper] : message.proper; + if (message.reciprocity != null && message.hasOwnProperty("reciprocity")) + object.reciprocity = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity[message.reciprocity] : message.reciprocity; + if (message.tense != null && message.hasOwnProperty("tense")) + object.tense = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Tense[message.tense] : message.tense; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = options.enums === String ? $root.google.cloud.language.v1beta2.PartOfSpeech.Voice[message.voice] : message.voice; + return object; + }; + + /** + * Converts this PartOfSpeech to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @instance + * @returns {Object.} JSON object + */ + PartOfSpeech.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartOfSpeech + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.PartOfSpeech + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartOfSpeech.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.PartOfSpeech"; + }; + + /** + * Tag enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Tag + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ADJ=1 ADJ value + * @property {number} ADP=2 ADP value + * @property {number} ADV=3 ADV value + * @property {number} CONJ=4 CONJ value + * @property {number} DET=5 DET value + * @property {number} NOUN=6 NOUN value + * @property {number} NUM=7 NUM value + * @property {number} PRON=8 PRON value + * @property {number} PRT=9 PRT value + * @property {number} PUNCT=10 PUNCT value + * @property {number} VERB=11 VERB value + * @property {number} X=12 X value + * @property {number} AFFIX=13 AFFIX value + */ + PartOfSpeech.Tag = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ADJ"] = 1; + values[valuesById[2] = "ADP"] = 2; + values[valuesById[3] = "ADV"] = 3; + values[valuesById[4] = "CONJ"] = 4; + values[valuesById[5] = "DET"] = 5; + values[valuesById[6] = "NOUN"] = 6; + values[valuesById[7] = "NUM"] = 7; + values[valuesById[8] = "PRON"] = 8; + values[valuesById[9] = "PRT"] = 9; + values[valuesById[10] = "PUNCT"] = 10; + values[valuesById[11] = "VERB"] = 11; + values[valuesById[12] = "X"] = 12; + values[valuesById[13] = "AFFIX"] = 13; + return values; + })(); + + /** + * Aspect enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Aspect + * @enum {number} + * @property {number} ASPECT_UNKNOWN=0 ASPECT_UNKNOWN value + * @property {number} PERFECTIVE=1 PERFECTIVE value + * @property {number} IMPERFECTIVE=2 IMPERFECTIVE value + * @property {number} PROGRESSIVE=3 PROGRESSIVE value + */ + PartOfSpeech.Aspect = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ASPECT_UNKNOWN"] = 0; + values[valuesById[1] = "PERFECTIVE"] = 1; + values[valuesById[2] = "IMPERFECTIVE"] = 2; + values[valuesById[3] = "PROGRESSIVE"] = 3; + return values; + })(); + + /** + * Case enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Case + * @enum {number} + * @property {number} CASE_UNKNOWN=0 CASE_UNKNOWN value + * @property {number} ACCUSATIVE=1 ACCUSATIVE value + * @property {number} ADVERBIAL=2 ADVERBIAL value + * @property {number} COMPLEMENTIVE=3 COMPLEMENTIVE value + * @property {number} DATIVE=4 DATIVE value + * @property {number} GENITIVE=5 GENITIVE value + * @property {number} INSTRUMENTAL=6 INSTRUMENTAL value + * @property {number} LOCATIVE=7 LOCATIVE value + * @property {number} NOMINATIVE=8 NOMINATIVE value + * @property {number} OBLIQUE=9 OBLIQUE value + * @property {number} PARTITIVE=10 PARTITIVE value + * @property {number} PREPOSITIONAL=11 PREPOSITIONAL value + * @property {number} REFLEXIVE_CASE=12 REFLEXIVE_CASE value + * @property {number} RELATIVE_CASE=13 RELATIVE_CASE value + * @property {number} VOCATIVE=14 VOCATIVE value + */ + PartOfSpeech.Case = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CASE_UNKNOWN"] = 0; + values[valuesById[1] = "ACCUSATIVE"] = 1; + values[valuesById[2] = "ADVERBIAL"] = 2; + values[valuesById[3] = "COMPLEMENTIVE"] = 3; + values[valuesById[4] = "DATIVE"] = 4; + values[valuesById[5] = "GENITIVE"] = 5; + values[valuesById[6] = "INSTRUMENTAL"] = 6; + values[valuesById[7] = "LOCATIVE"] = 7; + values[valuesById[8] = "NOMINATIVE"] = 8; + values[valuesById[9] = "OBLIQUE"] = 9; + values[valuesById[10] = "PARTITIVE"] = 10; + values[valuesById[11] = "PREPOSITIONAL"] = 11; + values[valuesById[12] = "REFLEXIVE_CASE"] = 12; + values[valuesById[13] = "RELATIVE_CASE"] = 13; + values[valuesById[14] = "VOCATIVE"] = 14; + return values; + })(); + + /** + * Form enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Form + * @enum {number} + * @property {number} FORM_UNKNOWN=0 FORM_UNKNOWN value + * @property {number} ADNOMIAL=1 ADNOMIAL value + * @property {number} AUXILIARY=2 AUXILIARY value + * @property {number} COMPLEMENTIZER=3 COMPLEMENTIZER value + * @property {number} FINAL_ENDING=4 FINAL_ENDING value + * @property {number} GERUND=5 GERUND value + * @property {number} REALIS=6 REALIS value + * @property {number} IRREALIS=7 IRREALIS value + * @property {number} SHORT=8 SHORT value + * @property {number} LONG=9 LONG value + * @property {number} ORDER=10 ORDER value + * @property {number} SPECIFIC=11 SPECIFIC value + */ + PartOfSpeech.Form = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORM_UNKNOWN"] = 0; + values[valuesById[1] = "ADNOMIAL"] = 1; + values[valuesById[2] = "AUXILIARY"] = 2; + values[valuesById[3] = "COMPLEMENTIZER"] = 3; + values[valuesById[4] = "FINAL_ENDING"] = 4; + values[valuesById[5] = "GERUND"] = 5; + values[valuesById[6] = "REALIS"] = 6; + values[valuesById[7] = "IRREALIS"] = 7; + values[valuesById[8] = "SHORT"] = 8; + values[valuesById[9] = "LONG"] = 9; + values[valuesById[10] = "ORDER"] = 10; + values[valuesById[11] = "SPECIFIC"] = 11; + return values; + })(); + + /** + * Gender enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Gender + * @enum {number} + * @property {number} GENDER_UNKNOWN=0 GENDER_UNKNOWN value + * @property {number} FEMININE=1 FEMININE value + * @property {number} MASCULINE=2 MASCULINE value + * @property {number} NEUTER=3 NEUTER value + */ + PartOfSpeech.Gender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENDER_UNKNOWN"] = 0; + values[valuesById[1] = "FEMININE"] = 1; + values[valuesById[2] = "MASCULINE"] = 2; + values[valuesById[3] = "NEUTER"] = 3; + return values; + })(); + + /** + * Mood enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Mood + * @enum {number} + * @property {number} MOOD_UNKNOWN=0 MOOD_UNKNOWN value + * @property {number} CONDITIONAL_MOOD=1 CONDITIONAL_MOOD value + * @property {number} IMPERATIVE=2 IMPERATIVE value + * @property {number} INDICATIVE=3 INDICATIVE value + * @property {number} INTERROGATIVE=4 INTERROGATIVE value + * @property {number} JUSSIVE=5 JUSSIVE value + * @property {number} SUBJUNCTIVE=6 SUBJUNCTIVE value + */ + PartOfSpeech.Mood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MOOD_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_MOOD"] = 1; + values[valuesById[2] = "IMPERATIVE"] = 2; + values[valuesById[3] = "INDICATIVE"] = 3; + values[valuesById[4] = "INTERROGATIVE"] = 4; + values[valuesById[5] = "JUSSIVE"] = 5; + values[valuesById[6] = "SUBJUNCTIVE"] = 6; + return values; + })(); + + /** + * Number enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Number + * @enum {number} + * @property {number} NUMBER_UNKNOWN=0 NUMBER_UNKNOWN value + * @property {number} SINGULAR=1 SINGULAR value + * @property {number} PLURAL=2 PLURAL value + * @property {number} DUAL=3 DUAL value + */ + PartOfSpeech.Number = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NUMBER_UNKNOWN"] = 0; + values[valuesById[1] = "SINGULAR"] = 1; + values[valuesById[2] = "PLURAL"] = 2; + values[valuesById[3] = "DUAL"] = 3; + return values; + })(); + + /** + * Person enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Person + * @enum {number} + * @property {number} PERSON_UNKNOWN=0 PERSON_UNKNOWN value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} REFLEXIVE_PERSON=4 REFLEXIVE_PERSON value + */ + PartOfSpeech.Person = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERSON_UNKNOWN"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "REFLEXIVE_PERSON"] = 4; + return values; + })(); + + /** + * Proper enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Proper + * @enum {number} + * @property {number} PROPER_UNKNOWN=0 PROPER_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} NOT_PROPER=2 NOT_PROPER value + */ + PartOfSpeech.Proper = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROPER_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "NOT_PROPER"] = 2; + return values; + })(); + + /** + * Reciprocity enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Reciprocity + * @enum {number} + * @property {number} RECIPROCITY_UNKNOWN=0 RECIPROCITY_UNKNOWN value + * @property {number} RECIPROCAL=1 RECIPROCAL value + * @property {number} NON_RECIPROCAL=2 NON_RECIPROCAL value + */ + PartOfSpeech.Reciprocity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECIPROCITY_UNKNOWN"] = 0; + values[valuesById[1] = "RECIPROCAL"] = 1; + values[valuesById[2] = "NON_RECIPROCAL"] = 2; + return values; + })(); + + /** + * Tense enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Tense + * @enum {number} + * @property {number} TENSE_UNKNOWN=0 TENSE_UNKNOWN value + * @property {number} CONDITIONAL_TENSE=1 CONDITIONAL_TENSE value + * @property {number} FUTURE=2 FUTURE value + * @property {number} PAST=3 PAST value + * @property {number} PRESENT=4 PRESENT value + * @property {number} IMPERFECT=5 IMPERFECT value + * @property {number} PLUPERFECT=6 PLUPERFECT value + */ + PartOfSpeech.Tense = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TENSE_UNKNOWN"] = 0; + values[valuesById[1] = "CONDITIONAL_TENSE"] = 1; + values[valuesById[2] = "FUTURE"] = 2; + values[valuesById[3] = "PAST"] = 3; + values[valuesById[4] = "PRESENT"] = 4; + values[valuesById[5] = "IMPERFECT"] = 5; + values[valuesById[6] = "PLUPERFECT"] = 6; + return values; + })(); + + /** + * Voice enum. + * @name google.cloud.language.v1beta2.PartOfSpeech.Voice + * @enum {number} + * @property {number} VOICE_UNKNOWN=0 VOICE_UNKNOWN value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CAUSATIVE=2 CAUSATIVE value + * @property {number} PASSIVE=3 PASSIVE value + */ + PartOfSpeech.Voice = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VOICE_UNKNOWN"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CAUSATIVE"] = 2; + values[valuesById[3] = "PASSIVE"] = 3; + return values; + })(); + + return PartOfSpeech; + })(); + + v1beta2.DependencyEdge = (function() { + + /** + * Properties of a DependencyEdge. + * @memberof google.cloud.language.v1beta2 + * @interface IDependencyEdge + * @property {number|null} [headTokenIndex] DependencyEdge headTokenIndex + * @property {google.cloud.language.v1beta2.DependencyEdge.Label|null} [label] DependencyEdge label + */ + + /** + * Constructs a new DependencyEdge. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a DependencyEdge. + * @implements IDependencyEdge + * @constructor + * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set + */ + function DependencyEdge(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]]; + } + + /** + * DependencyEdge headTokenIndex. + * @member {number} headTokenIndex + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + */ + DependencyEdge.prototype.headTokenIndex = 0; + + /** + * DependencyEdge label. + * @member {google.cloud.language.v1beta2.DependencyEdge.Label} label + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + */ + DependencyEdge.prototype.label = 0; + + /** + * Creates a new DependencyEdge instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge instance + */ + DependencyEdge.create = function create(properties) { + return new DependencyEdge(properties); + }; + + /** + * Encodes the specified DependencyEdge message. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headTokenIndex != null && Object.hasOwnProperty.call(message, "headTokenIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.headTokenIndex); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.label); + return writer; + }; + + /** + * Encodes the specified DependencyEdge message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.DependencyEdge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.IDependencyEdge} message DependencyEdge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DependencyEdge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.DependencyEdge(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.headTokenIndex = reader.int32(); + break; + } + case 2: { + message.label = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DependencyEdge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DependencyEdge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DependencyEdge message. + * @function verify + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DependencyEdge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + if (!$util.isInteger(message.headTokenIndex)) + return "headTokenIndex: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + break; + } + return null; + }; + + /** + * Creates a DependencyEdge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.DependencyEdge} DependencyEdge + */ + DependencyEdge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.DependencyEdge) + return object; + var message = new $root.google.cloud.language.v1beta2.DependencyEdge(); + if (object.headTokenIndex != null) + message.headTokenIndex = object.headTokenIndex | 0; + switch (object.label) { + case "UNKNOWN": + case 0: + message.label = 0; + break; + case "ABBREV": + case 1: + message.label = 1; + break; + case "ACOMP": + case 2: + message.label = 2; + break; + case "ADVCL": + case 3: + message.label = 3; + break; + case "ADVMOD": + case 4: + message.label = 4; + break; + case "AMOD": + case 5: + message.label = 5; + break; + case "APPOS": + case 6: + message.label = 6; + break; + case "ATTR": + case 7: + message.label = 7; + break; + case "AUX": + case 8: + message.label = 8; + break; + case "AUXPASS": + case 9: + message.label = 9; + break; + case "CC": + case 10: + message.label = 10; + break; + case "CCOMP": + case 11: + message.label = 11; + break; + case "CONJ": + case 12: + message.label = 12; + break; + case "CSUBJ": + case 13: + message.label = 13; + break; + case "CSUBJPASS": + case 14: + message.label = 14; + break; + case "DEP": + case 15: + message.label = 15; + break; + case "DET": + case 16: + message.label = 16; + break; + case "DISCOURSE": + case 17: + message.label = 17; + break; + case "DOBJ": + case 18: + message.label = 18; + break; + case "EXPL": + case 19: + message.label = 19; + break; + case "GOESWITH": + case 20: + message.label = 20; + break; + case "IOBJ": + case 21: + message.label = 21; + break; + case "MARK": + case 22: + message.label = 22; + break; + case "MWE": + case 23: + message.label = 23; + break; + case "MWV": + case 24: + message.label = 24; + break; + case "NEG": + case 25: + message.label = 25; + break; + case "NN": + case 26: + message.label = 26; + break; + case "NPADVMOD": + case 27: + message.label = 27; + break; + case "NSUBJ": + case 28: + message.label = 28; + break; + case "NSUBJPASS": + case 29: + message.label = 29; + break; + case "NUM": + case 30: + message.label = 30; + break; + case "NUMBER": + case 31: + message.label = 31; + break; + case "P": + case 32: + message.label = 32; + break; + case "PARATAXIS": + case 33: + message.label = 33; + break; + case "PARTMOD": + case 34: + message.label = 34; + break; + case "PCOMP": + case 35: + message.label = 35; + break; + case "POBJ": + case 36: + message.label = 36; + break; + case "POSS": + case 37: + message.label = 37; + break; + case "POSTNEG": + case 38: + message.label = 38; + break; + case "PRECOMP": + case 39: + message.label = 39; + break; + case "PRECONJ": + case 40: + message.label = 40; + break; + case "PREDET": + case 41: + message.label = 41; + break; + case "PREF": + case 42: + message.label = 42; + break; + case "PREP": + case 43: + message.label = 43; + break; + case "PRONL": + case 44: + message.label = 44; + break; + case "PRT": + case 45: + message.label = 45; + break; + case "PS": + case 46: + message.label = 46; + break; + case "QUANTMOD": + case 47: + message.label = 47; + break; + case "RCMOD": + case 48: + message.label = 48; + break; + case "RCMODREL": + case 49: + message.label = 49; + break; + case "RDROP": + case 50: + message.label = 50; + break; + case "REF": + case 51: + message.label = 51; + break; + case "REMNANT": + case 52: + message.label = 52; + break; + case "REPARANDUM": + case 53: + message.label = 53; + break; + case "ROOT": + case 54: + message.label = 54; + break; + case "SNUM": + case 55: + message.label = 55; + break; + case "SUFF": + case 56: + message.label = 56; + break; + case "TMOD": + case 57: + message.label = 57; + break; + case "TOPIC": + case 58: + message.label = 58; + break; + case "VMOD": + case 59: + message.label = 59; + break; + case "VOCATIVE": + case 60: + message.label = 60; + break; + case "XCOMP": + case 61: + message.label = 61; + break; + case "SUFFIX": + case 62: + message.label = 62; + break; + case "TITLE": + case 63: + message.label = 63; + break; + case "ADVPHMOD": + case 64: + message.label = 64; + break; + case "AUXCAUS": + case 65: + message.label = 65; + break; + case "AUXVV": + case 66: + message.label = 66; + break; + case "DTMOD": + case 67: + message.label = 67; + break; + case "FOREIGN": + case 68: + message.label = 68; + break; + case "KW": + case 69: + message.label = 69; + break; + case "LIST": + case 70: + message.label = 70; + break; + case "NOMC": + case 71: + message.label = 71; + break; + case "NOMCSUBJ": + case 72: + message.label = 72; + break; + case "NOMCSUBJPASS": + case 73: + message.label = 73; + break; + case "NUMC": + case 74: + message.label = 74; + break; + case "COP": + case 75: + message.label = 75; + break; + case "DISLOCATED": + case 76: + message.label = 76; + break; + case "ASP": + case 77: + message.label = 77; + break; + case "GMOD": + case 78: + message.label = 78; + break; + case "GOBJ": + case 79: + message.label = 79; + break; + case "INFMOD": + case 80: + message.label = 80; + break; + case "MES": + case 81: + message.label = 81; + break; + case "NCOMP": + case 82: + message.label = 82; + break; + } + return message; + }; + + /** + * Creates a plain object from a DependencyEdge message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {google.cloud.language.v1beta2.DependencyEdge} message DependencyEdge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DependencyEdge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.headTokenIndex = 0; + object.label = options.enums === String ? "UNKNOWN" : 0; + } + if (message.headTokenIndex != null && message.hasOwnProperty("headTokenIndex")) + object.headTokenIndex = message.headTokenIndex; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.cloud.language.v1beta2.DependencyEdge.Label[message.label] : message.label; + return object; + }; + + /** + * Converts this DependencyEdge to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @instance + * @returns {Object.} JSON object + */ + DependencyEdge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DependencyEdge + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.DependencyEdge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DependencyEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.DependencyEdge"; + }; + + /** + * Label enum. + * @name google.cloud.language.v1beta2.DependencyEdge.Label + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ABBREV=1 ABBREV value + * @property {number} ACOMP=2 ACOMP value + * @property {number} ADVCL=3 ADVCL value + * @property {number} ADVMOD=4 ADVMOD value + * @property {number} AMOD=5 AMOD value + * @property {number} APPOS=6 APPOS value + * @property {number} ATTR=7 ATTR value + * @property {number} AUX=8 AUX value + * @property {number} AUXPASS=9 AUXPASS value + * @property {number} CC=10 CC value + * @property {number} CCOMP=11 CCOMP value + * @property {number} CONJ=12 CONJ value + * @property {number} CSUBJ=13 CSUBJ value + * @property {number} CSUBJPASS=14 CSUBJPASS value + * @property {number} DEP=15 DEP value + * @property {number} DET=16 DET value + * @property {number} DISCOURSE=17 DISCOURSE value + * @property {number} DOBJ=18 DOBJ value + * @property {number} EXPL=19 EXPL value + * @property {number} GOESWITH=20 GOESWITH value + * @property {number} IOBJ=21 IOBJ value + * @property {number} MARK=22 MARK value + * @property {number} MWE=23 MWE value + * @property {number} MWV=24 MWV value + * @property {number} NEG=25 NEG value + * @property {number} NN=26 NN value + * @property {number} NPADVMOD=27 NPADVMOD value + * @property {number} NSUBJ=28 NSUBJ value + * @property {number} NSUBJPASS=29 NSUBJPASS value + * @property {number} NUM=30 NUM value + * @property {number} NUMBER=31 NUMBER value + * @property {number} P=32 P value + * @property {number} PARATAXIS=33 PARATAXIS value + * @property {number} PARTMOD=34 PARTMOD value + * @property {number} PCOMP=35 PCOMP value + * @property {number} POBJ=36 POBJ value + * @property {number} POSS=37 POSS value + * @property {number} POSTNEG=38 POSTNEG value + * @property {number} PRECOMP=39 PRECOMP value + * @property {number} PRECONJ=40 PRECONJ value + * @property {number} PREDET=41 PREDET value + * @property {number} PREF=42 PREF value + * @property {number} PREP=43 PREP value + * @property {number} PRONL=44 PRONL value + * @property {number} PRT=45 PRT value + * @property {number} PS=46 PS value + * @property {number} QUANTMOD=47 QUANTMOD value + * @property {number} RCMOD=48 RCMOD value + * @property {number} RCMODREL=49 RCMODREL value + * @property {number} RDROP=50 RDROP value + * @property {number} REF=51 REF value + * @property {number} REMNANT=52 REMNANT value + * @property {number} REPARANDUM=53 REPARANDUM value + * @property {number} ROOT=54 ROOT value + * @property {number} SNUM=55 SNUM value + * @property {number} SUFF=56 SUFF value + * @property {number} TMOD=57 TMOD value + * @property {number} TOPIC=58 TOPIC value + * @property {number} VMOD=59 VMOD value + * @property {number} VOCATIVE=60 VOCATIVE value + * @property {number} XCOMP=61 XCOMP value + * @property {number} SUFFIX=62 SUFFIX value + * @property {number} TITLE=63 TITLE value + * @property {number} ADVPHMOD=64 ADVPHMOD value + * @property {number} AUXCAUS=65 AUXCAUS value + * @property {number} AUXVV=66 AUXVV value + * @property {number} DTMOD=67 DTMOD value + * @property {number} FOREIGN=68 FOREIGN value + * @property {number} KW=69 KW value + * @property {number} LIST=70 LIST value + * @property {number} NOMC=71 NOMC value + * @property {number} NOMCSUBJ=72 NOMCSUBJ value + * @property {number} NOMCSUBJPASS=73 NOMCSUBJPASS value + * @property {number} NUMC=74 NUMC value + * @property {number} COP=75 COP value + * @property {number} DISLOCATED=76 DISLOCATED value + * @property {number} ASP=77 ASP value + * @property {number} GMOD=78 GMOD value + * @property {number} GOBJ=79 GOBJ value + * @property {number} INFMOD=80 INFMOD value + * @property {number} MES=81 MES value + * @property {number} NCOMP=82 NCOMP value + */ + DependencyEdge.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ABBREV"] = 1; + values[valuesById[2] = "ACOMP"] = 2; + values[valuesById[3] = "ADVCL"] = 3; + values[valuesById[4] = "ADVMOD"] = 4; + values[valuesById[5] = "AMOD"] = 5; + values[valuesById[6] = "APPOS"] = 6; + values[valuesById[7] = "ATTR"] = 7; + values[valuesById[8] = "AUX"] = 8; + values[valuesById[9] = "AUXPASS"] = 9; + values[valuesById[10] = "CC"] = 10; + values[valuesById[11] = "CCOMP"] = 11; + values[valuesById[12] = "CONJ"] = 12; + values[valuesById[13] = "CSUBJ"] = 13; + values[valuesById[14] = "CSUBJPASS"] = 14; + values[valuesById[15] = "DEP"] = 15; + values[valuesById[16] = "DET"] = 16; + values[valuesById[17] = "DISCOURSE"] = 17; + values[valuesById[18] = "DOBJ"] = 18; + values[valuesById[19] = "EXPL"] = 19; + values[valuesById[20] = "GOESWITH"] = 20; + values[valuesById[21] = "IOBJ"] = 21; + values[valuesById[22] = "MARK"] = 22; + values[valuesById[23] = "MWE"] = 23; + values[valuesById[24] = "MWV"] = 24; + values[valuesById[25] = "NEG"] = 25; + values[valuesById[26] = "NN"] = 26; + values[valuesById[27] = "NPADVMOD"] = 27; + values[valuesById[28] = "NSUBJ"] = 28; + values[valuesById[29] = "NSUBJPASS"] = 29; + values[valuesById[30] = "NUM"] = 30; + values[valuesById[31] = "NUMBER"] = 31; + values[valuesById[32] = "P"] = 32; + values[valuesById[33] = "PARATAXIS"] = 33; + values[valuesById[34] = "PARTMOD"] = 34; + values[valuesById[35] = "PCOMP"] = 35; + values[valuesById[36] = "POBJ"] = 36; + values[valuesById[37] = "POSS"] = 37; + values[valuesById[38] = "POSTNEG"] = 38; + values[valuesById[39] = "PRECOMP"] = 39; + values[valuesById[40] = "PRECONJ"] = 40; + values[valuesById[41] = "PREDET"] = 41; + values[valuesById[42] = "PREF"] = 42; + values[valuesById[43] = "PREP"] = 43; + values[valuesById[44] = "PRONL"] = 44; + values[valuesById[45] = "PRT"] = 45; + values[valuesById[46] = "PS"] = 46; + values[valuesById[47] = "QUANTMOD"] = 47; + values[valuesById[48] = "RCMOD"] = 48; + values[valuesById[49] = "RCMODREL"] = 49; + values[valuesById[50] = "RDROP"] = 50; + values[valuesById[51] = "REF"] = 51; + values[valuesById[52] = "REMNANT"] = 52; + values[valuesById[53] = "REPARANDUM"] = 53; + values[valuesById[54] = "ROOT"] = 54; + values[valuesById[55] = "SNUM"] = 55; + values[valuesById[56] = "SUFF"] = 56; + values[valuesById[57] = "TMOD"] = 57; + values[valuesById[58] = "TOPIC"] = 58; + values[valuesById[59] = "VMOD"] = 59; + values[valuesById[60] = "VOCATIVE"] = 60; + values[valuesById[61] = "XCOMP"] = 61; + values[valuesById[62] = "SUFFIX"] = 62; + values[valuesById[63] = "TITLE"] = 63; + values[valuesById[64] = "ADVPHMOD"] = 64; + values[valuesById[65] = "AUXCAUS"] = 65; + values[valuesById[66] = "AUXVV"] = 66; + values[valuesById[67] = "DTMOD"] = 67; + values[valuesById[68] = "FOREIGN"] = 68; + values[valuesById[69] = "KW"] = 69; + values[valuesById[70] = "LIST"] = 70; + values[valuesById[71] = "NOMC"] = 71; + values[valuesById[72] = "NOMCSUBJ"] = 72; + values[valuesById[73] = "NOMCSUBJPASS"] = 73; + values[valuesById[74] = "NUMC"] = 74; + values[valuesById[75] = "COP"] = 75; + values[valuesById[76] = "DISLOCATED"] = 76; + values[valuesById[77] = "ASP"] = 77; + values[valuesById[78] = "GMOD"] = 78; + values[valuesById[79] = "GOBJ"] = 79; + values[valuesById[80] = "INFMOD"] = 80; + values[valuesById[81] = "MES"] = 81; + values[valuesById[82] = "NCOMP"] = 82; + return values; + })(); + + return DependencyEdge; + })(); + + v1beta2.EntityMention = (function() { + + /** + * Properties of an EntityMention. + * @memberof google.cloud.language.v1beta2 + * @interface IEntityMention + * @property {google.cloud.language.v1beta2.ITextSpan|null} [text] EntityMention text + * @property {google.cloud.language.v1beta2.EntityMention.Type|null} [type] EntityMention type + * @property {google.cloud.language.v1beta2.ISentiment|null} [sentiment] EntityMention sentiment + */ + + /** + * Constructs a new EntityMention. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an EntityMention. + * @implements IEntityMention + * @constructor + * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set + */ + function EntityMention(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]]; + } + + /** + * EntityMention text. + * @member {google.cloud.language.v1beta2.ITextSpan|null|undefined} text + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.text = null; + + /** + * EntityMention type. + * @member {google.cloud.language.v1beta2.EntityMention.Type} type + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.type = 0; + + /** + * EntityMention sentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} sentiment + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + */ + EntityMention.prototype.sentiment = null; + + /** + * Creates a new EntityMention instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention instance + */ + EntityMention.create = function create(properties) { + return new EntityMention(properties); + }; + + /** + * Encodes the specified EntityMention message. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.language.v1beta2.TextSpan.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.sentiment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityMention message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.EntityMention.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.IEntityMention} message EntityMention message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMention.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.EntityMention(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = $root.google.cloud.language.v1beta2.TextSpan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityMention message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMention.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityMention message. + * @function verify + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityMention.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + var error = $root.google.cloud.language.v1beta2.TextSpan.verify(message.text); + if (error) + return "text." + error; + } + 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.sentiment != null && message.hasOwnProperty("sentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.sentiment); + if (error) + return "sentiment." + error; + } + return null; + }; + + /** + * Creates an EntityMention message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.EntityMention} EntityMention + */ + EntityMention.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.EntityMention) + return object; + var message = new $root.google.cloud.language.v1beta2.EntityMention(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.language.v1beta2.EntityMention.text: object expected"); + message.text = $root.google.cloud.language.v1beta2.TextSpan.fromObject(object.text); + } + switch (object.type) { + case "TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "PROPER": + case 1: + message.type = 1; + break; + case "COMMON": + case 2: + message.type = 2; + break; + } + if (object.sentiment != null) { + if (typeof object.sentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.EntityMention.sentiment: object expected"); + message.sentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.sentiment); + } + return message; + }; + + /** + * Creates a plain object from an EntityMention message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {google.cloud.language.v1beta2.EntityMention} message EntityMention + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityMention.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = null; + object.type = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.sentiment = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = $root.google.cloud.language.v1beta2.TextSpan.toObject(message.text, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.language.v1beta2.EntityMention.Type[message.type] : message.type; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.sentiment, options); + return object; + }; + + /** + * Converts this EntityMention to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.EntityMention + * @instance + * @returns {Object.} JSON object + */ + EntityMention.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityMention + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.EntityMention + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityMention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.EntityMention"; + }; + + /** + * Type enum. + * @name google.cloud.language.v1beta2.EntityMention.Type + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @property {number} PROPER=1 PROPER value + * @property {number} COMMON=2 COMMON value + */ + EntityMention.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "PROPER"] = 1; + values[valuesById[2] = "COMMON"] = 2; + return values; + })(); + + return EntityMention; + })(); + + v1beta2.TextSpan = (function() { + + /** + * Properties of a TextSpan. + * @memberof google.cloud.language.v1beta2 + * @interface ITextSpan + * @property {string|null} [content] TextSpan content + * @property {number|null} [beginOffset] TextSpan beginOffset + */ + + /** + * Constructs a new TextSpan. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a TextSpan. + * @implements ITextSpan + * @constructor + * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set + */ + function TextSpan(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]]; + } + + /** + * TextSpan content. + * @member {string} content + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + */ + TextSpan.prototype.content = ""; + + /** + * TextSpan beginOffset. + * @member {number} beginOffset + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + */ + TextSpan.prototype.beginOffset = 0; + + /** + * Creates a new TextSpan instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan instance + */ + TextSpan.create = function create(properties) { + return new TextSpan(properties); + }; + + /** + * Encodes the specified TextSpan message. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.beginOffset != null && Object.hasOwnProperty.call(message, "beginOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.beginOffset); + return writer; + }; + + /** + * Encodes the specified TextSpan message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.TextSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.ITextSpan} message TextSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSpan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSpan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.TextSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.beginOffset = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSpan message. + * @function verify + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + if (!$util.isInteger(message.beginOffset)) + return "beginOffset: integer expected"; + return null; + }; + + /** + * Creates a TextSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.TextSpan} TextSpan + */ + TextSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.TextSpan) + return object; + var message = new $root.google.cloud.language.v1beta2.TextSpan(); + if (object.content != null) + message.content = String(object.content); + if (object.beginOffset != null) + message.beginOffset = object.beginOffset | 0; + return message; + }; + + /** + * Creates a plain object from a TextSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {google.cloud.language.v1beta2.TextSpan} message TextSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.beginOffset = 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.beginOffset != null && message.hasOwnProperty("beginOffset")) + object.beginOffset = message.beginOffset; + return object; + }; + + /** + * Converts this TextSpan to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.TextSpan + * @instance + * @returns {Object.} JSON object + */ + TextSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSpan + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.TextSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.TextSpan"; + }; + + return TextSpan; + })(); + + v1beta2.ClassificationCategory = (function() { + + /** + * Properties of a ClassificationCategory. + * @memberof google.cloud.language.v1beta2 + * @interface IClassificationCategory + * @property {string|null} [name] ClassificationCategory name + * @property {number|null} [confidence] ClassificationCategory confidence + */ + + /** + * Constructs a new ClassificationCategory. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a ClassificationCategory. + * @implements IClassificationCategory + * @constructor + * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set + */ + function ClassificationCategory(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]]; + } + + /** + * ClassificationCategory name. + * @member {string} name + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @instance + */ + ClassificationCategory.prototype.name = ""; + + /** + * ClassificationCategory confidence. + * @member {number} confidence + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @instance + */ + ClassificationCategory.prototype.confidence = 0; + + /** + * Creates a new ClassificationCategory instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {google.cloud.language.v1beta2.IClassificationCategory=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory instance + */ + ClassificationCategory.create = function create(properties) { + return new ClassificationCategory(properties); + }; + + /** + * Encodes the specified ClassificationCategory message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationCategory.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified ClassificationCategory message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {google.cloud.language.v1beta2.IClassificationCategory} message ClassificationCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationCategory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationCategory message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationCategory.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.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a ClassificationCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationCategory} ClassificationCategory + */ + ClassificationCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationCategory) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassificationCategory(); + if (object.name != null) + message.name = String(object.name); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a ClassificationCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {google.cloud.language.v1beta2.ClassificationCategory} message ClassificationCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.confidence = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this ClassificationCategory to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @instance + * @returns {Object.} JSON object + */ + ClassificationCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationCategory + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationCategory"; + }; + + return ClassificationCategory; + })(); + + v1beta2.ClassificationModelOptions = (function() { + + /** + * Properties of a ClassificationModelOptions. + * @memberof google.cloud.language.v1beta2 + * @interface IClassificationModelOptions + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null} [v1Model] ClassificationModelOptions v1Model + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null} [v2Model] ClassificationModelOptions v2Model + */ + + /** + * Constructs a new ClassificationModelOptions. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a ClassificationModelOptions. + * @implements IClassificationModelOptions + * @constructor + * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set + */ + function ClassificationModelOptions(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]]; + } + + /** + * ClassificationModelOptions v1Model. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model|null|undefined} v1Model + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @instance + */ + ClassificationModelOptions.prototype.v1Model = null; + + /** + * ClassificationModelOptions v2Model. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model|null|undefined} v2Model + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @instance + */ + ClassificationModelOptions.prototype.v2Model = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ClassificationModelOptions modelType. + * @member {"v1Model"|"v2Model"|undefined} modelType + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @instance + */ + Object.defineProperty(ClassificationModelOptions.prototype, "modelType", { + get: $util.oneOfGetter($oneOfFields = ["v1Model", "v2Model"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ClassificationModelOptions instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1beta2.IClassificationModelOptions=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions instance + */ + ClassificationModelOptions.create = function create(properties) { + return new ClassificationModelOptions(properties); + }; + + /** + * Encodes the specified ClassificationModelOptions message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationModelOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.v1Model != null && Object.hasOwnProperty.call(message, "v1Model")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.encode(message.v1Model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.v2Model != null && Object.hasOwnProperty.call(message, "v2Model")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.encode(message.v2Model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassificationModelOptions message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1beta2.IClassificationModelOptions} message ClassificationModelOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationModelOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationModelOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.decode(reader, reader.uint32()); + break; + } + case 2: { + message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationModelOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationModelOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationModelOptions message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationModelOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify(message.v1Model); + if (error) + return "v1Model." + error; + } + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + if (properties.modelType === 1) + return "modelType: multiple values"; + properties.modelType = 1; + { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify(message.v2Model); + if (error) + return "v2Model." + error; + } + } + return null; + }; + + /** + * Creates a ClassificationModelOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions} ClassificationModelOptions + */ + ClassificationModelOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions(); + if (object.v1Model != null) { + if (typeof object.v1Model !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v1Model: object expected"); + message.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.fromObject(object.v1Model); + } + if (object.v2Model != null) { + if (typeof object.v2Model !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassificationModelOptions.v2Model: object expected"); + message.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.fromObject(object.v2Model); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationModelOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions} message ClassificationModelOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationModelOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.v1Model != null && message.hasOwnProperty("v1Model")) { + object.v1Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.toObject(message.v1Model, options); + if (options.oneofs) + object.modelType = "v1Model"; + } + if (message.v2Model != null && message.hasOwnProperty("v2Model")) { + object.v2Model = $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.toObject(message.v2Model, options); + if (options.oneofs) + object.modelType = "v2Model"; + } + return object; + }; + + /** + * Converts this ClassificationModelOptions to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @instance + * @returns {Object.} JSON object + */ + ClassificationModelOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationModelOptions + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationModelOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions"; + }; + + ClassificationModelOptions.V1Model = (function() { + + /** + * Properties of a V1Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @interface IV1Model + */ + + /** + * Constructs a new V1Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @classdesc Represents a V1Model. + * @implements IV1Model + * @constructor + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set + */ + function V1Model(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 V1Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model instance + */ + V1Model.create = function create(properties) { + return new V1Model(properties); + }; + + /** + * Encodes the specified V1Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified V1Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV1Model} message V1Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V1Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a V1Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a V1Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V1Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V1Model message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V1Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a V1Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} V1Model + */ + V1Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + return object; + return new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + }; + + /** + * Creates a plain object from a V1Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} message V1Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V1Model.toObject = function toObject() { + return {}; + }; + + /** + * Converts this V1Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @instance + * @returns {Object.} JSON object + */ + V1Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for V1Model + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V1Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V1Model"; + }; + + return V1Model; + })(); + + ClassificationModelOptions.V2Model = (function() { + + /** + * Properties of a V2Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @interface IV2Model + * @property {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion|null} [contentCategoriesVersion] V2Model contentCategoriesVersion + */ + + /** + * Constructs a new V2Model. + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions + * @classdesc Represents a V2Model. + * @implements IV2Model + * @constructor + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set + */ + function V2Model(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]]; + } + + /** + * V2Model contentCategoriesVersion. + * @member {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion} contentCategoriesVersion + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @instance + */ + V2Model.prototype.contentCategoriesVersion = 0; + + /** + * Creates a new V2Model instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model instance + */ + V2Model.create = function create(properties) { + return new V2Model(properties); + }; + + /** + * Encodes the specified V2Model message. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentCategoriesVersion != null && Object.hasOwnProperty.call(message, "contentCategoriesVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.contentCategoriesVersion); + return writer; + }; + + /** + * Encodes the specified V2Model message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.IV2Model} message V2Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + V2Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a V2Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentCategoriesVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a V2Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + V2Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a V2Model message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + V2Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + switch (message.contentCategoriesVersion) { + default: + return "contentCategoriesVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a V2Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} V2Model + */ + V2Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + switch (object.contentCategoriesVersion) { + case "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": + case 0: + message.contentCategoriesVersion = 0; + break; + case "V1": + case 1: + message.contentCategoriesVersion = 1; + break; + case "V2": + case 2: + message.contentCategoriesVersion = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a V2Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} message V2Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + V2Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contentCategoriesVersion = options.enums === String ? "CONTENT_CATEGORIES_VERSION_UNSPECIFIED" : 0; + if (message.contentCategoriesVersion != null && message.hasOwnProperty("contentCategoriesVersion")) + object.contentCategoriesVersion = options.enums === String ? $root.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion[message.contentCategoriesVersion] : message.contentCategoriesVersion; + return object; + }; + + /** + * Converts this V2Model to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @instance + * @returns {Object.} JSON object + */ + V2Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for V2Model + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + V2Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassificationModelOptions.V2Model"; + }; + + /** + * ContentCategoriesVersion enum. + * @name google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + * @enum {number} + * @property {number} CONTENT_CATEGORIES_VERSION_UNSPECIFIED=0 CONTENT_CATEGORIES_VERSION_UNSPECIFIED value + * @property {number} V1=1 V1 value + * @property {number} V2=2 V2 value + */ + V2Model.ContentCategoriesVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "V1"] = 1; + values[valuesById[2] = "V2"] = 2; + return values; + })(); + + return V2Model; + })(); + + return ClassificationModelOptions; + })(); + + v1beta2.AnalyzeSentimentRequest = (function() { + + /** + * Properties of an AnalyzeSentimentRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeSentimentRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSentimentRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSentimentRequest encodingType + */ + + /** + * Constructs a new AnalyzeSentimentRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeSentimentRequest. + * @implements IAnalyzeSentimentRequest + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set + */ + function AnalyzeSentimentRequest(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]]; + } + + /** + * AnalyzeSentimentRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @instance + */ + AnalyzeSentimentRequest.prototype.document = null; + + /** + * AnalyzeSentimentRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @instance + */ + AnalyzeSentimentRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeSentimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest instance + */ + AnalyzeSentimentRequest.create = function create(properties) { + return new AnalyzeSentimentRequest(properties); + }; + + /** + * Encodes the specified AnalyzeSentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeSentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentRequest} message AnalyzeSentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSentimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSentimentRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSentimentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeSentimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentRequest} AnalyzeSentimentRequest + */ + AnalyzeSentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSentimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {google.cloud.language.v1beta2.AnalyzeSentimentRequest} message AnalyzeSentimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSentimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeSentimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSentimentRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentRequest"; + }; + + return AnalyzeSentimentRequest; + })(); + + v1beta2.AnalyzeSentimentResponse = (function() { + + /** + * Properties of an AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeSentimentResponse + * @property {google.cloud.language.v1beta2.ISentiment|null} [documentSentiment] AnalyzeSentimentResponse documentSentiment + * @property {string|null} [language] AnalyzeSentimentResponse language + * @property {Array.|null} [sentences] AnalyzeSentimentResponse sentences + */ + + /** + * Constructs a new AnalyzeSentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeSentimentResponse. + * @implements IAnalyzeSentimentResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set + */ + function AnalyzeSentimentResponse(properties) { + this.sentences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeSentimentResponse documentSentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.documentSentiment = null; + + /** + * AnalyzeSentimentResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.language = ""; + + /** + * AnalyzeSentimentResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + */ + AnalyzeSentimentResponse.prototype.sentences = $util.emptyArray; + + /** + * Creates a new AnalyzeSentimentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse instance + */ + AnalyzeSentimentResponse.create = function create(properties) { + return new AnalyzeSentimentResponse(properties); + }; + + /** + * Encodes the specified AnalyzeSentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeSentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSentimentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSentimentResponse} message AnalyzeSentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.language = reader.string(); + break; + } + case 3: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSentimentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSentimentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSentimentResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSentimentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeSentimentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeSentimentResponse} AnalyzeSentimentResponse + */ + AnalyzeSentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSentimentResponse(); + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.documentSentiment); + } + if (object.language != null) + message.language = String(object.language); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSentimentResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSentimentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {google.cloud.language.v1beta2.AnalyzeSentimentResponse} message AnalyzeSentimentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSentimentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sentences = []; + if (options.defaults) { + object.documentSentiment = null; + object.language = ""; + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.documentSentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeSentimentResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSentimentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSentimentResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSentimentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSentimentResponse"; + }; + + return AnalyzeSentimentResponse; + })(); + + v1beta2.AnalyzeEntitySentimentRequest = (function() { + + /** + * Properties of an AnalyzeEntitySentimentRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeEntitySentimentRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitySentimentRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitySentimentRequest encodingType + */ + + /** + * Constructs a new AnalyzeEntitySentimentRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeEntitySentimentRequest. + * @implements IAnalyzeEntitySentimentRequest + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + */ + function AnalyzeEntitySentimentRequest(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]]; + } + + /** + * AnalyzeEntitySentimentRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @instance + */ + AnalyzeEntitySentimentRequest.prototype.document = null; + + /** + * AnalyzeEntitySentimentRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @instance + */ + AnalyzeEntitySentimentRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeEntitySentimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest instance + */ + AnalyzeEntitySentimentRequest.create = function create(properties) { + return new AnalyzeEntitySentimentRequest(properties); + }; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitySentimentRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitySentimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitySentimentRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitySentimentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeEntitySentimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} AnalyzeEntitySentimentRequest + */ + AnalyzeEntitySentimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitySentimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest} message AnalyzeEntitySentimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitySentimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeEntitySentimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitySentimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitySentimentRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitySentimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest"; + }; + + return AnalyzeEntitySentimentRequest; + })(); + + v1beta2.AnalyzeEntitySentimentResponse = (function() { + + /** + * Properties of an AnalyzeEntitySentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeEntitySentimentResponse + * @property {Array.|null} [entities] AnalyzeEntitySentimentResponse entities + * @property {string|null} [language] AnalyzeEntitySentimentResponse language + */ + + /** + * Constructs a new AnalyzeEntitySentimentResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeEntitySentimentResponse. + * @implements IAnalyzeEntitySentimentResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + */ + function AnalyzeEntitySentimentResponse(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeEntitySentimentResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @instance + */ + AnalyzeEntitySentimentResponse.prototype.entities = $util.emptyArray; + + /** + * AnalyzeEntitySentimentResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @instance + */ + AnalyzeEntitySentimentResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeEntitySentimentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse instance + */ + AnalyzeEntitySentimentResponse.create = function create(properties) { + return new AnalyzeEntitySentimentResponse(properties); + }; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1beta2.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitySentimentResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitySentimentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1beta2.Entity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitySentimentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitySentimentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitySentimentResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitySentimentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeEntitySentimentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} AnalyzeEntitySentimentResponse + */ + AnalyzeEntitySentimentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitySentimentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse} message AnalyzeEntitySentimentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitySentimentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) + object.language = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1beta2.Entity.toObject(message.entities[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeEntitySentimentResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitySentimentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitySentimentResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitySentimentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse"; + }; + + return AnalyzeEntitySentimentResponse; + })(); + + v1beta2.AnalyzeEntitiesRequest = (function() { + + /** + * Properties of an AnalyzeEntitiesRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeEntitiesRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeEntitiesRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeEntitiesRequest encodingType + */ + + /** + * Constructs a new AnalyzeEntitiesRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeEntitiesRequest. + * @implements IAnalyzeEntitiesRequest + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set + */ + function AnalyzeEntitiesRequest(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]]; + } + + /** + * AnalyzeEntitiesRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @instance + */ + AnalyzeEntitiesRequest.prototype.document = null; + + /** + * AnalyzeEntitiesRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @instance + */ + AnalyzeEntitiesRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest instance + */ + AnalyzeEntitiesRequest.create = function create(properties) { + return new AnalyzeEntitiesRequest(properties); + }; + + /** + * Encodes the specified AnalyzeEntitiesRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesRequest} message AnalyzeEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitiesRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} AnalyzeEntitiesRequest + */ + AnalyzeEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesRequest} message AnalyzeEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitiesRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesRequest"; + }; + + return AnalyzeEntitiesRequest; + })(); + + v1beta2.AnalyzeEntitiesResponse = (function() { + + /** + * Properties of an AnalyzeEntitiesResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeEntitiesResponse + * @property {Array.|null} [entities] AnalyzeEntitiesResponse entities + * @property {string|null} [language] AnalyzeEntitiesResponse language + */ + + /** + * Constructs a new AnalyzeEntitiesResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeEntitiesResponse. + * @implements IAnalyzeEntitiesResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set + */ + function AnalyzeEntitiesResponse(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeEntitiesResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @instance + */ + AnalyzeEntitiesResponse.prototype.entities = $util.emptyArray; + + /** + * AnalyzeEntitiesResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @instance + */ + AnalyzeEntitiesResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse instance + */ + AnalyzeEntitiesResponse.create = function create(properties) { + return new AnalyzeEntitiesResponse(properties); + }; + + /** + * Encodes the specified AnalyzeEntitiesResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1beta2.Entity.encode(message.entities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeEntitiesResponse} message AnalyzeEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1beta2.Entity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeEntitiesResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} AnalyzeEntitiesResponse + */ + AnalyzeEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeEntitiesResponse(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeEntitiesResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {google.cloud.language.v1beta2.AnalyzeEntitiesResponse} message AnalyzeEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) + object.language = ""; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1beta2.Entity.toObject(message.entities[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeEntitiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeEntitiesResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeEntitiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeEntitiesResponse"; + }; + + return AnalyzeEntitiesResponse; + })(); + + v1beta2.AnalyzeSyntaxRequest = (function() { + + /** + * Properties of an AnalyzeSyntaxRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeSyntaxRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnalyzeSyntaxRequest document + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnalyzeSyntaxRequest encodingType + */ + + /** + * Constructs a new AnalyzeSyntaxRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeSyntaxRequest. + * @implements IAnalyzeSyntaxRequest + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set + */ + function AnalyzeSyntaxRequest(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]]; + } + + /** + * AnalyzeSyntaxRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @instance + */ + AnalyzeSyntaxRequest.prototype.document = null; + + /** + * AnalyzeSyntaxRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @instance + */ + AnalyzeSyntaxRequest.prototype.encodingType = 0; + + /** + * Creates a new AnalyzeSyntaxRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest instance + */ + AnalyzeSyntaxRequest.create = function create(properties) { + return new AnalyzeSyntaxRequest(properties); + }; + + /** + * Encodes the specified AnalyzeSyntaxRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnalyzeSyntaxRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxRequest} message AnalyzeSyntaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSyntaxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSyntaxRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSyntaxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnalyzeSyntaxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} AnalyzeSyntaxRequest + */ + AnalyzeSyntaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeSyntaxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxRequest} message AnalyzeSyntaxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSyntaxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnalyzeSyntaxRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSyntaxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSyntaxRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSyntaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxRequest"; + }; + + return AnalyzeSyntaxRequest; + })(); + + v1beta2.AnalyzeSyntaxResponse = (function() { + + /** + * Properties of an AnalyzeSyntaxResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnalyzeSyntaxResponse + * @property {Array.|null} [sentences] AnalyzeSyntaxResponse sentences + * @property {Array.|null} [tokens] AnalyzeSyntaxResponse tokens + * @property {string|null} [language] AnalyzeSyntaxResponse language + */ + + /** + * Constructs a new AnalyzeSyntaxResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnalyzeSyntaxResponse. + * @implements IAnalyzeSyntaxResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set + */ + function AnalyzeSyntaxResponse(properties) { + this.sentences = []; + this.tokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeSyntaxResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.sentences = $util.emptyArray; + + /** + * AnalyzeSyntaxResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.tokens = $util.emptyArray; + + /** + * AnalyzeSyntaxResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @instance + */ + AnalyzeSyntaxResponse.prototype.language = ""; + + /** + * Creates a new AnalyzeSyntaxResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse instance + */ + AnalyzeSyntaxResponse.create = function create(properties) { + return new AnalyzeSyntaxResponse(properties); + }; + + /** + * Encodes the specified AnalyzeSyntaxResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1beta2.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.language); + return writer; + }; + + /** + * Encodes the specified AnalyzeSyntaxResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1beta2.IAnalyzeSyntaxResponse} message AnalyzeSyntaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeSyntaxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1beta2.Token.decode(reader, reader.uint32())); + break; + } + case 3: { + message.language = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeSyntaxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeSyntaxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeSyntaxResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeSyntaxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + return null; + }; + + /** + * Creates an AnalyzeSyntaxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} AnalyzeSyntaxResponse + */ + AnalyzeSyntaxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnalyzeSyntaxResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnalyzeSyntaxResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1beta2.Token.fromObject(object.tokens[i]); + } + } + if (object.language != null) + message.language = String(object.language); + return message; + }; + + /** + * Creates a plain object from an AnalyzeSyntaxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {google.cloud.language.v1beta2.AnalyzeSyntaxResponse} message AnalyzeSyntaxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeSyntaxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + } + if (options.defaults) + object.language = ""; + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1beta2.Token.toObject(message.tokens[j], options); + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + return object; + }; + + /** + * Converts this AnalyzeSyntaxResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeSyntaxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeSyntaxResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnalyzeSyntaxResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeSyntaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnalyzeSyntaxResponse"; + }; + + return AnalyzeSyntaxResponse; + })(); + + v1beta2.ClassifyTextRequest = (function() { + + /** + * Properties of a ClassifyTextRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IClassifyTextRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] ClassifyTextRequest document + * @property {google.cloud.language.v1beta2.IClassificationModelOptions|null} [classificationModelOptions] ClassifyTextRequest classificationModelOptions + */ + + /** + * Constructs a new ClassifyTextRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a ClassifyTextRequest. + * @implements IClassifyTextRequest + * @constructor + * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set + */ + function ClassifyTextRequest(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]]; + } + + /** + * ClassifyTextRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @instance + */ + ClassifyTextRequest.prototype.document = null; + + /** + * ClassifyTextRequest classificationModelOptions. + * @member {google.cloud.language.v1beta2.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @instance + */ + ClassifyTextRequest.prototype.classificationModelOptions = null; + + /** + * Creates a new ClassifyTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest instance + */ + ClassifyTextRequest.create = function create(properties) { + return new ClassifyTextRequest(properties); + }; + + /** + * Encodes the specified ClassifyTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassifyTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextRequest} message ClassifyTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassifyTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassifyTextRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassifyTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } + return null; + }; + + /** + * Creates a ClassifyTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassifyTextRequest} ClassifyTextRequest + */ + ClassifyTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassifyTextRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextRequest.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.fromObject(object.classificationModelOptions); + } + return message; + }; + + /** + * Creates a plain object from a ClassifyTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {google.cloud.language.v1beta2.ClassifyTextRequest} message ClassifyTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassifyTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.classificationModelOptions = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + return object; + }; + + /** + * Converts this ClassifyTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @instance + * @returns {Object.} JSON object + */ + ClassifyTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassifyTextRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassifyTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassifyTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextRequest"; + }; + + return ClassifyTextRequest; + })(); + + v1beta2.ClassifyTextResponse = (function() { + + /** + * Properties of a ClassifyTextResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IClassifyTextResponse + * @property {Array.|null} [categories] ClassifyTextResponse categories + */ + + /** + * Constructs a new ClassifyTextResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents a ClassifyTextResponse. + * @implements IClassifyTextResponse + * @constructor + * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set + */ + function ClassifyTextResponse(properties) { + this.categories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassifyTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @instance + */ + ClassifyTextResponse.prototype.categories = $util.emptyArray; + + /** + * Creates a new ClassifyTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse instance + */ + ClassifyTextResponse.create = function create(properties) { + return new ClassifyTextResponse(properties); + }; + + /** + * Encodes the specified ClassifyTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClassifyTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.ClassifyTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1beta2.IClassifyTextResponse} message ClassifyTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassifyTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassifyTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassifyTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassifyTextResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassifyTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + return null; + }; + + /** + * Creates a ClassifyTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.ClassifyTextResponse} ClassifyTextResponse + */ + ClassifyTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.ClassifyTextResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.ClassifyTextResponse(); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.ClassifyTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.categories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClassifyTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {google.cloud.language.v1beta2.ClassifyTextResponse} message ClassifyTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassifyTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.categories = []; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.categories[j], options); + } + return object; + }; + + /** + * Converts this ClassifyTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @instance + * @returns {Object.} JSON object + */ + ClassifyTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassifyTextResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.ClassifyTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassifyTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.ClassifyTextResponse"; + }; + + return ClassifyTextResponse; + })(); + + v1beta2.AnnotateTextRequest = (function() { + + /** + * Properties of an AnnotateTextRequest. + * @memberof google.cloud.language.v1beta2 + * @interface IAnnotateTextRequest + * @property {google.cloud.language.v1beta2.IDocument|null} [document] AnnotateTextRequest document + * @property {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures|null} [features] AnnotateTextRequest features + * @property {google.cloud.language.v1beta2.EncodingType|null} [encodingType] AnnotateTextRequest encodingType + */ + + /** + * Constructs a new AnnotateTextRequest. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnnotateTextRequest. + * @implements IAnnotateTextRequest + * @constructor + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest=} [properties] Properties to set + */ + function AnnotateTextRequest(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]]; + } + + /** + * AnnotateTextRequest document. + * @member {google.cloud.language.v1beta2.IDocument|null|undefined} document + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.document = null; + + /** + * AnnotateTextRequest features. + * @member {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures|null|undefined} features + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.features = null; + + /** + * AnnotateTextRequest encodingType. + * @member {google.cloud.language.v1beta2.EncodingType} encodingType + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @instance + */ + AnnotateTextRequest.prototype.encodingType = 0; + + /** + * Creates a new AnnotateTextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest} AnnotateTextRequest instance + */ + AnnotateTextRequest.create = function create(properties) { + return new AnnotateTextRequest(properties); + }; + + /** + * Encodes the specified AnnotateTextRequest message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.language.v1beta2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.encodingType != null && Object.hasOwnProperty.call(message, "encodingType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encodingType); + return writer; + }; + + /** + * Encodes the specified AnnotateTextRequest message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextRequest} message AnnotateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest} AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnnotateTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.language.v1beta2.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.features = $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features.decode(reader, reader.uint32()); + break; + } + case 3: { + message.encodingType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest} AnnotateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateTextRequest message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.language.v1beta2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features.verify(message.features); + if (error) + return "features." + error; + } + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + switch (message.encodingType) { + default: + return "encodingType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AnnotateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest} AnnotateTextRequest + */ + AnnotateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnnotateTextRequest) + return object; + var message = new $root.google.cloud.language.v1beta2.AnnotateTextRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextRequest.document: object expected"); + message.document = $root.google.cloud.language.v1beta2.Document.fromObject(object.document); + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextRequest.features: object expected"); + message.features = $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features.fromObject(object.features); + } + switch (object.encodingType) { + case "NONE": + case 0: + message.encodingType = 0; + break; + case "UTF8": + case 1: + message.encodingType = 1; + break; + case "UTF16": + case 2: + message.encodingType = 2; + break; + case "UTF32": + case 3: + message.encodingType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextRequest} message AnnotateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.features = null; + object.encodingType = options.enums === String ? "NONE" : 0; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.language.v1beta2.Document.toObject(message.document, options); + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features.toObject(message.features, options); + if (message.encodingType != null && message.hasOwnProperty("encodingType")) + object.encodingType = options.enums === String ? $root.google.cloud.language.v1beta2.EncodingType[message.encodingType] : message.encodingType; + return object; + }; + + /** + * Converts this AnnotateTextRequest to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateTextRequest + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnnotateTextRequest"; + }; + + AnnotateTextRequest.Features = (function() { + + /** + * Properties of a Features. + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @interface IFeatures + * @property {boolean|null} [extractSyntax] Features extractSyntax + * @property {boolean|null} [extractEntities] Features extractEntities + * @property {boolean|null} [extractDocumentSentiment] Features extractDocumentSentiment + * @property {boolean|null} [extractEntitySentiment] Features extractEntitySentiment + * @property {boolean|null} [classifyText] Features classifyText + * @property {google.cloud.language.v1beta2.IClassificationModelOptions|null} [classificationModelOptions] Features classificationModelOptions + */ + + /** + * Constructs a new Features. + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest + * @classdesc Represents a Features. + * @implements IFeatures + * @constructor + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures=} [properties] Properties to set + */ + function Features(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]]; + } + + /** + * Features extractSyntax. + * @member {boolean} extractSyntax + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractSyntax = false; + + /** + * Features extractEntities. + * @member {boolean} extractEntities + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntities = false; + + /** + * Features extractDocumentSentiment. + * @member {boolean} extractDocumentSentiment + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractDocumentSentiment = false; + + /** + * Features extractEntitySentiment. + * @member {boolean} extractEntitySentiment + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.extractEntitySentiment = false; + + /** + * Features classifyText. + * @member {boolean} classifyText + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classifyText = false; + + /** + * Features classificationModelOptions. + * @member {google.cloud.language.v1beta2.IClassificationModelOptions|null|undefined} classificationModelOptions + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + */ + Features.prototype.classificationModelOptions = null; + + /** + * Creates a new Features instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest.Features} Features instance + */ + Features.create = function create(properties) { + return new Features(properties); + }; + + /** + * Encodes the specified Features message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.Features.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extractSyntax != null && Object.hasOwnProperty.call(message, "extractSyntax")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.extractSyntax); + if (message.extractEntities != null && Object.hasOwnProperty.call(message, "extractEntities")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.extractEntities); + if (message.extractDocumentSentiment != null && Object.hasOwnProperty.call(message, "extractDocumentSentiment")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.extractDocumentSentiment); + if (message.extractEntitySentiment != null && Object.hasOwnProperty.call(message, "extractEntitySentiment")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.extractEntitySentiment); + if (message.classifyText != null && Object.hasOwnProperty.call(message, "classifyText")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.classifyText); + if (message.classificationModelOptions != null && Object.hasOwnProperty.call(message, "classificationModelOptions")) + $root.google.cloud.language.v1beta2.ClassificationModelOptions.encode(message.classificationModelOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Features message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextRequest.Features.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.IFeatures} message Features message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Features.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Features message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extractSyntax = reader.bool(); + break; + } + case 2: { + message.extractEntities = reader.bool(); + break; + } + case 3: { + message.extractDocumentSentiment = reader.bool(); + break; + } + case 4: { + message.extractEntitySentiment = reader.bool(); + break; + } + case 6: { + message.classifyText = reader.bool(); + break; + } + case 10: { + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Features message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest.Features} Features + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Features.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Features message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Features.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + if (typeof message.extractSyntax !== "boolean") + return "extractSyntax: boolean expected"; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + if (typeof message.extractEntities !== "boolean") + return "extractEntities: boolean expected"; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + if (typeof message.extractDocumentSentiment !== "boolean") + return "extractDocumentSentiment: boolean expected"; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + if (typeof message.extractEntitySentiment !== "boolean") + return "extractEntitySentiment: boolean expected"; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + if (typeof message.classifyText !== "boolean") + return "classifyText: boolean expected"; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) { + var error = $root.google.cloud.language.v1beta2.ClassificationModelOptions.verify(message.classificationModelOptions); + if (error) + return "classificationModelOptions." + error; + } + return null; + }; + + /** + * Creates a Features message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnnotateTextRequest.Features} Features + */ + Features.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features) + return object; + var message = new $root.google.cloud.language.v1beta2.AnnotateTextRequest.Features(); + if (object.extractSyntax != null) + message.extractSyntax = Boolean(object.extractSyntax); + if (object.extractEntities != null) + message.extractEntities = Boolean(object.extractEntities); + if (object.extractDocumentSentiment != null) + message.extractDocumentSentiment = Boolean(object.extractDocumentSentiment); + if (object.extractEntitySentiment != null) + message.extractEntitySentiment = Boolean(object.extractEntitySentiment); + if (object.classifyText != null) + message.classifyText = Boolean(object.classifyText); + if (object.classificationModelOptions != null) { + if (typeof object.classificationModelOptions !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextRequest.Features.classificationModelOptions: object expected"); + message.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.fromObject(object.classificationModelOptions); + } + return message; + }; + + /** + * Creates a plain object from a Features message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.Features} message Features + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Features.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extractSyntax = false; + object.extractEntities = false; + object.extractDocumentSentiment = false; + object.extractEntitySentiment = false; + object.classifyText = false; + object.classificationModelOptions = null; + } + if (message.extractSyntax != null && message.hasOwnProperty("extractSyntax")) + object.extractSyntax = message.extractSyntax; + if (message.extractEntities != null && message.hasOwnProperty("extractEntities")) + object.extractEntities = message.extractEntities; + if (message.extractDocumentSentiment != null && message.hasOwnProperty("extractDocumentSentiment")) + object.extractDocumentSentiment = message.extractDocumentSentiment; + if (message.extractEntitySentiment != null && message.hasOwnProperty("extractEntitySentiment")) + object.extractEntitySentiment = message.extractEntitySentiment; + if (message.classifyText != null && message.hasOwnProperty("classifyText")) + object.classifyText = message.classifyText; + if (message.classificationModelOptions != null && message.hasOwnProperty("classificationModelOptions")) + object.classificationModelOptions = $root.google.cloud.language.v1beta2.ClassificationModelOptions.toObject(message.classificationModelOptions, options); + return object; + }; + + /** + * Converts this Features to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @instance + * @returns {Object.} JSON object + */ + Features.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Features + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnnotateTextRequest.Features + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Features.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnnotateTextRequest.Features"; + }; + + return Features; + })(); + + return AnnotateTextRequest; + })(); + + v1beta2.AnnotateTextResponse = (function() { + + /** + * Properties of an AnnotateTextResponse. + * @memberof google.cloud.language.v1beta2 + * @interface IAnnotateTextResponse + * @property {Array.|null} [sentences] AnnotateTextResponse sentences + * @property {Array.|null} [tokens] AnnotateTextResponse tokens + * @property {Array.|null} [entities] AnnotateTextResponse entities + * @property {google.cloud.language.v1beta2.ISentiment|null} [documentSentiment] AnnotateTextResponse documentSentiment + * @property {string|null} [language] AnnotateTextResponse language + * @property {Array.|null} [categories] AnnotateTextResponse categories + */ + + /** + * Constructs a new AnnotateTextResponse. + * @memberof google.cloud.language.v1beta2 + * @classdesc Represents an AnnotateTextResponse. + * @implements IAnnotateTextResponse + * @constructor + * @param {google.cloud.language.v1beta2.IAnnotateTextResponse=} [properties] Properties to set + */ + function AnnotateTextResponse(properties) { + this.sentences = []; + this.tokens = []; + this.entities = []; + this.categories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateTextResponse sentences. + * @member {Array.} sentences + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.sentences = $util.emptyArray; + + /** + * AnnotateTextResponse tokens. + * @member {Array.} tokens + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.tokens = $util.emptyArray; + + /** + * AnnotateTextResponse entities. + * @member {Array.} entities + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.entities = $util.emptyArray; + + /** + * AnnotateTextResponse documentSentiment. + * @member {google.cloud.language.v1beta2.ISentiment|null|undefined} documentSentiment + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.documentSentiment = null; + + /** + * AnnotateTextResponse language. + * @member {string} language + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.language = ""; + + /** + * AnnotateTextResponse categories. + * @member {Array.} categories + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + */ + AnnotateTextResponse.prototype.categories = $util.emptyArray; + + /** + * Creates a new AnnotateTextResponse instance using the specified properties. + * @function create + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextResponse=} [properties] Properties to set + * @returns {google.cloud.language.v1beta2.AnnotateTextResponse} AnnotateTextResponse instance + */ + AnnotateTextResponse.create = function create(properties) { + return new AnnotateTextResponse(properties); + }; + + /** + * Encodes the specified AnnotateTextResponse message. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentences != null && message.sentences.length) + for (var i = 0; i < message.sentences.length; ++i) + $root.google.cloud.language.v1beta2.Sentence.encode(message.sentences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.google.cloud.language.v1beta2.Token.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.language.v1beta2.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentSentiment != null && Object.hasOwnProperty.call(message, "documentSentiment")) + $root.google.cloud.language.v1beta2.Sentiment.encode(message.documentSentiment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.language); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.language.v1beta2.ClassificationCategory.encode(message.categories[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateTextResponse message, length delimited. Does not implicitly {@link google.cloud.language.v1beta2.AnnotateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1beta2.IAnnotateTextResponse} message AnnotateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.language.v1beta2.AnnotateTextResponse} AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.language.v1beta2.AnnotateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sentences && message.sentences.length)) + message.sentences = []; + message.sentences.push($root.google.cloud.language.v1beta2.Sentence.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.google.cloud.language.v1beta2.Token.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.language.v1beta2.Entity.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.language = reader.string(); + break; + } + case 6: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.language.v1beta2.ClassificationCategory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.language.v1beta2.AnnotateTextResponse} AnnotateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateTextResponse message. + * @function verify + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentences != null && message.hasOwnProperty("sentences")) { + if (!Array.isArray(message.sentences)) + return "sentences: array expected"; + for (var i = 0; i < message.sentences.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Sentence.verify(message.sentences[i]); + if (error) + return "sentences." + error; + } + } + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Token.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.language.v1beta2.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) { + var error = $root.google.cloud.language.v1beta2.Sentiment.verify(message.documentSentiment); + if (error) + return "documentSentiment." + error; + } + if (message.language != null && message.hasOwnProperty("language")) + if (!$util.isString(message.language)) + return "language: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.language.v1beta2.ClassificationCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.language.v1beta2.AnnotateTextResponse} AnnotateTextResponse + */ + AnnotateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.language.v1beta2.AnnotateTextResponse) + return object; + var message = new $root.google.cloud.language.v1beta2.AnnotateTextResponse(); + if (object.sentences) { + if (!Array.isArray(object.sentences)) + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.sentences: array expected"); + message.sentences = []; + for (var i = 0; i < object.sentences.length; ++i) { + if (typeof object.sentences[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.sentences: object expected"); + message.sentences[i] = $root.google.cloud.language.v1beta2.Sentence.fromObject(object.sentences[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.tokens: object expected"); + message.tokens[i] = $root.google.cloud.language.v1beta2.Token.fromObject(object.tokens[i]); + } + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.entities: object expected"); + message.entities[i] = $root.google.cloud.language.v1beta2.Entity.fromObject(object.entities[i]); + } + } + if (object.documentSentiment != null) { + if (typeof object.documentSentiment !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.documentSentiment: object expected"); + message.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.fromObject(object.documentSentiment); + } + if (object.language != null) + message.language = String(object.language); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.language.v1beta2.AnnotateTextResponse.categories: object expected"); + message.categories[i] = $root.google.cloud.language.v1beta2.ClassificationCategory.fromObject(object.categories[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {google.cloud.language.v1beta2.AnnotateTextResponse} message AnnotateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sentences = []; + object.tokens = []; + object.entities = []; + object.categories = []; + } + if (options.defaults) { + object.documentSentiment = null; + object.language = ""; + } + if (message.sentences && message.sentences.length) { + object.sentences = []; + for (var j = 0; j < message.sentences.length; ++j) + object.sentences[j] = $root.google.cloud.language.v1beta2.Sentence.toObject(message.sentences[j], options); + } + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.google.cloud.language.v1beta2.Token.toObject(message.tokens[j], options); + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.language.v1beta2.Entity.toObject(message.entities[j], options); + } + if (message.documentSentiment != null && message.hasOwnProperty("documentSentiment")) + object.documentSentiment = $root.google.cloud.language.v1beta2.Sentiment.toObject(message.documentSentiment, options); + if (message.language != null && message.hasOwnProperty("language")) + object.language = message.language; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.language.v1beta2.ClassificationCategory.toObject(message.categories[j], options); + } + return object; + }; + + /** + * Converts this AnnotateTextResponse to JSON. + * @function toJSON + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateTextResponse + * @function getTypeUrl + * @memberof google.cloud.language.v1beta2.AnnotateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.language.v1beta2.AnnotateTextResponse"; + }; + + return AnnotateTextResponse; + })(); + + return v1beta2; + })(); + + return language; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + return values; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} 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; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.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: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + 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) { + 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.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: + 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; + } + } + 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.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; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-language/protos/protos.json b/packages/google-cloud-language/protos/protos.json new file mode 100644 index 000000000000..043713bcd1b9 --- /dev/null +++ b/packages/google-cloud-language/protos/protos.json @@ -0,0 +1,2889 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "language": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/language/v1;language", + "java_multiple_files": true, + "java_outer_classname": "LanguageServiceProto", + "java_package": "com.google.cloud.language.v1" + }, + "nested": { + "LanguageService": { + "options": { + "(google.api.default_host)": "language.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-language,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnalyzeSentiment": { + "requestType": "AnalyzeSentimentRequest", + "responseType": "AnalyzeSentimentResponse", + "options": { + "(google.api.http).post": "/v1/documents:analyzeSentiment", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:analyzeSentiment", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeEntities": { + "requestType": "AnalyzeEntitiesRequest", + "responseType": "AnalyzeEntitiesResponse", + "options": { + "(google.api.http).post": "/v1/documents:analyzeEntities", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:analyzeEntities", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeEntitySentiment": { + "requestType": "AnalyzeEntitySentimentRequest", + "responseType": "AnalyzeEntitySentimentResponse", + "options": { + "(google.api.http).post": "/v1/documents:analyzeEntitySentiment", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:analyzeEntitySentiment", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeSyntax": { + "requestType": "AnalyzeSyntaxRequest", + "responseType": "AnalyzeSyntaxResponse", + "options": { + "(google.api.http).post": "/v1/documents:analyzeSyntax", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:analyzeSyntax", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "ClassifyText": { + "requestType": "ClassifyTextRequest", + "responseType": "ClassifyTextResponse", + "options": { + "(google.api.http).post": "/v1/documents:classifyText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:classifyText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnnotateText": { + "requestType": "AnnotateTextRequest", + "responseType": "AnnotateTextResponse", + "options": { + "(google.api.http).post": "/v1/documents:annotateText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document,features" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/documents:annotateText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,features,encoding_type" + }, + { + "(google.api.method_signature)": "document,features" + } + ] + } + } + }, + "Document": { + "oneofs": { + "source": { + "oneof": [ + "content", + "gcsContentUri" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "gcsContentUri": { + "type": "string", + "id": 3 + }, + "language": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PLAIN_TEXT": 1, + "HTML": 2 + } + } + } + }, + "Sentence": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "sentiment": { + "type": "Sentiment", + "id": 2 + } + } + }, + "EncodingType": { + "values": { + "NONE": 0, + "UTF8": 1, + "UTF16": 2, + "UTF32": 3 + } + }, + "Entity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "salience": { + "type": "float", + "id": 4 + }, + "mentions": { + "rule": "repeated", + "type": "EntityMention", + "id": 5 + }, + "sentiment": { + "type": "Sentiment", + "id": 6 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN": 0, + "PERSON": 1, + "LOCATION": 2, + "ORGANIZATION": 3, + "EVENT": 4, + "WORK_OF_ART": 5, + "CONSUMER_GOOD": 6, + "OTHER": 7, + "PHONE_NUMBER": 9, + "ADDRESS": 10, + "DATE": 11, + "NUMBER": 12, + "PRICE": 13 + } + } + } + }, + "Token": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "partOfSpeech": { + "type": "PartOfSpeech", + "id": 2 + }, + "dependencyEdge": { + "type": "DependencyEdge", + "id": 3 + }, + "lemma": { + "type": "string", + "id": 4 + } + } + }, + "Sentiment": { + "fields": { + "magnitude": { + "type": "float", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + } + } + }, + "PartOfSpeech": { + "fields": { + "tag": { + "type": "Tag", + "id": 1 + }, + "aspect": { + "type": "Aspect", + "id": 2 + }, + "case": { + "type": "Case", + "id": 3 + }, + "form": { + "type": "Form", + "id": 4 + }, + "gender": { + "type": "Gender", + "id": 5 + }, + "mood": { + "type": "Mood", + "id": 6 + }, + "number": { + "type": "Number", + "id": 7 + }, + "person": { + "type": "Person", + "id": 8 + }, + "proper": { + "type": "Proper", + "id": 9 + }, + "reciprocity": { + "type": "Reciprocity", + "id": 10 + }, + "tense": { + "type": "Tense", + "id": 11 + }, + "voice": { + "type": "Voice", + "id": 12 + } + }, + "nested": { + "Tag": { + "values": { + "UNKNOWN": 0, + "ADJ": 1, + "ADP": 2, + "ADV": 3, + "CONJ": 4, + "DET": 5, + "NOUN": 6, + "NUM": 7, + "PRON": 8, + "PRT": 9, + "PUNCT": 10, + "VERB": 11, + "X": 12, + "AFFIX": 13 + } + }, + "Aspect": { + "values": { + "ASPECT_UNKNOWN": 0, + "PERFECTIVE": 1, + "IMPERFECTIVE": 2, + "PROGRESSIVE": 3 + } + }, + "Case": { + "values": { + "CASE_UNKNOWN": 0, + "ACCUSATIVE": 1, + "ADVERBIAL": 2, + "COMPLEMENTIVE": 3, + "DATIVE": 4, + "GENITIVE": 5, + "INSTRUMENTAL": 6, + "LOCATIVE": 7, + "NOMINATIVE": 8, + "OBLIQUE": 9, + "PARTITIVE": 10, + "PREPOSITIONAL": 11, + "REFLEXIVE_CASE": 12, + "RELATIVE_CASE": 13, + "VOCATIVE": 14 + } + }, + "Form": { + "values": { + "FORM_UNKNOWN": 0, + "ADNOMIAL": 1, + "AUXILIARY": 2, + "COMPLEMENTIZER": 3, + "FINAL_ENDING": 4, + "GERUND": 5, + "REALIS": 6, + "IRREALIS": 7, + "SHORT": 8, + "LONG": 9, + "ORDER": 10, + "SPECIFIC": 11 + } + }, + "Gender": { + "values": { + "GENDER_UNKNOWN": 0, + "FEMININE": 1, + "MASCULINE": 2, + "NEUTER": 3 + } + }, + "Mood": { + "values": { + "MOOD_UNKNOWN": 0, + "CONDITIONAL_MOOD": 1, + "IMPERATIVE": 2, + "INDICATIVE": 3, + "INTERROGATIVE": 4, + "JUSSIVE": 5, + "SUBJUNCTIVE": 6 + } + }, + "Number": { + "values": { + "NUMBER_UNKNOWN": 0, + "SINGULAR": 1, + "PLURAL": 2, + "DUAL": 3 + } + }, + "Person": { + "values": { + "PERSON_UNKNOWN": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "REFLEXIVE_PERSON": 4 + } + }, + "Proper": { + "values": { + "PROPER_UNKNOWN": 0, + "PROPER": 1, + "NOT_PROPER": 2 + } + }, + "Reciprocity": { + "values": { + "RECIPROCITY_UNKNOWN": 0, + "RECIPROCAL": 1, + "NON_RECIPROCAL": 2 + } + }, + "Tense": { + "values": { + "TENSE_UNKNOWN": 0, + "CONDITIONAL_TENSE": 1, + "FUTURE": 2, + "PAST": 3, + "PRESENT": 4, + "IMPERFECT": 5, + "PLUPERFECT": 6 + } + }, + "Voice": { + "values": { + "VOICE_UNKNOWN": 0, + "ACTIVE": 1, + "CAUSATIVE": 2, + "PASSIVE": 3 + } + } + } + }, + "DependencyEdge": { + "fields": { + "headTokenIndex": { + "type": "int32", + "id": 1 + }, + "label": { + "type": "Label", + "id": 2 + } + }, + "nested": { + "Label": { + "values": { + "UNKNOWN": 0, + "ABBREV": 1, + "ACOMP": 2, + "ADVCL": 3, + "ADVMOD": 4, + "AMOD": 5, + "APPOS": 6, + "ATTR": 7, + "AUX": 8, + "AUXPASS": 9, + "CC": 10, + "CCOMP": 11, + "CONJ": 12, + "CSUBJ": 13, + "CSUBJPASS": 14, + "DEP": 15, + "DET": 16, + "DISCOURSE": 17, + "DOBJ": 18, + "EXPL": 19, + "GOESWITH": 20, + "IOBJ": 21, + "MARK": 22, + "MWE": 23, + "MWV": 24, + "NEG": 25, + "NN": 26, + "NPADVMOD": 27, + "NSUBJ": 28, + "NSUBJPASS": 29, + "NUM": 30, + "NUMBER": 31, + "P": 32, + "PARATAXIS": 33, + "PARTMOD": 34, + "PCOMP": 35, + "POBJ": 36, + "POSS": 37, + "POSTNEG": 38, + "PRECOMP": 39, + "PRECONJ": 40, + "PREDET": 41, + "PREF": 42, + "PREP": 43, + "PRONL": 44, + "PRT": 45, + "PS": 46, + "QUANTMOD": 47, + "RCMOD": 48, + "RCMODREL": 49, + "RDROP": 50, + "REF": 51, + "REMNANT": 52, + "REPARANDUM": 53, + "ROOT": 54, + "SNUM": 55, + "SUFF": 56, + "TMOD": 57, + "TOPIC": 58, + "VMOD": 59, + "VOCATIVE": 60, + "XCOMP": 61, + "SUFFIX": 62, + "TITLE": 63, + "ADVPHMOD": 64, + "AUXCAUS": 65, + "AUXVV": 66, + "DTMOD": 67, + "FOREIGN": 68, + "KW": 69, + "LIST": 70, + "NOMC": 71, + "NOMCSUBJ": 72, + "NOMCSUBJPASS": 73, + "NUMC": 74, + "COP": 75, + "DISLOCATED": 76, + "ASP": 77, + "GMOD": 78, + "GOBJ": 79, + "INFMOD": 80, + "MES": 81, + "NCOMP": 82 + } + } + } + }, + "EntityMention": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "sentiment": { + "type": "Sentiment", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNKNOWN": 0, + "PROPER": 1, + "COMMON": 2 + } + } + } + }, + "TextSpan": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "beginOffset": { + "type": "int32", + "id": 2 + } + } + }, + "ClassificationCategory": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "ClassificationModelOptions": { + "oneofs": { + "modelType": { + "oneof": [ + "v1Model", + "v2Model" + ] + } + }, + "fields": { + "v1Model": { + "type": "V1Model", + "id": 1 + }, + "v2Model": { + "type": "V2Model", + "id": 2 + } + }, + "nested": { + "V1Model": { + "fields": {} + }, + "V2Model": { + "fields": { + "contentCategoriesVersion": { + "type": "ContentCategoriesVersion", + "id": 1 + } + }, + "nested": { + "ContentCategoriesVersion": { + "values": { + "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": 0, + "V1": 1, + "V2": 2 + } + } + } + } + } + }, + "AnalyzeSentimentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeSentimentResponse": { + "fields": { + "documentSentiment": { + "type": "Sentiment", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + }, + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 3 + } + } + }, + "AnalyzeEntitySentimentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeEntitySentimentResponse": { + "fields": { + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + } + } + }, + "AnalyzeEntitiesRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeEntitiesResponse": { + "fields": { + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + } + } + }, + "AnalyzeSyntaxRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeSyntaxResponse": { + "fields": { + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 1 + }, + "tokens": { + "rule": "repeated", + "type": "Token", + "id": 2 + }, + "language": { + "type": "string", + "id": 3 + } + } + }, + "ClassifyTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "classificationModelOptions": { + "type": "ClassificationModelOptions", + "id": 3 + } + } + }, + "ClassifyTextResponse": { + "fields": { + "categories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 1 + } + } + }, + "AnnotateTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "features": { + "type": "Features", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 3 + } + }, + "nested": { + "Features": { + "fields": { + "extractSyntax": { + "type": "bool", + "id": 1 + }, + "extractEntities": { + "type": "bool", + "id": 2 + }, + "extractDocumentSentiment": { + "type": "bool", + "id": 3 + }, + "extractEntitySentiment": { + "type": "bool", + "id": 4 + }, + "classifyText": { + "type": "bool", + "id": 6 + }, + "classificationModelOptions": { + "type": "ClassificationModelOptions", + "id": 10 + } + } + } + } + }, + "AnnotateTextResponse": { + "fields": { + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 1 + }, + "tokens": { + "rule": "repeated", + "type": "Token", + "id": 2 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 3 + }, + "documentSentiment": { + "type": "Sentiment", + "id": 4 + }, + "language": { + "type": "string", + "id": 5 + }, + "categories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 6 + } + } + } + } + }, + "v1beta2": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/language/v1beta2;language", + "java_multiple_files": true, + "java_outer_classname": "LanguageServiceProto", + "java_package": "com.google.cloud.language.v1beta2" + }, + "nested": { + "LanguageService": { + "options": { + "(google.api.default_host)": "language.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-language,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnalyzeSentiment": { + "requestType": "AnalyzeSentimentRequest", + "responseType": "AnalyzeSentimentResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:analyzeSentiment", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:analyzeSentiment", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeEntities": { + "requestType": "AnalyzeEntitiesRequest", + "responseType": "AnalyzeEntitiesResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:analyzeEntities", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:analyzeEntities", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeEntitySentiment": { + "requestType": "AnalyzeEntitySentimentRequest", + "responseType": "AnalyzeEntitySentimentResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:analyzeEntitySentiment", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:analyzeEntitySentiment", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnalyzeSyntax": { + "requestType": "AnalyzeSyntaxRequest", + "responseType": "AnalyzeSyntaxResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:analyzeSyntax", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:analyzeSyntax", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,encoding_type" + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "ClassifyText": { + "requestType": "ClassifyTextRequest", + "responseType": "ClassifyTextResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:classifyText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:classifyText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document" + } + ] + }, + "AnnotateText": { + "requestType": "AnnotateTextRequest", + "responseType": "AnnotateTextResponse", + "options": { + "(google.api.http).post": "/v1beta2/documents:annotateText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "document,features" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/documents:annotateText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "document,features,encoding_type" + }, + { + "(google.api.method_signature)": "document,features" + } + ] + } + } + }, + "Document": { + "oneofs": { + "source": { + "oneof": [ + "content", + "gcsContentUri" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "gcsContentUri": { + "type": "string", + "id": 3 + }, + "language": { + "type": "string", + "id": 4 + }, + "referenceWebUri": { + "type": "string", + "id": 5 + }, + "boilerplateHandling": { + "type": "BoilerplateHandling", + "id": 6 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PLAIN_TEXT": 1, + "HTML": 2 + } + }, + "BoilerplateHandling": { + "values": { + "BOILERPLATE_HANDLING_UNSPECIFIED": 0, + "SKIP_BOILERPLATE": 1, + "KEEP_BOILERPLATE": 2 + } + } + } + }, + "Sentence": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "sentiment": { + "type": "Sentiment", + "id": 2 + } + } + }, + "EncodingType": { + "values": { + "NONE": 0, + "UTF8": 1, + "UTF16": 2, + "UTF32": 3 + } + }, + "Entity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "salience": { + "type": "float", + "id": 4 + }, + "mentions": { + "rule": "repeated", + "type": "EntityMention", + "id": 5 + }, + "sentiment": { + "type": "Sentiment", + "id": 6 + } + }, + "nested": { + "Type": { + "values": { + "UNKNOWN": 0, + "PERSON": 1, + "LOCATION": 2, + "ORGANIZATION": 3, + "EVENT": 4, + "WORK_OF_ART": 5, + "CONSUMER_GOOD": 6, + "OTHER": 7, + "PHONE_NUMBER": 9, + "ADDRESS": 10, + "DATE": 11, + "NUMBER": 12, + "PRICE": 13 + } + } + } + }, + "Token": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "partOfSpeech": { + "type": "PartOfSpeech", + "id": 2 + }, + "dependencyEdge": { + "type": "DependencyEdge", + "id": 3 + }, + "lemma": { + "type": "string", + "id": 4 + } + } + }, + "Sentiment": { + "fields": { + "magnitude": { + "type": "float", + "id": 2 + }, + "score": { + "type": "float", + "id": 3 + } + } + }, + "PartOfSpeech": { + "fields": { + "tag": { + "type": "Tag", + "id": 1 + }, + "aspect": { + "type": "Aspect", + "id": 2 + }, + "case": { + "type": "Case", + "id": 3 + }, + "form": { + "type": "Form", + "id": 4 + }, + "gender": { + "type": "Gender", + "id": 5 + }, + "mood": { + "type": "Mood", + "id": 6 + }, + "number": { + "type": "Number", + "id": 7 + }, + "person": { + "type": "Person", + "id": 8 + }, + "proper": { + "type": "Proper", + "id": 9 + }, + "reciprocity": { + "type": "Reciprocity", + "id": 10 + }, + "tense": { + "type": "Tense", + "id": 11 + }, + "voice": { + "type": "Voice", + "id": 12 + } + }, + "nested": { + "Tag": { + "values": { + "UNKNOWN": 0, + "ADJ": 1, + "ADP": 2, + "ADV": 3, + "CONJ": 4, + "DET": 5, + "NOUN": 6, + "NUM": 7, + "PRON": 8, + "PRT": 9, + "PUNCT": 10, + "VERB": 11, + "X": 12, + "AFFIX": 13 + } + }, + "Aspect": { + "values": { + "ASPECT_UNKNOWN": 0, + "PERFECTIVE": 1, + "IMPERFECTIVE": 2, + "PROGRESSIVE": 3 + } + }, + "Case": { + "values": { + "CASE_UNKNOWN": 0, + "ACCUSATIVE": 1, + "ADVERBIAL": 2, + "COMPLEMENTIVE": 3, + "DATIVE": 4, + "GENITIVE": 5, + "INSTRUMENTAL": 6, + "LOCATIVE": 7, + "NOMINATIVE": 8, + "OBLIQUE": 9, + "PARTITIVE": 10, + "PREPOSITIONAL": 11, + "REFLEXIVE_CASE": 12, + "RELATIVE_CASE": 13, + "VOCATIVE": 14 + } + }, + "Form": { + "values": { + "FORM_UNKNOWN": 0, + "ADNOMIAL": 1, + "AUXILIARY": 2, + "COMPLEMENTIZER": 3, + "FINAL_ENDING": 4, + "GERUND": 5, + "REALIS": 6, + "IRREALIS": 7, + "SHORT": 8, + "LONG": 9, + "ORDER": 10, + "SPECIFIC": 11 + } + }, + "Gender": { + "values": { + "GENDER_UNKNOWN": 0, + "FEMININE": 1, + "MASCULINE": 2, + "NEUTER": 3 + } + }, + "Mood": { + "values": { + "MOOD_UNKNOWN": 0, + "CONDITIONAL_MOOD": 1, + "IMPERATIVE": 2, + "INDICATIVE": 3, + "INTERROGATIVE": 4, + "JUSSIVE": 5, + "SUBJUNCTIVE": 6 + } + }, + "Number": { + "values": { + "NUMBER_UNKNOWN": 0, + "SINGULAR": 1, + "PLURAL": 2, + "DUAL": 3 + } + }, + "Person": { + "values": { + "PERSON_UNKNOWN": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "REFLEXIVE_PERSON": 4 + } + }, + "Proper": { + "values": { + "PROPER_UNKNOWN": 0, + "PROPER": 1, + "NOT_PROPER": 2 + } + }, + "Reciprocity": { + "values": { + "RECIPROCITY_UNKNOWN": 0, + "RECIPROCAL": 1, + "NON_RECIPROCAL": 2 + } + }, + "Tense": { + "values": { + "TENSE_UNKNOWN": 0, + "CONDITIONAL_TENSE": 1, + "FUTURE": 2, + "PAST": 3, + "PRESENT": 4, + "IMPERFECT": 5, + "PLUPERFECT": 6 + } + }, + "Voice": { + "values": { + "VOICE_UNKNOWN": 0, + "ACTIVE": 1, + "CAUSATIVE": 2, + "PASSIVE": 3 + } + } + } + }, + "DependencyEdge": { + "fields": { + "headTokenIndex": { + "type": "int32", + "id": 1 + }, + "label": { + "type": "Label", + "id": 2 + } + }, + "nested": { + "Label": { + "values": { + "UNKNOWN": 0, + "ABBREV": 1, + "ACOMP": 2, + "ADVCL": 3, + "ADVMOD": 4, + "AMOD": 5, + "APPOS": 6, + "ATTR": 7, + "AUX": 8, + "AUXPASS": 9, + "CC": 10, + "CCOMP": 11, + "CONJ": 12, + "CSUBJ": 13, + "CSUBJPASS": 14, + "DEP": 15, + "DET": 16, + "DISCOURSE": 17, + "DOBJ": 18, + "EXPL": 19, + "GOESWITH": 20, + "IOBJ": 21, + "MARK": 22, + "MWE": 23, + "MWV": 24, + "NEG": 25, + "NN": 26, + "NPADVMOD": 27, + "NSUBJ": 28, + "NSUBJPASS": 29, + "NUM": 30, + "NUMBER": 31, + "P": 32, + "PARATAXIS": 33, + "PARTMOD": 34, + "PCOMP": 35, + "POBJ": 36, + "POSS": 37, + "POSTNEG": 38, + "PRECOMP": 39, + "PRECONJ": 40, + "PREDET": 41, + "PREF": 42, + "PREP": 43, + "PRONL": 44, + "PRT": 45, + "PS": 46, + "QUANTMOD": 47, + "RCMOD": 48, + "RCMODREL": 49, + "RDROP": 50, + "REF": 51, + "REMNANT": 52, + "REPARANDUM": 53, + "ROOT": 54, + "SNUM": 55, + "SUFF": 56, + "TMOD": 57, + "TOPIC": 58, + "VMOD": 59, + "VOCATIVE": 60, + "XCOMP": 61, + "SUFFIX": 62, + "TITLE": 63, + "ADVPHMOD": 64, + "AUXCAUS": 65, + "AUXVV": 66, + "DTMOD": 67, + "FOREIGN": 68, + "KW": 69, + "LIST": 70, + "NOMC": 71, + "NOMCSUBJ": 72, + "NOMCSUBJPASS": 73, + "NUMC": 74, + "COP": 75, + "DISLOCATED": 76, + "ASP": 77, + "GMOD": 78, + "GOBJ": 79, + "INFMOD": 80, + "MES": 81, + "NCOMP": 82 + } + } + } + }, + "EntityMention": { + "fields": { + "text": { + "type": "TextSpan", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "sentiment": { + "type": "Sentiment", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNKNOWN": 0, + "PROPER": 1, + "COMMON": 2 + } + } + } + }, + "TextSpan": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "beginOffset": { + "type": "int32", + "id": 2 + } + } + }, + "ClassificationCategory": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "ClassificationModelOptions": { + "oneofs": { + "modelType": { + "oneof": [ + "v1Model", + "v2Model" + ] + } + }, + "fields": { + "v1Model": { + "type": "V1Model", + "id": 1 + }, + "v2Model": { + "type": "V2Model", + "id": 2 + } + }, + "nested": { + "V1Model": { + "fields": {} + }, + "V2Model": { + "fields": { + "contentCategoriesVersion": { + "type": "ContentCategoriesVersion", + "id": 1 + } + }, + "nested": { + "ContentCategoriesVersion": { + "values": { + "CONTENT_CATEGORIES_VERSION_UNSPECIFIED": 0, + "V1": 1, + "V2": 2 + } + } + } + } + } + }, + "AnalyzeSentimentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeSentimentResponse": { + "fields": { + "documentSentiment": { + "type": "Sentiment", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + }, + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 3 + } + } + }, + "AnalyzeEntitySentimentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeEntitySentimentResponse": { + "fields": { + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + } + } + }, + "AnalyzeEntitiesRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeEntitiesResponse": { + "fields": { + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + } + } + }, + "AnalyzeSyntaxRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 2 + } + } + }, + "AnalyzeSyntaxResponse": { + "fields": { + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 1 + }, + "tokens": { + "rule": "repeated", + "type": "Token", + "id": 2 + }, + "language": { + "type": "string", + "id": 3 + } + } + }, + "ClassifyTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "classificationModelOptions": { + "type": "ClassificationModelOptions", + "id": 3 + } + } + }, + "ClassifyTextResponse": { + "fields": { + "categories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 1 + } + } + }, + "AnnotateTextRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "features": { + "type": "Features", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "encodingType": { + "type": "EncodingType", + "id": 3 + } + }, + "nested": { + "Features": { + "fields": { + "extractSyntax": { + "type": "bool", + "id": 1 + }, + "extractEntities": { + "type": "bool", + "id": 2 + }, + "extractDocumentSentiment": { + "type": "bool", + "id": 3 + }, + "extractEntitySentiment": { + "type": "bool", + "id": 4 + }, + "classifyText": { + "type": "bool", + "id": 6 + }, + "classificationModelOptions": { + "type": "ClassificationModelOptions", + "id": 10 + } + } + } + } + }, + "AnnotateTextResponse": { + "fields": { + "sentences": { + "rule": "repeated", + "type": "Sentence", + "id": 1 + }, + "tokens": { + "rule": "repeated", + "type": "Token", + "id": 2 + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 3 + }, + "documentSentiment": { + "type": "Sentiment", + "id": 4 + }, + "language": { + "type": "string", + "id": 5 + }, + "categories": { + "rule": "repeated", + "type": "ClassificationCategory", + "id": 6 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-language/samples/.eslintrc.yml b/packages/google-cloud-language/samples/.eslintrc.yml new file mode 100644 index 000000000000..0aa37ac630e2 --- /dev/null +++ b/packages/google-cloud-language/samples/.eslintrc.yml @@ -0,0 +1,4 @@ +--- +rules: + no-console: off + node/no-missing-require: off diff --git a/packages/google-cloud-language/samples/README.md b/packages/google-cloud-language/samples/README.md new file mode 100644 index 000000000000..fb68ff250327 --- /dev/null +++ b/packages/google-cloud-language/samples/README.md @@ -0,0 +1,284 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Natural Language: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Language_service.analyze_entities](#language_service.analyze_entities) + * [Language_service.analyze_entity_sentiment](#language_service.analyze_entity_sentiment) + * [Language_service.analyze_sentiment](#language_service.analyze_sentiment) + * [Language_service.analyze_syntax](#language_service.analyze_syntax) + * [Language_service.annotate_text](#language_service.annotate_text) + * [Language_service.classify_text](#language_service.classify_text) + * [Language_service.analyze_entities](#language_service.analyze_entities) + * [Language_service.analyze_entity_sentiment](#language_service.analyze_entity_sentiment) + * [Language_service.analyze_sentiment](#language_service.analyze_sentiment) + * [Language_service.analyze_syntax](#language_service.analyze_syntax) + * [Language_service.annotate_text](#language_service.annotate_text) + * [Language_service.classify_text](#language_service.classify_text) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Language_service.analyze_entities + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js` + + +----- + + + + +### Language_service.analyze_entity_sentiment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js` + + +----- + + + + +### Language_service.analyze_sentiment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js` + + +----- + + + + +### Language_service.analyze_syntax + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js` + + +----- + + + + +### Language_service.annotate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js` + + +----- + + + + +### Language_service.classify_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js` + + +----- + + + + +### Language_service.analyze_entities + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js` + + +----- + + + + +### Language_service.analyze_entity_sentiment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js` + + +----- + + + + +### Language_service.analyze_sentiment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js` + + +----- + + + + +### Language_service.analyze_syntax + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js` + + +----- + + + + +### Language_service.annotate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js` + + +----- + + + + +### Language_service.classify_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-language/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-language/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-language/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/natural-language/docs/ diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js new file mode 100644 index 000000000000..6578ecf4a8cc --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entities.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1_generated_LanguageService_AnalyzeEntities_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeEntities() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeEntities(request); + console.log(response); + } + + callAnalyzeEntities(); + // [END language_v1_generated_LanguageService_AnalyzeEntities_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js new file mode 100644 index 000000000000..f14643b689a4 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_entity_sentiment.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeEntitySentiment() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeEntitySentiment(request); + console.log(response); + } + + callAnalyzeEntitySentiment(); + // [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js new file mode 100644 index 000000000000..3f817360b1da --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_sentiment.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1_generated_LanguageService_AnalyzeSentiment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate sentence offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeSentiment() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeSentiment(request); + console.log(response); + } + + callAnalyzeSentiment(); + // [END language_v1_generated_LanguageService_AnalyzeSentiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js new file mode 100644 index 000000000000..f820de1de1a6 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.analyze_syntax.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1_generated_LanguageService_AnalyzeSyntax_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeSyntax() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeSyntax(request); + console.log(response); + } + + callAnalyzeSyntax(); + // [END language_v1_generated_LanguageService_AnalyzeSyntax_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js b/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js new file mode 100644 index 000000000000..16819e379b24 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.annotate_text.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(document, features) { + // [START language_v1_generated_LanguageService_AnnotateText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * Required. The enabled features. + */ + // const features = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnnotateText() { + // Construct request + const request = { + document, + features, + }; + + // Run request + const response = await languageClient.annotateText(request); + console.log(response); + } + + callAnnotateText(); + // [END language_v1_generated_LanguageService_AnnotateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js b/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js new file mode 100644 index 000000000000..3787a2664d4a --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/language_service.classify_text.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1_generated_LanguageService_ClassifyText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * Model options to use for classification. Defaults to v1 options if not + * specified. + */ + // const classificationModelOptions = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callClassifyText() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.classifyText(request); + console.log(response); + } + + callClassifyText(); + // [END language_v1_generated_LanguageService_ClassifyText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json new file mode 100644 index 000000000000..5fb5297d20c5 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1/snippet_metadata.google.cloud.language.v1.json @@ -0,0 +1,283 @@ +{ + "clientLibrary": { + "name": "nodejs-language", + "version": "5.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.language.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "language_v1_generated_LanguageService_AnalyzeSentiment_async", + "title": "LanguageService analyzeSentiment Sample", + "origin": "API_DEFINITION", + "description": " Analyzes the sentiment of the provided text.", + "canonical": true, + "file": "language_service.analyze_sentiment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeSentiment", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeSentiment", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1.AnalyzeSentimentResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeSentiment", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeSentiment", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1_generated_LanguageService_AnalyzeEntities_async", + "title": "LanguageService analyzeEntities Sample", + "origin": "API_DEFINITION", + "description": " Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.", + "canonical": true, + "file": "language_service.analyze_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeEntities", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeEntities", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1.AnalyzeEntitiesResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeEntities", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeEntities", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1_generated_LanguageService_AnalyzeEntitySentiment_async", + "title": "LanguageService analyzeEntitySentiment Sample", + "origin": "API_DEFINITION", + "description": " Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.", + "canonical": true, + "file": "language_service.analyze_entity_sentiment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeEntitySentiment", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeEntitySentiment", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1.AnalyzeEntitySentimentResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeEntitySentiment", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeEntitySentiment", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1_generated_LanguageService_AnalyzeSyntax_async", + "title": "LanguageService analyzeSyntax Sample", + "origin": "API_DEFINITION", + "description": " Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.", + "canonical": true, + "file": "language_service.analyze_syntax.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeSyntax", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeSyntax", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1.AnalyzeSyntaxResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeSyntax", + "fullName": "google.cloud.language.v1.LanguageService.AnalyzeSyntax", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1_generated_LanguageService_ClassifyText_async", + "title": "LanguageService classifyText Sample", + "origin": "API_DEFINITION", + "description": " Classifies a document into categories.", + "canonical": true, + "file": "language_service.classify_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ClassifyText", + "fullName": "google.cloud.language.v1.LanguageService.ClassifyText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "classification_model_options", + "type": ".google.cloud.language.v1.ClassificationModelOptions" + } + ], + "resultType": ".google.cloud.language.v1.ClassifyTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "ClassifyText", + "fullName": "google.cloud.language.v1.LanguageService.ClassifyText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1_generated_LanguageService_AnnotateText_async", + "title": "LanguageService annotateText Sample", + "origin": "API_DEFINITION", + "description": " A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.", + "canonical": true, + "file": "language_service.annotate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateText", + "fullName": "google.cloud.language.v1.LanguageService.AnnotateText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1.Document" + }, + { + "name": "features", + "type": ".google.cloud.language.v1.AnnotateTextRequest.Features" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1.AnnotateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1.LanguageServiceClient" + }, + "method": { + "shortName": "AnnotateText", + "fullName": "google.cloud.language.v1.LanguageService.AnnotateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1.LanguageService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js new file mode 100644 index 000000000000..dc4f7a1bee08 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entities.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_AnalyzeEntities_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeEntities() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeEntities(request); + console.log(response); + } + + callAnalyzeEntities(); + // [END language_v1beta2_generated_LanguageService_AnalyzeEntities_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js new file mode 100644 index 000000000000..86b5cd381b11 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_entity_sentiment.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeEntitySentiment() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeEntitySentiment(request); + console.log(response); + } + + callAnalyzeEntitySentiment(); + // [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js new file mode 100644 index 000000000000..77bf2ffe86da --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_sentiment.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate sentence offsets for the + * sentence sentiment. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeSentiment() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeSentiment(request); + console.log(response); + } + + callAnalyzeSentiment(); + // [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js new file mode 100644 index 000000000000..e96c0865bba2 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.analyze_syntax.js @@ -0,0 +1,65 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnalyzeSyntax() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.analyzeSyntax(request); + console.log(response); + } + + callAnalyzeSyntax(); + // [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js new file mode 100644 index 000000000000..96ab5ea0913c --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.annotate_text.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(document, features) { + // [START language_v1beta2_generated_LanguageService_AnnotateText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * Required. The enabled features. + */ + // const features = {} + /** + * The encoding type used by the API to calculate offsets. + */ + // const encodingType = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callAnnotateText() { + // Construct request + const request = { + document, + features, + }; + + // Run request + const response = await languageClient.annotateText(request); + console.log(response); + } + + callAnnotateText(); + // [END language_v1beta2_generated_LanguageService_AnnotateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js b/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js new file mode 100644 index 000000000000..a58389196830 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/language_service.classify_text.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(document) { + // [START language_v1beta2_generated_LanguageService_ClassifyText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Input document. + */ + // const document = {} + /** + * Model options to use for classification. Defaults to v1 options if not + * specified. + */ + // const classificationModelOptions = {} + + // Imports the Language library + const {LanguageServiceClient} = require('@google-cloud/language').v1beta2; + + // Instantiates a client + const languageClient = new LanguageServiceClient(); + + async function callClassifyText() { + // Construct request + const request = { + document, + }; + + // Run request + const response = await languageClient.classifyText(request); + console.log(response); + } + + callClassifyText(); + // [END language_v1beta2_generated_LanguageService_ClassifyText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json new file mode 100644 index 000000000000..98632a9b14c6 --- /dev/null +++ b/packages/google-cloud-language/samples/generated/v1beta2/snippet_metadata.google.cloud.language.v1beta2.json @@ -0,0 +1,283 @@ +{ + "clientLibrary": { + "name": "nodejs-language", + "version": "5.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.language.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "regionTag": "language_v1beta2_generated_LanguageService_AnalyzeSentiment_async", + "title": "LanguageService analyzeSentiment Sample", + "origin": "API_DEFINITION", + "description": " Analyzes the sentiment of the provided text.", + "canonical": true, + "file": "language_service.analyze_sentiment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeSentiment", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeSentiment", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1beta2.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1beta2.AnalyzeSentimentResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeSentiment", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeSentiment", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1beta2_generated_LanguageService_AnalyzeEntities_async", + "title": "LanguageService analyzeEntities Sample", + "origin": "API_DEFINITION", + "description": " Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.", + "canonical": true, + "file": "language_service.analyze_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeEntities", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeEntities", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1beta2.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1beta2.AnalyzeEntitiesResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeEntities", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeEntities", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async", + "title": "LanguageService analyzeEntitySentiment Sample", + "origin": "API_DEFINITION", + "description": " Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes sentiment associated with each entity and its mentions.", + "canonical": true, + "file": "language_service.analyze_entity_sentiment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeEntitySentiment", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentiment", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1beta2.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeEntitySentiment", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeEntitySentiment", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1beta2_generated_LanguageService_AnalyzeSyntax_async", + "title": "LanguageService analyzeSyntax Sample", + "origin": "API_DEFINITION", + "description": " Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.", + "canonical": true, + "file": "language_service.analyze_syntax.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeSyntax", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeSyntax", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1beta2.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1beta2.AnalyzeSyntaxResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "AnalyzeSyntax", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnalyzeSyntax", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1beta2_generated_LanguageService_ClassifyText_async", + "title": "LanguageService classifyText Sample", + "origin": "API_DEFINITION", + "description": " Classifies a document into categories.", + "canonical": true, + "file": "language_service.classify_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ClassifyText", + "fullName": "google.cloud.language.v1beta2.LanguageService.ClassifyText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "classification_model_options", + "type": ".google.cloud.language.v1beta2.ClassificationModelOptions" + } + ], + "resultType": ".google.cloud.language.v1beta2.ClassifyTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "ClassifyText", + "fullName": "google.cloud.language.v1beta2.LanguageService.ClassifyText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + }, + { + "regionTag": "language_v1beta2_generated_LanguageService_AnnotateText_async", + "title": "LanguageService annotateText Sample", + "origin": "API_DEFINITION", + "description": " A convenience method that provides all syntax, sentiment, entity, and classification features in one call.", + "canonical": true, + "file": "language_service.annotate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateText", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnnotateText", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.cloud.language.v1beta2.Document" + }, + { + "name": "features", + "type": ".google.cloud.language.v1beta2.AnnotateTextRequest.Features" + }, + { + "name": "encoding_type", + "type": ".google.cloud.language.v1beta2.EncodingType" + } + ], + "resultType": ".google.cloud.language.v1beta2.AnnotateTextResponse", + "client": { + "shortName": "LanguageServiceClient", + "fullName": "google.cloud.language.v1beta2.LanguageServiceClient" + }, + "method": { + "shortName": "AnnotateText", + "fullName": "google.cloud.language.v1beta2.LanguageService.AnnotateText", + "service": { + "shortName": "LanguageService", + "fullName": "google.cloud.language.v1beta2.LanguageService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-language/samples/package.json b/packages/google-cloud-language/samples/package.json new file mode 100644 index 000000000000..1db523db50c8 --- /dev/null +++ b/packages/google-cloud-language/samples/package.json @@ -0,0 +1,29 @@ +{ + "name": "nodejs-docs-samples-language", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-language", + "private": true, + "files": [ + "*.js", + "resources" + ], + "scripts": { + "test": "mocha --timeout 60000" + }, + "dependencies": { + "@google-cloud/automl": "^3.0.0", + "mathjs": "^11.0.0", + "@google-cloud/language": "^5.1.0", + "@google-cloud/storage": "^6.0.0", + "yargs": "^16.0.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-language/samples/quickstart.js b/packages/google-cloud-language/samples/quickstart.js new file mode 100644 index 000000000000..7eb7b5a4a29a --- /dev/null +++ b/packages/google-cloud-language/samples/quickstart.js @@ -0,0 +1,43 @@ +// Copyright 2017 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. + +'use strict'; + +// [START language_quickstart] +async function quickstart() { + // Imports the Google Cloud client library + const language = require('@google-cloud/language'); + + // Instantiates a client + const client = new language.LanguageServiceClient(); + + // The text to analyze + const text = 'Hello, world!'; + + const document = { + content: text, + type: 'PLAIN_TEXT', + }; + + // Detects the sentiment of the text + const [result] = await client.analyzeSentiment({document: document}); + const sentiment = result.documentSentiment; + + console.log(`Text: ${text}`); + console.log(`Sentiment score: ${sentiment.score}`); + console.log(`Sentiment magnitude: ${sentiment.magnitude}`); +} +// [END language_quickstart] + +quickstart().catch(console.error); diff --git a/packages/google-cloud-language/samples/test/quickstart.test.js b/packages/google-cloud-language/samples/test/quickstart.test.js new file mode 100644 index 000000000000..43470453dcaa --- /dev/null +++ b/packages/google-cloud-language/samples/test/quickstart.test.js @@ -0,0 +1,30 @@ +// Copyright 2017 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('quickstart', () => { + it('should analyze sentiment in text', async () => { + const stdout = execSync('node quickstart.js'); + assert(stdout, /Text: Hello, world!/); + assert(stdout, /Sentiment score: /); + assert(stdout, /Sentiment magnitude: /); + }); +}); diff --git a/packages/google-cloud-language/smoke-test/.eslintrc.yml b/packages/google-cloud-language/smoke-test/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-language/smoke-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-language/src/index.ts b/packages/google-cloud-language/src/index.ts new file mode 100644 index 000000000000..d41f5db2732a --- /dev/null +++ b/packages/google-cloud-language/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta2 from './v1beta2'; + +const LanguageServiceClient = v1.LanguageServiceClient; +type LanguageServiceClient = v1.LanguageServiceClient; + +export {v1, v1beta2, LanguageServiceClient}; +export default {v1, v1beta2, LanguageServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-language/src/v1/gapic_metadata.json b/packages/google-cloud-language/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..fc97e120f5a1 --- /dev/null +++ b/packages/google-cloud-language/src/v1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.language.v1", + "libraryPackage": "@google-cloud/language", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "LanguageServiceClient", + "rpcs": { + "AnalyzeSentiment": { + "methods": [ + "analyzeSentiment" + ] + }, + "AnalyzeEntities": { + "methods": [ + "analyzeEntities" + ] + }, + "AnalyzeEntitySentiment": { + "methods": [ + "analyzeEntitySentiment" + ] + }, + "AnalyzeSyntax": { + "methods": [ + "analyzeSyntax" + ] + }, + "ClassifyText": { + "methods": [ + "classifyText" + ] + }, + "AnnotateText": { + "methods": [ + "annotateText" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LanguageServiceClient", + "rpcs": { + "AnalyzeSentiment": { + "methods": [ + "analyzeSentiment" + ] + }, + "AnalyzeEntities": { + "methods": [ + "analyzeEntities" + ] + }, + "AnalyzeEntitySentiment": { + "methods": [ + "analyzeEntitySentiment" + ] + }, + "AnalyzeSyntax": { + "methods": [ + "analyzeSyntax" + ] + }, + "ClassifyText": { + "methods": [ + "classifyText" + ] + }, + "AnnotateText": { + "methods": [ + "annotateText" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-language/src/v1/index.ts b/packages/google-cloud-language/src/v1/index.ts new file mode 100644 index 000000000000..7e077a202c62 --- /dev/null +++ b/packages/google-cloud-language/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {LanguageServiceClient} from './language_service_client'; diff --git a/packages/google-cloud-language/src/v1/language_service_client.ts b/packages/google-cloud-language/src/v1/language_service_client.ts new file mode 100644 index 000000000000..22fe5f0ffcca --- /dev/null +++ b/packages/google-cloud-language/src/v1/language_service_client.ts @@ -0,0 +1,865 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/language_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './language_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides text analysis operations such as sentiment analysis and entity + * recognition. + * @class + * @memberof v1 + */ +export class LanguageServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + languageServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LanguageServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 LanguageServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof LanguageServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.language.v1.LanguageService', + 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.languageServiceStub) { + return this.languageServiceStub; + } + + // Put together the "service stub" for + // google.cloud.language.v1.LanguageService. + this.languageServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.language.v1.LanguageService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.language.v1.LanguageService, + 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 languageServiceStubMethods = [ + 'analyzeSentiment', + 'analyzeEntities', + 'analyzeEntitySentiment', + 'analyzeSyntax', + 'classifyText', + 'annotateText', + ]; + for (const methodName of languageServiceStubMethods) { + const callPromise = this.languageServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.languageServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'language.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'language.googleapis.com'; + } + + /** + * 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-language', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + 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 -- + // ------------------- + /** + * Analyzes the sentiment of the provided text. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.EncodingType} request.encodingType + * The encoding type used by the API to calculate sentence offsets. + * @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 [AnalyzeSentimentResponse]{@link google.cloud.language.v1.AnalyzeSentimentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.analyze_sentiment.js + * region_tag:language_v1_generated_LanguageService_AnalyzeSentiment_async + */ + analyzeSentiment( + request?: protos.google.cloud.language.v1.IAnalyzeSentimentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + protos.google.cloud.language.v1.IAnalyzeSentimentRequest | undefined, + {} | undefined + ] + >; + analyzeSentiment( + request: protos.google.cloud.language.v1.IAnalyzeSentimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSentiment( + request: protos.google.cloud.language.v1.IAnalyzeSentimentRequest, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSentiment( + request?: protos.google.cloud.language.v1.IAnalyzeSentimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeSentimentResponse, + protos.google.cloud.language.v1.IAnalyzeSentimentRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeSentiment(request, options, callback); + } + /** + * Finds named entities (currently proper names and common nouns) in the text + * along with entity types, salience, mentions for each entity, and + * other properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeEntitiesResponse]{@link google.cloud.language.v1.AnalyzeEntitiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.analyze_entities.js + * region_tag:language_v1_generated_LanguageService_AnalyzeEntities_async + */ + analyzeEntities( + request?: protos.google.cloud.language.v1.IAnalyzeEntitiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + protos.google.cloud.language.v1.IAnalyzeEntitiesRequest | undefined, + {} | undefined + ] + >; + analyzeEntities( + request: protos.google.cloud.language.v1.IAnalyzeEntitiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntities( + request: protos.google.cloud.language.v1.IAnalyzeEntitiesRequest, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntities( + request?: protos.google.cloud.language.v1.IAnalyzeEntitiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeEntitiesResponse, + protos.google.cloud.language.v1.IAnalyzeEntitiesRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeEntities(request, options, callback); + } + /** + * Finds entities, similar to {@link google.cloud.language.v1.LanguageService.AnalyzeEntities|AnalyzeEntities} in the text and analyzes + * sentiment associated with each entity and its mentions. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeEntitySentimentResponse]{@link google.cloud.language.v1.AnalyzeEntitySentimentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.analyze_entity_sentiment.js + * region_tag:language_v1_generated_LanguageService_AnalyzeEntitySentiment_async + */ + analyzeEntitySentiment( + request?: protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + ( + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | undefined + ), + {} | undefined + ] + >; + analyzeEntitySentiment( + request: protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntitySentiment( + request: protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntitySentiment( + request?: protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse, + ( + | protos.google.cloud.language.v1.IAnalyzeEntitySentimentRequest + | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeEntitySentiment( + request, + options, + callback + ); + } + /** + * Analyzes the syntax of the text and provides sentence boundaries and + * tokenization along with part of speech tags, dependency trees, and other + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeSyntaxResponse]{@link google.cloud.language.v1.AnalyzeSyntaxResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.analyze_syntax.js + * region_tag:language_v1_generated_LanguageService_AnalyzeSyntax_async + */ + analyzeSyntax( + request?: protos.google.cloud.language.v1.IAnalyzeSyntaxRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1.IAnalyzeSyntaxRequest | undefined, + {} | undefined + ] + >; + analyzeSyntax( + request: protos.google.cloud.language.v1.IAnalyzeSyntaxRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1.IAnalyzeSyntaxRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeSyntax( + request: protos.google.cloud.language.v1.IAnalyzeSyntaxRequest, + callback: Callback< + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1.IAnalyzeSyntaxRequest | null | undefined, + {} | null | undefined + > + ): void; + analyzeSyntax( + request?: protos.google.cloud.language.v1.IAnalyzeSyntaxRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + | protos.google.cloud.language.v1.IAnalyzeSyntaxRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1.IAnalyzeSyntaxRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1.IAnalyzeSyntaxRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeSyntax(request, options, callback); + } + /** + * Classifies a document into categories. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.ClassificationModelOptions} request.classificationModelOptions + * Model options to use for classification. Defaults to v1 options if not + * 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 [ClassifyTextResponse]{@link google.cloud.language.v1.ClassifyTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.classify_text.js + * region_tag:language_v1_generated_LanguageService_ClassifyText_async + */ + classifyText( + request?: protos.google.cloud.language.v1.IClassifyTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IClassifyTextResponse, + protos.google.cloud.language.v1.IClassifyTextRequest | undefined, + {} | undefined + ] + >; + classifyText( + request: protos.google.cloud.language.v1.IClassifyTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IClassifyTextResponse, + protos.google.cloud.language.v1.IClassifyTextRequest | null | undefined, + {} | null | undefined + > + ): void; + classifyText( + request: protos.google.cloud.language.v1.IClassifyTextRequest, + callback: Callback< + protos.google.cloud.language.v1.IClassifyTextResponse, + protos.google.cloud.language.v1.IClassifyTextRequest | null | undefined, + {} | null | undefined + > + ): void; + classifyText( + request?: protos.google.cloud.language.v1.IClassifyTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IClassifyTextResponse, + | protos.google.cloud.language.v1.IClassifyTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IClassifyTextResponse, + protos.google.cloud.language.v1.IClassifyTextRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IClassifyTextResponse, + protos.google.cloud.language.v1.IClassifyTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.classifyText(request, options, callback); + } + /** + * A convenience method that provides all the features that analyzeSentiment, + * analyzeEntities, and analyzeSyntax provide in one call. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1.AnnotateTextRequest.Features} request.features + * Required. The enabled features. + * @param {google.cloud.language.v1.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnnotateTextResponse]{@link google.cloud.language.v1.AnnotateTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/language_service.annotate_text.js + * region_tag:language_v1_generated_LanguageService_AnnotateText_async + */ + annotateText( + request?: protos.google.cloud.language.v1.IAnnotateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1.IAnnotateTextResponse, + protos.google.cloud.language.v1.IAnnotateTextRequest | undefined, + {} | undefined + ] + >; + annotateText( + request: protos.google.cloud.language.v1.IAnnotateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1.IAnnotateTextResponse, + protos.google.cloud.language.v1.IAnnotateTextRequest | null | undefined, + {} | null | undefined + > + ): void; + annotateText( + request: protos.google.cloud.language.v1.IAnnotateTextRequest, + callback: Callback< + protos.google.cloud.language.v1.IAnnotateTextResponse, + protos.google.cloud.language.v1.IAnnotateTextRequest | null | undefined, + {} | null | undefined + > + ): void; + annotateText( + request?: protos.google.cloud.language.v1.IAnnotateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1.IAnnotateTextResponse, + | protos.google.cloud.language.v1.IAnnotateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1.IAnnotateTextResponse, + protos.google.cloud.language.v1.IAnnotateTextRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1.IAnnotateTextResponse, + protos.google.cloud.language.v1.IAnnotateTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.annotateText(request, options, callback); + } + + /** + * 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.languageServiceStub && !this._terminated) { + return this.languageServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-language/src/v1/language_service_client_config.json b/packages/google-cloud-language/src/v1/language_service_client_config.json new file mode 100644 index 000000000000..4ee37da95959 --- /dev/null +++ b/packages/google-cloud-language/src/v1/language_service_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.cloud.language.v1.LanguageService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "AnalyzeSentiment": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeEntities": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeEntitySentiment": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeSyntax": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ClassifyText": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnnotateText": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-language/src/v1/language_service_proto_list.json b/packages/google-cloud-language/src/v1/language_service_proto_list.json new file mode 100644 index 000000000000..0456052873e1 --- /dev/null +++ b/packages/google-cloud-language/src/v1/language_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/language/v1/language_service.proto" +] diff --git a/packages/google-cloud-language/src/v1beta2/gapic_metadata.json b/packages/google-cloud-language/src/v1beta2/gapic_metadata.json new file mode 100644 index 000000000000..cc37c24c2d19 --- /dev/null +++ b/packages/google-cloud-language/src/v1beta2/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.language.v1beta2", + "libraryPackage": "@google-cloud/language", + "services": { + "LanguageService": { + "clients": { + "grpc": { + "libraryClient": "LanguageServiceClient", + "rpcs": { + "AnalyzeSentiment": { + "methods": [ + "analyzeSentiment" + ] + }, + "AnalyzeEntities": { + "methods": [ + "analyzeEntities" + ] + }, + "AnalyzeEntitySentiment": { + "methods": [ + "analyzeEntitySentiment" + ] + }, + "AnalyzeSyntax": { + "methods": [ + "analyzeSyntax" + ] + }, + "ClassifyText": { + "methods": [ + "classifyText" + ] + }, + "AnnotateText": { + "methods": [ + "annotateText" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LanguageServiceClient", + "rpcs": { + "AnalyzeSentiment": { + "methods": [ + "analyzeSentiment" + ] + }, + "AnalyzeEntities": { + "methods": [ + "analyzeEntities" + ] + }, + "AnalyzeEntitySentiment": { + "methods": [ + "analyzeEntitySentiment" + ] + }, + "AnalyzeSyntax": { + "methods": [ + "analyzeSyntax" + ] + }, + "ClassifyText": { + "methods": [ + "classifyText" + ] + }, + "AnnotateText": { + "methods": [ + "annotateText" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-language/src/v1beta2/index.ts b/packages/google-cloud-language/src/v1beta2/index.ts new file mode 100644 index 000000000000..7e077a202c62 --- /dev/null +++ b/packages/google-cloud-language/src/v1beta2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {LanguageServiceClient} from './language_service_client'; diff --git a/packages/google-cloud-language/src/v1beta2/language_service_client.ts b/packages/google-cloud-language/src/v1beta2/language_service_client.ts new file mode 100644 index 000000000000..9130aa8e1f39 --- /dev/null +++ b/packages/google-cloud-language/src/v1beta2/language_service_client.ts @@ -0,0 +1,884 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta2/language_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './language_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides text analysis operations such as sentiment analysis and entity + * recognition. + * @class + * @memberof v1beta2 + */ +export class LanguageServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + languageServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LanguageServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 LanguageServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof LanguageServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.language.v1beta2.LanguageService', + 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.languageServiceStub) { + return this.languageServiceStub; + } + + // Put together the "service stub" for + // google.cloud.language.v1beta2.LanguageService. + this.languageServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.language.v1beta2.LanguageService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.language.v1beta2.LanguageService, + 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 languageServiceStubMethods = [ + 'analyzeSentiment', + 'analyzeEntities', + 'analyzeEntitySentiment', + 'analyzeSyntax', + 'classifyText', + 'annotateText', + ]; + for (const methodName of languageServiceStubMethods) { + const callPromise = this.languageServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.languageServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'language.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'language.googleapis.com'; + } + + /** + * 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-language', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + 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 -- + // ------------------- + /** + * Analyzes the sentiment of the provided text. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.EncodingType} request.encodingType + * The encoding type used by the API to calculate sentence offsets for the + * sentence sentiment. + * @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 [AnalyzeSentimentResponse]{@link google.cloud.language.v1beta2.AnalyzeSentimentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.analyze_sentiment.js + * region_tag:language_v1beta2_generated_LanguageService_AnalyzeSentiment_async + */ + analyzeSentiment( + request?: protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest | undefined, + {} | undefined + ] + >; + analyzeSentiment( + request: protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSentiment( + request: protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSentiment( + request?: protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse, + protos.google.cloud.language.v1beta2.IAnalyzeSentimentRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeSentiment(request, options, callback); + } + /** + * Finds named entities (currently proper names and common nouns) in the text + * along with entity types, salience, mentions for each entity, and + * other properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeEntitiesResponse]{@link google.cloud.language.v1beta2.AnalyzeEntitiesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.analyze_entities.js + * region_tag:language_v1beta2_generated_LanguageService_AnalyzeEntities_async + */ + analyzeEntities( + request?: protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest | undefined, + {} | undefined + ] + >; + analyzeEntities( + request: protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntities( + request: protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntities( + request?: protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse, + protos.google.cloud.language.v1beta2.IAnalyzeEntitiesRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeEntities(request, options, callback); + } + /** + * Finds entities, similar to {@link google.cloud.language.v1beta2.LanguageService.AnalyzeEntities|AnalyzeEntities} in the text and analyzes + * sentiment associated with each entity and its mentions. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeEntitySentimentResponse]{@link google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.analyze_entity_sentiment.js + * region_tag:language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_async + */ + analyzeEntitySentiment( + request?: protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + ( + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | undefined + ), + {} | undefined + ] + >; + analyzeEntitySentiment( + request: protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntitySentiment( + request: protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeEntitySentiment( + request?: protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse, + ( + | protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentRequest + | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeEntitySentiment( + request, + options, + callback + ); + } + /** + * Analyzes the syntax of the text and provides sentence boundaries and + * tokenization along with part of speech tags, dependency trees, and other + * properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnalyzeSyntaxResponse]{@link google.cloud.language.v1beta2.AnalyzeSyntaxResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.analyze_syntax.js + * region_tag:language_v1beta2_generated_LanguageService_AnalyzeSyntax_async + */ + analyzeSyntax( + request?: protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest | undefined, + {} | undefined + ] + >; + analyzeSyntax( + request: protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSyntax( + request: protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeSyntax( + request?: protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + | protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse, + protos.google.cloud.language.v1beta2.IAnalyzeSyntaxRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.analyzeSyntax(request, options, callback); + } + /** + * Classifies a document into categories. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.ClassificationModelOptions} request.classificationModelOptions + * Model options to use for classification. Defaults to v1 options if not + * 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 [ClassifyTextResponse]{@link google.cloud.language.v1beta2.ClassifyTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.classify_text.js + * region_tag:language_v1beta2_generated_LanguageService_ClassifyText_async + */ + classifyText( + request?: protos.google.cloud.language.v1beta2.IClassifyTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + protos.google.cloud.language.v1beta2.IClassifyTextRequest | undefined, + {} | undefined + ] + >; + classifyText( + request: protos.google.cloud.language.v1beta2.IClassifyTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + | protos.google.cloud.language.v1beta2.IClassifyTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + classifyText( + request: protos.google.cloud.language.v1beta2.IClassifyTextRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + | protos.google.cloud.language.v1beta2.IClassifyTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + classifyText( + request?: protos.google.cloud.language.v1beta2.IClassifyTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + | protos.google.cloud.language.v1beta2.IClassifyTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + | protos.google.cloud.language.v1beta2.IClassifyTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IClassifyTextResponse, + protos.google.cloud.language.v1beta2.IClassifyTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.classifyText(request, options, callback); + } + /** + * A convenience method that provides all syntax, sentiment, entity, and + * classification features in one call. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.language.v1beta2.Document} request.document + * Required. Input document. + * @param {google.cloud.language.v1beta2.AnnotateTextRequest.Features} request.features + * Required. The enabled features. + * @param {google.cloud.language.v1beta2.EncodingType} request.encodingType + * The encoding type used by the API to calculate offsets. + * @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 [AnnotateTextResponse]{@link google.cloud.language.v1beta2.AnnotateTextResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/language_service.annotate_text.js + * region_tag:language_v1beta2_generated_LanguageService_AnnotateText_async + */ + annotateText( + request?: protos.google.cloud.language.v1beta2.IAnnotateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + protos.google.cloud.language.v1beta2.IAnnotateTextRequest | undefined, + {} | undefined + ] + >; + annotateText( + request: protos.google.cloud.language.v1beta2.IAnnotateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + | protos.google.cloud.language.v1beta2.IAnnotateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + annotateText( + request: protos.google.cloud.language.v1beta2.IAnnotateTextRequest, + callback: Callback< + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + | protos.google.cloud.language.v1beta2.IAnnotateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + annotateText( + request?: protos.google.cloud.language.v1beta2.IAnnotateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + | protos.google.cloud.language.v1beta2.IAnnotateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + | protos.google.cloud.language.v1beta2.IAnnotateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.language.v1beta2.IAnnotateTextResponse, + protos.google.cloud.language.v1beta2.IAnnotateTextRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.annotateText(request, options, callback); + } + + /** + * 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.languageServiceStub && !this._terminated) { + return this.languageServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-language/src/v1beta2/language_service_client_config.json b/packages/google-cloud-language/src/v1beta2/language_service_client_config.json new file mode 100644 index 000000000000..a2671a61cf0b --- /dev/null +++ b/packages/google-cloud-language/src/v1beta2/language_service_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.cloud.language.v1beta2.LanguageService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "AnalyzeSentiment": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeEntities": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeEntitySentiment": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeSyntax": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ClassifyText": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnnotateText": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-language/src/v1beta2/language_service_proto_list.json b/packages/google-cloud-language/src/v1beta2/language_service_proto_list.json new file mode 100644 index 000000000000..d5314f413091 --- /dev/null +++ b/packages/google-cloud-language/src/v1beta2/language_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/language/v1beta2/language_service.proto" +] diff --git a/packages/google-cloud-language/system-test/fixtures/sample/src/index.js b/packages/google-cloud-language/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..e43e3ad5c54f --- /dev/null +++ b/packages/google-cloud-language/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const language = require('@google-cloud/language'); + +function main() { + const languageServiceClient = new language.LanguageServiceClient(); +} + +main(); diff --git a/packages/google-cloud-language/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-language/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..67dcd47c2669 --- /dev/null +++ b/packages/google-cloud-language/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {LanguageServiceClient} from '@google-cloud/language'; + +// check that the client class type name can be used +function doStuffWithLanguageServiceClient(client: LanguageServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const languageServiceClient = new LanguageServiceClient(); + doStuffWithLanguageServiceClient(languageServiceClient); +} + +main(); diff --git a/packages/google-cloud-language/system-test/install.ts b/packages/google-cloud-language/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-language/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-language/system-test/language_service_smoke_test.js b/packages/google-cloud-language/system-test/language_service_smoke_test.js new file mode 100644 index 000000000000..f66626632cf1 --- /dev/null +++ b/packages/google-cloud-language/system-test/language_service_smoke_test.js @@ -0,0 +1,43 @@ +// Copyright 2017, Google Inc. All rights reserved. +// +// 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. + +'use strict'; + +const {describe, it} = require('mocha'); + +describe('LanguageServiceSmokeTest', () => { + it('successfully makes a call to the service', done => { + // eslint-disable-next-line node/no-missing-require + const language = require('../src'); + + const client = new language.v1.LanguageServiceClient({ + // optional auth parameters. + }); + + const content = 'Hello, world!'; + const type = 'PLAIN_TEXT'; + const document = { + content: content, + type: type, + }; + client + .analyzeSentiment({document: document}) + .then(responses => { + const response = responses[0]; + console.log(response); + }) + .then(done) + .catch(done); + }); +}); diff --git a/packages/google-cloud-language/test/gapic_language_service_v1.ts b/packages/google-cloud-language/test/gapic_language_service_v1.ts new file mode 100644 index 000000000000..17d06cbccb6b --- /dev/null +++ b/packages/google-cloud-language/test/gapic_language_service_v1.ts @@ -0,0 +1,671 @@ +// Copyright 2022 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 languageserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1.LanguageServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + languageserviceModule.v1.LanguageServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + languageserviceModule.v1.LanguageServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = languageserviceModule.v1.LanguageServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new languageserviceModule.v1.LanguageServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.languageServiceStub, undefined); + await client.initialize(); + assert(client.languageServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.languageServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.languageServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new languageserviceModule.v1.LanguageServiceClient({ + 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 languageserviceModule.v1.LanguageServiceClient({ + 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('analyzeSentiment', () => { + it('invokes analyzeSentiment without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentResponse() + ); + client.innerApiCalls.analyzeSentiment = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeSentiment(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSentiment without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentResponse() + ); + client.innerApiCalls.analyzeSentiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeSentiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IAnalyzeSentimentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSentiment with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeSentiment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeSentiment(request), expectedError); + }); + + it('invokes analyzeSentiment with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSentimentRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeSentiment(request), expectedError); + }); + }); + + describe('analyzeEntities', () => { + it('invokes analyzeEntities without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesResponse() + ); + client.innerApiCalls.analyzeEntities = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeEntities(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntities without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesResponse() + ); + client.innerApiCalls.analyzeEntities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeEntities( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IAnalyzeEntitiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntities with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeEntities = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeEntities(request), expectedError); + }); + + it('invokes analyzeEntities with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitiesRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeEntities(request), expectedError); + }); + }); + + describe('analyzeEntitySentiment', () => { + it('invokes analyzeEntitySentiment without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentResponse() + ); + client.innerApiCalls.analyzeEntitySentiment = + stubSimpleCall(expectedResponse); + const [response] = await client.analyzeEntitySentiment(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntitySentiment without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentResponse() + ); + client.innerApiCalls.analyzeEntitySentiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeEntitySentiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IAnalyzeEntitySentimentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntitySentiment with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeEntitySentiment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.analyzeEntitySentiment(request), + expectedError + ); + }); + + it('invokes analyzeEntitySentiment with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeEntitySentimentRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.analyzeEntitySentiment(request), + expectedError + ); + }); + }); + + describe('analyzeSyntax', () => { + it('invokes analyzeSyntax without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxResponse() + ); + client.innerApiCalls.analyzeSyntax = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeSyntax(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSyntax without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxResponse() + ); + client.innerApiCalls.analyzeSyntax = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeSyntax( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IAnalyzeSyntaxResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSyntax with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeSyntax = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeSyntax(request), expectedError); + }); + + it('invokes analyzeSyntax with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnalyzeSyntaxRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeSyntax(request), expectedError); + }); + }); + + describe('classifyText', () => { + it('invokes classifyText without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextResponse() + ); + client.innerApiCalls.classifyText = stubSimpleCall(expectedResponse); + const [response] = await client.classifyText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes classifyText without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextResponse() + ); + client.innerApiCalls.classifyText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.classifyText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IClassifyTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes classifyText with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.classifyText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.classifyText(request), expectedError); + }); + + it('invokes classifyText with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.ClassifyTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.classifyText(request), expectedError); + }); + }); + + describe('annotateText', () => { + it('invokes annotateText without error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextResponse() + ); + client.innerApiCalls.annotateText = stubSimpleCall(expectedResponse); + const [response] = await client.annotateText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateText without error using callback', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextResponse() + ); + client.innerApiCalls.annotateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1.IAnnotateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateText with error', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateText(request), expectedError); + }); + + it('invokes annotateText with closed client', async () => { + const client = new languageserviceModule.v1.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1.AnnotateTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.annotateText(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts b/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts new file mode 100644 index 000000000000..2be35ca97966 --- /dev/null +++ b/packages/google-cloud-language/test/gapic_language_service_v1beta2.ts @@ -0,0 +1,671 @@ +// Copyright 2022 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 languageserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1beta2.LanguageServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + languageserviceModule.v1beta2.LanguageServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + languageserviceModule.v1beta2.LanguageServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = languageserviceModule.v1beta2.LanguageServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.languageServiceStub, undefined); + await client.initialize(); + assert(client.languageServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.languageServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.languageServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + 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 languageserviceModule.v1beta2.LanguageServiceClient({ + 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('analyzeSentiment', () => { + it('invokes analyzeSentiment without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentResponse() + ); + client.innerApiCalls.analyzeSentiment = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeSentiment(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSentiment without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentResponse() + ); + client.innerApiCalls.analyzeSentiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeSentiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IAnalyzeSentimentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSentiment with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeSentiment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeSentiment(request), expectedError); + }); + + it('invokes analyzeSentiment with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSentimentRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeSentiment(request), expectedError); + }); + }); + + describe('analyzeEntities', () => { + it('invokes analyzeEntities without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesResponse() + ); + client.innerApiCalls.analyzeEntities = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeEntities(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntities without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesResponse() + ); + client.innerApiCalls.analyzeEntities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeEntities( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IAnalyzeEntitiesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntities with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeEntities = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeEntities(request), expectedError); + }); + + it('invokes analyzeEntities with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitiesRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeEntities(request), expectedError); + }); + }); + + describe('analyzeEntitySentiment', () => { + it('invokes analyzeEntitySentiment without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse() + ); + client.innerApiCalls.analyzeEntitySentiment = + stubSimpleCall(expectedResponse); + const [response] = await client.analyzeEntitySentiment(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntitySentiment without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse() + ); + client.innerApiCalls.analyzeEntitySentiment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeEntitySentiment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IAnalyzeEntitySentimentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeEntitySentiment with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeEntitySentiment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.analyzeEntitySentiment(request), + expectedError + ); + }); + + it('invokes analyzeEntitySentiment with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.analyzeEntitySentiment(request), + expectedError + ); + }); + }); + + describe('analyzeSyntax', () => { + it('invokes analyzeSyntax without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxResponse() + ); + client.innerApiCalls.analyzeSyntax = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeSyntax(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSyntax without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxResponse() + ); + client.innerApiCalls.analyzeSyntax = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeSyntax( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IAnalyzeSyntaxResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes analyzeSyntax with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeSyntax = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeSyntax(request), expectedError); + }); + + it('invokes analyzeSyntax with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnalyzeSyntaxRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeSyntax(request), expectedError); + }); + }); + + describe('classifyText', () => { + it('invokes classifyText without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextResponse() + ); + client.innerApiCalls.classifyText = stubSimpleCall(expectedResponse); + const [response] = await client.classifyText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes classifyText without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextResponse() + ); + client.innerApiCalls.classifyText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.classifyText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IClassifyTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes classifyText with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.classifyText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.classifyText(request), expectedError); + }); + + it('invokes classifyText with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.ClassifyTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.classifyText(request), expectedError); + }); + }); + + describe('annotateText', () => { + it('invokes annotateText without error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextResponse() + ); + client.innerApiCalls.annotateText = stubSimpleCall(expectedResponse); + const [response] = await client.annotateText(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateText without error using callback', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextResponse() + ); + client.innerApiCalls.annotateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateText( + request, + ( + err?: Error | null, + result?: protos.google.cloud.language.v1beta2.IAnnotateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateText with error', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateText(request), expectedError); + }); + + it('invokes annotateText with closed client', async () => { + const client = new languageserviceModule.v1beta2.LanguageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.language.v1beta2.AnnotateTextRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.annotateText(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-language/tsconfig.json b/packages/google-cloud-language/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-language/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/packages/google-cloud-language/webpack.config.js b/packages/google-cloud-language/webpack.config.js new file mode 100644 index 000000000000..a742509255e3 --- /dev/null +++ b/packages/google-cloud-language/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: 'LanguageService', + filename: './language-service.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/packages/google-cloud-memcache/.OwlBot.yaml b/packages/google-cloud-memcache/.OwlBot.yaml new file mode 100644 index 000000000000..071e80b23057 --- /dev/null +++ b/packages/google-cloud-memcache/.OwlBot.yaml @@ -0,0 +1,23 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/memcache/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-memcache/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-memcache/.eslintignore b/packages/google-cloud-memcache/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-memcache/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-memcache/.eslintrc.json b/packages/google-cloud-memcache/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-memcache/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-memcache/.gitattributes b/packages/google-cloud-memcache/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-memcache/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-memcache/.gitignore b/packages/google-cloud-memcache/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-memcache/.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/packages/google-cloud-memcache/.jsdoc.js b/packages/google-cloud-memcache/.jsdoc.js new file mode 100644 index 000000000000..27a3802542fc --- /dev/null +++ b/packages/google-cloud-memcache/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/memcache', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-memcache/.mocharc.js b/packages/google-cloud-memcache/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-memcache/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-memcache/.nycrc b/packages/google-cloud-memcache/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-memcache/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-memcache/.prettierignore b/packages/google-cloud-memcache/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-memcache/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-memcache/.prettierrc.js b/packages/google-cloud-memcache/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-memcache/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-memcache/.repo-metadata.json b/packages/google-cloud-memcache/.repo-metadata.json new file mode 100644 index 000000000000..bcb231300c62 --- /dev/null +++ b/packages/google-cloud-memcache/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "language": "nodejs", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/memorystore/docs/memcached", + "repo": "googleapis/google-cloud-node", + "default_version": "v1", + "name_pretty": "Memorystore for Memcached", + "release_level": "stable", + "distribution_name": "@google-cloud/memcache", + "name": "memcache", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/memcache/latest", + "api_id": "memcache.googleapis.com", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", + "api_shortname": "memcache", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-memcache/CHANGELOG.md b/packages/google-cloud-memcache/CHANGELOG.md new file mode 100644 index 000000000000..4cb7bd0d31c3 --- /dev/null +++ b/packages/google-cloud-memcache/CHANGELOG.md @@ -0,0 +1,160 @@ +# Changelog + +## [2.1.2](https://github.com/googleapis/nodejs-memcache/compare/v2.1.1...v2.1.2) (2022-09-21) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#216](https://github.com/googleapis/nodejs-memcache/issues/216)) ([6d5a65a](https://github.com/googleapis/nodejs-memcache/commit/6d5a65a5fd0881e38d72083aefc614bdd2360f19)) +* Preserve default values in x-goog-request-params header ([#218](https://github.com/googleapis/nodejs-memcache/issues/218)) ([8d8c968](https://github.com/googleapis/nodejs-memcache/commit/8d8c96866345800625f01edee0c42a675710fa22)) + +## [2.1.1](https://github.com/googleapis/nodejs-memcache/compare/v2.1.0...v2.1.1) (2022-08-27) + + +### Bug Fixes + +* better support for fallback mode ([#209](https://github.com/googleapis/nodejs-memcache/issues/209)) ([8398c52](https://github.com/googleapis/nodejs-memcache/commit/8398c52666aca0a251852edc3b3d341bdfa11902)) +* change import long to require ([#211](https://github.com/googleapis/nodejs-memcache/issues/211)) ([9139124](https://github.com/googleapis/nodejs-memcache/commit/91391240a20101ef11b1805973bd772fda8edabe)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-memcache/issues/1553)) ([#215](https://github.com/googleapis/nodejs-memcache/issues/215)) ([12ee008](https://github.com/googleapis/nodejs-memcache/commit/12ee00812abedba79271ea2dd97e042e1cab22bf)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-memcache/issues/1546)) ([#214](https://github.com/googleapis/nodejs-memcache/issues/214)) ([35b9a7b](https://github.com/googleapis/nodejs-memcache/commit/35b9a7bef37482d3f7209c16b6cd87fab0f72ea8)) +* use google-gax v3.3.0 ([12ee008](https://github.com/googleapis/nodejs-memcache/commit/12ee00812abedba79271ea2dd97e042e1cab22bf)) + +## [2.1.0](https://github.com/googleapis/nodejs-memcache/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#201](https://github.com/googleapis/nodejs-memcache/issues/201)) ([2151fc9](https://github.com/googleapis/nodejs-memcache/commit/2151fc9b1524bd8f3eed8492dc7baeb26d2db3ed)) + +## [2.0.0](https://github.com/googleapis/nodejs-memcache/compare/v1.5.1...v2.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#196) + +### Build System + +* update library to use Node 12 ([#196](https://github.com/googleapis/nodejs-memcache/issues/196)) ([776f934](https://github.com/googleapis/nodejs-memcache/commit/776f93402453fc1b33394d80e19f3478efca42b4)) + +### [1.5.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.5.0...v1.5.1) (2021-09-08) + + +### Bug Fixes + +* **build:** update branch to main ([#150](https://www.github.com/googleapis/nodejs-memcache/issues/150)) ([8c534ef](https://www.github.com/googleapis/nodejs-memcache/commit/8c534efaa39919a8df10622c9fa4e7dae18f5f61)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.7...v1.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#147](https://www.github.com/googleapis/nodejs-memcache/issues/147)) ([2914811](https://www.github.com/googleapis/nodejs-memcache/commit/2914811e7094e157af785fb52fe7211d2f4073cb)) + +### [1.4.7](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.6...v1.4.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#144](https://www.github.com/googleapis/nodejs-memcache/issues/144)) ([b50e358](https://www.github.com/googleapis/nodejs-memcache/commit/b50e3582e3e0381484617b23d2e2b63c2e4c4254)) + +### [1.4.6](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.5...v1.4.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#136](https://www.github.com/googleapis/nodejs-memcache/issues/136)) ([619f23e](https://www.github.com/googleapis/nodejs-memcache/commit/619f23ec0c25c8e5dd97894ada5f65ae763d2721)) + +### [1.4.5](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.4...v1.4.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#134](https://www.github.com/googleapis/nodejs-memcache/issues/134)) ([0a53a9b](https://www.github.com/googleapis/nodejs-memcache/commit/0a53a9b9febde8ac007105ee7356df90278c4949)) + +### [1.4.4](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.3...v1.4.4) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#131](https://www.github.com/googleapis/nodejs-memcache/issues/131)) ([f475455](https://www.github.com/googleapis/nodejs-memcache/commit/f47545548fe2bc478984a7ab715995fc32aee7cd)) + +### [1.4.3](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.2...v1.4.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#125](https://www.github.com/googleapis/nodejs-memcache/issues/125)) ([3b296ba](https://www.github.com/googleapis/nodejs-memcache/commit/3b296ba1e2598054ed391979b616ddf03f0b89f4)) + +### [1.4.2](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.1...v1.4.2) (2021-05-29) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#116](https://www.github.com/googleapis/nodejs-memcache/issues/116)) ([d892630](https://www.github.com/googleapis/nodejs-memcache/commit/d89263085fd359b47105c1fa3e78fd3cfb2f1d3c)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.4.0...v1.4.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#107](https://www.github.com/googleapis/nodejs-memcache/issues/107)) ([5a10a63](https://www.github.com/googleapis/nodejs-memcache/commit/5a10a632b62e00b2fe488deb92885bdc14f09f92)) +* use require() to load JSON protos ([#110](https://www.github.com/googleapis/nodejs-memcache/issues/110)) ([8335678](https://www.github.com/googleapis/nodejs-memcache/commit/8335678c41a08fb0b811db48540ff232b802e47a)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.3.0...v1.4.0) (2021-03-01) + + +### Features + +* add v1 version ([#88](https://www.github.com/googleapis/nodejs-memcache/issues/88)) ([105dc47](https://www.github.com/googleapis/nodejs-memcache/commit/105dc474f33479cca0888116a9d63a4f9abc59ac)) +* **docs:** indicate ga status ([#91](https://www.github.com/googleapis/nodejs-memcache/issues/91)) ([f5a4313](https://www.github.com/googleapis/nodejs-memcache/commit/f5a4313e5ee55887ea9c2350dcabd12b9ba2e5e0)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.1...v1.3.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#85](https://www.github.com/googleapis/nodejs-memcache/issues/85)) ([07e4454](https://www.github.com/googleapis/nodejs-memcache/commit/07e44541b9056d83a9505b72913c2b52ecd6e859)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-memcache/compare/v1.2.0...v1.2.1) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([8d54934](https://www.github.com/googleapis/nodejs-memcache/commit/8d54934fcd7d4ef97f6adbbff383414bd0c23c58)) +* do not modify options object, use defaultScopes ([#76](https://www.github.com/googleapis/nodejs-memcache/issues/76)) ([b48f1ef](https://www.github.com/googleapis/nodejs-memcache/commit/b48f1efd8df276d542cead808f5b602fabdc047b)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.1.0...v1.2.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#30](https://www.github.com/googleapis/nodejs-memcache/issues/30)) ([086b37f](https://www.github.com/googleapis/nodejs-memcache/commit/086b37f5d49f26c137bcc0941d6ec80f7ceb17fb)) + + +### Bug Fixes + +* proper fallback option handling ([7515a7e](https://www.github.com/googleapis/nodejs-memcache/commit/7515a7e680ee87f63e344eab63a74522f4cf1720)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-memcache/compare/v1.0.0...v1.1.0) (2020-06-04) + + +### Features + +* check status of long running operation by its name ([#23](https://www.github.com/googleapis/nodejs-memcache/issues/23)) ([2256227](https://www.github.com/googleapis/nodejs-memcache/commit/22562276b0f53e338b3fc925d8830879261f8209)) + + +### Bug Fixes + +* remove eslint, update gax, fix generated protos, run the generator ([#13](https://www.github.com/googleapis/nodejs-memcache/issues/13)) ([93da9fb](https://www.github.com/googleapis/nodejs-memcache/commit/93da9fbf2da01ba4ba8caf6d3403cc08093dd5aa)) + +## 1.0.0 (2020-04-03) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#3) + +### Features + +* initial generation of library ([#3](https://www.github.com/googleapis/nodejs-memcache/issues/3)) ([a94f499](https://www.github.com/googleapis/nodejs-memcache/commit/a94f499651bc3f56032261c51a030c893c71d7c3)) diff --git a/packages/google-cloud-memcache/CODE_OF_CONDUCT.md b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-memcache/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-memcache/CONTRIBUTING.md b/packages/google-cloud-memcache/CONTRIBUTING.md new file mode 100644 index 000000000000..ede158bdba20 --- /dev/null +++ b/packages/google-cloud-memcache/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Memorystore for Memcached API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=memcache.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-memcache/LICENSE b/packages/google-cloud-memcache/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-memcache/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md new file mode 100644 index 000000000000..4ddb4f15d904 --- /dev/null +++ b/packages/google-cloud-memcache/README.md @@ -0,0 +1,213 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Memorystore for Memcached: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/memcache.svg)](https://www.npmjs.org/package/@google-cloud/memcache) + + + + +Memcache client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Memorystore for Memcached Node.js Client API Reference][client-docs] +* [Memorystore for Memcached Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Memorystore for Memcached API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/memcache +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ +// const parent = 'abc123' +/** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ +// const pageSize = 1234 +/** + * The next_page_token value returned from a previous List request, + * if any. + */ +// const pageToken = 'abc123' +/** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ +// const filter = 'abc123' +/** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ +// const orderBy = 'abc123' + +// Imports the Memcache library +const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + +// Instantiates a client +const memcacheClient = new CloudMemcacheClient(); + +async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListInstances(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Cloud_memcache.apply_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js,samples/README.md) | +| Cloud_memcache.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js,samples/README.md) | +| Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js,samples/README.md) | +| Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js,samples/README.md) | +| Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js,samples/README.md) | +| Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js,samples/README.md) | +| Cloud_memcache.apply_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js,samples/README.md) | +| Cloud_memcache.apply_software_update | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js,samples/README.md) | +| Cloud_memcache.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js,samples/README.md) | +| Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js,samples/README.md) | +| Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js,samples/README.md) | +| Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js,samples/README.md) | +| Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/test/quickstart.js,samples/README.md) | + + + +The [Memorystore for Memcached Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/memcache@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/memcache/latest +[product-docs]: https://cloud.google.com/memorystore/docs/memcached +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=memcache.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-memcache/linkinator.config.json b/packages/google-cloud-memcache/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-memcache/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-memcache/package.json b/packages/google-cloud-memcache/package.json new file mode 100644 index 000000000000..9f8a5a44eae7 --- /dev/null +++ b/packages/google-cloud-memcache/package.json @@ -0,0 +1,54 @@ +{ + "name": "@google-cloud/memcache", + "version": "2.1.2", + "description": "Memcache client for Node.js", + "repository": "googleapis/nodejs-memcache", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm install", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "test": "c8 mocha build/test", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.1.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto b/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000000..56c9f800d5e3 --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto new file mode 100644 index 000000000000..308f0582009b --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto @@ -0,0 +1,495 @@ +// Copyright 2020 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.cloud.memcache.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/memcache/v1;memcache"; +option java_multiple_files = true; +option java_outer_classname = "CloudMemcacheProto"; +option java_package = "com.google.cloud.memcache.v1"; + +// Configures and manages Cloud Memorystore for Memcached instances. +// +// +// The `memcache.googleapis.com` service implements the Google Cloud Memorystore +// for Memcached API and defines the following resource model for managing +// Memorystore Memcached (also called Memcached below) instances: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of Memcached instances, named: +// `/instances/*` +// * As such, Memcached instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be a GCP `region`; for example: +// * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` +service CloudMemcache { + option (google.api.default_host) = "memcache.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given location. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Updates an existing Instance in a given project and location. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Updates the defined Memcached Parameters for an existing Instance. + // This method only stages the parameters, it must be followed by + // ApplyParameters to apply the parameters to nodes of the Memcached Instance. + rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/instances/*}:updateParameters" + body: "*" + }; + option (google.api.method_signature) = "name,update_mask,parameters"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } + + // ApplyParameters will restart the set of specified nodes in order to update + // them to the current set of parameters for the Memcached Instance. + rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:applyParameters" + body: "*" + }; + option (google.api.method_signature) = "name,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } +} + +message Instance { + option (google.api.resource) = { + type: "memcache.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Configuration for a Memcached Node. + message NodeConfig { + // Required. Number of cpus per Memcached node. + int32 cpu_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Memory size in MiB for each Memcached node. + int32 memory_size_mb = 2 [(google.api.field_behavior) = REQUIRED]; + } + + message Node { + // Different states of a Memcached node. + enum State { + // Node state is not set. + STATE_UNSPECIFIED = 0; + + // Node is being created. + CREATING = 1; + + // Node has been created and ready to be used. + READY = 2; + + // Node is being deleted. + DELETING = 3; + + // Node is being updated. + UPDATING = 4; + } + + // Output only. Identifier of the Memcached node. The node id does not + // include project or location like the Memcached instance name. + string node_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Location (GCP Zone) for the Memcached node. + string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Memcached node. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hostname or IP address of the Memcached node used by the + // clients to connect to the Memcached server on this node. + string host = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the Memcached server on this node. + int32 port = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined parameters currently applied to the node. + MemcacheParameters parameters = 6; + } + + message InstanceMessage { + enum Code { + // Message Code not set. + CODE_UNSPECIFIED = 0; + + // Memcached nodes are distributed unevenly. + ZONE_DISTRIBUTION_UNBALANCED = 1; + } + + // A code that correspond to one type of user-facing message. + Code code = 1; + + // Message on memcached instance which will be exposed to users. + string message = 2; + } + + // Different states of a Memcached instance. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // + // Note: Memcached instances are managed and addressed at regional level so + // location_id here refers to a GCP region; however, users may choose which + // zones Memcached nodes within an instances should be provisioned in. + // Refer to [zones] field for more details. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // User provided name for the instance only used for display + // purposes. Cannot be more than 80 characters. + string display_name = 2; + + // Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 3; + + // The full name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. If left unspecified, the `default` network + // will be used. + string authorized_network = 4; + + // Zones where Memcached nodes should be provisioned in. + // Memcached nodes will be equally distributed across these zones. If not + // provided, the service will by default create nodes in all zones in the + // region for the instance. + repeated string zones = 5; + + // Required. Number of nodes in the Memcached instance. + int32 node_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration for Memcached nodes. + NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // The major version of Memcached software. + // If not provided, latest supported version will be used. Currently the + // latest supported major version is MEMCACHE_1_5. + // The minor version will be automatically determined by our system based on + // the latest supported minor version. + MemcacheVersion memcache_version = 9; + + // Optional: User defined parameters to apply to the memcached process + // on each node. + MemcacheParameters parameters = 11; + + // Output only. List of Memcached nodes. + // Refer to [Node] message for more details. + repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this Memcached instance. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full version of memcached server running on this instance. + // System automatically determines the full memcached version for an instance + // based on the input MemcacheVersion. + // The full version format will be "memcached-1.5.16". + string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of messages that describe current statuses of memcached instance. + repeated InstanceMessage instance_messages = 19; + + // Output only. Endpoint for Discovery API + string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances]. +message ListInstancesRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; + + // List filter. For example, exclude all Memcached instances with name as + // my-instance by specifying "name != my-instance". + string filter = 4; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 5; +} + +// Response for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances]. +message ListInstancesResponse { + // A list of Memcached instances in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + repeated Instance instances = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetInstance][google.cloud.memcache.v1.CloudMemcache.GetInstance]. +message GetInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [CreateInstance][google.cloud.memcache.v1.CloudMemcache.CreateInstance]. +message CreateInstanceRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Memcached instance in the user + // project with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-40 characters. + // * Must end with a number or a letter. + // * Must be unique within the user project / location + // + // If any of the above are not met, will raise an invalid argument error. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached Instance + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [UpdateInstance][google.cloud.memcache.v1.CloudMemcache.UpdateInstance]. +message UpdateInstanceRequest { + // Required. Mask of fields to update. + // * `displayName` + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached Instance. + // Only fields specified in update_mask are updated. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteInstance][google.cloud.memcache.v1.CloudMemcache.DeleteInstance]. +message DeleteInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [ApplyParameters][google.cloud.memcache.v1.CloudMemcache.ApplyParameters]. +message ApplyParametersRequest { + // Required. Resource name of the Memcached instance for which parameter group updates + // should be applied. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which we should apply the instance-level parameter group. + repeated string node_ids = 2; + + // Whether to apply instance-level parameter group to all nodes. If set to + // true, will explicitly restrict users from specifying any nodes, and apply + // parameter group updates to all nodes within the instance. + bool apply_all = 3; +} + +// Request for [UpdateParameters][google.cloud.memcache.v1.CloudMemcache.UpdateParameters]. +message UpdateParametersRequest { + // Required. Resource name of the Memcached instance for which the parameters should be + // updated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters to apply to the instance. + MemcacheParameters parameters = 3; +} + +message MemcacheParameters { + // Output only. The unique ID associated with this set of parameters. Users + // can use this id to determine if the parameters associated with the instance + // differ from the parameters associated with the nodes and any action needs + // to be taken to apply parameters on nodes. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined set of parameters to use in the memcached process. + map params = 3; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto new file mode 100644 index 000000000000..1a3ff64a7f8e --- /dev/null +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto @@ -0,0 +1,550 @@ +// 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 +// +// 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.cloud.memcache.v1beta2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/memcache/v1beta2;memcache"; +option java_multiple_files = true; +option java_outer_classname = "CloudMemcacheProto"; +option java_package = "com.google.cloud.memcache.v1beta2"; + +// Configures and manages Cloud Memorystore for Memcached instances. +// +// +// The `memcache.googleapis.com` service implements the Google Cloud Memorystore +// for Memcached API and defines the following resource model for managing +// Memorystore Memcached (also called Memcached below) instances: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of Memcached instances, named: +// `/instances/*` +// * As such, Memcached instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be a GCP `region`; for example: +// * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` +service CloudMemcache { + option (google.api.default_host) = "memcache.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta2/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given location. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{parent=projects/*/locations/*}/instances" + body: "resource" + }; + option (google.api.method_signature) = "parent,instance_id,resource"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Updates an existing Instance in a given project and location. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta2/{resource.name=projects/*/locations/*/instances/*}" + body: "resource" + }; + option (google.api.method_signature) = "update_mask,resource"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Updates the defined Memcached parameters for an existing instance. + // This method only stages the parameters, it must be followed by + // `ApplyParameters` to apply the parameters to nodes of the Memcached + // instance. + rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters" + body: "*" + }; + option (google.api.method_signature) = "name,update_mask,parameters"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // `ApplyParameters` restarts the set of specified nodes in order to update + // them to the current set of parameters for the Memcached Instance. + rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters" + body: "*" + }; + option (google.api.method_signature) = "name,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } + + // Updates software on the selected nodes of the Instance. + rpc ApplySoftwareUpdate(ApplySoftwareUpdateRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate" + body: "*" + }; + option (google.api.method_signature) = "instance,node_ids,apply_all"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } +} + +// A Memorystore for Memcached instance +message Instance { + option (google.api.resource) = { + type: "memcache.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Configuration for a Memcached Node. + message NodeConfig { + // Required. Number of cpus per Memcached node. + int32 cpu_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Memory size in MiB for each Memcached node. + int32 memory_size_mb = 2 [(google.api.field_behavior) = REQUIRED]; + } + + message Node { + // Different states of a Memcached node. + enum State { + // Node state is not set. + STATE_UNSPECIFIED = 0; + + // Node is being created. + CREATING = 1; + + // Node has been created and ready to be used. + READY = 2; + + // Node is being deleted. + DELETING = 3; + + // Node is being updated. + UPDATING = 4; + } + + // Output only. Identifier of the Memcached node. The node id does not + // include project or location like the Memcached instance name. + string node_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Location (GCP Zone) for the Memcached node. + string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the Memcached node. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hostname or IP address of the Memcached node used by the + // clients to connect to the Memcached server on this node. + string host = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the Memcached server on this node. + int32 port = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined parameters currently applied to the node. + MemcacheParameters parameters = 6; + + // Output only. Returns true if there is an update waiting to be applied + bool update_available = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + message InstanceMessage { + enum Code { + // Message Code not set. + CODE_UNSPECIFIED = 0; + + // Memcached nodes are distributed unevenly. + ZONE_DISTRIBUTION_UNBALANCED = 1; + } + + // A code that correspond to one type of user-facing message. + Code code = 1; + + // Message on memcached instance which will be exposed to users. + string message = 2; + } + + // Different states of a Memcached instance. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // + // Note: Memcached instances are managed and addressed at the regional level + // so `location_id` here refers to a Google Cloud region; however, users may + // choose which zones Memcached nodes should be provisioned in within an + // instance. Refer to [zones][google.cloud.memcache.v1beta2.Instance.zones] field for more details. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // User provided name for the instance, which is only used for display + // purposes. Cannot be more than 80 characters. + string display_name = 2; + + // Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 3; + + // The full name of the Google Compute Engine + // [network](https://cloud.google.com/vpc/docs/vpc) to which the + // instance is connected. If left unspecified, the `default` network + // will be used. + string authorized_network = 4; + + // Zones in which Memcached nodes should be provisioned. + // Memcached nodes will be equally distributed across these zones. If not + // provided, the service will by default create nodes in all zones in the + // region for the instance. + repeated string zones = 5; + + // Required. Number of nodes in the Memcached instance. + int32 node_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Configuration for Memcached nodes. + NodeConfig node_config = 7 [(google.api.field_behavior) = REQUIRED]; + + // The major version of Memcached software. + // If not provided, latest supported version will be used. Currently the + // latest supported major version is `MEMCACHE_1_5`. + // The minor version will be automatically determined by our system based on + // the latest supported minor version. + MemcacheVersion memcache_version = 9; + + // Optional: User defined parameters to apply to the memcached process + // on each node. + MemcacheParameters parameters = 11; + + // Output only. List of Memcached nodes. + // Refer to [Node][google.cloud.memcache.v1beta2.Instance.Node] message for more details. + repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was updated. + google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of this Memcached instance. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The full version of memcached server running on this instance. + // System automatically determines the full memcached version for an instance + // based on the input MemcacheVersion. + // The full version format will be "memcached-1.5.16". + string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of messages that describe the current state of the Memcached instance. + repeated InstanceMessage instance_messages = 19; + + // Output only. Endpoint for the Discovery API. + string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Returns true if there is an update waiting to be applied + bool update_available = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. +message ListInstancesRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the `page_size` value, the response may include a partial + // list and a caller should only rely on response's + // [`next_page_token`][google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The `next_page_token` value returned from a previous List request, if any. + string page_token = 3; + + // List filter. For example, exclude all Memcached instances with name as + // my-instance by specifying `"name != my-instance"`. + string filter = 4; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 5; +} + +// Response for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. +message ListInstancesResponse { + // A list of Memcached instances in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + repeated Instance resources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [GetInstance][google.cloud.memcache.v1beta2.CloudMemcache.GetInstance]. +message GetInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [CreateInstance][google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance]. +message CreateInstanceRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Memcached instance in the user + // project with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-40 characters. + // * Must end with a number or a letter. + // * Must be unique within the user project / location. + // + // If any of the above are not met, the API raises an invalid argument error. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached [Instance] resource + Instance resource = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [UpdateInstance][google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance]. +message UpdateInstanceRequest { + // Required. Mask of fields to update. + // * `displayName` + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A Memcached [Instance] resource. + // Only fields specified in update_mask are updated. + Instance resource = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for [DeleteInstance][google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance]. +message DeleteInstanceRequest { + // Required. Memcached instance resource name in the format: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; +} + +// Request for [ApplyParameters][google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters]. +message ApplyParametersRequest { + // Required. Resource name of the Memcached instance for which parameter group updates + // should be applied. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which the instance-level parameter group is applied. + repeated string node_ids = 2; + + // Whether to apply instance-level parameter group to all nodes. If set to + // true, users are restricted from specifying individual nodes, and + // `ApplyParameters` updates all nodes within the instance. + bool apply_all = 3; +} + +// Request for [UpdateParameters][google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters]. +message UpdateParametersRequest { + // Required. Resource name of the Memcached instance for which the parameters should be + // updated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Required. Mask of fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // The parameters to apply to the instance. + MemcacheParameters parameters = 3; +} + +// Request for [ApplySoftwareUpdate][google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate]. +message ApplySoftwareUpdateRequest { + // Required. Resource name of the Memcached instance for which software update should be + // applied. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.googleapis.com/Instance" + } + ]; + + // Nodes to which we should apply the update to. Note all the selected nodes + // are updated in parallel. + repeated string node_ids = 2; + + // Whether to apply the update to all nodes. If set to + // true, will explicitly restrict users from specifying any nodes, and apply + // software update to all nodes (where applicable) within the instance. + bool apply_all = 3; +} + +// The unique ID associated with this set of parameters. Users +// can use this id to determine if the parameters associated with the instance +// differ from the parameters associated with the nodes. A discrepancy between +// parameter ids can inform users that they may need to take action to apply +// parameters on nodes. +message MemcacheParameters { + // Output only. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User defined set of parameters to use in the memcached process. + map params = 3; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} + +// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // Output only. The set of available zones in the location. The map is keyed + // by the lowercase ID of each zone, as defined by GCE. These keys can be + // specified in the `zones` field when creating a Memcached instance. + map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message ZoneMetadata { + +} diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts new file mode 100644 index 000000000000..2c69b2622479 --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -0,0 +1,9565 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace memcache. */ + namespace memcache { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudMemcache */ + class CloudMemcache extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudMemcache 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 CloudMemcache 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): CloudMemcache; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.memcache.v1.IListInstancesRequest, callback: google.cloud.memcache.v1.CloudMemcache.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.memcache.v1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.memcache.v1.IGetInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.memcache.v1.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.memcache.v1.ICreateInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.memcache.v1.ICreateInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.memcache.v1.IUpdateInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.memcache.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateParameters(request: google.cloud.memcache.v1.IUpdateParametersRequest, callback: google.cloud.memcache.v1.CloudMemcache.UpdateParametersCallback): void; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @returns Promise + */ + public updateParameters(request: google.cloud.memcache.v1.IUpdateParametersRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.memcache.v1.IDeleteInstanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.memcache.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyParameters(request: google.cloud.memcache.v1.IApplyParametersRequest, callback: google.cloud.memcache.v1.CloudMemcache.ApplyParametersCallback): void; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @returns Promise + */ + public applyParameters(request: google.cloud.memcache.v1.IApplyParametersRequest): Promise; + } + + namespace CloudMemcache { + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|applyParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance authorizedNetwork */ + authorizedNetwork?: (string|null); + + /** Instance zones */ + zones?: (string[]|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance nodeConfig */ + nodeConfig?: (google.cloud.memcache.v1.Instance.INodeConfig|null); + + /** Instance memcacheVersion */ + memcacheVersion?: (google.cloud.memcache.v1.MemcacheVersion|keyof typeof google.cloud.memcache.v1.MemcacheVersion|null); + + /** Instance parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** Instance memcacheNodes */ + memcacheNodes?: (google.cloud.memcache.v1.Instance.INode[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.memcache.v1.Instance.State|keyof typeof google.cloud.memcache.v1.Instance.State|null); + + /** Instance memcacheFullVersion */ + memcacheFullVersion?: (string|null); + + /** Instance instanceMessages */ + instanceMessages?: (google.cloud.memcache.v1.Instance.IInstanceMessage[]|null); + + /** Instance discoveryEndpoint */ + discoveryEndpoint?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance authorizedNetwork. */ + public authorizedNetwork: string; + + /** Instance zones. */ + public zones: string[]; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance nodeConfig. */ + public nodeConfig?: (google.cloud.memcache.v1.Instance.INodeConfig|null); + + /** Instance memcacheVersion. */ + public memcacheVersion: (google.cloud.memcache.v1.MemcacheVersion|keyof typeof google.cloud.memcache.v1.MemcacheVersion); + + /** Instance parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** Instance memcacheNodes. */ + public memcacheNodes: google.cloud.memcache.v1.Instance.INode[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.memcache.v1.Instance.State|keyof typeof google.cloud.memcache.v1.Instance.State); + + /** Instance memcacheFullVersion. */ + public memcacheFullVersion: string; + + /** Instance instanceMessages. */ + public instanceMessages: google.cloud.memcache.v1.Instance.IInstanceMessage[]; + + /** Instance discoveryEndpoint. */ + public discoveryEndpoint: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.memcache.v1.IInstance): google.cloud.memcache.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig cpuCount */ + cpuCount?: (number|null); + + /** NodeConfig memorySizeMb */ + memorySizeMb?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.INodeConfig); + + /** NodeConfig cpuCount. */ + public cpuCount: number; + + /** NodeConfig memorySizeMb. */ + public memorySizeMb: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.INodeConfig): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node nodeId */ + nodeId?: (string|null); + + /** Node zone */ + zone?: (string|null); + + /** Node state */ + state?: (google.cloud.memcache.v1.Instance.Node.State|keyof typeof google.cloud.memcache.v1.Instance.Node.State|null); + + /** Node host */ + host?: (string|null); + + /** Node port */ + port?: (number|null); + + /** Node parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.INode); + + /** Node nodeId. */ + public nodeId: string; + + /** Node zone. */ + public zone: string; + + /** Node state. */ + public state: (google.cloud.memcache.v1.Instance.Node.State|keyof typeof google.cloud.memcache.v1.Instance.Node.State); + + /** Node host. */ + public host: string; + + /** Node port. */ + public port: number; + + /** Node parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.INode): google.cloud.memcache.v1.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Node { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + UPDATING = 4 + } + } + + /** Properties of an InstanceMessage. */ + interface IInstanceMessage { + + /** InstanceMessage code */ + code?: (google.cloud.memcache.v1.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1.Instance.InstanceMessage.Code|null); + + /** InstanceMessage message */ + message?: (string|null); + } + + /** Represents an InstanceMessage. */ + class InstanceMessage implements IInstanceMessage { + + /** + * Constructs a new InstanceMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.Instance.IInstanceMessage); + + /** InstanceMessage code. */ + public code: (google.cloud.memcache.v1.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1.Instance.InstanceMessage.Code); + + /** InstanceMessage message. */ + public message: string; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceMessage instance + */ + public static create(properties?: google.cloud.memcache.v1.Instance.IInstanceMessage): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Verifies an InstanceMessage message. + * @param message Plain 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 InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.Instance.InstanceMessage; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @param message InstanceMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceMessage { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + ZONE_DISTRIBUTION_UNBALANCED = 1 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IListInstancesRequest): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.memcache.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.memcache.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.memcache.v1.IListInstancesResponse): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IGetInstanceRequest): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.memcache.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.ICreateInstanceRequest): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.memcache.v1.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.v1.IInstance|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IUpdateInstanceRequest): google.cloud.memcache.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IDeleteInstanceRequest): google.cloud.memcache.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplyParametersRequest. */ + interface IApplyParametersRequest { + + /** ApplyParametersRequest name */ + name?: (string|null); + + /** ApplyParametersRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplyParametersRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplyParametersRequest. */ + class ApplyParametersRequest implements IApplyParametersRequest { + + /** + * Constructs a new ApplyParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IApplyParametersRequest); + + /** ApplyParametersRequest name. */ + public name: string; + + /** ApplyParametersRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplyParametersRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IApplyParametersRequest): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Verifies an ApplyParametersRequest message. + * @param message Plain 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 ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ApplyParametersRequest; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @param message ApplyParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.ApplyParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateParametersRequest. */ + interface IUpdateParametersRequest { + + /** UpdateParametersRequest name */ + name?: (string|null); + + /** UpdateParametersRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters */ + parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + } + + /** Represents an UpdateParametersRequest. */ + class UpdateParametersRequest implements IUpdateParametersRequest { + + /** + * Constructs a new UpdateParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IUpdateParametersRequest); + + /** UpdateParametersRequest name. */ + public name: string; + + /** UpdateParametersRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters. */ + public parameters?: (google.cloud.memcache.v1.IMemcacheParameters|null); + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IUpdateParametersRequest): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Verifies an UpdateParametersRequest message. + * @param message Plain 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 UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.UpdateParametersRequest; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @param message UpdateParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.UpdateParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MemcacheParameters. */ + interface IMemcacheParameters { + + /** MemcacheParameters id */ + id?: (string|null); + + /** MemcacheParameters params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a MemcacheParameters. */ + class MemcacheParameters implements IMemcacheParameters { + + /** + * Constructs a new MemcacheParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IMemcacheParameters); + + /** MemcacheParameters id. */ + public id: string; + + /** MemcacheParameters params. */ + public params: { [k: string]: string }; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns MemcacheParameters instance + */ + public static create(properties?: google.cloud.memcache.v1.IMemcacheParameters): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Verifies a MemcacheParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemcacheParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.MemcacheParameters; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @param message MemcacheParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.MemcacheParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemcacheParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemcacheParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusDetail */ + statusDetail?: (string|null); + + /** OperationMetadata cancelRequested */ + cancelRequested?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusDetail. */ + public statusDetail: string; + + /** OperationMetadata cancelRequested. */ + public cancelRequested: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1.IOperationMetadata): google.cloud.memcache.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + } + + /** Namespace v1beta2. */ + namespace v1beta2 { + + /** Represents a CloudMemcache */ + class CloudMemcache extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudMemcache 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 CloudMemcache 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): CloudMemcache; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.memcache.v1beta2.IListInstancesRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.memcache.v1beta2.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.memcache.v1beta2.IGetInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.memcache.v1beta2.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.memcache.v1beta2.ICreateInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.memcache.v1beta2.ICreateInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.memcache.v1beta2.IUpdateInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.memcache.v1beta2.IUpdateInstanceRequest): Promise; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateParameters(request: google.cloud.memcache.v1beta2.IUpdateParametersRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback): void; + + /** + * Calls UpdateParameters. + * @param request UpdateParametersRequest message or plain object + * @returns Promise + */ + public updateParameters(request: google.cloud.memcache.v1beta2.IUpdateParametersRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.memcache.v1beta2.IDeleteInstanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.memcache.v1beta2.IDeleteInstanceRequest): Promise; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyParameters(request: google.cloud.memcache.v1beta2.IApplyParametersRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback): void; + + /** + * Calls ApplyParameters. + * @param request ApplyParametersRequest message or plain object + * @returns Promise + */ + public applyParameters(request: google.cloud.memcache.v1beta2.IApplyParametersRequest): Promise; + + /** + * Calls ApplySoftwareUpdate. + * @param request ApplySoftwareUpdateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applySoftwareUpdate(request: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback): void; + + /** + * Calls ApplySoftwareUpdate. + * @param request ApplySoftwareUpdateRequest message or plain object + * @returns Promise + */ + public applySoftwareUpdate(request: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest): Promise; + } + + namespace CloudMemcache { + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.memcache.v1beta2.Instance) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplySoftwareUpdateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance authorizedNetwork */ + authorizedNetwork?: (string|null); + + /** Instance zones */ + zones?: (string[]|null); + + /** Instance nodeCount */ + nodeCount?: (number|null); + + /** Instance nodeConfig */ + nodeConfig?: (google.cloud.memcache.v1beta2.Instance.INodeConfig|null); + + /** Instance memcacheVersion */ + memcacheVersion?: (google.cloud.memcache.v1beta2.MemcacheVersion|keyof typeof google.cloud.memcache.v1beta2.MemcacheVersion|null); + + /** Instance parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Instance memcacheNodes */ + memcacheNodes?: (google.cloud.memcache.v1beta2.Instance.INode[]|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.memcache.v1beta2.Instance.State|keyof typeof google.cloud.memcache.v1beta2.Instance.State|null); + + /** Instance memcacheFullVersion */ + memcacheFullVersion?: (string|null); + + /** Instance instanceMessages */ + instanceMessages?: (google.cloud.memcache.v1beta2.Instance.IInstanceMessage[]|null); + + /** Instance discoveryEndpoint */ + discoveryEndpoint?: (string|null); + + /** Instance updateAvailable */ + updateAvailable?: (boolean|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance authorizedNetwork. */ + public authorizedNetwork: string; + + /** Instance zones. */ + public zones: string[]; + + /** Instance nodeCount. */ + public nodeCount: number; + + /** Instance nodeConfig. */ + public nodeConfig?: (google.cloud.memcache.v1beta2.Instance.INodeConfig|null); + + /** Instance memcacheVersion. */ + public memcacheVersion: (google.cloud.memcache.v1beta2.MemcacheVersion|keyof typeof google.cloud.memcache.v1beta2.MemcacheVersion); + + /** Instance parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Instance memcacheNodes. */ + public memcacheNodes: google.cloud.memcache.v1beta2.Instance.INode[]; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.memcache.v1beta2.Instance.State|keyof typeof google.cloud.memcache.v1beta2.Instance.State); + + /** Instance memcacheFullVersion. */ + public memcacheFullVersion: string; + + /** Instance instanceMessages. */ + public instanceMessages: google.cloud.memcache.v1beta2.Instance.IInstanceMessage[]; + + /** Instance discoveryEndpoint. */ + public discoveryEndpoint: string; + + /** Instance updateAvailable. */ + public updateAvailable: boolean; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IInstance): google.cloud.memcache.v1beta2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig cpuCount */ + cpuCount?: (number|null); + + /** NodeConfig memorySizeMb */ + memorySizeMb?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.INodeConfig); + + /** NodeConfig cpuCount. */ + public cpuCount: number; + + /** NodeConfig memorySizeMb. */ + public memorySizeMb: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.INodeConfig): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Node. */ + interface INode { + + /** Node nodeId */ + nodeId?: (string|null); + + /** Node zone */ + zone?: (string|null); + + /** Node state */ + state?: (google.cloud.memcache.v1beta2.Instance.Node.State|keyof typeof google.cloud.memcache.v1beta2.Instance.Node.State|null); + + /** Node host */ + host?: (string|null); + + /** Node port */ + port?: (number|null); + + /** Node parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Node updateAvailable */ + updateAvailable?: (boolean|null); + } + + /** Represents a Node. */ + class Node implements INode { + + /** + * Constructs a new Node. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.INode); + + /** Node nodeId. */ + public nodeId: string; + + /** Node zone. */ + public zone: string; + + /** Node state. */ + public state: (google.cloud.memcache.v1beta2.Instance.Node.State|keyof typeof google.cloud.memcache.v1beta2.Instance.Node.State); + + /** Node host. */ + public host: string; + + /** Node port. */ + public port: number; + + /** Node parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** Node updateAvailable. */ + public updateAvailable: boolean; + + /** + * Creates a new Node instance using the specified properties. + * @param [properties] Properties to set + * @returns Node instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.INode): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @param message Node message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.INode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Node message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Verifies a Node message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Node + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.Node; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @param message Node + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Node to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Node + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Node { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + UPDATING = 4 + } + } + + /** Properties of an InstanceMessage. */ + interface IInstanceMessage { + + /** InstanceMessage code */ + code?: (google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null); + + /** InstanceMessage message */ + message?: (string|null); + } + + /** Represents an InstanceMessage. */ + class InstanceMessage implements IInstanceMessage { + + /** + * Constructs a new InstanceMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.Instance.IInstanceMessage); + + /** InstanceMessage code. */ + public code: (google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|keyof typeof google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code); + + /** InstanceMessage message. */ + public message: string; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceMessage instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.Instance.IInstanceMessage): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @param message InstanceMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.Instance.IInstanceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Verifies an InstanceMessage message. + * @param message Plain 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 InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @param message InstanceMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceMessage { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + ZONE_DISTRIBUTION_UNBALANCED = 1 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IListInstancesRequest): google.cloud.memcache.v1beta2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse resources */ + resources?: (google.cloud.memcache.v1beta2.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IListInstancesResponse); + + /** ListInstancesResponse resources. */ + public resources: google.cloud.memcache.v1beta2.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IListInstancesResponse): google.cloud.memcache.v1beta2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IGetInstanceRequest): google.cloud.memcache.v1beta2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest resource */ + resource?: (google.cloud.memcache.v1beta2.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest resource. */ + public resource?: (google.cloud.memcache.v1beta2.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.ICreateInstanceRequest): google.cloud.memcache.v1beta2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest resource */ + resource?: (google.cloud.memcache.v1beta2.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest resource. */ + public resource?: (google.cloud.memcache.v1beta2.IInstance|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IUpdateInstanceRequest): google.cloud.memcache.v1beta2.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IDeleteInstanceRequest): google.cloud.memcache.v1beta2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplyParametersRequest. */ + interface IApplyParametersRequest { + + /** ApplyParametersRequest name */ + name?: (string|null); + + /** ApplyParametersRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplyParametersRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplyParametersRequest. */ + class ApplyParametersRequest implements IApplyParametersRequest { + + /** + * Constructs a new ApplyParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IApplyParametersRequest); + + /** ApplyParametersRequest name. */ + public name: string; + + /** ApplyParametersRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplyParametersRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IApplyParametersRequest): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @param message ApplyParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IApplyParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Verifies an ApplyParametersRequest message. + * @param message Plain 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 ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ApplyParametersRequest; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @param message ApplyParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ApplyParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateParametersRequest. */ + interface IUpdateParametersRequest { + + /** UpdateParametersRequest name */ + name?: (string|null); + + /** UpdateParametersRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters */ + parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + } + + /** Represents an UpdateParametersRequest. */ + class UpdateParametersRequest implements IUpdateParametersRequest { + + /** + * Constructs a new UpdateParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IUpdateParametersRequest); + + /** UpdateParametersRequest name. */ + public name: string; + + /** UpdateParametersRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateParametersRequest parameters. */ + public parameters?: (google.cloud.memcache.v1beta2.IMemcacheParameters|null); + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateParametersRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IUpdateParametersRequest): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @param message UpdateParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IUpdateParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Verifies an UpdateParametersRequest message. + * @param message Plain 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 UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.UpdateParametersRequest; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @param message UpdateParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.UpdateParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplySoftwareUpdateRequest. */ + interface IApplySoftwareUpdateRequest { + + /** ApplySoftwareUpdateRequest instance */ + instance?: (string|null); + + /** ApplySoftwareUpdateRequest nodeIds */ + nodeIds?: (string[]|null); + + /** ApplySoftwareUpdateRequest applyAll */ + applyAll?: (boolean|null); + } + + /** Represents an ApplySoftwareUpdateRequest. */ + class ApplySoftwareUpdateRequest implements IApplySoftwareUpdateRequest { + + /** + * Constructs a new ApplySoftwareUpdateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest); + + /** ApplySoftwareUpdateRequest instance. */ + public instance: string; + + /** ApplySoftwareUpdateRequest nodeIds. */ + public nodeIds: string[]; + + /** ApplySoftwareUpdateRequest applyAll. */ + public applyAll: boolean; + + /** + * Creates a new ApplySoftwareUpdateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplySoftwareUpdateRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @param message ApplySoftwareUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @param message ApplySoftwareUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Verifies an ApplySoftwareUpdateRequest message. + * @param message Plain 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 ApplySoftwareUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplySoftwareUpdateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest; + + /** + * Creates a plain object from an ApplySoftwareUpdateRequest message. Also converts values to other types if specified. + * @param message ApplySoftwareUpdateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplySoftwareUpdateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplySoftwareUpdateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MemcacheParameters. */ + interface IMemcacheParameters { + + /** MemcacheParameters id */ + id?: (string|null); + + /** MemcacheParameters params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a MemcacheParameters. */ + class MemcacheParameters implements IMemcacheParameters { + + /** + * Constructs a new MemcacheParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IMemcacheParameters); + + /** MemcacheParameters id. */ + public id: string; + + /** MemcacheParameters params. */ + public params: { [k: string]: string }; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns MemcacheParameters instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IMemcacheParameters): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @param message MemcacheParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IMemcacheParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Verifies a MemcacheParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MemcacheParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.MemcacheParameters; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @param message MemcacheParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.MemcacheParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MemcacheParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MemcacheParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusDetail */ + statusDetail?: (string|null); + + /** OperationMetadata cancelRequested */ + cancelRequested?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusDetail. */ + public statusDetail: string; + + /** OperationMetadata cancelRequested. */ + public cancelRequested: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IOperationMetadata): google.cloud.memcache.v1beta2.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata availableZones */ + availableZones?: ({ [k: string]: google.cloud.memcache.v1beta2.IZoneMetadata }|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.ILocationMetadata); + + /** LocationMetadata availableZones. */ + public availableZones: { [k: string]: google.cloud.memcache.v1beta2.IZoneMetadata }; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.ILocationMetadata): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZoneMetadata. */ + interface IZoneMetadata { + } + + /** Represents a ZoneMetadata. */ + class ZoneMetadata implements IZoneMetadata { + + /** + * Constructs a new ZoneMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IZoneMetadata); + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IZoneMetadata): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1beta2.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1beta2.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Verifies a ZoneMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.ZoneMetadata; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @param message ZoneMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.ZoneMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZoneMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js new file mode 100644 index 000000000000..1bfd3472deae --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.js @@ -0,0 +1,24400 @@ +// Copyright 2022 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_memcache_protos || ($protobuf.roots._google_cloud_memcache_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.memcache = (function() { + + /** + * Namespace memcache. + * @memberof google.cloud + * @namespace + */ + var memcache = {}; + + memcache.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.memcache + * @namespace + */ + var v1 = {}; + + v1.CloudMemcache = (function() { + + /** + * Constructs a new CloudMemcache service. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a CloudMemcache + * @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 CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; + + /** + * Creates new CloudMemcache service using the specified rpc implementation. + * @function create + * @memberof google.cloud.memcache.v1.CloudMemcache + * @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 {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + */ + CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|listInstances}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.memcache.v1.ListInstancesRequest, $root.google.cloud.memcache.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|getInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.memcache.v1.GetInstanceRequest, $root.google.cloud.memcache.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|createInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.memcache.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|updateParameters}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef UpdateParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { + return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateParameters" }); + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|deleteInstance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|applyParameters}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef ApplyParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { + return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyParameters" }); + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudMemcache; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.memcache.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [authorizedNetwork] Instance authorizedNetwork + * @property {Array.|null} [zones] Instance zones + * @property {number|null} [nodeCount] Instance nodeCount + * @property {google.cloud.memcache.v1.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig + * @property {google.cloud.memcache.v1.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] Instance parameters + * @property {Array.|null} [memcacheNodes] Instance memcacheNodes + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.memcache.v1.Instance.State|null} [state] Instance state + * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion + * @property {Array.|null} [instanceMessages] Instance instanceMessages + * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.memcache.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.zones = []; + this.memcacheNodes = []; + this.instanceMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance authorizedNetwork. + * @member {string} authorizedNetwork + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.authorizedNetwork = ""; + + /** + * Instance zones. + * @member {Array.} zones + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.zones = $util.emptyArray; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance nodeConfig. + * @member {google.cloud.memcache.v1.Instance.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.nodeConfig = null; + + /** + * Instance memcacheVersion. + * @member {google.cloud.memcache.v1.MemcacheVersion} memcacheVersion + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheVersion = 0; + + /** + * Instance parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.parameters = null; + + /** + * Instance memcacheNodes. + * @member {Array.} memcacheNodes + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheNodes = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.memcache.v1.Instance.State} state + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance memcacheFullVersion. + * @member {string} memcacheFullVersion + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.memcacheFullVersion = ""; + + /** + * Instance instanceMessages. + * @member {Array.} instanceMessages + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.instanceMessages = $util.emptyArray; + + /** + * Instance discoveryEndpoint. + * @member {string} discoveryEndpoint + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.discoveryEndpoint = ""; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + 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(); + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.memcache.v1.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.memcacheNodes != null && message.memcacheNodes.length) + for (var i = 0; i < message.memcacheNodes.length; ++i) + $root.google.cloud.memcache.v1.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); + if (message.instanceMessages != null && message.instanceMessages.length) + for (var i = 0; i < message.instanceMessages.length; ++i) + $root.google.cloud.memcache.v1.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = 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; + } + case 4: { + message.authorizedNetwork = reader.string(); + break; + } + case 5: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memcacheVersion = reader.int32(); + break; + } + case 11: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 18: { + message.memcacheFullVersion = reader.string(); + break; + } + case 19: { + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + } + case 20: { + message.discoveryEndpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (!$util.isString(message.authorizedNetwork)) + return "authorizedNetwork: string expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.memcache.v1.Instance.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + switch (message.memcacheVersion) { + default: + return "memcacheVersion: enum value expected"; + case 0: + case 1: + break; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { + if (!Array.isArray(message.memcacheNodes)) + return "memcacheNodes: array expected"; + for (var i = 0; i < message.memcacheNodes.length; ++i) { + var error = $root.google.cloud.memcache.v1.Instance.Node.verify(message.memcacheNodes[i]); + if (error) + return "memcacheNodes." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (!$util.isString(message.memcacheFullVersion)) + return "memcacheFullVersion: string expected"; + if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { + if (!Array.isArray(message.instanceMessages)) + return "instanceMessages: array expected"; + for (var i = 0; i < message.instanceMessages.length; ++i) { + var error = $root.google.cloud.memcache.v1.Instance.InstanceMessage.verify(message.instanceMessages[i]); + if (error) + return "instanceMessages." + error; + } + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (!$util.isString(message.discoveryEndpoint)) + return "discoveryEndpoint: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance) + return object; + var message = new $root.google.cloud.memcache.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.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.authorizedNetwork != null) + message.authorizedNetwork = String(object.authorizedNetwork); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.memcache.v1.Instance.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.fromObject(object.nodeConfig); + } + switch (object.memcacheVersion) { + case "MEMCACHE_VERSION_UNSPECIFIED": + case 0: + message.memcacheVersion = 0; + break; + case "MEMCACHE_1_5": + case 1: + message.memcacheVersion = 1; + break; + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + if (object.memcacheNodes) { + if (!Array.isArray(object.memcacheNodes)) + throw TypeError(".google.cloud.memcache.v1.Instance.memcacheNodes: array expected"); + message.memcacheNodes = []; + for (var i = 0; i < object.memcacheNodes.length; ++i) { + if (typeof object.memcacheNodes[i] !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.memcacheNodes: object expected"); + message.memcacheNodes[i] = $root.google.cloud.memcache.v1.Instance.Node.fromObject(object.memcacheNodes[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "PERFORMING_MAINTENANCE": + case 5: + message.state = 5; + break; + } + if (object.memcacheFullVersion != null) + message.memcacheFullVersion = String(object.memcacheFullVersion); + if (object.instanceMessages) { + if (!Array.isArray(object.instanceMessages)) + throw TypeError(".google.cloud.memcache.v1.Instance.instanceMessages: array expected"); + message.instanceMessages = []; + for (var i = 0; i < object.instanceMessages.length; ++i) { + if (typeof object.instanceMessages[i] !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.instanceMessages: object expected"); + message.instanceMessages[i] = $root.google.cloud.memcache.v1.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); + } + } + if (object.discoveryEndpoint != null) + message.discoveryEndpoint = String(object.discoveryEndpoint); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {google.cloud.memcache.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.zones = []; + object.memcacheNodes = []; + object.instanceMessages = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.authorizedNetwork = ""; + object.nodeCount = 0; + object.nodeConfig = null; + object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; + object.parameters = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.memcacheFullVersion = ""; + object.discoveryEndpoint = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + object.authorizedNetwork = message.authorizedNetwork; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.memcache.v1.Instance.NodeConfig.toObject(message.nodeConfig, options); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + if (message.memcacheNodes && message.memcacheNodes.length) { + object.memcacheNodes = []; + for (var j = 0; j < message.memcacheNodes.length; ++j) + object.memcacheNodes[j] = $root.google.cloud.memcache.v1.Instance.Node.toObject(message.memcacheNodes[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1.Instance.State[message.state] : message.state; + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + object.memcacheFullVersion = message.memcacheFullVersion; + if (message.instanceMessages && message.instanceMessages.length) { + object.instanceMessages = []; + for (var j = 0; j < message.instanceMessages.length; ++j) + object.instanceMessages[j] = $root.google.cloud.memcache.v1.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + object.discoveryEndpoint = message.discoveryEndpoint; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance"; + }; + + Instance.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.memcache.v1.Instance + * @interface INodeConfig + * @property {number|null} [cpuCount] NodeConfig cpuCount + * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.memcache.v1.Instance.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(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]]; + } + + /** + * NodeConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.cpuCount = 0; + + /** + * NodeConfig memorySizeMb. + * @member {number} memorySizeMb + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.memorySizeMb = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 2: { + message.memorySizeMb = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (!$util.isInteger(message.memorySizeMb)) + return "memorySizeMb: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.NodeConfig) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.NodeConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memorySizeMb != null) + message.memorySizeMb = object.memorySizeMb | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1.Instance.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.memorySizeMb = 0; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + object.memorySizeMb = message.memorySizeMb; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.NodeConfig"; + }; + + return NodeConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.memcache.v1.Instance + * @interface INode + * @property {string|null} [nodeId] Node nodeId + * @property {string|null} [zone] Node zone + * @property {google.cloud.memcache.v1.Instance.Node.State|null} [state] Node state + * @property {string|null} [host] Node host + * @property {number|null} [port] Node port + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] Node parameters + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.memcache.v1.Instance.INode=} [properties] Properties to set + */ + function Node(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]]; + } + + /** + * Node nodeId. + * @member {string} nodeId + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.nodeId = ""; + + /** + * Node zone. + * @member {string} zone + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.zone = ""; + + /** + * Node state. + * @member {google.cloud.memcache.v1.Instance.Node.State} state + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.state = 0; + + /** + * Node host. + * @member {string} host + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.host = ""; + + /** + * Node port. + * @member {number} port + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.port = 0; + + /** + * Node parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + */ + Node.prototype.parameters = null; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeId = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.host = reader.string(); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + case 6: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string 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: + break; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.Node) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.Node(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.zone != null) + message.zone = String(object.zone); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.Node.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {google.cloud.memcache.v1.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.zone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + object.port = 0; + object.parameters = null; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1.Instance.Node.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.Node"; + }; + + /** + * State enum. + * @name google.cloud.memcache.v1.Instance.Node.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=3 DELETING value + * @property {number} UPDATING=4 UPDATING value + */ + Node.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + return values; + })(); + + return Node; + })(); + + Instance.InstanceMessage = (function() { + + /** + * Properties of an InstanceMessage. + * @memberof google.cloud.memcache.v1.Instance + * @interface IInstanceMessage + * @property {google.cloud.memcache.v1.Instance.InstanceMessage.Code|null} [code] InstanceMessage code + * @property {string|null} [message] InstanceMessage message + */ + + /** + * Constructs a new InstanceMessage. + * @memberof google.cloud.memcache.v1.Instance + * @classdesc Represents an InstanceMessage. + * @implements IInstanceMessage + * @constructor + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage=} [properties] Properties to set + */ + function InstanceMessage(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]]; + } + + /** + * InstanceMessage code. + * @member {google.cloud.memcache.v1.Instance.InstanceMessage.Code} code + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.code = 0; + + /** + * InstanceMessage message. + * @member {string} message + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.message = ""; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage instance + */ + InstanceMessage.create = function create(properties) { + return new InstanceMessage(properties); + }; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.Instance.InstanceMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.Instance.InstanceMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceMessage message. + * @function verify + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.Instance.InstanceMessage} InstanceMessage + */ + InstanceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.Instance.InstanceMessage) + return object; + var message = new $root.google.cloud.memcache.v1.Instance.InstanceMessage(); + switch (object.code) { + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "ZONE_DISTRIBUTION_UNBALANCED": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1.Instance.InstanceMessage} message InstanceMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.memcache.v1.Instance.InstanceMessage.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this InstanceMessage to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @instance + * @returns {Object.} JSON object + */ + InstanceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceMessage + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.Instance.InstanceMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.Instance.InstanceMessage"; + }; + + /** + * Code enum. + * @name google.cloud.memcache.v1.Instance.InstanceMessage.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value + */ + InstanceMessage.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; + return values; + })(); + + return InstanceMessage; + })(); + + /** + * State enum. + * @name google.cloud.memcache.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + + return Instance; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.memcache.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(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]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.memcache.v1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.memcache.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.memcache.v1.Instance.encode(message.instances[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.memcache.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.memcache.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.memcache.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.memcache.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.memcache.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.memcache.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(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]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.memcache.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(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]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.memcache.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.memcache.v1.IInstance|null} [instance] UpdateInstanceRequest instance + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(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]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(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]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.ApplyParametersRequest = (function() { + + /** + * Properties of an ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IApplyParametersRequest + * @property {string|null} [name] ApplyParametersRequest name + * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds + * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + */ + + /** + * Constructs a new ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an ApplyParametersRequest. + * @implements IApplyParametersRequest + * @constructor + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + */ + function ApplyParametersRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.name = ""; + + /** + * ApplyParametersRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplyParametersRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.applyAll = false; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest instance + */ + ApplyParametersRequest.create = function create(properties) { + return new ApplyParametersRequest(properties); + }; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.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.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyParametersRequest.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.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + */ + ApplyParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ApplyParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1.ApplyParametersRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.ApplyParametersRequest} message ApplyParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.applyAll = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplyParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ApplyParametersRequest"; + }; + + return ApplyParametersRequest; + })(); + + v1.UpdateParametersRequest = (function() { + + /** + * Properties of an UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IUpdateParametersRequest + * @property {string|null} [name] UpdateParametersRequest name + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters + */ + + /** + * Constructs a new UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an UpdateParametersRequest. + * @implements IUpdateParametersRequest + * @constructor + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + */ + function UpdateParametersRequest(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]]; + } + + /** + * UpdateParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.name = ""; + + /** + * UpdateParametersRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.updateMask = null; + + /** + * UpdateParametersRequest parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.parameters = null; + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest instance + */ + UpdateParametersRequest.create = function create(properties) { + return new UpdateParametersRequest(properties); + }; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParametersRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + */ + UpdateParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.UpdateParametersRequest} message UpdateParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateMask = null; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateParametersRequest"; + }; + + return UpdateParametersRequest; + })(); + + v1.MemcacheParameters = (function() { + + /** + * Properties of a MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @interface IMemcacheParameters + * @property {string|null} [id] MemcacheParameters id + * @property {Object.|null} [params] MemcacheParameters params + */ + + /** + * Constructs a new MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a MemcacheParameters. + * @implements IMemcacheParameters + * @constructor + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + */ + function MemcacheParameters(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MemcacheParameters id. + * @member {string} id + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.id = ""; + + /** + * MemcacheParameters params. + * @member {Object.} params + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.params = $util.emptyObject; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters instance + */ + MemcacheParameters.create = function create(properties) { + return new MemcacheParameters(properties); + }; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.MemcacheParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemcacheParameters message. + * @function verify + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemcacheParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + */ + MemcacheParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.MemcacheParameters) + return object; + var message = new $root.google.cloud.memcache.v1.MemcacheParameters(); + if (object.id != null) + message.id = String(object.id); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.memcache.v1.MemcacheParameters.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.MemcacheParameters} message MemcacheParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemcacheParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this MemcacheParameters to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @instance + * @returns {Object.} JSON object + */ + MemcacheParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MemcacheParameters + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.MemcacheParameters"; + }; + + return MemcacheParameters; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [cancelRequested] OperationMetadata cancelRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusDetail = reader.string(); + break; + } + case 6: { + message.cancelRequested = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: string expected"; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusDetail = ""; + object.cancelRequested = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1.MemcacheVersion + * @enum {number} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + + return v1; + })(); + + memcache.v1beta2 = (function() { + + /** + * Namespace v1beta2. + * @memberof google.cloud.memcache + * @namespace + */ + var v1beta2 = {}; + + v1beta2.CloudMemcache = (function() { + + /** + * Constructs a new CloudMemcache service. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a CloudMemcache + * @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 CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; + + /** + * Creates new CloudMemcache service using the specified rpc implementation. + * @function create + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @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 {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + */ + CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.memcache.v1beta2.ListInstancesRequest, $root.google.cloud.memcache.v1beta2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.memcache.v1beta2.GetInstanceRequest, $root.google.cloud.memcache.v1beta2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|createInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.memcache.v1beta2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { + return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1beta2.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateParameters" }); + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|deleteInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplyParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { + return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1beta2.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyParameters" }); + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplySoftwareUpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applySoftwareUpdate = function applySoftwareUpdate(request, callback) { + return this.rpcCall(applySoftwareUpdate, $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplySoftwareUpdate" }); + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudMemcache; + })(); + + v1beta2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.memcache.v1beta2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [authorizedNetwork] Instance authorizedNetwork + * @property {Array.|null} [zones] Instance zones + * @property {number|null} [nodeCount] Instance nodeCount + * @property {google.cloud.memcache.v1beta2.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig + * @property {google.cloud.memcache.v1beta2.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Instance parameters + * @property {Array.|null} [memcacheNodes] Instance memcacheNodes + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.memcache.v1beta2.Instance.State|null} [state] Instance state + * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion + * @property {Array.|null} [instanceMessages] Instance instanceMessages + * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + * @property {boolean|null} [updateAvailable] Instance updateAvailable + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.zones = []; + this.memcacheNodes = []; + this.instanceMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance authorizedNetwork. + * @member {string} authorizedNetwork + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.authorizedNetwork = ""; + + /** + * Instance zones. + * @member {Array.} zones + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.zones = $util.emptyArray; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance nodeConfig. + * @member {google.cloud.memcache.v1beta2.Instance.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeConfig = null; + + /** + * Instance memcacheVersion. + * @member {google.cloud.memcache.v1beta2.MemcacheVersion} memcacheVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheVersion = 0; + + /** + * Instance parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.parameters = null; + + /** + * Instance memcacheNodes. + * @member {Array.} memcacheNodes + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheNodes = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.memcache.v1beta2.Instance.State} state + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance memcacheFullVersion. + * @member {string} memcacheFullVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheFullVersion = ""; + + /** + * Instance instanceMessages. + * @member {Array.} instanceMessages + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.instanceMessages = $util.emptyArray; + + /** + * Instance discoveryEndpoint. + * @member {string} discoveryEndpoint + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.discoveryEndpoint = ""; + + /** + * Instance updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateAvailable = false; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + 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(); + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.memcacheNodes != null && message.memcacheNodes.length) + for (var i = 0; i < message.memcacheNodes.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); + if (message.instanceMessages != null && message.instanceMessages.length) + for (var i = 0; i < message.instanceMessages.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.updateAvailable); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = 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; + } + case 4: { + message.authorizedNetwork = reader.string(); + break; + } + case 5: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memcacheVersion = reader.int32(); + break; + } + case 11: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 18: { + message.memcacheFullVersion = reader.string(); + break; + } + case 19: { + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + } + case 20: { + message.discoveryEndpoint = reader.string(); + break; + } + case 21: { + message.updateAvailable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (!$util.isString(message.authorizedNetwork)) + return "authorizedNetwork: string expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + switch (message.memcacheVersion) { + default: + return "memcacheVersion: enum value expected"; + case 0: + case 1: + break; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { + if (!Array.isArray(message.memcacheNodes)) + return "memcacheNodes: array expected"; + for (var i = 0; i < message.memcacheNodes.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.Node.verify(message.memcacheNodes[i]); + if (error) + return "memcacheNodes." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (!$util.isString(message.memcacheFullVersion)) + return "memcacheFullVersion: string expected"; + if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { + if (!Array.isArray(message.instanceMessages)) + return "instanceMessages: array expected"; + for (var i = 0; i < message.instanceMessages.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify(message.instanceMessages[i]); + if (error) + return "instanceMessages." + error; + } + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (!$util.isString(message.discoveryEndpoint)) + return "discoveryEndpoint: string expected"; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.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.authorizedNetwork != null) + message.authorizedNetwork = String(object.authorizedNetwork); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.fromObject(object.nodeConfig); + } + switch (object.memcacheVersion) { + case "MEMCACHE_VERSION_UNSPECIFIED": + case 0: + message.memcacheVersion = 0; + break; + case "MEMCACHE_1_5": + case 1: + message.memcacheVersion = 1; + break; + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + if (object.memcacheNodes) { + if (!Array.isArray(object.memcacheNodes)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: array expected"); + message.memcacheNodes = []; + for (var i = 0; i < object.memcacheNodes.length; ++i) { + if (typeof object.memcacheNodes[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: object expected"); + message.memcacheNodes[i] = $root.google.cloud.memcache.v1beta2.Instance.Node.fromObject(object.memcacheNodes[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "PERFORMING_MAINTENANCE": + case 5: + message.state = 5; + break; + } + if (object.memcacheFullVersion != null) + message.memcacheFullVersion = String(object.memcacheFullVersion); + if (object.instanceMessages) { + if (!Array.isArray(object.instanceMessages)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: array expected"); + message.instanceMessages = []; + for (var i = 0; i < object.instanceMessages.length; ++i) { + if (typeof object.instanceMessages[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: object expected"); + message.instanceMessages[i] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); + } + } + if (object.discoveryEndpoint != null) + message.discoveryEndpoint = String(object.discoveryEndpoint); + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.zones = []; + object.memcacheNodes = []; + object.instanceMessages = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.authorizedNetwork = ""; + object.nodeCount = 0; + object.nodeConfig = null; + object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; + object.parameters = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.memcacheFullVersion = ""; + object.discoveryEndpoint = ""; + object.updateAvailable = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + 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.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + object.authorizedNetwork = message.authorizedNetwork; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.toObject(message.nodeConfig, options); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.memcacheNodes && message.memcacheNodes.length) { + object.memcacheNodes = []; + for (var j = 0; j < message.memcacheNodes.length; ++j) + object.memcacheNodes[j] = $root.google.cloud.memcache.v1beta2.Instance.Node.toObject(message.memcacheNodes[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.State[message.state] : message.state; + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + object.memcacheFullVersion = message.memcacheFullVersion; + if (message.instanceMessages && message.instanceMessages.length) { + object.instanceMessages = []; + for (var j = 0; j < message.instanceMessages.length; ++j) + object.instanceMessages[j] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + object.discoveryEndpoint = message.discoveryEndpoint; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance"; + }; + + Instance.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INodeConfig + * @property {number|null} [cpuCount] NodeConfig cpuCount + * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(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]]; + } + + /** + * NodeConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.cpuCount = 0; + + /** + * NodeConfig memorySizeMb. + * @member {number} memorySizeMb + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.memorySizeMb = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 2: { + message.memorySizeMb = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (!$util.isInteger(message.memorySizeMb)) + return "memorySizeMb: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.NodeConfig) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memorySizeMb != null) + message.memorySizeMb = object.memorySizeMb | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.memorySizeMb = 0; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + object.memorySizeMb = message.memorySizeMb; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.NodeConfig"; + }; + + return NodeConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INode + * @property {string|null} [nodeId] Node nodeId + * @property {string|null} [zone] Node zone + * @property {google.cloud.memcache.v1beta2.Instance.Node.State|null} [state] Node state + * @property {string|null} [host] Node host + * @property {number|null} [port] Node port + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Node parameters + * @property {boolean|null} [updateAvailable] Node updateAvailable + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + */ + function Node(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]]; + } + + /** + * Node nodeId. + * @member {string} nodeId + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.nodeId = ""; + + /** + * Node zone. + * @member {string} zone + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.zone = ""; + + /** + * Node state. + * @member {google.cloud.memcache.v1beta2.Instance.Node.State} state + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.state = 0; + + /** + * Node host. + * @member {string} host + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.host = ""; + + /** + * Node port. + * @member {number} port + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.port = 0; + + /** + * Node parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.parameters = null; + + /** + * Node updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.updateAvailable = false; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.updateAvailable); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeId = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.host = reader.string(); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + case 6: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateAvailable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string 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: + break; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.Node) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.zone != null) + message.zone = String(object.zone); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.Node.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.zone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + object.port = 0; + object.parameters = null; + object.updateAvailable = false; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.Node"; + }; + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.Node.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=3 DELETING value + * @property {number} UPDATING=4 UPDATING value + */ + Node.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + return values; + })(); + + return Node; + })(); + + Instance.InstanceMessage = (function() { + + /** + * Properties of an InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface IInstanceMessage + * @property {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null} [code] InstanceMessage code + * @property {string|null} [message] InstanceMessage message + */ + + /** + * Constructs a new InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents an InstanceMessage. + * @implements IInstanceMessage + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + */ + function InstanceMessage(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]]; + } + + /** + * InstanceMessage code. + * @member {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code} code + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.code = 0; + + /** + * InstanceMessage message. + * @member {string} message + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.message = ""; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage instance + */ + InstanceMessage.create = function create(properties) { + return new InstanceMessage(properties); + }; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceMessage message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + */ + InstanceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); + switch (object.code) { + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "ZONE_DISTRIBUTION_UNBALANCED": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.InstanceMessage} message InstanceMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this InstanceMessage to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + * @returns {Object.} JSON object + */ + InstanceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceMessage + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.InstanceMessage"; + }; + + /** + * Code enum. + * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value + */ + InstanceMessage.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; + return values; + })(); + + return InstanceMessage; + })(); + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + + return Instance; + })(); + + v1beta2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(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]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ListInstancesRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {google.cloud.memcache.v1beta2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1beta2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.memcache.v1beta2 + * @interface IListInstancesResponse + * @property {Array.|null} [resources] ListInstancesResponse resources + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.resources = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse resources. + * @member {Array.} resources + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.resources = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resources[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ListInstancesResponse) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ListInstancesResponse(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.memcache.v1beta2.ListInstancesResponse.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.ListInstancesResponse.resources: object expected"); + message.resources[i] = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.memcache.v1beta2.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {google.cloud.memcache.v1beta2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1beta2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(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]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.GetInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1beta2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.memcache.v1beta2.IInstance|null} [resource] CreateInstanceRequest resource + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(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]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest resource. + * @member {google.cloud.memcache.v1beta2.IInstance|null|undefined} resource + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.resource = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.CreateInstanceRequest.resource: object expected"); + message.resource = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.resource = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resource, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1beta2.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.memcache.v1beta2.IInstance|null} [resource] UpdateInstanceRequest resource + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(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]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest resource. + * @member {google.cloud.memcache.v1beta2.IInstance|null|undefined} resource + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.resource = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.memcache.v1beta2.Instance.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.resource = $root.google.cloud.memcache.v1beta2.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateInstanceRequest.resource: object expected"); + message.resource = $root.google.cloud.memcache.v1beta2.Instance.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.resource = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.memcache.v1beta2.Instance.toObject(message.resource, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1beta2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(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]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1beta2.ApplyParametersRequest = (function() { + + /** + * Properties of an ApplyParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IApplyParametersRequest + * @property {string|null} [name] ApplyParametersRequest name + * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds + * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + */ + + /** + * Constructs a new ApplyParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an ApplyParametersRequest. + * @implements IApplyParametersRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest=} [properties] Properties to set + */ + function ApplyParametersRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.name = ""; + + /** + * ApplyParametersRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplyParametersRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + */ + ApplyParametersRequest.prototype.applyAll = false; + + /** + * Creates a new ApplyParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest instance + */ + ApplyParametersRequest.create = function create(properties) { + return new ApplyParametersRequest(properties); + }; + + /** + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.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.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplyParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ApplyParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyParametersRequest.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.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ApplyParametersRequest} ApplyParametersRequest + */ + ApplyParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ApplyParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ApplyParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1beta2.ApplyParametersRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.ApplyParametersRequest} message ApplyParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.applyAll = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplyParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplyParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ApplyParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ApplyParametersRequest"; + }; + + return ApplyParametersRequest; + })(); + + v1beta2.UpdateParametersRequest = (function() { + + /** + * Properties of an UpdateParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IUpdateParametersRequest + * @property {string|null} [name] UpdateParametersRequest name + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters + */ + + /** + * Constructs a new UpdateParametersRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an UpdateParametersRequest. + * @implements IUpdateParametersRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest=} [properties] Properties to set + */ + function UpdateParametersRequest(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]]; + } + + /** + * UpdateParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.name = ""; + + /** + * UpdateParametersRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.updateMask = null; + + /** + * UpdateParametersRequest parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + */ + UpdateParametersRequest.prototype.parameters = null; + + /** + * Creates a new UpdateParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest instance + */ + UpdateParametersRequest.create = function create(properties) { + return new UpdateParametersRequest(properties); + }; + + /** + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.UpdateParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.UpdateParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParametersRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.UpdateParametersRequest} UpdateParametersRequest + */ + UpdateParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.UpdateParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.UpdateParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateParametersRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.UpdateParametersRequest.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1beta2.UpdateParametersRequest} message UpdateParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateMask = null; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.UpdateParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.UpdateParametersRequest"; + }; + + return UpdateParametersRequest; + })(); + + v1beta2.ApplySoftwareUpdateRequest = (function() { + + /** + * Properties of an ApplySoftwareUpdateRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IApplySoftwareUpdateRequest + * @property {string|null} [instance] ApplySoftwareUpdateRequest instance + * @property {Array.|null} [nodeIds] ApplySoftwareUpdateRequest nodeIds + * @property {boolean|null} [applyAll] ApplySoftwareUpdateRequest applyAll + */ + + /** + * Constructs a new ApplySoftwareUpdateRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an ApplySoftwareUpdateRequest. + * @implements IApplySoftwareUpdateRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest=} [properties] Properties to set + */ + function ApplySoftwareUpdateRequest(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplySoftwareUpdateRequest instance. + * @member {string} instance + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.instance = ""; + + /** + * ApplySoftwareUpdateRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.nodeIds = $util.emptyArray; + + /** + * ApplySoftwareUpdateRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + */ + ApplySoftwareUpdateRequest.prototype.applyAll = false; + + /** + * Creates a new ApplySoftwareUpdateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest instance + */ + ApplySoftwareUpdateRequest.create = function create(properties) { + return new ApplySoftwareUpdateRequest(properties); + }; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplySoftwareUpdateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + if (message.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; + + /** + * Encodes the specified ApplySoftwareUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplySoftwareUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplySoftwareUpdateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplySoftwareUpdateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplySoftwareUpdateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplySoftwareUpdateRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplySoftwareUpdateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; + + /** + * Creates an ApplySoftwareUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} ApplySoftwareUpdateRequest + */ + ApplySoftwareUpdateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; + + /** + * Creates a plain object from an ApplySoftwareUpdateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest} message ApplySoftwareUpdateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplySoftwareUpdateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.instance = ""; + object.applyAll = false; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; + + /** + * Converts this ApplySoftwareUpdateRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @instance + * @returns {Object.} JSON object + */ + ApplySoftwareUpdateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplySoftwareUpdateRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplySoftwareUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest"; + }; + + return ApplySoftwareUpdateRequest; + })(); + + v1beta2.MemcacheParameters = (function() { + + /** + * Properties of a MemcacheParameters. + * @memberof google.cloud.memcache.v1beta2 + * @interface IMemcacheParameters + * @property {string|null} [id] MemcacheParameters id + * @property {Object.|null} [params] MemcacheParameters params + */ + + /** + * Constructs a new MemcacheParameters. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a MemcacheParameters. + * @implements IMemcacheParameters + * @constructor + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters=} [properties] Properties to set + */ + function MemcacheParameters(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MemcacheParameters id. + * @member {string} id + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.id = ""; + + /** + * MemcacheParameters params. + * @member {Object.} params + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + */ + MemcacheParameters.prototype.params = $util.emptyObject; + + /** + * Creates a new MemcacheParameters instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters instance + */ + MemcacheParameters.create = function create(properties) { + return new MemcacheParameters(properties); + }; + + /** + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.MemcacheParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MemcacheParameters message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MemcacheParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.MemcacheParameters} MemcacheParameters + */ + MemcacheParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.MemcacheParameters) + return object; + var message = new $root.google.cloud.memcache.v1beta2.MemcacheParameters(); + if (object.id != null) + message.id = String(object.id); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.MemcacheParameters.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1beta2.MemcacheParameters} message MemcacheParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MemcacheParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this MemcacheParameters to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @instance + * @returns {Object.} JSON object + */ + MemcacheParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MemcacheParameters + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.MemcacheParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.MemcacheParameters"; + }; + + return MemcacheParameters; + })(); + + v1beta2.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [cancelRequested] OperationMetadata cancelRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusDetail = reader.string(); + break; + } + case 6: { + message.cancelRequested = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: string expected"; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.OperationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1beta2.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusDetail = ""; + object.cancelRequested = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1beta2.MemcacheVersion + * @enum {number} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1beta2.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + + v1beta2.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @interface ILocationMetadata + * @property {Object.|null} [availableZones] LocationMetadata availableZones + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.availableZones = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata availableZones. + * @member {Object.} availableZones + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @instance + */ + LocationMetadata.prototype.availableZones = $util.emptyObject; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) + for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.memcache.v1beta2.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.availableZones === $util.emptyObject) + message.availableZones = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.memcache.v1beta2.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.availableZones[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableZones != null && message.hasOwnProperty("availableZones")) { + if (!$util.isObject(message.availableZones)) + return "availableZones: object expected"; + var key = Object.keys(message.availableZones); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.ZoneMetadata.verify(message.availableZones[key[i]]); + if (error) + return "availableZones." + error; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.LocationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1beta2.LocationMetadata(); + if (object.availableZones) { + if (typeof object.availableZones !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.LocationMetadata.availableZones: object expected"); + message.availableZones = {}; + for (var keys = Object.keys(object.availableZones), i = 0; i < keys.length; ++i) { + if (typeof object.availableZones[keys[i]] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.LocationMetadata.availableZones: object expected"); + message.availableZones[keys[i]] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.fromObject(object.availableZones[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {google.cloud.memcache.v1beta2.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.availableZones = {}; + var keys2; + if (message.availableZones && (keys2 = Object.keys(message.availableZones)).length) { + object.availableZones = {}; + for (var j = 0; j < keys2.length; ++j) + object.availableZones[keys2[j]] = $root.google.cloud.memcache.v1beta2.ZoneMetadata.toObject(message.availableZones[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v1beta2.ZoneMetadata = (function() { + + /** + * Properties of a ZoneMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @interface IZoneMetadata + */ + + /** + * Constructs a new ZoneMetadata. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a ZoneMetadata. + * @implements IZoneMetadata + * @constructor + * @param {google.cloud.memcache.v1beta2.IZoneMetadata=} [properties] Properties to set + */ + function ZoneMetadata(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 ZoneMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata instance + */ + ZoneMetadata.create = function create(properties) { + return new ZoneMetadata(properties); + }; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.ZoneMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1beta2.ZoneMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.ZoneMetadata} ZoneMetadata + */ + ZoneMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.ZoneMetadata) + return object; + return new $root.google.cloud.memcache.v1beta2.ZoneMetadata(); + }; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1beta2.ZoneMetadata} message ZoneMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ZoneMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @instance + * @returns {Object.} JSON object + */ + ZoneMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZoneMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.ZoneMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZoneMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.ZoneMetadata"; + }; + + return ZoneMetadata; + })(); + + return v1beta2; + })(); + + return memcache; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json new file mode 100644 index 000000000000..c2caeed30cd0 --- /dev/null +++ b/packages/google-cloud-memcache/protos/protos.json @@ -0,0 +1,2792 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "memcache": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/memcache/v1;memcache", + "java_multiple_files": true, + "java_outer_classname": "CloudMemcacheProto", + "java_package": "com.google.cloud.memcache.v1" + }, + "nested": { + "CloudMemcache": { + "options": { + "(google.api.default_host)": "memcache.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + }, + "UpdateParameters": { + "requestType": "UpdateParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{name=projects/*/locations/*/instances/*}:updateParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,update_mask,parameters", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=projects/*/locations/*/instances/*}:updateParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,update_mask,parameters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + }, + "ApplyParameters": { + "requestType": "ApplyParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:applyParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:applyParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "memcache.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "authorizedNetwork": { + "type": "string", + "id": 4 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "nodeCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memcacheVersion": { + "type": "MemcacheVersion", + "id": 9 + }, + "parameters": { + "type": "MemcacheParameters", + "id": 11 + }, + "memcacheNodes": { + "rule": "repeated", + "type": "Node", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memcacheFullVersion": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceMessages": { + "rule": "repeated", + "type": "InstanceMessage", + "id": 19 + }, + "discoveryEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memorySizeMb": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Node": { + "fields": { + "nodeId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "host": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "port": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 3, + "UPDATING": 4 + } + } + } + }, + "InstanceMessage": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "ZONE_DISTRIBUTION_UNBALANCED": 1 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "ApplyParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 3 + } + } + }, + "MemcacheParameters": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusDetail": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelRequested": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + } + } + }, + "v1beta2": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/memcache/v1beta2;memcache", + "java_multiple_files": true, + "java_outer_classname": "CloudMemcacheProto", + "java_package": "com.google.cloud.memcache.v1beta2" + }, + "nested": { + "CloudMemcache": { + "options": { + "(google.api.default_host)": "memcache.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1beta2/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1beta2/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "resource", + "(google.api.method_signature)": "parent,instance_id,resource", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{parent=projects/*/locations/*}/instances", + "body": "resource" + } + }, + { + "(google.api.method_signature)": "parent,instance_id,resource" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta2/{resource.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "resource", + "(google.api.method_signature)": "update_mask,resource", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta2/{resource.name=projects/*/locations/*/instances/*}", + "body": "resource" + } + }, + { + "(google.api.method_signature)": "update_mask,resource" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + }, + "UpdateParameters": { + "requestType": "UpdateParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,update_mask,parameters", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta2/{name=projects/*/locations/*/instances/*}:updateParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,update_mask,parameters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta2/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + }, + "ApplyParameters": { + "requestType": "ApplyParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{name=projects/*/locations/*/instances/*}:applyParameters", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + }, + "ApplySoftwareUpdate": { + "requestType": "ApplySoftwareUpdateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance,node_ids,apply_all", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:applySoftwareUpdate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance,node_ids,apply_all" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "memcache.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "authorizedNetwork": { + "type": "string", + "id": 4 + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "nodeCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memcacheVersion": { + "type": "MemcacheVersion", + "id": 9 + }, + "parameters": { + "type": "MemcacheParameters", + "id": 11 + }, + "memcacheNodes": { + "rule": "repeated", + "type": "Node", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memcacheFullVersion": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceMessages": { + "rule": "repeated", + "type": "InstanceMessage", + "id": 19 + }, + "discoveryEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateAvailable": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "memorySizeMb": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Node": { + "fields": { + "nodeId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "host": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "port": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 6 + }, + "updateAvailable": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 3, + "UPDATING": 4 + } + } + } + }, + "InstanceMessage": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "ZONE_DISTRIBUTION_UNBALANCED": 1 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "resources": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + } + } + }, + "ApplyParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "MemcacheParameters", + "id": 3 + } + } + }, + "ApplySoftwareUpdateRequest": { + "fields": { + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "nodeIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "applyAll": { + "type": "bool", + "id": 3 + } + } + }, + "MemcacheParameters": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusDetail": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelRequested": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + }, + "LocationMetadata": { + "fields": { + "availableZones": { + "keyType": "string", + "type": "ZoneMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ZoneMetadata": { + "fields": {} + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-memcache/samples/README.md b/packages/google-cloud-memcache/samples/README.md new file mode 100644 index 000000000000..e063dd9547e3 --- /dev/null +++ b/packages/google-cloud-memcache/samples/README.md @@ -0,0 +1,338 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Memorystore for Memcached: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Cloud_memcache.apply_parameters](#cloud_memcache.apply_parameters) + * [Cloud_memcache.create_instance](#cloud_memcache.create_instance) + * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) + * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) + * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) + * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) + * [Cloud_memcache.apply_parameters](#cloud_memcache.apply_parameters) + * [Cloud_memcache.apply_software_update](#cloud_memcache.apply_software_update) + * [Cloud_memcache.create_instance](#cloud_memcache.create_instance) + * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) + * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) + * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) + * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Cloud_memcache.apply_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js` + + +----- + + + + +### Cloud_memcache.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js` + + +----- + + + + +### Cloud_memcache.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js` + + +----- + + + + +### Cloud_memcache.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js` + + +----- + + + + +### Cloud_memcache.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js` + + +----- + + + + +### Cloud_memcache.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js` + + +----- + + + + +### Cloud_memcache.update_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js` + + +----- + + + + +### Cloud_memcache.apply_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js` + + +----- + + + + +### Cloud_memcache.apply_software_update + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js` + + +----- + + + + +### Cloud_memcache.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js` + + +----- + + + + +### Cloud_memcache.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js` + + +----- + + + + +### Cloud_memcache.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js` + + +----- + + + + +### Cloud_memcache.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js` + + +----- + + + + +### Cloud_memcache.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js` + + +----- + + + + +### Cloud_memcache.update_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/memorystore/docs/memcached diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js new file mode 100644 index 000000000000..0ea4aa54a92f --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1_generated_CloudMemcache_ApplyParameters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + */ + // const name = 'abc123' + /** + * Nodes to which we should apply the instance-level parameter group. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplyParameters() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.applyParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplyParameters(); + // [END memcache_v1_generated_CloudMemcache_ApplyParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js new file mode 100644 index 000000000000..86daa8740368 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js @@ -0,0 +1,81 @@ +// Copyright 2022 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'; + +function main(parent, instanceId, instance) { + // [START memcache_v1_generated_CloudMemcache_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * If any of the above are not met, will raise an invalid argument error. + */ + // const instanceId = 'abc123' + /** + * Required. A Memcached Instance + */ + // const instance = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await memcacheClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END memcache_v1_generated_CloudMemcache_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js new file mode 100644 index 000000000000..488f1e5b165f --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1_generated_CloudMemcache_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END memcache_v1_generated_CloudMemcache_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js new file mode 100644 index 000000000000..800c25eb3598 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1_generated_CloudMemcache_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await memcacheClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END memcache_v1_generated_CloudMemcache_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js new file mode 100644 index 000000000000..c0518a8c2f47 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js @@ -0,0 +1,88 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START memcache_v1_generated_CloudMemcache_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END memcache_v1_generated_CloudMemcache_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js new file mode 100644 index 000000000000..6aa546dd0bf6 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(updateMask, instance) { + // [START memcache_v1_generated_CloudMemcache_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + * * `displayName` + */ + // const updateMask = {} + /** + * Required. A Memcached Instance. + * Only fields specified in update_mask are updated. + */ + // const instance = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + updateMask, + instance, + }; + + // Run request + const [operation] = await memcacheClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END memcache_v1_generated_CloudMemcache_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js new file mode 100644 index 000000000000..9557f67fa740 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(name, updateMask) { + // [START memcache_v1_generated_CloudMemcache_UpdateParameters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + */ + // const name = 'abc123' + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * The parameters to apply to the instance. + */ + // const parameters = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateParameters() { + // Construct request + const request = { + name, + updateMask, + }; + + // Run request + const [operation] = await memcacheClient.updateParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateParameters(); + // [END memcache_v1_generated_CloudMemcache_UpdateParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json new file mode 100644 index 000000000000..1f01c932f6d9 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -0,0 +1,339 @@ +{ + "clientLibrary": { + "name": "nodejs-memcache", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "memcache_v1_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.memcache.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " ApplyParameters will restart the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js new file mode 100644 index 000000000000..f09d814ae765 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + */ + // const name = 'abc123' + /** + * Nodes to which the instance-level parameter group is applied. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply instance-level parameter group to all nodes. If set to + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplyParameters() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.applyParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplyParameters(); + // [END memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js new file mode 100644 index 000000000000..fe2719cea26f --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_software_update.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(instance) { + // [START memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which software update should be + * applied. + */ + // const instance = 'abc123' + /** + * Nodes to which we should apply the update to. Note all the selected nodes + * are updated in parallel. + */ + // const nodeIds = 'abc123' + /** + * Whether to apply the update to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * software update to all nodes (where applicable) within the instance. + */ + // const applyAll = true + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callApplySoftwareUpdate() { + // Construct request + const request = { + instance, + }; + + // Run request + const [operation] = await memcacheClient.applySoftwareUpdate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplySoftwareUpdate(); + // [END memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js new file mode 100644 index 000000000000..7da201922040 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.create_instance.js @@ -0,0 +1,81 @@ +// Copyright 2022 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'; + +function main(parent, instanceId, resource) { + // [START memcache_v1beta2_generated_CloudMemcache_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location. + * If any of the above are not met, the API raises an invalid argument error. + */ + // const instanceId = 'abc123' + /** + * Required. A Memcached Instance resource + */ + // const resource = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + resource, + }; + + // Run request + const [operation] = await memcacheClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js new file mode 100644 index 000000000000..941e43b132f0 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await memcacheClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js new file mode 100644 index 000000000000..8f6b2939630f --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START memcache_v1beta2_generated_CloudMemcache_GetInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + */ + // const name = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await memcacheClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js new file mode 100644 index 000000000000..ec3a3c75cbf2 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js @@ -0,0 +1,87 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START memcache_v1beta2_generated_CloudMemcache_ListInstances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * `next_page_token` google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The `next_page_token` value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying `"name != my-instance"`. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END memcache_v1beta2_generated_CloudMemcache_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js new file mode 100644 index 000000000000..881e0da669ad --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(updateMask, resource) { + // [START memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. + * * `displayName` + */ + // const updateMask = {} + /** + * Required. A Memcached Instance resource. + * Only fields specified in update_mask are updated. + */ + // const resource = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + updateMask, + resource, + }; + + // Run request + const [operation] = await memcacheClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js new file mode 100644 index 000000000000..5563bc51310f --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(name, updateMask) { + // [START memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + */ + // const name = 'abc123' + /** + * Required. Mask of fields to update. + */ + // const updateMask = {} + /** + * The parameters to apply to the instance. + */ + // const parameters = {} + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callUpdateParameters() { + // Construct request + const request = { + name, + updateMask, + }; + + // Run request + const [operation] = await memcacheClient.updateParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateParameters(); + // [END memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json new file mode 100644 index 000000000000..54f71cd0a479 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -0,0 +1,387 @@ +{ + "clientLibrary": { + "name": "nodejs-memcache", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.memcache.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ListInstances_async", + "title": "CloudMemcache listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances in a given location.", + "canonical": true, + "file": "cloud_memcache.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.ListInstancesResponse", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ListInstances", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_GetInstance_async", + "title": "CloudMemcache getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "cloud_memcache.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.memcache.v1beta2.Instance", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.GetInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_CreateInstance_async", + "title": "CloudMemcache createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Instance in a given location.", + "canonical": true, + "file": "cloud_memcache.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.CreateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async", + "title": "CloudMemcache updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing Instance in a given project and location.", + "canonical": true, + "file": "cloud_memcache.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "resource", + "type": ".google.cloud.memcache.v1beta2.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async", + "title": "CloudMemcache updateParameters Sample", + "origin": "API_DEFINITION", + "description": " Updates the defined Memcached parameters for an existing instance. This method only stages the parameters, it must be followed by `ApplyParameters` to apply the parameters to nodes of the Memcached instance.", + "canonical": true, + "file": "cloud_memcache.update_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "parameters", + "type": ".google.cloud.memcache.v1beta2.MemcacheParameters" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "UpdateParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.UpdateParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async", + "title": "CloudMemcache deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Instance.", + "canonical": true, + "file": "cloud_memcache.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async", + "title": "CloudMemcache applyParameters Sample", + "origin": "API_DEFINITION", + "description": " `ApplyParameters` restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "canonical": true, + "file": "cloud_memcache.apply_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplyParameters", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async", + "title": "CloudMemcache applySoftwareUpdate Sample", + "origin": "API_DEFINITION", + "description": " Updates software on the selected nodes of the Instance.", + "canonical": true, + "file": "cloud_memcache.apply_software_update.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "async": true, + "parameters": [ + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" + }, + { + "name": "apply_all", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "ApplySoftwareUpdate", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-memcache/samples/package.json b/packages/google-cloud-memcache/samples/package.json new file mode 100644 index 000000000000..f1d56b70aca7 --- /dev/null +++ b/packages/google-cloud-memcache/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-memcache-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/memcache": "^2.1.2" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-memcache/samples/quickstart.js b/packages/google-cloud-memcache/samples/quickstart.js new file mode 100644 index 000000000000..035dfa835656 --- /dev/null +++ b/packages/google-cloud-memcache/samples/quickstart.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START memcache_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await memcacheClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END memcache_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/test/quickstart.js b/packages/google-cloud-memcache/samples/test/quickstart.js new file mode 100644 index 000000000000..ba4902cd315f --- /dev/null +++ b/packages/google-cloud-memcache/samples/test/quickstart.js @@ -0,0 +1,43 @@ +// Copyright 2020 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. +// + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; +const memcacheClient = new CloudMemcacheClient(); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Sample Integration Tests', () => { + let projectId; + before(async () => { + projectId = await memcacheClient.getProjectId(); + }); + it('should run quickstart.js', async () => { + const stdout = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + { + cwd, + } + ); + + assert(stdout !== null); + }); +}); diff --git a/packages/google-cloud-memcache/src/index.ts b/packages/google-cloud-memcache/src/index.ts new file mode 100644 index 000000000000..dea7e54d1be7 --- /dev/null +++ b/packages/google-cloud-memcache/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta2 from './v1beta2'; + +const CloudMemcacheClient = v1.CloudMemcacheClient; +type CloudMemcacheClient = v1.CloudMemcacheClient; + +export {v1, v1beta2, CloudMemcacheClient}; +export default {v1, v1beta2, CloudMemcacheClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts new file mode 100644 index 000000000000..00f877309a41 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -0,0 +1,1575 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/cloud_memcache_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_memcache_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Memorystore for Memcached instances. + * + * + * The `memcache.googleapis.com` service implements the Google Cloud Memorystore + * for Memcached API and defines the following resource model for managing + * Memorystore Memcached (also called Memcached below) instances: + * * The service works with a collection of cloud projects, named: `/projects/*` + * * Each project has a collection of available locations, named: `/locations/*` + * * Each location has a collection of Memcached instances, named: + * `/instances/*` + * * As such, Memcached instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + * Note that location_id must be a GCP `region`; for example: + * * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` + * @class + * @memberof v1 + */ +export class CloudMemcacheClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudMemcacheStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudMemcacheClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 CloudMemcacheClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CloudMemcacheClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = []; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const updateParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + const applyParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const applyParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), + updateParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateParametersResponse.decode.bind(updateParametersResponse), + updateParametersMetadata.decode.bind(updateParametersMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + applyParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyParametersResponse.decode.bind(applyParametersResponse), + applyParametersMetadata.decode.bind(applyParametersMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.memcache.v1.CloudMemcache', + 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.cloudMemcacheStub) { + return this.cloudMemcacheStub; + } + + // Put together the "service stub" for + // google.cloud.memcache.v1.CloudMemcache. + this.cloudMemcacheStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.memcache.v1.CloudMemcache' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.memcache.v1.CloudMemcache, + 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 cloudMemcacheStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'updateParameters', + 'deleteInstance', + 'applyParameters', + ]; + for (const methodName of cloudMemcacheStubMethods) { + const callPromise = this.cloudMemcacheStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudMemcacheStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'memcache.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'memcache.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @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 [Instance]{@link google.cloud.memcache.v1.Instance}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.get_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.memcache.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.memcache.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.cloud.memcache.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.memcache.v1.IInstance, + | protos.google.cloud.memcache.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IGetInstanceRequest | 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.getInstance(request, options, callback); + } + + /** + * Creates a new Instance in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location + * + * If any of the above are not met, will raise an invalid argument error. + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached Instance + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.create_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request?: protos.google.cloud.memcache.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.create_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1.Instance} request.instance + * Required. A Memcached Instance. + * Only fields specified in update_mask are updated. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.update_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request?: protos.google.cloud.memcache.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'instance.name': request.instance!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.update_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateInstance_async + */ + async checkUpdateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + /** + * Updates the defined Memcached Parameters for an existing Instance. + * This method only stages the parameters, it must be followed by + * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.update_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateParameters_async + */ + updateParameters( + request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request?: protos.google.cloud.memcache.v1.IUpdateParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.updateParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateParameters()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.update_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_UpdateParameters_async + */ + async checkUpdateParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateParameters, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.delete_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.memcache.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.delete_instance.js + * region_tag:memcache_v1_generated_CloudMemcache_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + /** + * ApplyParameters will restart the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the instance-level parameter group. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * parameter group updates to all nodes within the instance. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_ApplyParameters_async + */ + applyParameters( + request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request: protos.google.cloud.memcache.v1.IApplyParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request?: protos.google.cloud.memcache.v1.IApplyParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.applyParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `applyParameters()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1_generated_CloudMemcache_ApplyParameters_async + */ + async checkApplyParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.applyParameters, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } + /** + * Lists Instances in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [Instance]{@link google.cloud.memcache.v1.Instance}. + * 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 `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance[], + protos.google.cloud.memcache.v1.IListInstancesRequest | null, + protos.google.cloud.memcache.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): void; + listInstances( + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + | protos.google.cloud.memcache.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.memcache.v1.IListInstancesRequest, + protos.google.cloud.memcache.v1.IListInstancesResponse | null | undefined, + protos.google.cloud.memcache.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.memcache.v1.IInstance[], + protos.google.cloud.memcache.v1.IListInstancesRequest | null, + protos.google.cloud.memcache.v1.IListInstancesResponse + ] + > | 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.listInstances(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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [Instance]{@link google.cloud.memcache.v1.Instance} 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 `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstances`, 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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, + * if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying "name != my-instance". + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Instance]{@link google.cloud.memcache.v1.Instance}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_memcache.list_instances.js + * region_tag:memcache_v1_generated_CloudMemcache_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.memcache.v1.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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.cloudMemcacheStub && !this._terminated) { + return this.cloudMemcacheStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json new file mode 100644 index 000000000000..93395ae4fd38 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.memcache.v1.CloudMemcache": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "ListInstances": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json b/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json new file mode 100644 index 000000000000..759395dd6de9 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/memcache/v1/cloud_memcache.proto" +] diff --git a/packages/google-cloud-memcache/src/v1/gapic_metadata.json b/packages/google-cloud-memcache/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..dba038c2360a --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/gapic_metadata.json @@ -0,0 +1,97 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.memcache.v1", + "libraryPackage": "@google-cloud/memcache", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1/index.ts b/packages/google-cloud-memcache/src/v1/index.ts new file mode 100644 index 000000000000..86a77cf1cfe7 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {CloudMemcacheClient} from './cloud_memcache_client'; diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts new file mode 100644 index 000000000000..4f1dbf3c9237 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -0,0 +1,1769 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v1beta2/cloud_memcache_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_memcache_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Memorystore for Memcached instances. + * + * + * The `memcache.googleapis.com` service implements the Google Cloud Memorystore + * for Memcached API and defines the following resource model for managing + * Memorystore Memcached (also called Memcached below) instances: + * * The service works with a collection of cloud projects, named: `/projects/*` + * * Each project has a collection of available locations, named: `/locations/*` + * * Each location has a collection of Memcached instances, named: + * `/instances/*` + * * As such, Memcached instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + * Note that location_id must be a GCP `region`; for example: + * * `projects/my-memcached-project/locations/us-central1/instances/my-memcached` + * @class + * @memberof v1beta2 + */ +export class CloudMemcacheClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudMemcacheStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudMemcacheClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 CloudMemcacheClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CloudMemcacheClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'resources' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1beta2/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1beta2/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta2/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta2/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta2/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta2/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const updateParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const updateParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const applyParametersResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const applyParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + const applySoftwareUpdateResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const applySoftwareUpdateMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), + updateParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateParametersResponse.decode.bind(updateParametersResponse), + updateParametersMetadata.decode.bind(updateParametersMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + applyParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyParametersResponse.decode.bind(applyParametersResponse), + applyParametersMetadata.decode.bind(applyParametersMetadata) + ), + applySoftwareUpdate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applySoftwareUpdateResponse.decode.bind(applySoftwareUpdateResponse), + applySoftwareUpdateMetadata.decode.bind(applySoftwareUpdateMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.memcache.v1beta2.CloudMemcache', + 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.cloudMemcacheStub) { + return this.cloudMemcacheStub; + } + + // Put together the "service stub" for + // google.cloud.memcache.v1beta2.CloudMemcache. + this.cloudMemcacheStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.memcache.v1beta2.CloudMemcache' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.memcache.v1beta2.CloudMemcache, + 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 cloudMemcacheStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'updateParameters', + 'deleteInstance', + 'applyParameters', + 'applySoftwareUpdate', + ]; + for (const methodName of cloudMemcacheStubMethods) { + const callPromise = this.cloudMemcacheStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudMemcacheStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'memcache.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'memcache.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @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 [Instance]{@link google.cloud.memcache.v1beta2.Instance}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.get_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.cloud.memcache.v1beta2.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.memcache.v1beta2.IInstance, + | protos.google.cloud.memcache.v1beta2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IGetInstanceRequest | 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.getInstance(request, options, callback); + } + + /** + * Creates a new Instance in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {string} request.instanceId + * Required. The logical name of the Memcached instance in the user + * project with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-40 characters. + * * Must end with a number or a letter. + * * Must be unique within the user project / location. + * + * If any of the above are not met, the API raises an invalid argument error. + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [Instance] resource + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.create_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request?: protos.google.cloud.memcache.v1beta2.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.createInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.create_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * Updates an existing Instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * * `displayName` + * @param {google.cloud.memcache.v1beta2.Instance} request.resource + * Required. A Memcached [Instance] resource. + * Only fields specified in update_mask are updated. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.update_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request?: protos.google.cloud.memcache.v1beta2.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'resource.name': request.resource!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.update_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateInstance_async + */ + async checkUpdateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * Updates the defined Memcached parameters for an existing instance. + * This method only stages the parameters, it must be followed by + * `ApplyParameters` to apply the parameters to nodes of the Memcached + * instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which the parameters should be + * updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * @param {google.cloud.memcache.v1beta2.MemcacheParameters} request.parameters + * The parameters to apply to the instance. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.update_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async + */ + updateParameters( + request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateParameters( + request?: protos.google.cloud.memcache.v1beta2.IUpdateParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.updateParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateParameters()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.update_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_UpdateParameters_async + */ + async checkUpdateParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateParameters, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * Deletes a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Memcached instance resource name in the format: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.delete_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.memcache.v1beta2.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.delete_instance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * `ApplyParameters` restarts the set of specified nodes in order to update + * them to the current set of parameters for the Memcached Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the Memcached instance for which parameter group updates + * should be applied. + * @param {string[]} request.nodeIds + * Nodes to which the instance-level parameter group is applied. + * @param {boolean} request.applyAll + * Whether to apply instance-level parameter group to all nodes. If set to + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async + */ + applyParameters( + request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyParameters( + request?: protos.google.cloud.memcache.v1beta2.IApplyParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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.applyParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `applyParameters()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_parameters.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplyParameters_async + */ + async checkApplyParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.applyParameters, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * Updates software on the selected nodes of the Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Required. Resource name of the Memcached instance for which software update should be + * applied. + * @param {string[]} request.nodeIds + * Nodes to which we should apply the update to. Note all the selected nodes + * are updated in parallel. + * @param {boolean} request.applyAll + * Whether to apply the update to all nodes. If set to + * true, will explicitly restrict users from specifying any nodes, and apply + * software update to all nodes (where applicable) within the instance. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_software_update.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async + */ + applySoftwareUpdate( + request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applySoftwareUpdate( + request: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applySoftwareUpdate( + request?: protos.google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + instance: request.instance ?? '', + }); + this.initialize(); + return this.innerApiCalls.applySoftwareUpdate(request, options, callback); + } + /** + * Check the status of the long running operation returned by `applySoftwareUpdate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.apply_software_update.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_async + */ + async checkApplySoftwareUpdateProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.applySoftwareUpdate, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } + /** + * Lists Instances in a given location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying `"name != my-instance"`. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [Instance]{@link google.cloud.memcache.v1beta2.Instance}. + * 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 `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance[], + protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, + protos.google.cloud.memcache.v1beta2.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): void; + listInstances( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + | protos.google.cloud.memcache.v1beta2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.memcache.v1beta2.IInstance + > + ): Promise< + [ + protos.google.cloud.memcache.v1beta2.IInstance[], + protos.google.cloud.memcache.v1beta2.IListInstancesRequest | null, + protos.google.cloud.memcache.v1beta2.IListInstancesResponse + ] + > | 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.listInstances(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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying `"name != my-instance"`. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [Instance]{@link google.cloud.memcache.v1beta2.Instance} 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 `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstances`, 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 resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region + * @param {number} request.pageSize + * The maximum number of items to return. + * + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1beta2.ListInstancesResponse.next_page_token|`next_page_token`} + * to determine if there are more instances left to be queried. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if any. + * @param {string} request.filter + * List filter. For example, exclude all Memcached instances with name as + * my-instance by specifying `"name != my-instance"`. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Instance]{@link google.cloud.memcache.v1beta2.Instance}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta2/cloud_memcache.list_instances.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.memcache.v1beta2.IListInstancesRequest, + 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['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * 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.cloudMemcacheStub && !this._terminated) { + return this.cloudMemcacheStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json new file mode 100644 index 000000000000..c3d3b2ae69b2 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.memcache.v1beta2.CloudMemcache": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "ListInstances": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyParameters": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplySoftwareUpdate": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json new file mode 100644 index 000000000000..f37919f31b77 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/memcache/v1beta2/cloud_memcache.proto" +] diff --git a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json new file mode 100644 index 000000000000..e6f17d63c4c8 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json @@ -0,0 +1,107 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.memcache.v1beta2", + "libraryPackage": "@google-cloud/memcache", + "services": { + "CloudMemcache": { + "clients": { + "grpc": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ApplySoftwareUpdate": { + "methods": [ + "applySoftwareUpdate" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudMemcacheClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "UpdateParameters": { + "methods": [ + "updateParameters" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ApplyParameters": { + "methods": [ + "applyParameters" + ] + }, + "ApplySoftwareUpdate": { + "methods": [ + "applySoftwareUpdate" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-memcache/src/v1beta2/index.ts b/packages/google-cloud-memcache/src/v1beta2/index.ts new file mode 100644 index 000000000000..86a77cf1cfe7 --- /dev/null +++ b/packages/google-cloud-memcache/src/v1beta2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {CloudMemcacheClient} from './cloud_memcache_client'; diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..33fe980a26be --- /dev/null +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const memcache = require('@google-cloud/memcache'); + +function main() { + const cloudMemcacheClient = new memcache.CloudMemcacheClient(); +} + +main(); diff --git a/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..4c9dab2db99e --- /dev/null +++ b/packages/google-cloud-memcache/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {CloudMemcacheClient} from '@google-cloud/memcache'; + +// check that the client class type name can be used +function doStuffWithCloudMemcacheClient(client: CloudMemcacheClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudMemcacheClient = new CloudMemcacheClient(); + doStuffWithCloudMemcacheClient(cloudMemcacheClient); +} + +main(); diff --git a/packages/google-cloud-memcache/system-test/install.ts b/packages/google-cloud-memcache/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-memcache/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts new file mode 100644 index 000000000000..16220391357a --- /dev/null +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -0,0 +1,1781 @@ +// Copyright 2022 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 cloudmemcacheModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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.CloudMemcacheClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1.CloudMemcacheClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudmemcacheModule.v1.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); + }); + + it('has close method for the initialized client', done => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1.CloudMemcacheClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateParameters', () => { + it('invokes updateParameters without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateParameters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateParameters(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('applyParameters', () => { + it('invokes applyParameters without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = + stubLongRunningCall(expectedResponse); + const [operation] = await client.applyParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.applyParameters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applyParameters(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApplyParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkApplyParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkApplyParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + generateSampleMessage(new protos.google.cloud.memcache.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.memcache.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.memcache.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts new file mode 100644 index 000000000000..d6c1f112fdfd --- /dev/null +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -0,0 +1,1999 @@ +// Copyright 2022 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 cloudmemcacheModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v1beta2.CloudMemcacheClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudmemcacheModule.v1beta2.CloudMemcacheClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudmemcacheModule.v1beta2.CloudMemcacheClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + await client.initialize(); + assert(client.cloudMemcacheStub); + }); + + it('has close method for the initialized client', done => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudMemcacheStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudMemcacheStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateInstanceRequest() + ); + request.resource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateInstanceRequest', + ['resource', 'name'] + ); + request.resource.name = defaultValue1; + const expectedHeaderRequestParams = `resource.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateParameters', () => { + it('invokes updateParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateParameters = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateParameters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.UpdateParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.UpdateParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateParameters(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('applyParameters', () => { + it('invokes applyParameters without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = + stubLongRunningCall(expectedResponse); + const [operation] = await client.applyParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyParameters = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.applyParameters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyParameters with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplyParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplyParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applyParameters(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApplyParametersProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkApplyParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyParametersProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkApplyParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('applySoftwareUpdate', () => { + it('invokes applySoftwareUpdate without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applySoftwareUpdate = + stubLongRunningCall(expectedResponse); + const [operation] = await client.applySoftwareUpdate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applySoftwareUpdate without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applySoftwareUpdate = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applySoftwareUpdate( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applySoftwareUpdate with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.applySoftwareUpdate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applySoftwareUpdate with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applySoftwareUpdate = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applySoftwareUpdate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applySoftwareUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApplySoftwareUpdateProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkApplySoftwareUpdateProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplySoftwareUpdateProgress with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkApplySoftwareUpdateProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.memcache.v1beta2.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.memcache.v1beta2.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.memcache.v1beta2.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.memcache.v1beta2.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-memcache/tsconfig.json b/packages/google-cloud-memcache/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-memcache/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/packages/google-cloud-memcache/webpack.config.js b/packages/google-cloud-memcache/webpack.config.js new file mode 100644 index 000000000000..183014a7caf7 --- /dev/null +++ b/packages/google-cloud-memcache/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: 'CloudMemcache', + filename: './cloud-memcache.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/packages/google-cloud-oslogin/.OwlBot.yaml b/packages/google-cloud-oslogin/.OwlBot.yaml new file mode 100644 index 000000000000..edcb8680974a --- /dev/null +++ b/packages/google-cloud-oslogin/.OwlBot.yaml @@ -0,0 +1,21 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/oslogin/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-oslogin/$1 + diff --git a/packages/google-cloud-oslogin/.eslintignore b/packages/google-cloud-oslogin/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-oslogin/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-oslogin/.eslintrc.json b/packages/google-cloud-oslogin/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-oslogin/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-oslogin/.gitattributes b/packages/google-cloud-oslogin/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-oslogin/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-oslogin/.gitignore b/packages/google-cloud-oslogin/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-oslogin/.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/packages/google-cloud-oslogin/.jsdoc.js b/packages/google-cloud-oslogin/.jsdoc.js new file mode 100644 index 000000000000..83fc87c6ceb6 --- /dev/null +++ b/packages/google-cloud-oslogin/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/os-login', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-oslogin/.mocharc.js b/packages/google-cloud-oslogin/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-oslogin/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-oslogin/.nycrc b/packages/google-cloud-oslogin/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-oslogin/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-oslogin/.prettierignore b/packages/google-cloud-oslogin/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-oslogin/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-oslogin/.prettierrc.js b/packages/google-cloud-oslogin/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-oslogin/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-oslogin/.repo-metadata.json b/packages/google-cloud-oslogin/.repo-metadata.json new file mode 100644 index 000000000000..03c20aaddd24 --- /dev/null +++ b/packages/google-cloud-oslogin/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/os-login/latest", + "api_id": "oslogin.googleapis.com", + "distribution_name": "@google-cloud/os-login", + "release_level": "stable", + "default_version": "v1", + "language": "nodejs", + "name_pretty": "Google Cloud OS Login", + "repo": "googleapis/google-cloud-node", + "product_documentation": "https://cloud.google.com/compute/docs/oslogin/", + "requires_billing": true, + "name": "oslogin", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559755", + "api_shortname": "oslogin", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-oslogin/CHANGELOG.md b/packages/google-cloud-oslogin/CHANGELOG.md new file mode 100644 index 000000000000..65dbbcebf719 --- /dev/null +++ b/packages/google-cloud-oslogin/CHANGELOG.md @@ -0,0 +1,420 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/os-login?activeTab=versions + +## [4.0.2](https://github.com/googleapis/nodejs-os-login/compare/v4.0.1...v4.0.2) (2022-09-16) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#548](https://github.com/googleapis/nodejs-os-login/issues/548)) ([ae426fe](https://github.com/googleapis/nodejs-os-login/commit/ae426fe0178d310d06ed488d4506ab8c916a3f62)) +* Better support for fallback mode ([#543](https://github.com/googleapis/nodejs-os-login/issues/543)) ([d149110](https://github.com/googleapis/nodejs-os-login/commit/d149110ac085100b47f680ab10c2505885f88f2d)) +* Change import long to require ([#544](https://github.com/googleapis/nodejs-os-login/issues/544)) ([5bf317b](https://github.com/googleapis/nodejs-os-login/commit/5bf317b8f2488f6860e941b14ccd38469e61059b)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-os-login/issues/1553)) ([#547](https://github.com/googleapis/nodejs-os-login/issues/547)) ([a71f7b4](https://github.com/googleapis/nodejs-os-login/commit/a71f7b48575b5ad66334c4338d7c5c0acf658cdd)) +* Preserve default values in x-goog-request-params header ([#551](https://github.com/googleapis/nodejs-os-login/issues/551)) ([1f50d1d](https://github.com/googleapis/nodejs-os-login/commit/1f50d1d0a868547d0069991826bfe429443d0f24)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-os-login/issues/1546)) ([#546](https://github.com/googleapis/nodejs-os-login/issues/546)) ([9a273e0](https://github.com/googleapis/nodejs-os-login/commit/9a273e07c65036f5a017b28bf25e29bb217862f4)) +* use google-gax v3.3.0 ([a71f7b4](https://github.com/googleapis/nodejs-os-login/commit/a71f7b48575b5ad66334c4338d7c5c0acf658cdd)) + +## [4.0.1](https://github.com/googleapis/nodejs-os-login/compare/v4.0.0...v4.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#534](https://github.com/googleapis/nodejs-os-login/issues/534)) ([52d5d5c](https://github.com/googleapis/nodejs-os-login/commit/52d5d5cc99d50a9a469a54ca1c75943c082b26dc)) + +## [4.0.0](https://github.com/googleapis/nodejs-os-login/compare/v3.3.1...v4.0.0) (2022-05-20) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#527) + +### Build System + +* update library to use Node 12 ([#527](https://github.com/googleapis/nodejs-os-login/issues/527)) ([32db700](https://github.com/googleapis/nodejs-os-login/commit/32db70055f46499e97607123ec84fd72ff2c749f)) + +### [3.3.1](https://www.github.com/googleapis/nodejs-os-login/compare/v3.3.0...v3.3.1) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#480](https://www.github.com/googleapis/nodejs-os-login/issues/480)) ([0b7bec3](https://www.github.com/googleapis/nodejs-os-login/commit/0b7bec3162c80b1be59f309d8d05a2a5ff938917)) + +## [3.3.0](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.6...v3.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#476](https://www.github.com/googleapis/nodejs-os-login/issues/476)) ([4654c87](https://www.github.com/googleapis/nodejs-os-login/commit/4654c8762819176cf81703beffce92f79424ec86)) + +### [3.2.6](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.5...v3.2.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#474](https://www.github.com/googleapis/nodejs-os-login/issues/474)) ([b84fa0a](https://www.github.com/googleapis/nodejs-os-login/commit/b84fa0a5ed3d6b4888e083e8fbda68a47d4d691a)) + +### [3.2.5](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.4...v3.2.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#466](https://www.github.com/googleapis/nodejs-os-login/issues/466)) ([a500bc5](https://www.github.com/googleapis/nodejs-os-login/commit/a500bc585737edf483e6645b7e64dc36c9ca743b)) + +### [3.2.4](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.3...v3.2.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#464](https://www.github.com/googleapis/nodejs-os-login/issues/464)) ([67847c3](https://www.github.com/googleapis/nodejs-os-login/commit/67847c3d7f8328c797daf93a8880025b3fdbc763)) + +### [3.2.3](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.2...v3.2.3) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#462](https://www.github.com/googleapis/nodejs-os-login/issues/462)) ([cd8da67](https://www.github.com/googleapis/nodejs-os-login/commit/cd8da670380e2550c19da03bb29cfb639ff3bcc4)) +* make request optional in all cases ([#458](https://www.github.com/googleapis/nodejs-os-login/issues/458)) ([f1e43fa](https://www.github.com/googleapis/nodejs-os-login/commit/f1e43fa48e715199ab53ca552dc276adaf2c8f0d)) + +### [3.2.2](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.1...v3.2.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#449](https://www.github.com/googleapis/nodejs-os-login/issues/449)) ([40518aa](https://www.github.com/googleapis/nodejs-os-login/commit/40518aaf15307d6b89579c5d40c3739d7c499279)) + +### [3.2.1](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.0...v3.2.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#439](https://www.github.com/googleapis/nodejs-os-login/issues/439)) ([c85faf2](https://www.github.com/googleapis/nodejs-os-login/commit/c85faf2a1529cc4557e37938903b2e73dfb8d40c)) +* use require() to load JSON protos ([#442](https://www.github.com/googleapis/nodejs-os-login/issues/442)) ([41d5b27](https://www.github.com/googleapis/nodejs-os-login/commit/41d5b274bb3b3e07af0d6bd511f6b76f7f96a927)) + +## [3.2.0](https://www.github.com/googleapis/nodejs-os-login/compare/v3.1.3...v3.2.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#408](https://www.github.com/googleapis/nodejs-os-login/issues/408)) ([b413e00](https://www.github.com/googleapis/nodejs-os-login/commit/b413e004b0d3c686a25ee2068c761f6aeb65d6e4)) + +### [3.1.3](https://www.github.com/googleapis/nodejs-os-login/compare/v3.1.2...v3.1.3) (2020-11-25) + + +### Bug Fixes + +* check for fetch on window ([#401](https://www.github.com/googleapis/nodejs-os-login/issues/401)) ([e2547a9](https://www.github.com/googleapis/nodejs-os-login/commit/e2547a90031a46a4ad044318c26c160d8fb04ff6)) + +### [3.1.2](https://www.github.com/googleapis/nodejs-os-login/compare/v3.1.1...v3.1.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#397](https://www.github.com/googleapis/nodejs-os-login/issues/397)) ([340a7c9](https://www.github.com/googleapis/nodejs-os-login/commit/340a7c9503e6c1dbb4d0edfb3d69fdff58357daa)) + +### [3.1.1](https://www.github.com/googleapis/nodejs-os-login/compare/v3.1.0...v3.1.1) (2020-07-24) + + +### Bug Fixes + +* move gitattributes files to node templates ([#367](https://www.github.com/googleapis/nodejs-os-login/issues/367)) ([bc08404](https://www.github.com/googleapis/nodejs-os-login/commit/bc084043f09b0d47586d9d7ef98369cddfc9fff7)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-os-login/compare/v3.0.1...v3.1.0) (2020-06-29) + + +### Features + +* move ts target to es2018 from es2016 ([#348](https://www.github.com/googleapis/nodejs-os-login/issues/348)) ([3f4dce8](https://www.github.com/googleapis/nodejs-os-login/commit/3f4dce8ec3f1c601885858eb90dcec73e3d31fa5)) + + +### Bug Fixes + +* proper fallback option handling ([45d50b2](https://www.github.com/googleapis/nodejs-os-login/commit/45d50b2c13268fbe907f01945f75f2f4c7e301c4)) +* update node issue template ([#353](https://www.github.com/googleapis/nodejs-os-login/issues/353)) ([ca3ca7d](https://www.github.com/googleapis/nodejs-os-login/commit/ca3ca7d647ce15583a925970fa2ffb07e2c601ca)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-os-login/compare/v3.0.0...v3.0.1) (2020-06-04) + + +### Bug Fixes + +* regen protos and tests, formatting ([#342](https://www.github.com/googleapis/nodejs-os-login/issues/342)) ([579f1e4](https://www.github.com/googleapis/nodejs-os-login/commit/579f1e48ef2a3f0fd1460b07592d5dc499cf8043)) +* synth.py clean up for multiple version ([#343](https://www.github.com/googleapis/nodejs-os-login/issues/343)) ([d270479](https://www.github.com/googleapis/nodejs-os-login/commit/d270479f7ee2b9d4874a1282c13c049015b15510)) +* use unique proto root ([#332](https://www.github.com/googleapis/nodejs-os-login/issues/332)) ([cb42aa4](https://www.github.com/googleapis/nodejs-os-login/commit/cb42aa413c55c374ccac9ae42c6dd666a2aab3ca)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-os-login/compare/v2.0.1...v3.0.0) (2020-04-13) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. +* This adds the v1 variant of the API, and makes it the default export. For any non-versioned imports of the service class, please make sure to test updates. + +### Features + +* bump release level to GA ([#292](https://www.github.com/googleapis/nodejs-os-login/issues/292)) ([321aaa4](https://www.github.com/googleapis/nodejs-os-login/commit/321aaa4247894ac204077d71b92c7d36bf77dcac)) +* deferred client initialization ([#304](https://www.github.com/googleapis/nodejs-os-login/issues/304)) ([1b87592](https://www.github.com/googleapis/nodejs-os-login/commit/1b8759220088e5d330479e6a7623fd67a325a389)) +* drop node8 support ([#318](https://www.github.com/googleapis/nodejs-os-login/issues/318)) ([1a96118](https://www.github.com/googleapis/nodejs-os-login/commit/1a961188fe2043a6471d9765643f12153604ee6a)) +* export protos in src/index.ts ([53eda47](https://www.github.com/googleapis/nodejs-os-login/commit/53eda478c5e7b41cea528172a76c4acff62b265b)) +* use the v1 variant of the API ([#287](https://www.github.com/googleapis/nodejs-os-login/issues/287)) ([ee86b49](https://www.github.com/googleapis/nodejs-os-login/commit/ee86b4956e81528c5ef4ef055c8dc9dbaf0644be)) + + +### Bug Fixes + +* export explicit version from protos.js ([#322](https://www.github.com/googleapis/nodejs-os-login/issues/322)) ([aa2131b](https://www.github.com/googleapis/nodejs-os-login/commit/aa2131b5f7d398468294cca65f427a2e15182c3f)) +* proto messages now accept strings for enums ([9606ac8](https://www.github.com/googleapis/nodejs-os-login/commit/9606ac8744e14e7f30740b8c5df1c1548e1e14af)) +* remove eslint, update gax, fix generated protos, run the generator ([#327](https://www.github.com/googleapis/nodejs-os-login/issues/327)) ([185446a](https://www.github.com/googleapis/nodejs-os-login/commit/185446a42d9f3851f67aff90dae4e15061c0313d)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-os-login/compare/v2.0.0...v2.0.1) (2020-01-29) + + +### Bug Fixes + +* update generated proto.json and proto.d.ts ([7a1b082](https://www.github.com/googleapis/nodejs-os-login/commit/7a1b082b0f50df5ccf3e5da8f43319eebc4b842b)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-os-login/compare/v1.3.2...v2.0.0) (2020-01-25) + + +### ⚠ BREAKING CHANGES + +* move to typescript code generation (#260) + +### Features + +* move to typescript code generation ([#260](https://www.github.com/googleapis/nodejs-os-login/issues/260)) ([37a5836](https://www.github.com/googleapis/nodejs-os-login/commit/37a5836f30346dfc39d1a07dec2080f5644d499f)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([1231063](https://www.github.com/googleapis/nodejs-os-login/commit/1231063de822c3fbed554aea3e426fa0eacea743)) + +### [1.3.2](https://www.github.com/googleapis/nodejs-os-login/compare/v1.3.1...v1.3.2) (2019-11-15) + + +### Bug Fixes + +* **docs:** bump release level to beta ([da02304](https://www.github.com/googleapis/nodejs-os-login/commit/da0230474ad978c5dd837db9c92c875318ffba3a)) +* **docs:** snippets are now replaced in jsdoc comments ([#248](https://www.github.com/googleapis/nodejs-os-login/issues/248)) ([f77a00e](https://www.github.com/googleapis/nodejs-os-login/commit/f77a00ecf9f761db1249a15fc41f8297ad94200e)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-os-login/compare/v1.3.0...v1.3.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#242](https://www.github.com/googleapis/nodejs-os-login/issues/242)) ([9fdab76](https://www.github.com/googleapis/nodejs-os-login/commit/9fdab764c004c047ce5c58d6014b8c55637acba7)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-os-login/compare/v1.2.0...v1.3.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([ffd6424](https://www.github.com/googleapis/nodejs-os-login/commit/ffd6424)) + + +### Features + +* .d.ts for protos ([#231](https://www.github.com/googleapis/nodejs-os-login/issues/231)) ([233dbbe](https://www.github.com/googleapis/nodejs-os-login/commit/233dbbe)) +* add name and operating system type fields ([#241](https://www.github.com/googleapis/nodejs-os-login/issues/241)) ([b40e175](https://www.github.com/googleapis/nodejs-os-login/commit/b40e175)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-os-login/compare/v1.1.4...v1.2.0) (2019-09-09) + + +### Features + +* load protos from JSON, grpc-fallback support ([da55493](https://www.github.com/googleapis/nodejs-os-login/commit/da55493)) + +### [1.1.4](https://www.github.com/googleapis/nodejs-os-login/compare/v1.1.3...v1.1.4) (2019-08-26) + + +### Bug Fixes + +* include the correct version of node in a header ([#220](https://www.github.com/googleapis/nodejs-os-login/issues/220)) ([0c2ada9](https://www.github.com/googleapis/nodejs-os-login/commit/0c2ada9)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-os-login/compare/v1.1.2...v1.1.3) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([f8f02ba](https://www.github.com/googleapis/nodejs-os-login/commit/f8f02ba)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-os-login/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#210](https://www.github.com/googleapis/nodejs-os-login/issues/210)) ([3827374](https://www.github.com/googleapis/nodejs-os-login/commit/3827374)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-os-login/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#207](https://www.github.com/googleapis/nodejs-os-login/issues/207)) ([f6a50ea](https://www.github.com/googleapis/nodejs-os-login/commit/f6a50ea)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-os-login/compare/v1.0.0...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override in client constructor ([#204](https://www.github.com/googleapis/nodejs-os-login/issues/204)) ([bcc4d3d](https://www.github.com/googleapis/nodejs-os-login/commit/bcc4d3d)) +* support apiEndpoint override in client constructor ([#206](https://www.github.com/googleapis/nodejs-os-login/issues/206)) ([3aeacf6](https://www.github.com/googleapis/nodejs-os-login/commit/3aeacf6)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-os-login/compare/v0.3.3...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#184) + +### Bug Fixes + +* **deps:** update dependency google-gax to ^0.26.0 ([#182](https://www.github.com/googleapis/nodejs-os-login/issues/182)) ([c97e514](https://www.github.com/googleapis/nodejs-os-login/commit/c97e514)) +* **deps:** update dependency google-gax to v1 ([#191](https://www.github.com/googleapis/nodejs-os-login/issues/191)) ([5268691](https://www.github.com/googleapis/nodejs-os-login/commit/5268691)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#184](https://www.github.com/googleapis/nodejs-os-login/issues/184)) ([8b0866a](https://www.github.com/googleapis/nodejs-os-login/commit/8b0866a)) + +### [0.3.3](https://www.github.com/googleapis/nodejs-os-login/compare/v0.3.2...v0.3.3) (2019-04-30) + + +### Bug Fixes + +* include 'x-goog-request-params' header in requests ([#167](https://www.github.com/googleapis/nodejs-os-login/issues/167)) ([074051d](https://www.github.com/googleapis/nodejs-os-login/commit/074051d)) + +## v0.3.2 + +03-18-2019 13:47 PDT + +### Implementation Changes +- refactor: update json import paths ([#156](https://github.com/googleapis/nodejs-os-login/pull/156)) +- fix: throw on invalid credentials + +### Dependencies +- chore(deps): update dependency mocha to v6 + +### Documentation +- docs: update comments on protos ([#151](https://github.com/googleapis/nodejs-os-login/pull/151)) +- build: use linkinator for docs test ([#148](https://github.com/googleapis/nodejs-os-login/pull/148)) +- docs: update links in contrib guide ([#149](https://github.com/googleapis/nodejs-os-login/pull/149)) +- build: create docs test npm scripts ([#146](https://github.com/googleapis/nodejs-os-login/pull/146)) +- docs: update contributing path in README ([#144](https://github.com/googleapis/nodejs-os-login/pull/144)) +- chore: move CONTRIBUTING.md to root ([#143](https://github.com/googleapis/nodejs-os-login/pull/143)) +- docs: add lint/fix example to contributing guide ([#141](https://github.com/googleapis/nodejs-os-login/pull/141)) + +### Internal / Testing Changes +- chore: use per-repo npm publish ([#158](https://github.com/googleapis/nodejs-os-login/pull/158)) +- build: use per-repo publish token ([#157](https://github.com/googleapis/nodejs-os-login/pull/157)) +- build: Add docuploader credentials to node publish jobs ([#154](https://github.com/googleapis/nodejs-os-login/pull/154)) +- build: use node10 to run samples-test, system-test etc ([#153](https://github.com/googleapis/nodejs-os-login/pull/153)) +- build: update release configuration +- build: test using @grpc/grpc-js in CI ([#145](https://github.com/googleapis/nodejs-os-login/pull/145)) + +## v0.3.1 + +01-31-2019 23:16 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#139](https://github.com/googleapis/nodejs-os-login/pull/139)) +- fix(deps): update dependency google-gax to ^0.24.0 ([#137](https://github.com/googleapis/nodejs-os-login/pull/137)) +- fix(deps): update dependency google-gax to ^0.23.0 ([#133](https://github.com/googleapis/nodejs-os-login/pull/133)) +- fix(deps): update dependency google-gax to ^0.22.0 ([#109](https://github.com/googleapis/nodejs-os-login/pull/109)) + +### Documentation +- docs: update readme badges ([#118](https://github.com/googleapis/nodejs-os-login/pull/118)) +- refactor(samples): replace promise with await async ([#114](https://github.com/googleapis/nodejs-os-login/pull/114)) + +### Internal / Testing Changes +- chore(deps): update dependency eslint-config-prettier to v4 ([#138](https://github.com/googleapis/nodejs-os-login/pull/138)) +- build: ignore googleapis.com in doc link check ([#136](https://github.com/googleapis/nodejs-os-login/pull/136)) +- chore: sync gapic files +- build: check broken links in generated docs ([#132](https://github.com/googleapis/nodejs-os-login/pull/132)) +- chore(build): inject yoshi automation key ([#131](https://github.com/googleapis/nodejs-os-login/pull/131)) +- chore: update nyc and eslint configs ([#130](https://github.com/googleapis/nodejs-os-login/pull/130)) +- chore: fix publish.sh permission +x ([#128](https://github.com/googleapis/nodejs-os-login/pull/128)) +- fix(build): fix Kokoro release script ([#127](https://github.com/googleapis/nodejs-os-login/pull/127)) +- build: add Kokoro configs for autorelease ([#126](https://github.com/googleapis/nodejs-os-login/pull/126)) +- chore: always nyc report before calling codecov ([#123](https://github.com/googleapis/nodejs-os-login/pull/123)) +- chore: nyc ignore build/test by default ([#122](https://github.com/googleapis/nodejs-os-login/pull/122)) +- chore: update license file ([#120](https://github.com/googleapis/nodejs-os-login/pull/120)) +- fix(build): fix system key decryption ([#116](https://github.com/googleapis/nodejs-os-login/pull/116)) +- chore: add a synth.metadata +- chore: update eslintignore config ([#108](https://github.com/googleapis/nodejs-os-login/pull/108)) +- chore(deps): dependency @google-cloud/nodejs-repo-tools to v3 ([#107](https://github.com/googleapis/nodejs-os-login/pull/107)) +- refactor: drop a few deps ([#105](https://github.com/googleapis/nodejs-os-login/pull/105)) +- chore: drop contributors from multiple places ([#106](https://github.com/googleapis/nodejs-os-login/pull/106)) +- chore: use latest npm on Windows ([#104](https://github.com/googleapis/nodejs-os-login/pull/104)) +- chore(deps): update dependency through2 to v3 ([#103](https://github.com/googleapis/nodejs-os-login/pull/103)) +- chore: update CircleCI config ([#102](https://github.com/googleapis/nodejs-os-login/pull/102)) +- chore: include build in eslintignore ([#99](https://github.com/googleapis/nodejs-os-login/pull/99)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#95](https://github.com/googleapis/nodejs-os-login/pull/95)) +- chore: update issue templates ([#94](https://github.com/googleapis/nodejs-os-login/pull/94)) +- chore: remove old issue template ([#92](https://github.com/googleapis/nodejs-os-login/pull/92)) +- build: run tests on node11 ([#91](https://github.com/googleapis/nodejs-os-login/pull/91)) +- chores(build): do not collect sponge.xml from windows builds ([#90](https://github.com/googleapis/nodejs-os-login/pull/90)) +- chores(build): run codecov on continuous builds ([#89](https://github.com/googleapis/nodejs-os-login/pull/89)) +- chore: update new issue template ([#88](https://github.com/googleapis/nodejs-os-login/pull/88)) +- build: fix codecov uploading on Kokoro ([#85](https://github.com/googleapis/nodejs-os-login/pull/85)) +- Update kokoro config ([#83](https://github.com/googleapis/nodejs-os-login/pull/83)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#82](https://github.com/googleapis/nodejs-os-login/pull/82)) +- Update kokoro config ([#79](https://github.com/googleapis/nodejs-os-login/pull/79)) + +## v0.3.0 + +### Breaking changes +- fix: drop support for node.js 4.x and 9.x ([#43](https://github.com/googleapis/nodejs-os-login/pull/43)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.20.0 ([#71](https://github.com/googleapis/nodejs-os-login/pull/71)) +- fix(deps): update dependency google-gax to ^0.19.0 ([#65](https://github.com/googleapis/nodejs-os-login/pull/65)) +- fix(deps): update dependency google-gax to ^0.18.0 ([#55](https://github.com/googleapis/nodejs-os-login/pull/55)) + +### Documentation +- Update comments in the code ([#68](https://github.com/googleapis/nodejs-os-login/pull/68)) + +### Internal / Testing Changes +- test: remove appveyor config ([#78](https://github.com/googleapis/nodejs-os-login/pull/78)) +- build: bring in Kokoro cfgs via synth.py ([#77](https://github.com/googleapis/nodejs-os-login/pull/77)) +- Fix the linter ([#75](https://github.com/googleapis/nodejs-os-login/pull/75)) +- Enable prefer-const in the eslint config ([#74](https://github.com/googleapis/nodejs-os-login/pull/74)) +- Enable no-var in eslint ([#73](https://github.com/googleapis/nodejs-os-login/pull/73)) +- Switch to let/const ([#72](https://github.com/googleapis/nodejs-os-login/pull/72)) +- Retry npm install in CI ([#70](https://github.com/googleapis/nodejs-os-login/pull/70)) +- chore(deps): update dependency nyc to v13 ([#66](https://github.com/googleapis/nodejs-os-login/pull/66)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#64](https://github.com/googleapis/nodejs-os-login/pull/64)) +- chore: do not use npm ci ([#63](https://github.com/googleapis/nodejs-os-login/pull/63)) +- chore: ignore package-lock.json ([#60](https://github.com/googleapis/nodejs-os-login/pull/60)) +- chore(deps): lock file maintenance ([#59](https://github.com/googleapis/nodejs-os-login/pull/59)) +- chore(deps): lock file maintenance ([#58](https://github.com/googleapis/nodejs-os-login/pull/58)) +- remove that whitespace ([#56](https://github.com/googleapis/nodejs-os-login/pull/56)) +- chore: update renovate config ([#57](https://github.com/googleapis/nodejs-os-login/pull/57)) +- chore(deps): lock file maintenance ([#54](https://github.com/googleapis/nodejs-os-login/pull/54)) +- chore: move mocha options to mocha.opts ([#52](https://github.com/googleapis/nodejs-os-login/pull/52)) +- chore: require node 8 for samples ([#53](https://github.com/googleapis/nodejs-os-login/pull/53)) +- chore(deps): lock file maintenance ([#51](https://github.com/googleapis/nodejs-os-login/pull/51)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#48](https://github.com/googleapis/nodejs-os-login/pull/48)) +- test: use strictEqual in tests ([#49](https://github.com/googleapis/nodejs-os-login/pull/49)) +- chore(deps): lock file maintenance ([#47](https://github.com/googleapis/nodejs-os-login/pull/47)) +- chore(deps): lock file maintenance ([#45](https://github.com/googleapis/nodejs-os-login/pull/45)) +- chore(deps): lock file maintenance ([#44](https://github.com/googleapis/nodejs-os-login/pull/44)) +- chore(deps): lock file maintenance ([#42](https://github.com/googleapis/nodejs-os-login/pull/42)) +- chore(deps): lock file maintenance ([#41](https://github.com/googleapis/nodejs-os-login/pull/41)) +- chore(deps): lock file maintenance ([#40](https://github.com/googleapis/nodejs-os-login/pull/40)) +- Add license header to synth.py ([#39](https://github.com/googleapis/nodejs-os-login/pull/39)) +- Add synth.py and update google-gax ([#36](https://github.com/googleapis/nodejs-os-login/pull/36)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v2.3.0 ([#37](https://github.com/googleapis/nodejs-os-login/pull/37)) +- Configure Renovate ([#30](https://github.com/googleapis/nodejs-os-login/pull/30)) +- chore(package): update eslint to version 5.0.0 ([#31](https://github.com/googleapis/nodejs-os-login/pull/31)) +- refactor: drop repo-tool as an exec wrapper ([#35](https://github.com/googleapis/nodejs-os-login/pull/35)) +- fix: update linking for samples ([#32](https://github.com/googleapis/nodejs-os-login/pull/32)) +- chore: update sample lockfiles ([#34](https://github.com/googleapis/nodejs-os-login/pull/34)) +- chore(package): update nyc to version 12.0.2 +- chore: lock files maintenance ([#26](https://github.com/googleapis/nodejs-os-login/pull/26)) +- chore: the ultimate fix for repo-tools EPERM ([#25](https://github.com/googleapis/nodejs-os-login/pull/25)) +- chore: timeout for system test ([#24](https://github.com/googleapis/nodejs-os-login/pull/24)) +- chore: lock files maintenance ([#23](https://github.com/googleapis/nodejs-os-login/pull/23)) +- chore: test on node10 ([#22](https://github.com/googleapis/nodejs-os-login/pull/22)) +- chore: lock files maintenance ([#20](https://github.com/googleapis/nodejs-os-login/pull/20)) +- chore: workaround for repo-tools EPERM ([#19](https://github.com/googleapis/nodejs-os-login/pull/19)) diff --git a/packages/google-cloud-oslogin/CODE_OF_CONDUCT.md b/packages/google-cloud-oslogin/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-oslogin/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-oslogin/CONTRIBUTING.md b/packages/google-cloud-oslogin/CONTRIBUTING.md new file mode 100644 index 000000000000..d85264cd28fb --- /dev/null +++ b/packages/google-cloud-oslogin/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud OS Login API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=oslogin.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-oslogin/LICENSE b/packages/google-cloud-oslogin/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-oslogin/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-oslogin/README.md b/packages/google-cloud-oslogin/README.md new file mode 100644 index 000000000000..ce0f4d4624d8 --- /dev/null +++ b/packages/google-cloud-oslogin/README.md @@ -0,0 +1,188 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud OS Login: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/os-login.svg)](https://www.npmjs.org/package/@google-cloud/os-login) + + + + +Google Cloud OS Login API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google Cloud OS Login Node.js Client API Reference][client-docs] +* [Google Cloud OS Login Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud OS Login API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/os-login +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The unique ID for the user in format `users/{user}`. + */ +// const name = 'abc123' +/** + * The project ID of the Google Cloud Platform project. + */ +// const projectId = 'abc123' +/** + * A system ID for filtering the results of the request. + */ +// const systemId = 'abc123' + +// Imports the Oslogin library +const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + +// Instantiates a client +const osloginClient = new OsLoginServiceClient(); + +async function callGetLoginProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getLoginProfile(request); + console.log(response[0]); +} + +callGetLoginProfile(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Os_login_service.delete_posix_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js,samples/README.md) | +| Os_login_service.delete_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js,samples/README.md) | +| Os_login_service.get_login_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js,samples/README.md) | +| Os_login_service.get_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js,samples/README.md) | +| Os_login_service.import_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js,samples/README.md) | +| Os_login_service.update_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js,samples/README.md) | +| Os_login_service.delete_posix_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js,samples/README.md) | +| Os_login_service.delete_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js,samples/README.md) | +| Os_login_service.get_login_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js,samples/README.md) | +| Os_login_service.get_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js,samples/README.md) | +| Os_login_service.import_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js,samples/README.md) | +| Os_login_service.update_ssh_public_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/quickstart.js,samples/README.md) | +| Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/test/sample.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/test/sample.test.js,samples/README.md) | + + + +The [Google Cloud OS Login Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/os-login@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/os-login/latest +[product-docs]: https://cloud.google.com/compute/docs/oslogin/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=oslogin.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-oslogin/linkinator.config.json b/packages/google-cloud-oslogin/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-oslogin/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-oslogin/owlbot.py b/packages/google-cloud-oslogin/owlbot.py new file mode 100644 index 000000000000..a0ff1e286d8f --- /dev/null +++ b/packages/google-cloud-oslogin/owlbot.py @@ -0,0 +1,19 @@ +# Copyright 2022 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. + +import synthtool.languages.node as node + +node.owlbot_main(templates_excludes=[ +README.md' +]) diff --git a/packages/google-cloud-oslogin/package.json b/packages/google-cloud-oslogin/package.json new file mode 100644 index 000000000000..8f52e47f51f8 --- /dev/null +++ b/packages/google-cloud-oslogin/package.json @@ -0,0 +1,69 @@ +{ + "name": "@google-cloud/os-login", + "description": "Google Cloud OS Login API client for Node.js", + "version": "4.0.2", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-os-login", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src", + "AUTHORS", + "COPYING" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google os login", + "os login", + "Google Cloud OS Login API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "lint": "gts check", + "fix": "gts fix", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common.proto new file mode 100644 index 000000000000..aec538c826fe --- /dev/null +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common.proto @@ -0,0 +1,69 @@ +// Copyright 2017 Google Inc. +// +// 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.cloud.oslogin.common; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/common;common"; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.common"; + + +// The POSIX account information associated with a Google account. +message PosixAccount { + // Only one POSIX account can be marked as primary. + bool primary = 1; + + // The username of the POSIX account. + string username = 2; + + // The user ID. + int64 uid = 3; + + // The default group ID. + int64 gid = 4; + + // The path to the home directory for this account. + string home_directory = 5; + + // The path to the logic shell for this account. + string shell = 6; + + // The GECOS (user information) entry for this account. + string gecos = 7; + + // System identifier for which account the username or uid applies to. + // By default, the empty value is used. + string system_id = 8; + + // Output only. A POSIX account identifier. + string account_id = 9; +} + +// The SSH public key information associated with a Google account. +message SshPublicKey { + // Public key text in SSH format, defined by + // RFC4253 + // section 6.6. + string key = 1; + + // An expiration time in microseconds since epoch. + int64 expiration_time_usec = 2; + + // Output only. The SHA-256 fingerprint of the SSH public key. + string fingerprint = 3; +} diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto new file mode 100644 index 000000000000..4d9755f0d205 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/common/common.proto @@ -0,0 +1,111 @@ +// Copyright 2019 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.cloud.oslogin.common; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.OsLogin.Common"; +option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/common;common"; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.common"; +option php_namespace = "Google\\Cloud\\OsLogin\\Common"; +option ruby_package = "Google::Cloud::OsLogin::Common"; + +// Define a "User" resource owned by OS Login. +option (google.api.resource_definition) = { + type: "oslogin.googleapis.com/User" + pattern: "users/{user}" +}; + +// The operating system options for account entries. +enum OperatingSystemType { + // The operating system type associated with the user account information is + // unspecified. + OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0; + + // Linux user account information. + LINUX = 1; + + // Windows user account information. + WINDOWS = 2; +} + +// The POSIX account information associated with a Google account. +message PosixAccount { + option (google.api.resource) = { + type: "oslogin.googleapis.com/PosixAccount" + pattern: "users/{user}/projects/{project}" + }; + + // Only one POSIX account can be marked as primary. + bool primary = 1; + + // The username of the POSIX account. + string username = 2; + + // The user ID. + int64 uid = 3; + + // The default group ID. + int64 gid = 4; + + // The path to the home directory for this account. + string home_directory = 5; + + // The path to the logic shell for this account. + string shell = 6; + + // The GECOS (user information) entry for this account. + string gecos = 7; + + // System identifier for which account the username or uid applies to. + // By default, the empty value is used. + string system_id = 8; + + // Output only. A POSIX account identifier. + string account_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The operating system type where this account applies. + OperatingSystemType operating_system_type = 10; + + // Output only. The canonical resource name. + string name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The SSH public key information associated with a Google account. +message SshPublicKey { + option (google.api.resource) = { + type: "oslogin.googleapis.com/SshPublicKey" + pattern: "users/{user}/sshPublicKeys/{fingerprint}" + }; + + // Public key text in SSH format, defined by + // RFC4253 + // section 6.6. + string key = 1; + + // An expiration time in microseconds since epoch. + int64 expiration_time_usec = 2; + + // Output only. The SHA-256 fingerprint of the SSH public key. + string fingerprint = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The canonical resource name. + string name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1/oslogin.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1/oslogin.proto new file mode 100644 index 000000000000..25e9be0a07e7 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1/oslogin.proto @@ -0,0 +1,212 @@ +// Copyright 2019 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.cloud.oslogin.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/oslogin/common/common.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.OsLogin.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin"; +option java_multiple_files = true; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.v1"; +option php_namespace = "Google\\Cloud\\OsLogin\\V1"; +option ruby_package = "Google::Cloud::OsLogin::V1"; + +// Cloud OS Login API +// +// The Cloud OS Login API allows you to manage users and their associated SSH +// public keys for logging into virtual machines on Google Cloud Platform. +service OsLoginService { + option (google.api.default_host) = "oslogin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute"; + + // Deletes a POSIX account. + rpc DeletePosixAccount(DeletePosixAccountRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=users/*/projects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an SSH public key. + rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) { + option (google.api.http) = { + get: "/v1/{name=users/*}/loginProfile" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves an SSH public key. + rpc GetSshPublicKey(GetSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + get: "/v1/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + rpc ImportSshPublicKey(ImportSshPublicKeyRequest) returns (ImportSshPublicKeyResponse) { + option (google.api.http) = { + post: "/v1/{parent=users/*}:importSshPublicKey" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "parent,ssh_public_key"; + option (google.api.method_signature) = "parent,ssh_public_key,project_id"; + } + + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + patch: "/v1/{name=users/*/sshPublicKeys/*}" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "name,ssh_public_key"; + option (google.api.method_signature) = "name,ssh_public_key,update_mask"; + } +} + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +message LoginProfile { + // Required. A unique user ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of POSIX accounts associated with the user. + repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + + // A map from SSH public key fingerprint to the associated key object. + map ssh_public_keys = 3; +} + +// A request message for deleting a POSIX account entry. +message DeletePosixAccountRequest { + // Required. A reference to the POSIX account to update. POSIX accounts are identified + // by the project ID they are associated with. A reference to the POSIX + // account is in format `users/{user}/projects/{project}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/PosixAccount" + } + ]; +} + +// A request message for deleting an SSH public key. +message DeleteSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for retrieving the login profile information for a user. +message GetLoginProfileRequest { + // Required. The unique ID for the user in format `users/{user}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/PosixAccount" + } + ]; + + // The project ID of the Google Cloud Platform project. + string project_id = 2; + + // A system ID for filtering the results of the request. + string system_id = 3; +} + +// A request message for retrieving an SSH public key. +message GetSshPublicKeyRequest { + // Required. The fingerprint of the public key to retrieve. Public keys are identified + // by their SHA-256 fingerprint. The fingerprint of the public key is in + // format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for importing an SSH public key. +message ImportSshPublicKeyRequest { + // Required. The unique ID for the user in format `users/{user}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Optional. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The project ID of the Google Cloud Platform project. + string project_id = 3; +} + +// A response message for importing an SSH public key. +message ImportSshPublicKeyResponse { + // The login profile information for the user. + LoginProfile login_profile = 1; +} + +// A request message for updating an SSH public key. +message UpdateSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Mask to control which fields get updated. Updates all if not present. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1alpha/oslogin.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1alpha/oslogin.proto new file mode 100644 index 000000000000..806864a91c21 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1alpha/oslogin.proto @@ -0,0 +1,146 @@ +// Copyright 2017 Google Inc. +// +// 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.cloud.oslogin.v1alpha; + +import "google/api/annotations.proto"; +import "google/cloud/oslogin/common.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1alpha;oslogin"; +option java_multiple_files = true; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.v1alpha"; + + +// Cloud OS Login API +// +// The Cloud OS Login API allows you to manage users and their associated SSH +// public keys for logging into virtual machines on Google Cloud Platform. +service OsLoginService { + // Deletes a POSIX account. + rpc DeletePosixAccount(DeletePosixAccountRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v1alpha/{name=users/*/projects/*}" }; + } + + // Deletes an SSH public key. + rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v1alpha/{name=users/*/sshPublicKeys/*}" }; + } + + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) { + option (google.api.http) = { get: "/v1alpha/{name=users/*}/loginProfile" }; + } + + // Retrieves an SSH public key. + rpc GetSshPublicKey(GetSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { get: "/v1alpha/{name=users/*/sshPublicKeys/*}" }; + } + + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + rpc ImportSshPublicKey(ImportSshPublicKeyRequest) returns (ImportSshPublicKeyResponse) { + option (google.api.http) = { post: "/v1alpha/{parent=users/*}:importSshPublicKey" body: "ssh_public_key" }; + } + + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { patch: "/v1alpha/{name=users/*/sshPublicKeys/*}" body: "ssh_public_key" }; + } +} + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +message LoginProfile { + // A unique user ID for identifying the user. + string name = 1; + + // The list of POSIX accounts associated with the Directory API user. + repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + + // A map from SSH public key fingerprint to the associated key object. + map ssh_public_keys = 3; + + // Indicates if the user is suspended. + bool suspended = 4; +} + +// A request message for deleting a POSIX account entry. +message DeletePosixAccountRequest { + // A reference to the POSIX account to update. POSIX accounts are identified + // by the project ID they are associated with. A reference to the POSIX + // account is in format `users/{user}/projects/{project}`. + string name = 1; +} + +// A request message for deleting an SSH public key. +message DeleteSshPublicKeyRequest { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1; +} + +// A request message for retrieving the login profile information for a user. +message GetLoginProfileRequest { + // The unique ID for the user in format `users/{user}`. + string name = 1; +} + +// A request message for retrieving an SSH public key. +message GetSshPublicKeyRequest { + // The fingerprint of the public key to retrieve. Public keys are identified + // by their SHA-256 fingerprint. The fingerprint of the public key is in + // format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1; +} + +// A request message for importing an SSH public key. +message ImportSshPublicKeyRequest { + // The unique ID for the user in format `users/{user}`. + string parent = 1; + + // The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2; + + // The project ID of the Google Cloud Platform project. + string project_id = 3; +} + +// A response message for importing an SSH public key. +message ImportSshPublicKeyResponse { + // The login profile information for the user. + LoginProfile login_profile = 1; +} + +// A request message for updating an SSH public key. +message UpdateSshPublicKeyRequest { + // The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1; + + // The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2; + + // Mask to control which fields get updated. Updates all if not present. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto new file mode 100644 index 000000000000..a5d7847466a0 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto @@ -0,0 +1,208 @@ +// Copyright 2019 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.cloud.oslogin.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/oslogin/common/common.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.OsLogin.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta;oslogin"; +option java_multiple_files = true; +option java_outer_classname = "OsLoginProto"; +option java_package = "com.google.cloud.oslogin.v1beta"; +option php_namespace = "Google\\Cloud\\OsLogin\\V1beta"; +option ruby_package = "Google::Cloud::OsLogin::V1beta"; + +// Cloud OS Login API +// +// The Cloud OS Login API allows you to manage users and their associated SSH +// public keys for logging into virtual machines on Google Cloud Platform. +service OsLoginService { + option (google.api.default_host) = "oslogin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly"; + + // Deletes a POSIX account. + rpc DeletePosixAccount(DeletePosixAccountRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=users/*/projects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes an SSH public key. + rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the profile information used for logging in to a virtual machine + // on Google Compute Engine. + rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) { + option (google.api.http) = { + get: "/v1beta/{name=users/*}/loginProfile" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves an SSH public key. + rpc GetSshPublicKey(GetSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + get: "/v1beta/{name=users/*/sshPublicKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds an SSH public key and returns the profile information. Default POSIX + // account information is set when no username and UID exist as part of the + // login profile. + rpc ImportSshPublicKey(ImportSshPublicKeyRequest) returns (ImportSshPublicKeyResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=users/*}:importSshPublicKey" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "parent,ssh_public_key"; + option (google.api.method_signature) = "parent,ssh_public_key,project_id"; + } + + // Updates an SSH public key and returns the profile information. This method + // supports patch semantics. + rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { + option (google.api.http) = { + patch: "/v1beta/{name=users/*/sshPublicKeys/*}" + body: "ssh_public_key" + }; + option (google.api.method_signature) = "name,ssh_public_key"; + option (google.api.method_signature) = "name,ssh_public_key,update_mask"; + } +} + +// The user profile information used for logging in to a virtual machine on +// Google Compute Engine. +message LoginProfile { + // Required. A unique user ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of POSIX accounts associated with the user. + repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2; + + // A map from SSH public key fingerprint to the associated key object. + map ssh_public_keys = 3; +} + +// A request message for deleting a POSIX account entry. +message DeletePosixAccountRequest { + // Required. A reference to the POSIX account to update. POSIX accounts are identified + // by the project ID they are associated with. A reference to the POSIX + // account is in format `users/{user}/projects/{project}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/PosixAccount" + } + ]; +} + +// A request message for deleting an SSH public key. +message DeleteSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for retrieving the login profile information for a user. +message GetLoginProfileRequest { + // Required. The unique ID for the user in format `users/{user}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "oslogin.googleapis.com/User"]; + + // The project ID of the Google Cloud Platform project. + string project_id = 2; + + // A system ID for filtering the results of the request. + string system_id = 3; +} + +// A request message for retrieving an SSH public key. +message GetSshPublicKeyRequest { + // Required. The fingerprint of the public key to retrieve. Public keys are identified + // by their SHA-256 fingerprint. The fingerprint of the public key is in + // format `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; +} + +// A request message for importing an SSH public key. +message ImportSshPublicKeyRequest { + // The unique ID for the user in format `users/{user}`. + string parent = 1 [(google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/SshPublicKey" + }]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // The project ID of the Google Cloud Platform project. + string project_id = 3; +} + +// A response message for importing an SSH public key. +message ImportSshPublicKeyResponse { + // The login profile information for the user. + LoginProfile login_profile = 1; +} + +// A request message for updating an SSH public key. +message UpdateSshPublicKeyRequest { + // Required. The fingerprint of the public key to update. Public keys are identified by + // their SHA-256 fingerprint. The fingerprint of the public key is in format + // `users/{user}/sshPublicKeys/{fingerprint}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Mask to control which fields get updated. Updates all if not present. + google.protobuf.FieldMask update_mask = 3; +} diff --git a/packages/google-cloud-oslogin/protos/protos.d.ts b/packages/google-cloud-oslogin/protos/protos.d.ts new file mode 100644 index 000000000000..a5dde2857104 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/protos.d.ts @@ -0,0 +1,6429 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace oslogin. */ + namespace oslogin { + + /** Namespace common. */ + namespace common { + + /** OperatingSystemType enum. */ + enum OperatingSystemType { + OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0, + LINUX = 1, + WINDOWS = 2 + } + + /** Properties of a PosixAccount. */ + interface IPosixAccount { + + /** PosixAccount primary */ + primary?: (boolean|null); + + /** PosixAccount username */ + username?: (string|null); + + /** PosixAccount uid */ + uid?: (number|Long|string|null); + + /** PosixAccount gid */ + gid?: (number|Long|string|null); + + /** PosixAccount homeDirectory */ + homeDirectory?: (string|null); + + /** PosixAccount shell */ + shell?: (string|null); + + /** PosixAccount gecos */ + gecos?: (string|null); + + /** PosixAccount systemId */ + systemId?: (string|null); + + /** PosixAccount accountId */ + accountId?: (string|null); + + /** PosixAccount operatingSystemType */ + operatingSystemType?: (google.cloud.oslogin.common.OperatingSystemType|keyof typeof google.cloud.oslogin.common.OperatingSystemType|null); + + /** PosixAccount name */ + name?: (string|null); + } + + /** Represents a PosixAccount. */ + class PosixAccount implements IPosixAccount { + + /** + * Constructs a new PosixAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.common.IPosixAccount); + + /** PosixAccount primary. */ + public primary: boolean; + + /** PosixAccount username. */ + public username: string; + + /** PosixAccount uid. */ + public uid: (number|Long|string); + + /** PosixAccount gid. */ + public gid: (number|Long|string); + + /** PosixAccount homeDirectory. */ + public homeDirectory: string; + + /** PosixAccount shell. */ + public shell: string; + + /** PosixAccount gecos. */ + public gecos: string; + + /** PosixAccount systemId. */ + public systemId: string; + + /** PosixAccount accountId. */ + public accountId: string; + + /** PosixAccount operatingSystemType. */ + public operatingSystemType: (google.cloud.oslogin.common.OperatingSystemType|keyof typeof google.cloud.oslogin.common.OperatingSystemType); + + /** PosixAccount name. */ + public name: string; + + /** + * Creates a new PosixAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns PosixAccount instance + */ + public static create(properties?: google.cloud.oslogin.common.IPosixAccount): google.cloud.oslogin.common.PosixAccount; + + /** + * Encodes the specified PosixAccount message. Does not implicitly {@link google.cloud.oslogin.common.PosixAccount.verify|verify} messages. + * @param message PosixAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.common.IPosixAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PosixAccount message, length delimited. Does not implicitly {@link google.cloud.oslogin.common.PosixAccount.verify|verify} messages. + * @param message PosixAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.common.IPosixAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PosixAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PosixAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.common.PosixAccount; + + /** + * Decodes a PosixAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PosixAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.common.PosixAccount; + + /** + * Verifies a PosixAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PosixAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PosixAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.common.PosixAccount; + + /** + * Creates a plain object from a PosixAccount message. Also converts values to other types if specified. + * @param message PosixAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.common.PosixAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PosixAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PosixAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SshPublicKey. */ + interface ISshPublicKey { + + /** SshPublicKey key */ + key?: (string|null); + + /** SshPublicKey expirationTimeUsec */ + expirationTimeUsec?: (number|Long|string|null); + + /** SshPublicKey fingerprint */ + fingerprint?: (string|null); + + /** SshPublicKey name */ + name?: (string|null); + } + + /** Represents a SshPublicKey. */ + class SshPublicKey implements ISshPublicKey { + + /** + * Constructs a new SshPublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.common.ISshPublicKey); + + /** SshPublicKey key. */ + public key: string; + + /** SshPublicKey expirationTimeUsec. */ + public expirationTimeUsec: (number|Long|string); + + /** SshPublicKey fingerprint. */ + public fingerprint: string; + + /** SshPublicKey name. */ + public name: string; + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SshPublicKey instance + */ + public static create(properties?: google.cloud.oslogin.common.ISshPublicKey): google.cloud.oslogin.common.SshPublicKey; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.oslogin.common.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.common.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.oslogin.common.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.common.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.common.SshPublicKey; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.common.SshPublicKey; + + /** + * Verifies a SshPublicKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SshPublicKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.common.SshPublicKey; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @param message SshPublicKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.common.SshPublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SshPublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SshPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1. */ + namespace v1 { + + /** Represents an OsLoginService */ + class OsLoginService extends $protobuf.rpc.Service { + + /** + * Constructs a new OsLoginService 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 OsLoginService 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): OsLoginService; + + /** + * Calls DeletePosixAccount. + * @param request DeletePosixAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePosixAccount(request: google.cloud.oslogin.v1.IDeletePosixAccountRequest, callback: google.cloud.oslogin.v1.OsLoginService.DeletePosixAccountCallback): void; + + /** + * Calls DeletePosixAccount. + * @param request DeletePosixAccountRequest message or plain object + * @returns Promise + */ + public deletePosixAccount(request: google.cloud.oslogin.v1.IDeletePosixAccountRequest): Promise; + + /** + * Calls DeleteSshPublicKey. + * @param request DeleteSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSshPublicKey(request: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, callback: google.cloud.oslogin.v1.OsLoginService.DeleteSshPublicKeyCallback): void; + + /** + * Calls DeleteSshPublicKey. + * @param request DeleteSshPublicKeyRequest message or plain object + * @returns Promise + */ + public deleteSshPublicKey(request: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest): Promise; + + /** + * Calls GetLoginProfile. + * @param request GetLoginProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LoginProfile + */ + public getLoginProfile(request: google.cloud.oslogin.v1.IGetLoginProfileRequest, callback: google.cloud.oslogin.v1.OsLoginService.GetLoginProfileCallback): void; + + /** + * Calls GetLoginProfile. + * @param request GetLoginProfileRequest message or plain object + * @returns Promise + */ + public getLoginProfile(request: google.cloud.oslogin.v1.IGetLoginProfileRequest): Promise; + + /** + * Calls GetSshPublicKey. + * @param request GetSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SshPublicKey + */ + public getSshPublicKey(request: google.cloud.oslogin.v1.IGetSshPublicKeyRequest, callback: google.cloud.oslogin.v1.OsLoginService.GetSshPublicKeyCallback): void; + + /** + * Calls GetSshPublicKey. + * @param request GetSshPublicKeyRequest message or plain object + * @returns Promise + */ + public getSshPublicKey(request: google.cloud.oslogin.v1.IGetSshPublicKeyRequest): Promise; + + /** + * Calls ImportSshPublicKey. + * @param request ImportSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImportSshPublicKeyResponse + */ + public importSshPublicKey(request: google.cloud.oslogin.v1.IImportSshPublicKeyRequest, callback: google.cloud.oslogin.v1.OsLoginService.ImportSshPublicKeyCallback): void; + + /** + * Calls ImportSshPublicKey. + * @param request ImportSshPublicKeyRequest message or plain object + * @returns Promise + */ + public importSshPublicKey(request: google.cloud.oslogin.v1.IImportSshPublicKeyRequest): Promise; + + /** + * Calls UpdateSshPublicKey. + * @param request UpdateSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SshPublicKey + */ + public updateSshPublicKey(request: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, callback: google.cloud.oslogin.v1.OsLoginService.UpdateSshPublicKeyCallback): void; + + /** + * Calls UpdateSshPublicKey. + * @param request UpdateSshPublicKeyRequest message or plain object + * @returns Promise + */ + public updateSshPublicKey(request: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest): Promise; + } + + namespace OsLoginService { + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|deletePosixAccount}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePosixAccountCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|deleteSshPublicKey}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSshPublicKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|getLoginProfile}. + * @param error Error, if any + * @param [response] LoginProfile + */ + type GetLoginProfileCallback = (error: (Error|null), response?: google.cloud.oslogin.v1.LoginProfile) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|getSshPublicKey}. + * @param error Error, if any + * @param [response] SshPublicKey + */ + type GetSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.common.SshPublicKey) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|importSshPublicKey}. + * @param error Error, if any + * @param [response] ImportSshPublicKeyResponse + */ + type ImportSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.v1.ImportSshPublicKeyResponse) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|updateSshPublicKey}. + * @param error Error, if any + * @param [response] SshPublicKey + */ + type UpdateSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.common.SshPublicKey) => void; + } + + /** Properties of a LoginProfile. */ + interface ILoginProfile { + + /** LoginProfile name */ + name?: (string|null); + + /** LoginProfile posixAccounts */ + posixAccounts?: (google.cloud.oslogin.common.IPosixAccount[]|null); + + /** LoginProfile sshPublicKeys */ + sshPublicKeys?: ({ [k: string]: google.cloud.oslogin.common.ISshPublicKey }|null); + } + + /** Represents a LoginProfile. */ + class LoginProfile implements ILoginProfile { + + /** + * Constructs a new LoginProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.ILoginProfile); + + /** LoginProfile name. */ + public name: string; + + /** LoginProfile posixAccounts. */ + public posixAccounts: google.cloud.oslogin.common.IPosixAccount[]; + + /** LoginProfile sshPublicKeys. */ + public sshPublicKeys: { [k: string]: google.cloud.oslogin.common.ISshPublicKey }; + + /** + * Creates a new LoginProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns LoginProfile instance + */ + public static create(properties?: google.cloud.oslogin.v1.ILoginProfile): google.cloud.oslogin.v1.LoginProfile; + + /** + * Encodes the specified LoginProfile message. Does not implicitly {@link google.cloud.oslogin.v1.LoginProfile.verify|verify} messages. + * @param message LoginProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.ILoginProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoginProfile message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.LoginProfile.verify|verify} messages. + * @param message LoginProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.ILoginProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoginProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.LoginProfile; + + /** + * Decodes a LoginProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.LoginProfile; + + /** + * Verifies a LoginProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoginProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoginProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.LoginProfile; + + /** + * Creates a plain object from a LoginProfile message. Also converts values to other types if specified. + * @param message LoginProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.LoginProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoginProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoginProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePosixAccountRequest. */ + interface IDeletePosixAccountRequest { + + /** DeletePosixAccountRequest name */ + name?: (string|null); + } + + /** Represents a DeletePosixAccountRequest. */ + class DeletePosixAccountRequest implements IDeletePosixAccountRequest { + + /** + * Constructs a new DeletePosixAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IDeletePosixAccountRequest); + + /** DeletePosixAccountRequest name. */ + public name: string; + + /** + * Creates a new DeletePosixAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePosixAccountRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IDeletePosixAccountRequest): google.cloud.oslogin.v1.DeletePosixAccountRequest; + + /** + * Encodes the specified DeletePosixAccountRequest message. Does not implicitly {@link google.cloud.oslogin.v1.DeletePosixAccountRequest.verify|verify} messages. + * @param message DeletePosixAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IDeletePosixAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePosixAccountRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.DeletePosixAccountRequest.verify|verify} messages. + * @param message DeletePosixAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IDeletePosixAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.DeletePosixAccountRequest; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.DeletePosixAccountRequest; + + /** + * Verifies a DeletePosixAccountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePosixAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePosixAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.DeletePosixAccountRequest; + + /** + * Creates a plain object from a DeletePosixAccountRequest message. Also converts values to other types if specified. + * @param message DeletePosixAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.DeletePosixAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePosixAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePosixAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSshPublicKeyRequest. */ + interface IDeleteSshPublicKeyRequest { + + /** DeleteSshPublicKeyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSshPublicKeyRequest. */ + class DeleteSshPublicKeyRequest implements IDeleteSshPublicKeyRequest { + + /** + * Constructs a new DeleteSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest); + + /** DeleteSshPublicKeyRequest name. */ + public name: string; + + /** + * Creates a new DeleteSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest): google.cloud.oslogin.v1.DeleteSshPublicKeyRequest; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.verify|verify} messages. + * @param message DeleteSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.verify|verify} messages. + * @param message DeleteSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.DeleteSshPublicKeyRequest; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.DeleteSshPublicKeyRequest; + + /** + * Verifies a DeleteSshPublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.DeleteSshPublicKeyRequest; + + /** + * Creates a plain object from a DeleteSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message DeleteSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.DeleteSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLoginProfileRequest. */ + interface IGetLoginProfileRequest { + + /** GetLoginProfileRequest name */ + name?: (string|null); + + /** GetLoginProfileRequest projectId */ + projectId?: (string|null); + + /** GetLoginProfileRequest systemId */ + systemId?: (string|null); + } + + /** Represents a GetLoginProfileRequest. */ + class GetLoginProfileRequest implements IGetLoginProfileRequest { + + /** + * Constructs a new GetLoginProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IGetLoginProfileRequest); + + /** GetLoginProfileRequest name. */ + public name: string; + + /** GetLoginProfileRequest projectId. */ + public projectId: string; + + /** GetLoginProfileRequest systemId. */ + public systemId: string; + + /** + * Creates a new GetLoginProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLoginProfileRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IGetLoginProfileRequest): google.cloud.oslogin.v1.GetLoginProfileRequest; + + /** + * Encodes the specified GetLoginProfileRequest message. Does not implicitly {@link google.cloud.oslogin.v1.GetLoginProfileRequest.verify|verify} messages. + * @param message GetLoginProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IGetLoginProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLoginProfileRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.GetLoginProfileRequest.verify|verify} messages. + * @param message GetLoginProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IGetLoginProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.GetLoginProfileRequest; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.GetLoginProfileRequest; + + /** + * Verifies a GetLoginProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLoginProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLoginProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.GetLoginProfileRequest; + + /** + * Creates a plain object from a GetLoginProfileRequest message. Also converts values to other types if specified. + * @param message GetLoginProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.GetLoginProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLoginProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLoginProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSshPublicKeyRequest. */ + interface IGetSshPublicKeyRequest { + + /** GetSshPublicKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetSshPublicKeyRequest. */ + class GetSshPublicKeyRequest implements IGetSshPublicKeyRequest { + + /** + * Constructs a new GetSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IGetSshPublicKeyRequest); + + /** GetSshPublicKeyRequest name. */ + public name: string; + + /** + * Creates a new GetSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IGetSshPublicKeyRequest): google.cloud.oslogin.v1.GetSshPublicKeyRequest; + + /** + * Encodes the specified GetSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.GetSshPublicKeyRequest.verify|verify} messages. + * @param message GetSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IGetSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.GetSshPublicKeyRequest.verify|verify} messages. + * @param message GetSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IGetSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.GetSshPublicKeyRequest; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.GetSshPublicKeyRequest; + + /** + * Verifies a GetSshPublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.GetSshPublicKeyRequest; + + /** + * Creates a plain object from a GetSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message GetSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.GetSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportSshPublicKeyRequest. */ + interface IImportSshPublicKeyRequest { + + /** ImportSshPublicKeyRequest parent */ + parent?: (string|null); + + /** ImportSshPublicKeyRequest sshPublicKey */ + sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** ImportSshPublicKeyRequest projectId */ + projectId?: (string|null); + } + + /** Represents an ImportSshPublicKeyRequest. */ + class ImportSshPublicKeyRequest implements IImportSshPublicKeyRequest { + + /** + * Constructs a new ImportSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IImportSshPublicKeyRequest); + + /** ImportSshPublicKeyRequest parent. */ + public parent: string; + + /** ImportSshPublicKeyRequest sshPublicKey. */ + public sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** ImportSshPublicKeyRequest projectId. */ + public projectId: string; + + /** + * Creates a new ImportSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IImportSshPublicKeyRequest): google.cloud.oslogin.v1.ImportSshPublicKeyRequest; + + /** + * Encodes the specified ImportSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyRequest.verify|verify} messages. + * @param message ImportSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IImportSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyRequest.verify|verify} messages. + * @param message ImportSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IImportSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.ImportSshPublicKeyRequest; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.ImportSshPublicKeyRequest; + + /** + * Verifies an ImportSshPublicKeyRequest message. + * @param message Plain 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 ImportSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.ImportSshPublicKeyRequest; + + /** + * Creates a plain object from an ImportSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message ImportSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.ImportSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportSshPublicKeyResponse. */ + interface IImportSshPublicKeyResponse { + + /** ImportSshPublicKeyResponse loginProfile */ + loginProfile?: (google.cloud.oslogin.v1.ILoginProfile|null); + } + + /** Represents an ImportSshPublicKeyResponse. */ + class ImportSshPublicKeyResponse implements IImportSshPublicKeyResponse { + + /** + * Constructs a new ImportSshPublicKeyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IImportSshPublicKeyResponse); + + /** ImportSshPublicKeyResponse loginProfile. */ + public loginProfile?: (google.cloud.oslogin.v1.ILoginProfile|null); + + /** + * Creates a new ImportSshPublicKeyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSshPublicKeyResponse instance + */ + public static create(properties?: google.cloud.oslogin.v1.IImportSshPublicKeyResponse): google.cloud.oslogin.v1.ImportSshPublicKeyResponse; + + /** + * Encodes the specified ImportSshPublicKeyResponse message. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyResponse.verify|verify} messages. + * @param message ImportSshPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IImportSshPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSshPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyResponse.verify|verify} messages. + * @param message ImportSshPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IImportSshPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.ImportSshPublicKeyResponse; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.ImportSshPublicKeyResponse; + + /** + * Verifies an ImportSshPublicKeyResponse message. + * @param message Plain 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 ImportSshPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSshPublicKeyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.ImportSshPublicKeyResponse; + + /** + * Creates a plain object from an ImportSshPublicKeyResponse message. Also converts values to other types if specified. + * @param message ImportSshPublicKeyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.ImportSshPublicKeyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSshPublicKeyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportSshPublicKeyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSshPublicKeyRequest. */ + interface IUpdateSshPublicKeyRequest { + + /** UpdateSshPublicKeyRequest name */ + name?: (string|null); + + /** UpdateSshPublicKeyRequest sshPublicKey */ + sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** UpdateSshPublicKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSshPublicKeyRequest. */ + class UpdateSshPublicKeyRequest implements IUpdateSshPublicKeyRequest { + + /** + * Constructs a new UpdateSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest); + + /** UpdateSshPublicKeyRequest name. */ + public name: string; + + /** UpdateSshPublicKeyRequest sshPublicKey. */ + public sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** UpdateSshPublicKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest): google.cloud.oslogin.v1.UpdateSshPublicKeyRequest; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.verify|verify} messages. + * @param message UpdateSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.verify|verify} messages. + * @param message UpdateSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1.UpdateSshPublicKeyRequest; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1.UpdateSshPublicKeyRequest; + + /** + * Verifies an UpdateSshPublicKeyRequest message. + * @param message Plain 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 UpdateSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1.UpdateSshPublicKeyRequest; + + /** + * Creates a plain object from an UpdateSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message UpdateSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1.UpdateSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Represents an OsLoginService */ + class OsLoginService extends $protobuf.rpc.Service { + + /** + * Constructs a new OsLoginService 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 OsLoginService 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): OsLoginService; + + /** + * Calls DeletePosixAccount. + * @param request DeletePosixAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePosixAccount(request: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.DeletePosixAccountCallback): void; + + /** + * Calls DeletePosixAccount. + * @param request DeletePosixAccountRequest message or plain object + * @returns Promise + */ + public deletePosixAccount(request: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest): Promise; + + /** + * Calls DeleteSshPublicKey. + * @param request DeleteSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSshPublicKey(request: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.DeleteSshPublicKeyCallback): void; + + /** + * Calls DeleteSshPublicKey. + * @param request DeleteSshPublicKeyRequest message or plain object + * @returns Promise + */ + public deleteSshPublicKey(request: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest): Promise; + + /** + * Calls GetLoginProfile. + * @param request GetLoginProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LoginProfile + */ + public getLoginProfile(request: google.cloud.oslogin.v1beta.IGetLoginProfileRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.GetLoginProfileCallback): void; + + /** + * Calls GetLoginProfile. + * @param request GetLoginProfileRequest message or plain object + * @returns Promise + */ + public getLoginProfile(request: google.cloud.oslogin.v1beta.IGetLoginProfileRequest): Promise; + + /** + * Calls GetSshPublicKey. + * @param request GetSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SshPublicKey + */ + public getSshPublicKey(request: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.GetSshPublicKeyCallback): void; + + /** + * Calls GetSshPublicKey. + * @param request GetSshPublicKeyRequest message or plain object + * @returns Promise + */ + public getSshPublicKey(request: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest): Promise; + + /** + * Calls ImportSshPublicKey. + * @param request ImportSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImportSshPublicKeyResponse + */ + public importSshPublicKey(request: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.ImportSshPublicKeyCallback): void; + + /** + * Calls ImportSshPublicKey. + * @param request ImportSshPublicKeyRequest message or plain object + * @returns Promise + */ + public importSshPublicKey(request: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest): Promise; + + /** + * Calls UpdateSshPublicKey. + * @param request UpdateSshPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SshPublicKey + */ + public updateSshPublicKey(request: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, callback: google.cloud.oslogin.v1beta.OsLoginService.UpdateSshPublicKeyCallback): void; + + /** + * Calls UpdateSshPublicKey. + * @param request UpdateSshPublicKeyRequest message or plain object + * @returns Promise + */ + public updateSshPublicKey(request: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest): Promise; + } + + namespace OsLoginService { + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|deletePosixAccount}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePosixAccountCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|deleteSshPublicKey}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSshPublicKeyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|getLoginProfile}. + * @param error Error, if any + * @param [response] LoginProfile + */ + type GetLoginProfileCallback = (error: (Error|null), response?: google.cloud.oslogin.v1beta.LoginProfile) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|getSshPublicKey}. + * @param error Error, if any + * @param [response] SshPublicKey + */ + type GetSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.common.SshPublicKey) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|importSshPublicKey}. + * @param error Error, if any + * @param [response] ImportSshPublicKeyResponse + */ + type ImportSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) => void; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|updateSshPublicKey}. + * @param error Error, if any + * @param [response] SshPublicKey + */ + type UpdateSshPublicKeyCallback = (error: (Error|null), response?: google.cloud.oslogin.common.SshPublicKey) => void; + } + + /** Properties of a LoginProfile. */ + interface ILoginProfile { + + /** LoginProfile name */ + name?: (string|null); + + /** LoginProfile posixAccounts */ + posixAccounts?: (google.cloud.oslogin.common.IPosixAccount[]|null); + + /** LoginProfile sshPublicKeys */ + sshPublicKeys?: ({ [k: string]: google.cloud.oslogin.common.ISshPublicKey }|null); + } + + /** Represents a LoginProfile. */ + class LoginProfile implements ILoginProfile { + + /** + * Constructs a new LoginProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.ILoginProfile); + + /** LoginProfile name. */ + public name: string; + + /** LoginProfile posixAccounts. */ + public posixAccounts: google.cloud.oslogin.common.IPosixAccount[]; + + /** LoginProfile sshPublicKeys. */ + public sshPublicKeys: { [k: string]: google.cloud.oslogin.common.ISshPublicKey }; + + /** + * Creates a new LoginProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns LoginProfile instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.ILoginProfile): google.cloud.oslogin.v1beta.LoginProfile; + + /** + * Encodes the specified LoginProfile message. Does not implicitly {@link google.cloud.oslogin.v1beta.LoginProfile.verify|verify} messages. + * @param message LoginProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.ILoginProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoginProfile message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.LoginProfile.verify|verify} messages. + * @param message LoginProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.ILoginProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoginProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.LoginProfile; + + /** + * Decodes a LoginProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.LoginProfile; + + /** + * Verifies a LoginProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoginProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoginProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.LoginProfile; + + /** + * Creates a plain object from a LoginProfile message. Also converts values to other types if specified. + * @param message LoginProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.LoginProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoginProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoginProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePosixAccountRequest. */ + interface IDeletePosixAccountRequest { + + /** DeletePosixAccountRequest name */ + name?: (string|null); + } + + /** Represents a DeletePosixAccountRequest. */ + class DeletePosixAccountRequest implements IDeletePosixAccountRequest { + + /** + * Constructs a new DeletePosixAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest); + + /** DeletePosixAccountRequest name. */ + public name: string; + + /** + * Creates a new DeletePosixAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePosixAccountRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest): google.cloud.oslogin.v1beta.DeletePosixAccountRequest; + + /** + * Encodes the specified DeletePosixAccountRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.DeletePosixAccountRequest.verify|verify} messages. + * @param message DeletePosixAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePosixAccountRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.DeletePosixAccountRequest.verify|verify} messages. + * @param message DeletePosixAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.DeletePosixAccountRequest; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.DeletePosixAccountRequest; + + /** + * Verifies a DeletePosixAccountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePosixAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePosixAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.DeletePosixAccountRequest; + + /** + * Creates a plain object from a DeletePosixAccountRequest message. Also converts values to other types if specified. + * @param message DeletePosixAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.DeletePosixAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePosixAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePosixAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSshPublicKeyRequest. */ + interface IDeleteSshPublicKeyRequest { + + /** DeleteSshPublicKeyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSshPublicKeyRequest. */ + class DeleteSshPublicKeyRequest implements IDeleteSshPublicKeyRequest { + + /** + * Constructs a new DeleteSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest); + + /** DeleteSshPublicKeyRequest name. */ + public name: string; + + /** + * Creates a new DeleteSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest): google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.verify|verify} messages. + * @param message DeleteSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.verify|verify} messages. + * @param message DeleteSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; + + /** + * Verifies a DeleteSshPublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest; + + /** + * Creates a plain object from a DeleteSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message DeleteSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLoginProfileRequest. */ + interface IGetLoginProfileRequest { + + /** GetLoginProfileRequest name */ + name?: (string|null); + + /** GetLoginProfileRequest projectId */ + projectId?: (string|null); + + /** GetLoginProfileRequest systemId */ + systemId?: (string|null); + } + + /** Represents a GetLoginProfileRequest. */ + class GetLoginProfileRequest implements IGetLoginProfileRequest { + + /** + * Constructs a new GetLoginProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IGetLoginProfileRequest); + + /** GetLoginProfileRequest name. */ + public name: string; + + /** GetLoginProfileRequest projectId. */ + public projectId: string; + + /** GetLoginProfileRequest systemId. */ + public systemId: string; + + /** + * Creates a new GetLoginProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLoginProfileRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IGetLoginProfileRequest): google.cloud.oslogin.v1beta.GetLoginProfileRequest; + + /** + * Encodes the specified GetLoginProfileRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.GetLoginProfileRequest.verify|verify} messages. + * @param message GetLoginProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IGetLoginProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLoginProfileRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.GetLoginProfileRequest.verify|verify} messages. + * @param message GetLoginProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IGetLoginProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.GetLoginProfileRequest; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.GetLoginProfileRequest; + + /** + * Verifies a GetLoginProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLoginProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLoginProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.GetLoginProfileRequest; + + /** + * Creates a plain object from a GetLoginProfileRequest message. Also converts values to other types if specified. + * @param message GetLoginProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.GetLoginProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLoginProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLoginProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSshPublicKeyRequest. */ + interface IGetSshPublicKeyRequest { + + /** GetSshPublicKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetSshPublicKeyRequest. */ + class GetSshPublicKeyRequest implements IGetSshPublicKeyRequest { + + /** + * Constructs a new GetSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest); + + /** GetSshPublicKeyRequest name. */ + public name: string; + + /** + * Creates a new GetSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest): google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; + + /** + * Encodes the specified GetSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.verify|verify} messages. + * @param message GetSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.verify|verify} messages. + * @param message GetSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; + + /** + * Verifies a GetSshPublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.GetSshPublicKeyRequest; + + /** + * Creates a plain object from a GetSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message GetSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportSshPublicKeyRequest. */ + interface IImportSshPublicKeyRequest { + + /** ImportSshPublicKeyRequest parent */ + parent?: (string|null); + + /** ImportSshPublicKeyRequest sshPublicKey */ + sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** ImportSshPublicKeyRequest projectId */ + projectId?: (string|null); + } + + /** Represents an ImportSshPublicKeyRequest. */ + class ImportSshPublicKeyRequest implements IImportSshPublicKeyRequest { + + /** + * Constructs a new ImportSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest); + + /** ImportSshPublicKeyRequest parent. */ + public parent: string; + + /** ImportSshPublicKeyRequest sshPublicKey. */ + public sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** ImportSshPublicKeyRequest projectId. */ + public projectId: string; + + /** + * Creates a new ImportSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest): google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; + + /** + * Encodes the specified ImportSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.verify|verify} messages. + * @param message ImportSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.verify|verify} messages. + * @param message ImportSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; + + /** + * Verifies an ImportSshPublicKeyRequest message. + * @param message Plain 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 ImportSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest; + + /** + * Creates a plain object from an ImportSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message ImportSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportSshPublicKeyResponse. */ + interface IImportSshPublicKeyResponse { + + /** ImportSshPublicKeyResponse loginProfile */ + loginProfile?: (google.cloud.oslogin.v1beta.ILoginProfile|null); + } + + /** Represents an ImportSshPublicKeyResponse. */ + class ImportSshPublicKeyResponse implements IImportSshPublicKeyResponse { + + /** + * Constructs a new ImportSshPublicKeyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse); + + /** ImportSshPublicKeyResponse loginProfile. */ + public loginProfile?: (google.cloud.oslogin.v1beta.ILoginProfile|null); + + /** + * Creates a new ImportSshPublicKeyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportSshPublicKeyResponse instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse): google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; + + /** + * Encodes the specified ImportSshPublicKeyResponse message. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.verify|verify} messages. + * @param message ImportSshPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportSshPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.verify|verify} messages. + * @param message ImportSshPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; + + /** + * Verifies an ImportSshPublicKeyResponse message. + * @param message Plain 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 ImportSshPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportSshPublicKeyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse; + + /** + * Creates a plain object from an ImportSshPublicKeyResponse message. Also converts values to other types if specified. + * @param message ImportSshPublicKeyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportSshPublicKeyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportSshPublicKeyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSshPublicKeyRequest. */ + interface IUpdateSshPublicKeyRequest { + + /** UpdateSshPublicKeyRequest name */ + name?: (string|null); + + /** UpdateSshPublicKeyRequest sshPublicKey */ + sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** UpdateSshPublicKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSshPublicKeyRequest. */ + class UpdateSshPublicKeyRequest implements IUpdateSshPublicKeyRequest { + + /** + * Constructs a new UpdateSshPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest); + + /** UpdateSshPublicKeyRequest name. */ + public name: string; + + /** UpdateSshPublicKeyRequest sshPublicKey. */ + public sshPublicKey?: (google.cloud.oslogin.common.ISshPublicKey|null); + + /** UpdateSshPublicKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSshPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSshPublicKeyRequest instance + */ + public static create(properties?: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest): google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.verify|verify} messages. + * @param message UpdateSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.verify|verify} messages. + * @param message UpdateSshPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; + + /** + * Verifies an UpdateSshPublicKeyRequest message. + * @param message Plain 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 UpdateSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSshPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest; + + /** + * Creates a plain object from an UpdateSshPublicKeyRequest message. Also converts values to other types if specified. + * @param message UpdateSshPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSshPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSshPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** 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; + } + + /** 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 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; + } + } +} diff --git a/packages/google-cloud-oslogin/protos/protos.js b/packages/google-cloud-oslogin/protos/protos.js new file mode 100644 index 000000000000..0c786411ecb2 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/protos.js @@ -0,0 +1,16554 @@ +// Copyright 2022 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_os_login_protos || ($protobuf.roots._google_cloud_os_login_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.oslogin = (function() { + + /** + * Namespace oslogin. + * @memberof google.cloud + * @namespace + */ + var oslogin = {}; + + oslogin.common = (function() { + + /** + * Namespace common. + * @memberof google.cloud.oslogin + * @namespace + */ + var common = {}; + + /** + * OperatingSystemType enum. + * @name google.cloud.oslogin.common.OperatingSystemType + * @enum {number} + * @property {number} OPERATING_SYSTEM_TYPE_UNSPECIFIED=0 OPERATING_SYSTEM_TYPE_UNSPECIFIED value + * @property {number} LINUX=1 LINUX value + * @property {number} WINDOWS=2 WINDOWS value + */ + common.OperatingSystemType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATING_SYSTEM_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINUX"] = 1; + values[valuesById[2] = "WINDOWS"] = 2; + return values; + })(); + + common.PosixAccount = (function() { + + /** + * Properties of a PosixAccount. + * @memberof google.cloud.oslogin.common + * @interface IPosixAccount + * @property {boolean|null} [primary] PosixAccount primary + * @property {string|null} [username] PosixAccount username + * @property {number|Long|null} [uid] PosixAccount uid + * @property {number|Long|null} [gid] PosixAccount gid + * @property {string|null} [homeDirectory] PosixAccount homeDirectory + * @property {string|null} [shell] PosixAccount shell + * @property {string|null} [gecos] PosixAccount gecos + * @property {string|null} [systemId] PosixAccount systemId + * @property {string|null} [accountId] PosixAccount accountId + * @property {google.cloud.oslogin.common.OperatingSystemType|null} [operatingSystemType] PosixAccount operatingSystemType + * @property {string|null} [name] PosixAccount name + */ + + /** + * Constructs a new PosixAccount. + * @memberof google.cloud.oslogin.common + * @classdesc Represents a PosixAccount. + * @implements IPosixAccount + * @constructor + * @param {google.cloud.oslogin.common.IPosixAccount=} [properties] Properties to set + */ + function PosixAccount(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]]; + } + + /** + * PosixAccount primary. + * @member {boolean} primary + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.primary = false; + + /** + * PosixAccount username. + * @member {string} username + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.username = ""; + + /** + * PosixAccount uid. + * @member {number|Long} uid + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.uid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PosixAccount gid. + * @member {number|Long} gid + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.gid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PosixAccount homeDirectory. + * @member {string} homeDirectory + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.homeDirectory = ""; + + /** + * PosixAccount shell. + * @member {string} shell + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.shell = ""; + + /** + * PosixAccount gecos. + * @member {string} gecos + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.gecos = ""; + + /** + * PosixAccount systemId. + * @member {string} systemId + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.systemId = ""; + + /** + * PosixAccount accountId. + * @member {string} accountId + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.accountId = ""; + + /** + * PosixAccount operatingSystemType. + * @member {google.cloud.oslogin.common.OperatingSystemType} operatingSystemType + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.operatingSystemType = 0; + + /** + * PosixAccount name. + * @member {string} name + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + */ + PosixAccount.prototype.name = ""; + + /** + * Creates a new PosixAccount instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {google.cloud.oslogin.common.IPosixAccount=} [properties] Properties to set + * @returns {google.cloud.oslogin.common.PosixAccount} PosixAccount instance + */ + PosixAccount.create = function create(properties) { + return new PosixAccount(properties); + }; + + /** + * Encodes the specified PosixAccount message. Does not implicitly {@link google.cloud.oslogin.common.PosixAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {google.cloud.oslogin.common.IPosixAccount} message PosixAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PosixAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.primary); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.username); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.uid); + if (message.gid != null && Object.hasOwnProperty.call(message, "gid")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.gid); + if (message.homeDirectory != null && Object.hasOwnProperty.call(message, "homeDirectory")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.homeDirectory); + if (message.shell != null && Object.hasOwnProperty.call(message, "shell")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.shell); + if (message.gecos != null && Object.hasOwnProperty.call(message, "gecos")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.gecos); + if (message.systemId != null && Object.hasOwnProperty.call(message, "systemId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.systemId); + if (message.accountId != null && Object.hasOwnProperty.call(message, "accountId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.accountId); + if (message.operatingSystemType != null && Object.hasOwnProperty.call(message, "operatingSystemType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.operatingSystemType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.name); + return writer; + }; + + /** + * Encodes the specified PosixAccount message, length delimited. Does not implicitly {@link google.cloud.oslogin.common.PosixAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {google.cloud.oslogin.common.IPosixAccount} message PosixAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PosixAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PosixAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.common.PosixAccount} PosixAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PosixAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.common.PosixAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primary = reader.bool(); + break; + } + case 2: { + message.username = reader.string(); + break; + } + case 3: { + message.uid = reader.int64(); + break; + } + case 4: { + message.gid = reader.int64(); + break; + } + case 5: { + message.homeDirectory = reader.string(); + break; + } + case 6: { + message.shell = reader.string(); + break; + } + case 7: { + message.gecos = reader.string(); + break; + } + case 8: { + message.systemId = reader.string(); + break; + } + case 9: { + message.accountId = reader.string(); + break; + } + case 10: { + message.operatingSystemType = reader.int32(); + break; + } + case 11: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PosixAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.common.PosixAccount} PosixAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PosixAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PosixAccount message. + * @function verify + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PosixAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primary != null && message.hasOwnProperty("primary")) + if (typeof message.primary !== "boolean") + return "primary: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isInteger(message.uid) && !(message.uid && $util.isInteger(message.uid.low) && $util.isInteger(message.uid.high))) + return "uid: integer|Long expected"; + if (message.gid != null && message.hasOwnProperty("gid")) + if (!$util.isInteger(message.gid) && !(message.gid && $util.isInteger(message.gid.low) && $util.isInteger(message.gid.high))) + return "gid: integer|Long expected"; + if (message.homeDirectory != null && message.hasOwnProperty("homeDirectory")) + if (!$util.isString(message.homeDirectory)) + return "homeDirectory: string expected"; + if (message.shell != null && message.hasOwnProperty("shell")) + if (!$util.isString(message.shell)) + return "shell: string expected"; + if (message.gecos != null && message.hasOwnProperty("gecos")) + if (!$util.isString(message.gecos)) + return "gecos: string expected"; + if (message.systemId != null && message.hasOwnProperty("systemId")) + if (!$util.isString(message.systemId)) + return "systemId: string expected"; + if (message.accountId != null && message.hasOwnProperty("accountId")) + if (!$util.isString(message.accountId)) + return "accountId: string expected"; + if (message.operatingSystemType != null && message.hasOwnProperty("operatingSystemType")) + switch (message.operatingSystemType) { + default: + return "operatingSystemType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a PosixAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.common.PosixAccount} PosixAccount + */ + PosixAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.common.PosixAccount) + return object; + var message = new $root.google.cloud.oslogin.common.PosixAccount(); + if (object.primary != null) + message.primary = Boolean(object.primary); + if (object.username != null) + message.username = String(object.username); + if (object.uid != null) + if ($util.Long) + (message.uid = $util.Long.fromValue(object.uid)).unsigned = false; + else if (typeof object.uid === "string") + message.uid = parseInt(object.uid, 10); + else if (typeof object.uid === "number") + message.uid = object.uid; + else if (typeof object.uid === "object") + message.uid = new $util.LongBits(object.uid.low >>> 0, object.uid.high >>> 0).toNumber(); + if (object.gid != null) + if ($util.Long) + (message.gid = $util.Long.fromValue(object.gid)).unsigned = false; + else if (typeof object.gid === "string") + message.gid = parseInt(object.gid, 10); + else if (typeof object.gid === "number") + message.gid = object.gid; + else if (typeof object.gid === "object") + message.gid = new $util.LongBits(object.gid.low >>> 0, object.gid.high >>> 0).toNumber(); + if (object.homeDirectory != null) + message.homeDirectory = String(object.homeDirectory); + if (object.shell != null) + message.shell = String(object.shell); + if (object.gecos != null) + message.gecos = String(object.gecos); + if (object.systemId != null) + message.systemId = String(object.systemId); + if (object.accountId != null) + message.accountId = String(object.accountId); + switch (object.operatingSystemType) { + case "OPERATING_SYSTEM_TYPE_UNSPECIFIED": + case 0: + message.operatingSystemType = 0; + break; + case "LINUX": + case 1: + message.operatingSystemType = 1; + break; + case "WINDOWS": + case 2: + message.operatingSystemType = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PosixAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {google.cloud.oslogin.common.PosixAccount} message PosixAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PosixAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primary = false; + object.username = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.uid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.uid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gid = options.longs === String ? "0" : 0; + object.homeDirectory = ""; + object.shell = ""; + object.gecos = ""; + object.systemId = ""; + object.accountId = ""; + object.operatingSystemType = options.enums === String ? "OPERATING_SYSTEM_TYPE_UNSPECIFIED" : 0; + object.name = ""; + } + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = message.primary; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.uid != null && message.hasOwnProperty("uid")) + if (typeof message.uid === "number") + object.uid = options.longs === String ? String(message.uid) : message.uid; + else + object.uid = options.longs === String ? $util.Long.prototype.toString.call(message.uid) : options.longs === Number ? new $util.LongBits(message.uid.low >>> 0, message.uid.high >>> 0).toNumber() : message.uid; + if (message.gid != null && message.hasOwnProperty("gid")) + if (typeof message.gid === "number") + object.gid = options.longs === String ? String(message.gid) : message.gid; + else + object.gid = options.longs === String ? $util.Long.prototype.toString.call(message.gid) : options.longs === Number ? new $util.LongBits(message.gid.low >>> 0, message.gid.high >>> 0).toNumber() : message.gid; + if (message.homeDirectory != null && message.hasOwnProperty("homeDirectory")) + object.homeDirectory = message.homeDirectory; + if (message.shell != null && message.hasOwnProperty("shell")) + object.shell = message.shell; + if (message.gecos != null && message.hasOwnProperty("gecos")) + object.gecos = message.gecos; + if (message.systemId != null && message.hasOwnProperty("systemId")) + object.systemId = message.systemId; + if (message.accountId != null && message.hasOwnProperty("accountId")) + object.accountId = message.accountId; + if (message.operatingSystemType != null && message.hasOwnProperty("operatingSystemType")) + object.operatingSystemType = options.enums === String ? $root.google.cloud.oslogin.common.OperatingSystemType[message.operatingSystemType] : message.operatingSystemType; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this PosixAccount to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.common.PosixAccount + * @instance + * @returns {Object.} JSON object + */ + PosixAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PosixAccount + * @function getTypeUrl + * @memberof google.cloud.oslogin.common.PosixAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PosixAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.common.PosixAccount"; + }; + + return PosixAccount; + })(); + + common.SshPublicKey = (function() { + + /** + * Properties of a SshPublicKey. + * @memberof google.cloud.oslogin.common + * @interface ISshPublicKey + * @property {string|null} [key] SshPublicKey key + * @property {number|Long|null} [expirationTimeUsec] SshPublicKey expirationTimeUsec + * @property {string|null} [fingerprint] SshPublicKey fingerprint + * @property {string|null} [name] SshPublicKey name + */ + + /** + * Constructs a new SshPublicKey. + * @memberof google.cloud.oslogin.common + * @classdesc Represents a SshPublicKey. + * @implements ISshPublicKey + * @constructor + * @param {google.cloud.oslogin.common.ISshPublicKey=} [properties] Properties to set + */ + function SshPublicKey(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]]; + } + + /** + * SshPublicKey key. + * @member {string} key + * @memberof google.cloud.oslogin.common.SshPublicKey + * @instance + */ + SshPublicKey.prototype.key = ""; + + /** + * SshPublicKey expirationTimeUsec. + * @member {number|Long} expirationTimeUsec + * @memberof google.cloud.oslogin.common.SshPublicKey + * @instance + */ + SshPublicKey.prototype.expirationTimeUsec = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SshPublicKey fingerprint. + * @member {string} fingerprint + * @memberof google.cloud.oslogin.common.SshPublicKey + * @instance + */ + SshPublicKey.prototype.fingerprint = ""; + + /** + * SshPublicKey name. + * @member {string} name + * @memberof google.cloud.oslogin.common.SshPublicKey + * @instance + */ + SshPublicKey.prototype.name = ""; + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {google.cloud.oslogin.common.ISshPublicKey=} [properties] Properties to set + * @returns {google.cloud.oslogin.common.SshPublicKey} SshPublicKey instance + */ + SshPublicKey.create = function create(properties) { + return new SshPublicKey(properties); + }; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.oslogin.common.SshPublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {google.cloud.oslogin.common.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.expirationTimeUsec != null && Object.hasOwnProperty.call(message, "expirationTimeUsec")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.expirationTimeUsec); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fingerprint); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.oslogin.common.SshPublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {google.cloud.oslogin.common.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.common.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.common.SshPublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.expirationTimeUsec = reader.int64(); + break; + } + case 3: { + message.fingerprint = reader.string(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.common.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SshPublicKey message. + * @function verify + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SshPublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.expirationTimeUsec != null && message.hasOwnProperty("expirationTimeUsec")) + if (!$util.isInteger(message.expirationTimeUsec) && !(message.expirationTimeUsec && $util.isInteger(message.expirationTimeUsec.low) && $util.isInteger(message.expirationTimeUsec.high))) + return "expirationTimeUsec: integer|Long expected"; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.common.SshPublicKey} SshPublicKey + */ + SshPublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.common.SshPublicKey) + return object; + var message = new $root.google.cloud.oslogin.common.SshPublicKey(); + if (object.key != null) + message.key = String(object.key); + if (object.expirationTimeUsec != null) + if ($util.Long) + (message.expirationTimeUsec = $util.Long.fromValue(object.expirationTimeUsec)).unsigned = false; + else if (typeof object.expirationTimeUsec === "string") + message.expirationTimeUsec = parseInt(object.expirationTimeUsec, 10); + else if (typeof object.expirationTimeUsec === "number") + message.expirationTimeUsec = object.expirationTimeUsec; + else if (typeof object.expirationTimeUsec === "object") + message.expirationTimeUsec = new $util.LongBits(object.expirationTimeUsec.low >>> 0, object.expirationTimeUsec.high >>> 0).toNumber(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {google.cloud.oslogin.common.SshPublicKey} message SshPublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SshPublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expirationTimeUsec = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expirationTimeUsec = options.longs === String ? "0" : 0; + object.fingerprint = ""; + object.name = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.expirationTimeUsec != null && message.hasOwnProperty("expirationTimeUsec")) + if (typeof message.expirationTimeUsec === "number") + object.expirationTimeUsec = options.longs === String ? String(message.expirationTimeUsec) : message.expirationTimeUsec; + else + object.expirationTimeUsec = options.longs === String ? $util.Long.prototype.toString.call(message.expirationTimeUsec) : options.longs === Number ? new $util.LongBits(message.expirationTimeUsec.low >>> 0, message.expirationTimeUsec.high >>> 0).toNumber() : message.expirationTimeUsec; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) + object.fingerprint = message.fingerprint; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this SshPublicKey to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.common.SshPublicKey + * @instance + * @returns {Object.} JSON object + */ + SshPublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SshPublicKey + * @function getTypeUrl + * @memberof google.cloud.oslogin.common.SshPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SshPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.common.SshPublicKey"; + }; + + return SshPublicKey; + })(); + + return common; + })(); + + oslogin.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.oslogin + * @namespace + */ + var v1 = {}; + + v1.OsLoginService = (function() { + + /** + * Constructs a new OsLoginService service. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents an OsLoginService + * @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 OsLoginService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OsLoginService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OsLoginService; + + /** + * Creates new OsLoginService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.oslogin.v1.OsLoginService + * @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 {OsLoginService} RPC service. Useful where requests and/or responses are streamed. + */ + OsLoginService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|deletePosixAccount}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef DeletePosixAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePosixAccount. + * @function deletePosixAccount + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest} request DeletePosixAccountRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.DeletePosixAccountCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.deletePosixAccount = function deletePosixAccount(request, callback) { + return this.rpcCall(deletePosixAccount, $root.google.cloud.oslogin.v1.DeletePosixAccountRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePosixAccount" }); + + /** + * Calls DeletePosixAccount. + * @function deletePosixAccount + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest} request DeletePosixAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|deleteSshPublicKey}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef DeleteSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSshPublicKey. + * @function deleteSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest} request DeleteSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.DeleteSshPublicKeyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.deleteSshPublicKey = function deleteSshPublicKey(request, callback) { + return this.rpcCall(deleteSshPublicKey, $root.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSshPublicKey" }); + + /** + * Calls DeleteSshPublicKey. + * @function deleteSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest} request DeleteSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|getLoginProfile}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef GetLoginProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.v1.LoginProfile} [response] LoginProfile + */ + + /** + * Calls GetLoginProfile. + * @function getLoginProfile + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest} request GetLoginProfileRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.GetLoginProfileCallback} callback Node-style callback called with the error, if any, and LoginProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.getLoginProfile = function getLoginProfile(request, callback) { + return this.rpcCall(getLoginProfile, $root.google.cloud.oslogin.v1.GetLoginProfileRequest, $root.google.cloud.oslogin.v1.LoginProfile, request, callback); + }, "name", { value: "GetLoginProfile" }); + + /** + * Calls GetLoginProfile. + * @function getLoginProfile + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest} request GetLoginProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|getSshPublicKey}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef GetSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.common.SshPublicKey} [response] SshPublicKey + */ + + /** + * Calls GetSshPublicKey. + * @function getSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest} request GetSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.GetSshPublicKeyCallback} callback Node-style callback called with the error, if any, and SshPublicKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.getSshPublicKey = function getSshPublicKey(request, callback) { + return this.rpcCall(getSshPublicKey, $root.google.cloud.oslogin.v1.GetSshPublicKeyRequest, $root.google.cloud.oslogin.common.SshPublicKey, request, callback); + }, "name", { value: "GetSshPublicKey" }); + + /** + * Calls GetSshPublicKey. + * @function getSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest} request GetSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|importSshPublicKey}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef ImportSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} [response] ImportSshPublicKeyResponse + */ + + /** + * Calls ImportSshPublicKey. + * @function importSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest} request ImportSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.ImportSshPublicKeyCallback} callback Node-style callback called with the error, if any, and ImportSshPublicKeyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.importSshPublicKey = function importSshPublicKey(request, callback) { + return this.rpcCall(importSshPublicKey, $root.google.cloud.oslogin.v1.ImportSshPublicKeyRequest, $root.google.cloud.oslogin.v1.ImportSshPublicKeyResponse, request, callback); + }, "name", { value: "ImportSshPublicKey" }); + + /** + * Calls ImportSshPublicKey. + * @function importSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest} request ImportSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1.OsLoginService|updateSshPublicKey}. + * @memberof google.cloud.oslogin.v1.OsLoginService + * @typedef UpdateSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.common.SshPublicKey} [response] SshPublicKey + */ + + /** + * Calls UpdateSshPublicKey. + * @function updateSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest} request UpdateSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1.OsLoginService.UpdateSshPublicKeyCallback} callback Node-style callback called with the error, if any, and SshPublicKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.updateSshPublicKey = function updateSshPublicKey(request, callback) { + return this.rpcCall(updateSshPublicKey, $root.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest, $root.google.cloud.oslogin.common.SshPublicKey, request, callback); + }, "name", { value: "UpdateSshPublicKey" }); + + /** + * Calls UpdateSshPublicKey. + * @function updateSshPublicKey + * @memberof google.cloud.oslogin.v1.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest} request UpdateSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OsLoginService; + })(); + + v1.LoginProfile = (function() { + + /** + * Properties of a LoginProfile. + * @memberof google.cloud.oslogin.v1 + * @interface ILoginProfile + * @property {string|null} [name] LoginProfile name + * @property {Array.|null} [posixAccounts] LoginProfile posixAccounts + * @property {Object.|null} [sshPublicKeys] LoginProfile sshPublicKeys + */ + + /** + * Constructs a new LoginProfile. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents a LoginProfile. + * @implements ILoginProfile + * @constructor + * @param {google.cloud.oslogin.v1.ILoginProfile=} [properties] Properties to set + */ + function LoginProfile(properties) { + this.posixAccounts = []; + this.sshPublicKeys = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoginProfile name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.LoginProfile + * @instance + */ + LoginProfile.prototype.name = ""; + + /** + * LoginProfile posixAccounts. + * @member {Array.} posixAccounts + * @memberof google.cloud.oslogin.v1.LoginProfile + * @instance + */ + LoginProfile.prototype.posixAccounts = $util.emptyArray; + + /** + * LoginProfile sshPublicKeys. + * @member {Object.} sshPublicKeys + * @memberof google.cloud.oslogin.v1.LoginProfile + * @instance + */ + LoginProfile.prototype.sshPublicKeys = $util.emptyObject; + + /** + * Creates a new LoginProfile instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {google.cloud.oslogin.v1.ILoginProfile=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.LoginProfile} LoginProfile instance + */ + LoginProfile.create = function create(properties) { + return new LoginProfile(properties); + }; + + /** + * Encodes the specified LoginProfile message. Does not implicitly {@link google.cloud.oslogin.v1.LoginProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {google.cloud.oslogin.v1.ILoginProfile} message LoginProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoginProfile.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.posixAccounts != null && message.posixAccounts.length) + for (var i = 0; i < message.posixAccounts.length; ++i) + $root.google.cloud.oslogin.common.PosixAccount.encode(message.posixAccounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sshPublicKeys != null && Object.hasOwnProperty.call(message, "sshPublicKeys")) + for (var keys = Object.keys(message.sshPublicKeys), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKeys[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LoginProfile message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.LoginProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {google.cloud.oslogin.v1.ILoginProfile} message LoginProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoginProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoginProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.LoginProfile} LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoginProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.LoginProfile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.posixAccounts && message.posixAccounts.length)) + message.posixAccounts = []; + message.posixAccounts.push($root.google.cloud.oslogin.common.PosixAccount.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.sshPublicKeys === $util.emptyObject) + message.sshPublicKeys = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sshPublicKeys[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoginProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.LoginProfile} LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoginProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoginProfile message. + * @function verify + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoginProfile.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.posixAccounts != null && message.hasOwnProperty("posixAccounts")) { + if (!Array.isArray(message.posixAccounts)) + return "posixAccounts: array expected"; + for (var i = 0; i < message.posixAccounts.length; ++i) { + var error = $root.google.cloud.oslogin.common.PosixAccount.verify(message.posixAccounts[i]); + if (error) + return "posixAccounts." + error; + } + } + if (message.sshPublicKeys != null && message.hasOwnProperty("sshPublicKeys")) { + if (!$util.isObject(message.sshPublicKeys)) + return "sshPublicKeys: object expected"; + var key = Object.keys(message.sshPublicKeys); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKeys[key[i]]); + if (error) + return "sshPublicKeys." + error; + } + } + return null; + }; + + /** + * Creates a LoginProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.LoginProfile} LoginProfile + */ + LoginProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.LoginProfile) + return object; + var message = new $root.google.cloud.oslogin.v1.LoginProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.posixAccounts) { + if (!Array.isArray(object.posixAccounts)) + throw TypeError(".google.cloud.oslogin.v1.LoginProfile.posixAccounts: array expected"); + message.posixAccounts = []; + for (var i = 0; i < object.posixAccounts.length; ++i) { + if (typeof object.posixAccounts[i] !== "object") + throw TypeError(".google.cloud.oslogin.v1.LoginProfile.posixAccounts: object expected"); + message.posixAccounts[i] = $root.google.cloud.oslogin.common.PosixAccount.fromObject(object.posixAccounts[i]); + } + } + if (object.sshPublicKeys) { + if (typeof object.sshPublicKeys !== "object") + throw TypeError(".google.cloud.oslogin.v1.LoginProfile.sshPublicKeys: object expected"); + message.sshPublicKeys = {}; + for (var keys = Object.keys(object.sshPublicKeys), i = 0; i < keys.length; ++i) { + if (typeof object.sshPublicKeys[keys[i]] !== "object") + throw TypeError(".google.cloud.oslogin.v1.LoginProfile.sshPublicKeys: object expected"); + message.sshPublicKeys[keys[i]] = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKeys[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LoginProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {google.cloud.oslogin.v1.LoginProfile} message LoginProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoginProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.posixAccounts = []; + if (options.objects || options.defaults) + object.sshPublicKeys = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.posixAccounts && message.posixAccounts.length) { + object.posixAccounts = []; + for (var j = 0; j < message.posixAccounts.length; ++j) + object.posixAccounts[j] = $root.google.cloud.oslogin.common.PosixAccount.toObject(message.posixAccounts[j], options); + } + var keys2; + if (message.sshPublicKeys && (keys2 = Object.keys(message.sshPublicKeys)).length) { + object.sshPublicKeys = {}; + for (var j = 0; j < keys2.length; ++j) + object.sshPublicKeys[keys2[j]] = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKeys[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LoginProfile to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.LoginProfile + * @instance + * @returns {Object.} JSON object + */ + LoginProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoginProfile + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.LoginProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoginProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.LoginProfile"; + }; + + return LoginProfile; + })(); + + v1.DeletePosixAccountRequest = (function() { + + /** + * Properties of a DeletePosixAccountRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IDeletePosixAccountRequest + * @property {string|null} [name] DeletePosixAccountRequest name + */ + + /** + * Constructs a new DeletePosixAccountRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents a DeletePosixAccountRequest. + * @implements IDeletePosixAccountRequest + * @constructor + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest=} [properties] Properties to set + */ + function DeletePosixAccountRequest(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]]; + } + + /** + * DeletePosixAccountRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @instance + */ + DeletePosixAccountRequest.prototype.name = ""; + + /** + * Creates a new DeletePosixAccountRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.DeletePosixAccountRequest} DeletePosixAccountRequest instance + */ + DeletePosixAccountRequest.create = function create(properties) { + return new DeletePosixAccountRequest(properties); + }; + + /** + * Encodes the specified DeletePosixAccountRequest message. Does not implicitly {@link google.cloud.oslogin.v1.DeletePosixAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest} message DeletePosixAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.DeletePosixAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1.IDeletePosixAccountRequest} message DeletePosixAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePosixAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.DeletePosixAccountRequest} DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePosixAccountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.DeletePosixAccountRequest(); + 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 DeletePosixAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.DeletePosixAccountRequest} DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePosixAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePosixAccountRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.DeletePosixAccountRequest} DeletePosixAccountRequest + */ + DeletePosixAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.DeletePosixAccountRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.DeletePosixAccountRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePosixAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1.DeletePosixAccountRequest} message DeletePosixAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePosixAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePosixAccountRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.DeletePosixAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePosixAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.DeletePosixAccountRequest"; + }; + + return DeletePosixAccountRequest; + })(); + + v1.DeleteSshPublicKeyRequest = (function() { + + /** + * Properties of a DeleteSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IDeleteSshPublicKeyRequest + * @property {string|null} [name] DeleteSshPublicKeyRequest name + */ + + /** + * Constructs a new DeleteSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents a DeleteSshPublicKeyRequest. + * @implements IDeleteSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest=} [properties] Properties to set + */ + function DeleteSshPublicKeyRequest(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]]; + } + + /** + * DeleteSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @instance + */ + DeleteSshPublicKeyRequest.prototype.name = ""; + + /** + * Creates a new DeleteSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest instance + */ + DeleteSshPublicKeyRequest.create = function create(properties) { + return new DeleteSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest(); + 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 DeleteSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + */ + DeleteSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.DeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.DeleteSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.DeleteSshPublicKeyRequest"; + }; + + return DeleteSshPublicKeyRequest; + })(); + + v1.GetLoginProfileRequest = (function() { + + /** + * Properties of a GetLoginProfileRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IGetLoginProfileRequest + * @property {string|null} [name] GetLoginProfileRequest name + * @property {string|null} [projectId] GetLoginProfileRequest projectId + * @property {string|null} [systemId] GetLoginProfileRequest systemId + */ + + /** + * Constructs a new GetLoginProfileRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents a GetLoginProfileRequest. + * @implements IGetLoginProfileRequest + * @constructor + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest=} [properties] Properties to set + */ + function GetLoginProfileRequest(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]]; + } + + /** + * GetLoginProfileRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.name = ""; + + /** + * GetLoginProfileRequest projectId. + * @member {string} projectId + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.projectId = ""; + + /** + * GetLoginProfileRequest systemId. + * @member {string} systemId + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.systemId = ""; + + /** + * Creates a new GetLoginProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.GetLoginProfileRequest} GetLoginProfileRequest instance + */ + GetLoginProfileRequest.create = function create(properties) { + return new GetLoginProfileRequest(properties); + }; + + /** + * Encodes the specified GetLoginProfileRequest message. Does not implicitly {@link google.cloud.oslogin.v1.GetLoginProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest} message GetLoginProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLoginProfileRequest.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.systemId != null && Object.hasOwnProperty.call(message, "systemId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.systemId); + return writer; + }; + + /** + * Encodes the specified GetLoginProfileRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.GetLoginProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1.IGetLoginProfileRequest} message GetLoginProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLoginProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.GetLoginProfileRequest} GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLoginProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.GetLoginProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.systemId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.GetLoginProfileRequest} GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLoginProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLoginProfileRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLoginProfileRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.systemId != null && message.hasOwnProperty("systemId")) + if (!$util.isString(message.systemId)) + return "systemId: string expected"; + return null; + }; + + /** + * Creates a GetLoginProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.GetLoginProfileRequest} GetLoginProfileRequest + */ + GetLoginProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.GetLoginProfileRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.GetLoginProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.systemId != null) + message.systemId = String(object.systemId); + return message; + }; + + /** + * Creates a plain object from a GetLoginProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1.GetLoginProfileRequest} message GetLoginProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLoginProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.projectId = ""; + object.systemId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.systemId != null && message.hasOwnProperty("systemId")) + object.systemId = message.systemId; + return object; + }; + + /** + * Converts this GetLoginProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetLoginProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLoginProfileRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.GetLoginProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLoginProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.GetLoginProfileRequest"; + }; + + return GetLoginProfileRequest; + })(); + + v1.GetSshPublicKeyRequest = (function() { + + /** + * Properties of a GetSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IGetSshPublicKeyRequest + * @property {string|null} [name] GetSshPublicKeyRequest name + */ + + /** + * Constructs a new GetSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents a GetSshPublicKeyRequest. + * @implements IGetSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest=} [properties] Properties to set + */ + function GetSshPublicKeyRequest(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]]; + } + + /** + * GetSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @instance + */ + GetSshPublicKeyRequest.prototype.name = ""; + + /** + * Creates a new GetSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.GetSshPublicKeyRequest} GetSshPublicKeyRequest instance + */ + GetSshPublicKeyRequest.create = function create(properties) { + return new GetSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified GetSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.GetSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest} message GetSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.GetSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IGetSshPublicKeyRequest} message GetSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.GetSshPublicKeyRequest} GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.GetSshPublicKeyRequest(); + 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 GetSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.GetSshPublicKeyRequest} GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.GetSshPublicKeyRequest} GetSshPublicKeyRequest + */ + GetSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.GetSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.GetSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.GetSshPublicKeyRequest} message GetSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.GetSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.GetSshPublicKeyRequest"; + }; + + return GetSshPublicKeyRequest; + })(); + + v1.ImportSshPublicKeyRequest = (function() { + + /** + * Properties of an ImportSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IImportSshPublicKeyRequest + * @property {string|null} [parent] ImportSshPublicKeyRequest parent + * @property {google.cloud.oslogin.common.ISshPublicKey|null} [sshPublicKey] ImportSshPublicKeyRequest sshPublicKey + * @property {string|null} [projectId] ImportSshPublicKeyRequest projectId + */ + + /** + * Constructs a new ImportSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents an ImportSshPublicKeyRequest. + * @implements IImportSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest=} [properties] Properties to set + */ + function ImportSshPublicKeyRequest(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]]; + } + + /** + * ImportSshPublicKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.parent = ""; + + /** + * ImportSshPublicKeyRequest sshPublicKey. + * @member {google.cloud.oslogin.common.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.sshPublicKey = null; + + /** + * ImportSshPublicKeyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.projectId = ""; + + /** + * Creates a new ImportSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest instance + */ + ImportSshPublicKeyRequest.create = function create(properties) { + return new ImportSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified ImportSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest} message ImportSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyRequest.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.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified ImportSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyRequest} message ImportSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.ImportSshPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSshPublicKeyRequest.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.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + error; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates an ImportSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + */ + ImportSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.ImportSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.ImportSshPublicKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.oslogin.v1.ImportSshPublicKeyRequest.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from an ImportSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.ImportSshPublicKeyRequest} message ImportSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSshPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sshPublicKey = null; + object.projectId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) + object.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKey, options); + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this ImportSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + ImportSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.ImportSshPublicKeyRequest"; + }; + + return ImportSshPublicKeyRequest; + })(); + + v1.ImportSshPublicKeyResponse = (function() { + + /** + * Properties of an ImportSshPublicKeyResponse. + * @memberof google.cloud.oslogin.v1 + * @interface IImportSshPublicKeyResponse + * @property {google.cloud.oslogin.v1.ILoginProfile|null} [loginProfile] ImportSshPublicKeyResponse loginProfile + */ + + /** + * Constructs a new ImportSshPublicKeyResponse. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents an ImportSshPublicKeyResponse. + * @implements IImportSshPublicKeyResponse + * @constructor + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyResponse=} [properties] Properties to set + */ + function ImportSshPublicKeyResponse(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]]; + } + + /** + * ImportSshPublicKeyResponse loginProfile. + * @member {google.cloud.oslogin.v1.ILoginProfile|null|undefined} loginProfile + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @instance + */ + ImportSshPublicKeyResponse.prototype.loginProfile = null; + + /** + * Creates a new ImportSshPublicKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyResponse=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse instance + */ + ImportSshPublicKeyResponse.create = function create(properties) { + return new ImportSshPublicKeyResponse(properties); + }; + + /** + * Encodes the specified ImportSshPublicKeyResponse message. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyResponse} message ImportSshPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.loginProfile != null && Object.hasOwnProperty.call(message, "loginProfile")) + $root.google.cloud.oslogin.v1.LoginProfile.encode(message.loginProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportSshPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.ImportSshPublicKeyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1.IImportSshPublicKeyResponse} message ImportSshPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.ImportSshPublicKeyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.loginProfile = $root.google.cloud.oslogin.v1.LoginProfile.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSshPublicKeyResponse message. + * @function verify + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSshPublicKeyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.loginProfile != null && message.hasOwnProperty("loginProfile")) { + var error = $root.google.cloud.oslogin.v1.LoginProfile.verify(message.loginProfile); + if (error) + return "loginProfile." + error; + } + return null; + }; + + /** + * Creates an ImportSshPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + */ + ImportSshPublicKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.ImportSshPublicKeyResponse) + return object; + var message = new $root.google.cloud.oslogin.v1.ImportSshPublicKeyResponse(); + if (object.loginProfile != null) { + if (typeof object.loginProfile !== "object") + throw TypeError(".google.cloud.oslogin.v1.ImportSshPublicKeyResponse.loginProfile: object expected"); + message.loginProfile = $root.google.cloud.oslogin.v1.LoginProfile.fromObject(object.loginProfile); + } + return message; + }; + + /** + * Creates a plain object from an ImportSshPublicKeyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1.ImportSshPublicKeyResponse} message ImportSshPublicKeyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSshPublicKeyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.loginProfile = null; + if (message.loginProfile != null && message.hasOwnProperty("loginProfile")) + object.loginProfile = $root.google.cloud.oslogin.v1.LoginProfile.toObject(message.loginProfile, options); + return object; + }; + + /** + * Converts this ImportSshPublicKeyResponse to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @instance + * @returns {Object.} JSON object + */ + ImportSshPublicKeyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSshPublicKeyResponse + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.ImportSshPublicKeyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSshPublicKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.ImportSshPublicKeyResponse"; + }; + + return ImportSshPublicKeyResponse; + })(); + + v1.UpdateSshPublicKeyRequest = (function() { + + /** + * Properties of an UpdateSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @interface IUpdateSshPublicKeyRequest + * @property {string|null} [name] UpdateSshPublicKeyRequest name + * @property {google.cloud.oslogin.common.ISshPublicKey|null} [sshPublicKey] UpdateSshPublicKeyRequest sshPublicKey + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSshPublicKeyRequest updateMask + */ + + /** + * Constructs a new UpdateSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1 + * @classdesc Represents an UpdateSshPublicKeyRequest. + * @implements IUpdateSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest=} [properties] Properties to set + */ + function UpdateSshPublicKeyRequest(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]]; + } + + /** + * UpdateSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.name = ""; + + /** + * UpdateSshPublicKeyRequest sshPublicKey. + * @member {google.cloud.oslogin.common.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.sshPublicKey = null; + + /** + * UpdateSshPublicKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest instance + */ + UpdateSshPublicKeyRequest.create = function create(properties) { + return new UpdateSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSshPublicKeyRequest.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.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSshPublicKeyRequest.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.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + 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 UpdateSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + */ + UpdateSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1.UpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSshPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sshPublicKey = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) + object.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKey, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1.UpdateSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1.UpdateSshPublicKeyRequest"; + }; + + return UpdateSshPublicKeyRequest; + })(); + + return v1; + })(); + + oslogin.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.oslogin + * @namespace + */ + var v1beta = {}; + + v1beta.OsLoginService = (function() { + + /** + * Constructs a new OsLoginService service. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents an OsLoginService + * @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 OsLoginService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OsLoginService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OsLoginService; + + /** + * Creates new OsLoginService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @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 {OsLoginService} RPC service. Useful where requests and/or responses are streamed. + */ + OsLoginService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|deletePosixAccount}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef DeletePosixAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePosixAccount. + * @function deletePosixAccount + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest} request DeletePosixAccountRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.DeletePosixAccountCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.deletePosixAccount = function deletePosixAccount(request, callback) { + return this.rpcCall(deletePosixAccount, $root.google.cloud.oslogin.v1beta.DeletePosixAccountRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePosixAccount" }); + + /** + * Calls DeletePosixAccount. + * @function deletePosixAccount + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest} request DeletePosixAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|deleteSshPublicKey}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef DeleteSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSshPublicKey. + * @function deleteSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest} request DeleteSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.DeleteSshPublicKeyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.deleteSshPublicKey = function deleteSshPublicKey(request, callback) { + return this.rpcCall(deleteSshPublicKey, $root.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSshPublicKey" }); + + /** + * Calls DeleteSshPublicKey. + * @function deleteSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest} request DeleteSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|getLoginProfile}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef GetLoginProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.v1beta.LoginProfile} [response] LoginProfile + */ + + /** + * Calls GetLoginProfile. + * @function getLoginProfile + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest} request GetLoginProfileRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.GetLoginProfileCallback} callback Node-style callback called with the error, if any, and LoginProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.getLoginProfile = function getLoginProfile(request, callback) { + return this.rpcCall(getLoginProfile, $root.google.cloud.oslogin.v1beta.GetLoginProfileRequest, $root.google.cloud.oslogin.v1beta.LoginProfile, request, callback); + }, "name", { value: "GetLoginProfile" }); + + /** + * Calls GetLoginProfile. + * @function getLoginProfile + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest} request GetLoginProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|getSshPublicKey}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef GetSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.common.SshPublicKey} [response] SshPublicKey + */ + + /** + * Calls GetSshPublicKey. + * @function getSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest} request GetSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.GetSshPublicKeyCallback} callback Node-style callback called with the error, if any, and SshPublicKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.getSshPublicKey = function getSshPublicKey(request, callback) { + return this.rpcCall(getSshPublicKey, $root.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest, $root.google.cloud.oslogin.common.SshPublicKey, request, callback); + }, "name", { value: "GetSshPublicKey" }); + + /** + * Calls GetSshPublicKey. + * @function getSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest} request GetSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|importSshPublicKey}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef ImportSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} [response] ImportSshPublicKeyResponse + */ + + /** + * Calls ImportSshPublicKey. + * @function importSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest} request ImportSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.ImportSshPublicKeyCallback} callback Node-style callback called with the error, if any, and ImportSshPublicKeyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.importSshPublicKey = function importSshPublicKey(request, callback) { + return this.rpcCall(importSshPublicKey, $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest, $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse, request, callback); + }, "name", { value: "ImportSshPublicKey" }); + + /** + * Calls ImportSshPublicKey. + * @function importSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest} request ImportSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.oslogin.v1beta.OsLoginService|updateSshPublicKey}. + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @typedef UpdateSshPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.oslogin.common.SshPublicKey} [response] SshPublicKey + */ + + /** + * Calls UpdateSshPublicKey. + * @function updateSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest} request UpdateSshPublicKeyRequest message or plain object + * @param {google.cloud.oslogin.v1beta.OsLoginService.UpdateSshPublicKeyCallback} callback Node-style callback called with the error, if any, and SshPublicKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OsLoginService.prototype.updateSshPublicKey = function updateSshPublicKey(request, callback) { + return this.rpcCall(updateSshPublicKey, $root.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest, $root.google.cloud.oslogin.common.SshPublicKey, request, callback); + }, "name", { value: "UpdateSshPublicKey" }); + + /** + * Calls UpdateSshPublicKey. + * @function updateSshPublicKey + * @memberof google.cloud.oslogin.v1beta.OsLoginService + * @instance + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest} request UpdateSshPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OsLoginService; + })(); + + v1beta.LoginProfile = (function() { + + /** + * Properties of a LoginProfile. + * @memberof google.cloud.oslogin.v1beta + * @interface ILoginProfile + * @property {string|null} [name] LoginProfile name + * @property {Array.|null} [posixAccounts] LoginProfile posixAccounts + * @property {Object.|null} [sshPublicKeys] LoginProfile sshPublicKeys + */ + + /** + * Constructs a new LoginProfile. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents a LoginProfile. + * @implements ILoginProfile + * @constructor + * @param {google.cloud.oslogin.v1beta.ILoginProfile=} [properties] Properties to set + */ + function LoginProfile(properties) { + this.posixAccounts = []; + this.sshPublicKeys = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoginProfile name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @instance + */ + LoginProfile.prototype.name = ""; + + /** + * LoginProfile posixAccounts. + * @member {Array.} posixAccounts + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @instance + */ + LoginProfile.prototype.posixAccounts = $util.emptyArray; + + /** + * LoginProfile sshPublicKeys. + * @member {Object.} sshPublicKeys + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @instance + */ + LoginProfile.prototype.sshPublicKeys = $util.emptyObject; + + /** + * Creates a new LoginProfile instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {google.cloud.oslogin.v1beta.ILoginProfile=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.LoginProfile} LoginProfile instance + */ + LoginProfile.create = function create(properties) { + return new LoginProfile(properties); + }; + + /** + * Encodes the specified LoginProfile message. Does not implicitly {@link google.cloud.oslogin.v1beta.LoginProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {google.cloud.oslogin.v1beta.ILoginProfile} message LoginProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoginProfile.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.posixAccounts != null && message.posixAccounts.length) + for (var i = 0; i < message.posixAccounts.length; ++i) + $root.google.cloud.oslogin.common.PosixAccount.encode(message.posixAccounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sshPublicKeys != null && Object.hasOwnProperty.call(message, "sshPublicKeys")) + for (var keys = Object.keys(message.sshPublicKeys), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKeys[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LoginProfile message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.LoginProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {google.cloud.oslogin.v1beta.ILoginProfile} message LoginProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoginProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoginProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.LoginProfile} LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoginProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.LoginProfile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.posixAccounts && message.posixAccounts.length)) + message.posixAccounts = []; + message.posixAccounts.push($root.google.cloud.oslogin.common.PosixAccount.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.sshPublicKeys === $util.emptyObject) + message.sshPublicKeys = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sshPublicKeys[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoginProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.LoginProfile} LoginProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoginProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoginProfile message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoginProfile.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.posixAccounts != null && message.hasOwnProperty("posixAccounts")) { + if (!Array.isArray(message.posixAccounts)) + return "posixAccounts: array expected"; + for (var i = 0; i < message.posixAccounts.length; ++i) { + var error = $root.google.cloud.oslogin.common.PosixAccount.verify(message.posixAccounts[i]); + if (error) + return "posixAccounts." + error; + } + } + if (message.sshPublicKeys != null && message.hasOwnProperty("sshPublicKeys")) { + if (!$util.isObject(message.sshPublicKeys)) + return "sshPublicKeys: object expected"; + var key = Object.keys(message.sshPublicKeys); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKeys[key[i]]); + if (error) + return "sshPublicKeys." + error; + } + } + return null; + }; + + /** + * Creates a LoginProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.LoginProfile} LoginProfile + */ + LoginProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.LoginProfile) + return object; + var message = new $root.google.cloud.oslogin.v1beta.LoginProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.posixAccounts) { + if (!Array.isArray(object.posixAccounts)) + throw TypeError(".google.cloud.oslogin.v1beta.LoginProfile.posixAccounts: array expected"); + message.posixAccounts = []; + for (var i = 0; i < object.posixAccounts.length; ++i) { + if (typeof object.posixAccounts[i] !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.LoginProfile.posixAccounts: object expected"); + message.posixAccounts[i] = $root.google.cloud.oslogin.common.PosixAccount.fromObject(object.posixAccounts[i]); + } + } + if (object.sshPublicKeys) { + if (typeof object.sshPublicKeys !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.LoginProfile.sshPublicKeys: object expected"); + message.sshPublicKeys = {}; + for (var keys = Object.keys(object.sshPublicKeys), i = 0; i < keys.length; ++i) { + if (typeof object.sshPublicKeys[keys[i]] !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.LoginProfile.sshPublicKeys: object expected"); + message.sshPublicKeys[keys[i]] = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKeys[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LoginProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {google.cloud.oslogin.v1beta.LoginProfile} message LoginProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoginProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.posixAccounts = []; + if (options.objects || options.defaults) + object.sshPublicKeys = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.posixAccounts && message.posixAccounts.length) { + object.posixAccounts = []; + for (var j = 0; j < message.posixAccounts.length; ++j) + object.posixAccounts[j] = $root.google.cloud.oslogin.common.PosixAccount.toObject(message.posixAccounts[j], options); + } + var keys2; + if (message.sshPublicKeys && (keys2 = Object.keys(message.sshPublicKeys)).length) { + object.sshPublicKeys = {}; + for (var j = 0; j < keys2.length; ++j) + object.sshPublicKeys[keys2[j]] = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKeys[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LoginProfile to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @instance + * @returns {Object.} JSON object + */ + LoginProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoginProfile + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.LoginProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoginProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.LoginProfile"; + }; + + return LoginProfile; + })(); + + v1beta.DeletePosixAccountRequest = (function() { + + /** + * Properties of a DeletePosixAccountRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IDeletePosixAccountRequest + * @property {string|null} [name] DeletePosixAccountRequest name + */ + + /** + * Constructs a new DeletePosixAccountRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents a DeletePosixAccountRequest. + * @implements IDeletePosixAccountRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest=} [properties] Properties to set + */ + function DeletePosixAccountRequest(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]]; + } + + /** + * DeletePosixAccountRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @instance + */ + DeletePosixAccountRequest.prototype.name = ""; + + /** + * Creates a new DeletePosixAccountRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.DeletePosixAccountRequest} DeletePosixAccountRequest instance + */ + DeletePosixAccountRequest.create = function create(properties) { + return new DeletePosixAccountRequest(properties); + }; + + /** + * Encodes the specified DeletePosixAccountRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.DeletePosixAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest} message DeletePosixAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.DeletePosixAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeletePosixAccountRequest} message DeletePosixAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePosixAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePosixAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.DeletePosixAccountRequest} DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePosixAccountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.DeletePosixAccountRequest(); + 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 DeletePosixAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.DeletePosixAccountRequest} DeletePosixAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePosixAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePosixAccountRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.DeletePosixAccountRequest} DeletePosixAccountRequest + */ + DeletePosixAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.DeletePosixAccountRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.DeletePosixAccountRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePosixAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {google.cloud.oslogin.v1beta.DeletePosixAccountRequest} message DeletePosixAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePosixAccountRequest.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 DeletePosixAccountRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePosixAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePosixAccountRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.DeletePosixAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePosixAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.DeletePosixAccountRequest"; + }; + + return DeletePosixAccountRequest; + })(); + + v1beta.DeleteSshPublicKeyRequest = (function() { + + /** + * Properties of a DeleteSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IDeleteSshPublicKeyRequest + * @property {string|null} [name] DeleteSshPublicKeyRequest name + */ + + /** + * Constructs a new DeleteSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents a DeleteSshPublicKeyRequest. + * @implements IDeleteSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest=} [properties] Properties to set + */ + function DeleteSshPublicKeyRequest(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]]; + } + + /** + * DeleteSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @instance + */ + DeleteSshPublicKeyRequest.prototype.name = ""; + + /** + * Creates a new DeleteSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest instance + */ + DeleteSshPublicKeyRequest.create = function create(properties) { + return new DeleteSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified DeleteSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest(); + 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 DeleteSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} DeleteSshPublicKeyRequest + */ + DeleteSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest} message DeleteSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSshPublicKeyRequest.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 DeleteSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest"; + }; + + return DeleteSshPublicKeyRequest; + })(); + + v1beta.GetLoginProfileRequest = (function() { + + /** + * Properties of a GetLoginProfileRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IGetLoginProfileRequest + * @property {string|null} [name] GetLoginProfileRequest name + * @property {string|null} [projectId] GetLoginProfileRequest projectId + * @property {string|null} [systemId] GetLoginProfileRequest systemId + */ + + /** + * Constructs a new GetLoginProfileRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents a GetLoginProfileRequest. + * @implements IGetLoginProfileRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest=} [properties] Properties to set + */ + function GetLoginProfileRequest(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]]; + } + + /** + * GetLoginProfileRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.name = ""; + + /** + * GetLoginProfileRequest projectId. + * @member {string} projectId + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.projectId = ""; + + /** + * GetLoginProfileRequest systemId. + * @member {string} systemId + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @instance + */ + GetLoginProfileRequest.prototype.systemId = ""; + + /** + * Creates a new GetLoginProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.GetLoginProfileRequest} GetLoginProfileRequest instance + */ + GetLoginProfileRequest.create = function create(properties) { + return new GetLoginProfileRequest(properties); + }; + + /** + * Encodes the specified GetLoginProfileRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.GetLoginProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest} message GetLoginProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLoginProfileRequest.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.systemId != null && Object.hasOwnProperty.call(message, "systemId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.systemId); + return writer; + }; + + /** + * Encodes the specified GetLoginProfileRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.GetLoginProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetLoginProfileRequest} message GetLoginProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLoginProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.GetLoginProfileRequest} GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLoginProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.GetLoginProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.systemId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLoginProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.GetLoginProfileRequest} GetLoginProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLoginProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLoginProfileRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLoginProfileRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.systemId != null && message.hasOwnProperty("systemId")) + if (!$util.isString(message.systemId)) + return "systemId: string expected"; + return null; + }; + + /** + * Creates a GetLoginProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.GetLoginProfileRequest} GetLoginProfileRequest + */ + GetLoginProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.GetLoginProfileRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.GetLoginProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.systemId != null) + message.systemId = String(object.systemId); + return message; + }; + + /** + * Creates a plain object from a GetLoginProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {google.cloud.oslogin.v1beta.GetLoginProfileRequest} message GetLoginProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLoginProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.projectId = ""; + object.systemId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.systemId != null && message.hasOwnProperty("systemId")) + object.systemId = message.systemId; + return object; + }; + + /** + * Converts this GetLoginProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetLoginProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLoginProfileRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.GetLoginProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLoginProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.GetLoginProfileRequest"; + }; + + return GetLoginProfileRequest; + })(); + + v1beta.GetSshPublicKeyRequest = (function() { + + /** + * Properties of a GetSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IGetSshPublicKeyRequest + * @property {string|null} [name] GetSshPublicKeyRequest name + */ + + /** + * Constructs a new GetSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents a GetSshPublicKeyRequest. + * @implements IGetSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest=} [properties] Properties to set + */ + function GetSshPublicKeyRequest(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]]; + } + + /** + * GetSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @instance + */ + GetSshPublicKeyRequest.prototype.name = ""; + + /** + * Creates a new GetSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} GetSshPublicKeyRequest instance + */ + GetSshPublicKeyRequest.create = function create(properties) { + return new GetSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified GetSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest} message GetSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.GetSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest} message GetSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest(); + 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 GetSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} GetSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} GetSshPublicKeyRequest + */ + GetSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.GetSshPublicKeyRequest} message GetSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSshPublicKeyRequest.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 GetSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.GetSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.GetSshPublicKeyRequest"; + }; + + return GetSshPublicKeyRequest; + })(); + + v1beta.ImportSshPublicKeyRequest = (function() { + + /** + * Properties of an ImportSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IImportSshPublicKeyRequest + * @property {string|null} [parent] ImportSshPublicKeyRequest parent + * @property {google.cloud.oslogin.common.ISshPublicKey|null} [sshPublicKey] ImportSshPublicKeyRequest sshPublicKey + * @property {string|null} [projectId] ImportSshPublicKeyRequest projectId + */ + + /** + * Constructs a new ImportSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents an ImportSshPublicKeyRequest. + * @implements IImportSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest=} [properties] Properties to set + */ + function ImportSshPublicKeyRequest(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]]; + } + + /** + * ImportSshPublicKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.parent = ""; + + /** + * ImportSshPublicKeyRequest sshPublicKey. + * @member {google.cloud.oslogin.common.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.sshPublicKey = null; + + /** + * ImportSshPublicKeyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @instance + */ + ImportSshPublicKeyRequest.prototype.projectId = ""; + + /** + * Creates a new ImportSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest instance + */ + ImportSshPublicKeyRequest.create = function create(properties) { + return new ImportSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified ImportSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest} message ImportSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyRequest.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.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified ImportSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest} message ImportSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSshPublicKeyRequest.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.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + error; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates an ImportSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} ImportSshPublicKeyRequest + */ + ImportSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from an ImportSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest} message ImportSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSshPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sshPublicKey = null; + object.projectId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) + object.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKey, options); + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this ImportSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + ImportSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest"; + }; + + return ImportSshPublicKeyRequest; + })(); + + v1beta.ImportSshPublicKeyResponse = (function() { + + /** + * Properties of an ImportSshPublicKeyResponse. + * @memberof google.cloud.oslogin.v1beta + * @interface IImportSshPublicKeyResponse + * @property {google.cloud.oslogin.v1beta.ILoginProfile|null} [loginProfile] ImportSshPublicKeyResponse loginProfile + */ + + /** + * Constructs a new ImportSshPublicKeyResponse. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents an ImportSshPublicKeyResponse. + * @implements IImportSshPublicKeyResponse + * @constructor + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse=} [properties] Properties to set + */ + function ImportSshPublicKeyResponse(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]]; + } + + /** + * ImportSshPublicKeyResponse loginProfile. + * @member {google.cloud.oslogin.v1beta.ILoginProfile|null|undefined} loginProfile + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @instance + */ + ImportSshPublicKeyResponse.prototype.loginProfile = null; + + /** + * Creates a new ImportSshPublicKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse instance + */ + ImportSshPublicKeyResponse.create = function create(properties) { + return new ImportSshPublicKeyResponse(properties); + }; + + /** + * Encodes the specified ImportSshPublicKeyResponse message. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse} message ImportSshPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.loginProfile != null && Object.hasOwnProperty.call(message, "loginProfile")) + $root.google.cloud.oslogin.v1beta.LoginProfile.encode(message.loginProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportSshPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse} message ImportSshPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportSshPublicKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.loginProfile = $root.google.cloud.oslogin.v1beta.LoginProfile.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportSshPublicKeyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportSshPublicKeyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportSshPublicKeyResponse message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportSshPublicKeyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.loginProfile != null && message.hasOwnProperty("loginProfile")) { + var error = $root.google.cloud.oslogin.v1beta.LoginProfile.verify(message.loginProfile); + if (error) + return "loginProfile." + error; + } + return null; + }; + + /** + * Creates an ImportSshPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} ImportSshPublicKeyResponse + */ + ImportSshPublicKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse) + return object; + var message = new $root.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse(); + if (object.loginProfile != null) { + if (typeof object.loginProfile !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse.loginProfile: object expected"); + message.loginProfile = $root.google.cloud.oslogin.v1beta.LoginProfile.fromObject(object.loginProfile); + } + return message; + }; + + /** + * Creates a plain object from an ImportSshPublicKeyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse} message ImportSshPublicKeyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportSshPublicKeyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.loginProfile = null; + if (message.loginProfile != null && message.hasOwnProperty("loginProfile")) + object.loginProfile = $root.google.cloud.oslogin.v1beta.LoginProfile.toObject(message.loginProfile, options); + return object; + }; + + /** + * Converts this ImportSshPublicKeyResponse to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @instance + * @returns {Object.} JSON object + */ + ImportSshPublicKeyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportSshPublicKeyResponse + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportSshPublicKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse"; + }; + + return ImportSshPublicKeyResponse; + })(); + + v1beta.UpdateSshPublicKeyRequest = (function() { + + /** + * Properties of an UpdateSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @interface IUpdateSshPublicKeyRequest + * @property {string|null} [name] UpdateSshPublicKeyRequest name + * @property {google.cloud.oslogin.common.ISshPublicKey|null} [sshPublicKey] UpdateSshPublicKeyRequest sshPublicKey + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSshPublicKeyRequest updateMask + */ + + /** + * Constructs a new UpdateSshPublicKeyRequest. + * @memberof google.cloud.oslogin.v1beta + * @classdesc Represents an UpdateSshPublicKeyRequest. + * @implements IUpdateSshPublicKeyRequest + * @constructor + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest=} [properties] Properties to set + */ + function UpdateSshPublicKeyRequest(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]]; + } + + /** + * UpdateSshPublicKeyRequest name. + * @member {string} name + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.name = ""; + + /** + * UpdateSshPublicKeyRequest sshPublicKey. + * @member {google.cloud.oslogin.common.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.sshPublicKey = null; + + /** + * UpdateSshPublicKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @instance + */ + UpdateSshPublicKeyRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSshPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest instance + */ + UpdateSshPublicKeyRequest.create = function create(properties) { + return new UpdateSshPublicKeyRequest(properties); + }; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message. Does not implicitly {@link google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSshPublicKeyRequest.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.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.oslogin.common.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSshPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSshPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSshPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSshPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSshPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSshPublicKeyRequest message. + * @function verify + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSshPublicKeyRequest.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.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + var error = $root.google.cloud.oslogin.common.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + 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 UpdateSshPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} UpdateSshPublicKeyRequest + */ + UpdateSshPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest) + return object; + var message = new $root.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSshPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest} message UpdateSshPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSshPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.sshPublicKey = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) + object.sshPublicKey = $root.google.cloud.oslogin.common.SshPublicKey.toObject(message.sshPublicKey, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSshPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSshPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSshPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSshPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest"; + }; + + return UpdateSshPublicKeyRequest; + })(); + + return v1beta; + })(); + + return oslogin; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-oslogin/protos/protos.json b/packages/google-cloud-oslogin/protos/protos.json new file mode 100644 index 000000000000..a07b79a4f361 --- /dev/null +++ b/packages/google-cloud-oslogin/protos/protos.json @@ -0,0 +1,1819 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "oslogin": { + "nested": { + "common": { + "options": { + "csharp_namespace": "Google.Cloud.OsLogin.Common", + "go_package": "google.golang.org/genproto/googleapis/cloud/oslogin/common;common", + "java_outer_classname": "OsLoginProto", + "java_package": "com.google.cloud.oslogin.common", + "php_namespace": "Google\\Cloud\\OsLogin\\Common", + "ruby_package": "Google::Cloud::OsLogin::Common", + "(google.api.resource_definition).type": "oslogin.googleapis.com/User", + "(google.api.resource_definition).pattern": "users/{user}" + }, + "nested": { + "OperatingSystemType": { + "values": { + "OPERATING_SYSTEM_TYPE_UNSPECIFIED": 0, + "LINUX": 1, + "WINDOWS": 2 + } + }, + "PosixAccount": { + "options": { + "(google.api.resource).type": "oslogin.googleapis.com/PosixAccount", + "(google.api.resource).pattern": "users/{user}/projects/{project}" + }, + "fields": { + "primary": { + "type": "bool", + "id": 1 + }, + "username": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "int64", + "id": 3 + }, + "gid": { + "type": "int64", + "id": 4 + }, + "homeDirectory": { + "type": "string", + "id": 5 + }, + "shell": { + "type": "string", + "id": 6 + }, + "gecos": { + "type": "string", + "id": 7 + }, + "systemId": { + "type": "string", + "id": 8 + }, + "accountId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operatingSystemType": { + "type": "OperatingSystemType", + "id": 10 + }, + "name": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SshPublicKey": { + "options": { + "(google.api.resource).type": "oslogin.googleapis.com/SshPublicKey", + "(google.api.resource).pattern": "users/{user}/sshPublicKeys/{fingerprint}" + }, + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "expirationTimeUsec": { + "type": "int64", + "id": 2 + }, + "fingerprint": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OsLogin.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin", + "java_multiple_files": true, + "java_outer_classname": "OsLoginProto", + "java_package": "com.google.cloud.oslogin.v1", + "php_namespace": "Google\\Cloud\\OsLogin\\V1", + "ruby_package": "Google::Cloud::OsLogin::V1" + }, + "nested": { + "OsLoginService": { + "options": { + "(google.api.default_host)": "oslogin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute" + }, + "methods": { + "DeletePosixAccount": { + "requestType": "DeletePosixAccountRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=users/*/projects/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=users/*/projects/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteSshPublicKey": { + "requestType": "DeleteSshPublicKeyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=users/*/sshPublicKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=users/*/sshPublicKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetLoginProfile": { + "requestType": "GetLoginProfileRequest", + "responseType": "LoginProfile", + "options": { + "(google.api.http).get": "/v1/{name=users/*}/loginProfile", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*}/loginProfile" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSshPublicKey": { + "requestType": "GetSshPublicKeyRequest", + "responseType": "google.cloud.oslogin.common.SshPublicKey", + "options": { + "(google.api.http).get": "/v1/{name=users/*/sshPublicKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*/sshPublicKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportSshPublicKey": { + "requestType": "ImportSshPublicKeyRequest", + "responseType": "ImportSshPublicKeyResponse", + "options": { + "(google.api.http).post": "/v1/{parent=users/*}:importSshPublicKey", + "(google.api.http).body": "ssh_public_key", + "(google.api.method_signature)": "parent,ssh_public_key,project_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=users/*}:importSshPublicKey", + "body": "ssh_public_key" + } + }, + { + "(google.api.method_signature)": "parent,ssh_public_key" + }, + { + "(google.api.method_signature)": "parent,ssh_public_key,project_id" + } + ] + }, + "UpdateSshPublicKey": { + "requestType": "UpdateSshPublicKeyRequest", + "responseType": "google.cloud.oslogin.common.SshPublicKey", + "options": { + "(google.api.http).patch": "/v1/{name=users/*/sshPublicKeys/*}", + "(google.api.http).body": "ssh_public_key", + "(google.api.method_signature)": "name,ssh_public_key,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=users/*/sshPublicKeys/*}", + "body": "ssh_public_key" + } + }, + { + "(google.api.method_signature)": "name,ssh_public_key" + }, + { + "(google.api.method_signature)": "name,ssh_public_key,update_mask" + } + ] + } + } + }, + "LoginProfile": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "posixAccounts": { + "rule": "repeated", + "type": "google.cloud.oslogin.common.PosixAccount", + "id": 2 + }, + "sshPublicKeys": { + "keyType": "string", + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 3 + } + } + }, + "DeletePosixAccountRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/PosixAccount" + } + } + } + }, + "DeleteSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + } + } + }, + "GetLoginProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "oslogin.googleapis.com/PosixAccount" + } + }, + "projectId": { + "type": "string", + "id": 2 + }, + "systemId": { + "type": "string", + "id": 3 + } + } + }, + "GetSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + } + } + }, + "ImportSshPublicKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "oslogin.googleapis.com/SshPublicKey" + } + }, + "sshPublicKey": { + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectId": { + "type": "string", + "id": 3 + } + } + }, + "ImportSshPublicKeyResponse": { + "fields": { + "loginProfile": { + "type": "LoginProfile", + "id": 1 + } + } + }, + "UpdateSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + }, + "sshPublicKey": { + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + } + } + }, + "v1beta": { + "options": { + "csharp_namespace": "Google.Cloud.OsLogin.V1Beta", + "go_package": "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta;oslogin", + "java_multiple_files": true, + "java_outer_classname": "OsLoginProto", + "java_package": "com.google.cloud.oslogin.v1beta", + "php_namespace": "Google\\Cloud\\OsLogin\\V1beta", + "ruby_package": "Google::Cloud::OsLogin::V1beta" + }, + "nested": { + "OsLoginService": { + "options": { + "(google.api.default_host)": "oslogin.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly" + }, + "methods": { + "DeletePosixAccount": { + "requestType": "DeletePosixAccountRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=users/*/projects/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=users/*/projects/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteSshPublicKey": { + "requestType": "DeleteSshPublicKeyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=users/*/sshPublicKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=users/*/sshPublicKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetLoginProfile": { + "requestType": "GetLoginProfileRequest", + "responseType": "LoginProfile", + "options": { + "(google.api.http).get": "/v1beta/{name=users/*}/loginProfile", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=users/*}/loginProfile" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetSshPublicKey": { + "requestType": "GetSshPublicKeyRequest", + "responseType": "google.cloud.oslogin.common.SshPublicKey", + "options": { + "(google.api.http).get": "/v1beta/{name=users/*/sshPublicKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=users/*/sshPublicKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportSshPublicKey": { + "requestType": "ImportSshPublicKeyRequest", + "responseType": "ImportSshPublicKeyResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=users/*}:importSshPublicKey", + "(google.api.http).body": "ssh_public_key", + "(google.api.method_signature)": "parent,ssh_public_key,project_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=users/*}:importSshPublicKey", + "body": "ssh_public_key" + } + }, + { + "(google.api.method_signature)": "parent,ssh_public_key" + }, + { + "(google.api.method_signature)": "parent,ssh_public_key,project_id" + } + ] + }, + "UpdateSshPublicKey": { + "requestType": "UpdateSshPublicKeyRequest", + "responseType": "google.cloud.oslogin.common.SshPublicKey", + "options": { + "(google.api.http).patch": "/v1beta/{name=users/*/sshPublicKeys/*}", + "(google.api.http).body": "ssh_public_key", + "(google.api.method_signature)": "name,ssh_public_key,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{name=users/*/sshPublicKeys/*}", + "body": "ssh_public_key" + } + }, + { + "(google.api.method_signature)": "name,ssh_public_key" + }, + { + "(google.api.method_signature)": "name,ssh_public_key,update_mask" + } + ] + } + } + }, + "LoginProfile": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "posixAccounts": { + "rule": "repeated", + "type": "google.cloud.oslogin.common.PosixAccount", + "id": 2 + }, + "sshPublicKeys": { + "keyType": "string", + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 3 + } + } + }, + "DeletePosixAccountRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/PosixAccount" + } + } + } + }, + "DeleteSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + } + } + }, + "GetLoginProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/User" + } + }, + "projectId": { + "type": "string", + "id": 2 + }, + "systemId": { + "type": "string", + "id": 3 + } + } + }, + "GetSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + } + } + }, + "ImportSshPublicKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "oslogin.googleapis.com/SshPublicKey" + } + }, + "sshPublicKey": { + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 3 + } + } + }, + "ImportSshPublicKeyResponse": { + "fields": { + "loginProfile": { + "type": "LoginProfile", + "id": 1 + } + } + }, + "UpdateSshPublicKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "oslogin.googleapis.com/SshPublicKey" + } + }, + "sshPublicKey": { + "type": "google.cloud.oslogin.common.SshPublicKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-oslogin/samples/.eslintrc.yml b/packages/google-cloud-oslogin/samples/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-oslogin/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-oslogin/samples/README.md b/packages/google-cloud-oslogin/samples/README.md new file mode 100644 index 000000000000..d30af6f0f6ae --- /dev/null +++ b/packages/google-cloud-oslogin/samples/README.md @@ -0,0 +1,284 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud OS Login: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Os_login_service.delete_posix_account](#os_login_service.delete_posix_account) + * [Os_login_service.delete_ssh_public_key](#os_login_service.delete_ssh_public_key) + * [Os_login_service.get_login_profile](#os_login_service.get_login_profile) + * [Os_login_service.get_ssh_public_key](#os_login_service.get_ssh_public_key) + * [Os_login_service.import_ssh_public_key](#os_login_service.import_ssh_public_key) + * [Os_login_service.update_ssh_public_key](#os_login_service.update_ssh_public_key) + * [Os_login_service.delete_posix_account](#os_login_service.delete_posix_account) + * [Os_login_service.delete_ssh_public_key](#os_login_service.delete_ssh_public_key) + * [Os_login_service.get_login_profile](#os_login_service.get_login_profile) + * [Os_login_service.get_ssh_public_key](#os_login_service.get_ssh_public_key) + * [Os_login_service.import_ssh_public_key](#os_login_service.import_ssh_public_key) + * [Os_login_service.update_ssh_public_key](#os_login_service.update_ssh_public_key) + * [Quickstart](#quickstart) + * [Sample.test](#sample.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Os_login_service.delete_posix_account + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js` + + +----- + + + + +### Os_login_service.delete_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js` + + +----- + + + + +### Os_login_service.get_login_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js` + + +----- + + + + +### Os_login_service.get_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js` + + +----- + + + + +### Os_login_service.import_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js` + + +----- + + + + +### Os_login_service.update_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js` + + +----- + + + + +### Os_login_service.delete_posix_account + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js` + + +----- + + + + +### Os_login_service.delete_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js` + + +----- + + + + +### Os_login_service.get_login_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js` + + +----- + + + + +### Os_login_service.get_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js` + + +----- + + + + +### Os_login_service.import_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js` + + +----- + + + + +### Os_login_service.update_ssh_public_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/quickstart.js` + + +----- + + + + +### Sample.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-oslogin/samples/test/sample.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-oslogin/samples/test/sample.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-oslogin/samples/test/sample.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/compute/docs/oslogin/ diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js new file mode 100644 index 000000000000..9ffef6406c7c --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_posix_account.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1_generated_OsLoginService_DeletePosixAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX + * account is in format `users/{user}/projects/{project}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callDeletePosixAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.deletePosixAccount(request); + console.log(response); + } + + callDeletePosixAccount(); + // [END oslogin_v1_generated_OsLoginService_DeletePosixAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js new file mode 100644 index 000000000000..cf03e46e16d4 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.delete_ssh_public_key.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callDeleteSshPublicKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.deleteSshPublicKey(request); + console.log(response); + } + + callDeleteSshPublicKey(); + // [END oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js new file mode 100644 index 000000000000..bfe9398c9030 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_login_profile.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1_generated_OsLoginService_GetLoginProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique ID for the user in format `users/{user}`. + */ + // const name = 'abc123' + /** + * The project ID of the Google Cloud Platform project. + */ + // const projectId = 'abc123' + /** + * A system ID for filtering the results of the request. + */ + // const systemId = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callGetLoginProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getLoginProfile(request); + console.log(response); + } + + callGetLoginProfile(); + // [END oslogin_v1_generated_OsLoginService_GetLoginProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js new file mode 100644 index 000000000000..d95414b4f9cb --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.get_ssh_public_key.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1_generated_OsLoginService_GetSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in + * format `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callGetSshPublicKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getSshPublicKey(request); + console.log(response); + } + + callGetSshPublicKey(); + // [END oslogin_v1_generated_OsLoginService_GetSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js new file mode 100644 index 000000000000..c6d826aa785d --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.import_ssh_public_key.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique ID for the user in format `users/{user}`. + */ + // const parent = 'abc123' + /** + * Optional. The SSH public key and expiration time. + */ + // const sshPublicKey = {} + /** + * The project ID of the Google Cloud Platform project. + */ + // const projectId = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callImportSshPublicKey() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await osloginClient.importSshPublicKey(request); + console.log(response); + } + + callImportSshPublicKey(); + // [END oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js new file mode 100644 index 000000000000..a9d5dc708c61 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/os_login_service.update_ssh_public_key.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(name, sshPublicKey) { + // [START oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + /** + * Required. The SSH public key and expiration time. + */ + // const sshPublicKey = {} + /** + * Mask to control which fields get updated. Updates all if not present. + */ + // const updateMask = {} + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callUpdateSshPublicKey() { + // Construct request + const request = { + name, + sshPublicKey, + }; + + // Run request + const response = await osloginClient.updateSshPublicKey(request); + console.log(response); + } + + callUpdateSshPublicKey(); + // [END oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1/snippet_metadata.google.cloud.oslogin.v1.json b/packages/google-cloud-oslogin/samples/generated/v1/snippet_metadata.google.cloud.oslogin.v1.json new file mode 100644 index 000000000000..28bc0c843b89 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1/snippet_metadata.google.cloud.oslogin.v1.json @@ -0,0 +1,279 @@ +{ + "clientLibrary": { + "name": "nodejs-oslogin", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.oslogin.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "oslogin_v1_generated_OsLoginService_DeletePosixAccount_async", + "title": "OsLoginService deletePosixAccount Sample", + "origin": "API_DEFINITION", + "description": " Deletes a POSIX account.", + "canonical": true, + "file": "os_login_service.delete_posix_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePosixAccount", + "fullName": "google.cloud.oslogin.v1.OsLoginService.DeletePosixAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "DeletePosixAccount", + "fullName": "google.cloud.oslogin.v1.OsLoginService.DeletePosixAccount", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async", + "title": "OsLoginService deleteSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes an SSH public key.", + "canonical": true, + "file": "os_login_service.delete_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.DeleteSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "DeleteSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.DeleteSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1_generated_OsLoginService_GetLoginProfile_async", + "title": "OsLoginService getLoginProfile Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.", + "canonical": true, + "file": "os_login_service.get_login_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLoginProfile", + "fullName": "google.cloud.oslogin.v1.OsLoginService.GetLoginProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "system_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.v1.LoginProfile", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "GetLoginProfile", + "fullName": "google.cloud.oslogin.v1.OsLoginService.GetLoginProfile", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1_generated_OsLoginService_GetSshPublicKey_async", + "title": "OsLoginService getSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Retrieves an SSH public key.", + "canonical": true, + "file": "os_login_service.get_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.GetSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.common.SshPublicKey", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "GetSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.GetSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async", + "title": "OsLoginService importSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile.", + "canonical": true, + "file": "os_login_service.import_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.ImportSshPublicKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "ssh_public_key", + "type": ".google.cloud.oslogin.common.SshPublicKey" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.v1.ImportSshPublicKeyResponse", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "ImportSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.ImportSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async", + "title": "OsLoginService updateSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Updates an SSH public key and returns the profile information. This method supports patch semantics.", + "canonical": true, + "file": "os_login_service.update_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.UpdateSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ssh_public_key", + "type": ".google.cloud.oslogin.common.SshPublicKey" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.oslogin.common.SshPublicKey", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1.OsLoginServiceClient" + }, + "method": { + "shortName": "UpdateSshPublicKey", + "fullName": "google.cloud.oslogin.v1.OsLoginService.UpdateSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1.OsLoginService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js new file mode 100644 index 000000000000..8833aa395b40 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_posix_account.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX + * account is in format `users/{user}/projects/{project}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callDeletePosixAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.deletePosixAccount(request); + console.log(response); + } + + callDeletePosixAccount(); + // [END oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js new file mode 100644 index 000000000000..2dc7fdc4fa1b --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.delete_ssh_public_key.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callDeleteSshPublicKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.deleteSshPublicKey(request); + console.log(response); + } + + callDeleteSshPublicKey(); + // [END oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js new file mode 100644 index 000000000000..97028d9fcd44 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_login_profile.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1beta_generated_OsLoginService_GetLoginProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique ID for the user in format `users/{user}`. + */ + // const name = 'abc123' + /** + * The project ID of the Google Cloud Platform project. + */ + // const projectId = 'abc123' + /** + * A system ID for filtering the results of the request. + */ + // const systemId = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callGetLoginProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getLoginProfile(request); + console.log(response); + } + + callGetLoginProfile(); + // [END oslogin_v1beta_generated_OsLoginService_GetLoginProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js new file mode 100644 index 000000000000..7e901702ea9e --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.get_ssh_public_key.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in + * format `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callGetSshPublicKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getSshPublicKey(request); + console.log(response); + } + + callGetSshPublicKey(); + // [END oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js new file mode 100644 index 000000000000..d1af96117a47 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.import_ssh_public_key.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(sshPublicKey) { + // [START oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The unique ID for the user in format `users/{user}`. + */ + // const parent = 'abc123' + /** + * Required. The SSH public key and expiration time. + */ + // const sshPublicKey = {} + /** + * The project ID of the Google Cloud Platform project. + */ + // const projectId = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callImportSshPublicKey() { + // Construct request + const request = { + sshPublicKey, + }; + + // Run request + const response = await osloginClient.importSshPublicKey(request); + console.log(response); + } + + callImportSshPublicKey(); + // [END oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js new file mode 100644 index 000000000000..ce67375a1b9f --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.update_ssh_public_key.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(name, sshPublicKey) { + // [START oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + */ + // const name = 'abc123' + /** + * Required. The SSH public key and expiration time. + */ + // const sshPublicKey = {} + /** + * Mask to control which fields get updated. Updates all if not present. + */ + // const updateMask = {} + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1beta; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callUpdateSshPublicKey() { + // Construct request + const request = { + name, + sshPublicKey, + }; + + // Run request + const response = await osloginClient.updateSshPublicKey(request); + console.log(response); + } + + callUpdateSshPublicKey(); + // [END oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata.google.cloud.oslogin.v1beta.json b/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata.google.cloud.oslogin.v1beta.json new file mode 100644 index 000000000000..fb9fed85fff1 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata.google.cloud.oslogin.v1beta.json @@ -0,0 +1,279 @@ +{ + "clientLibrary": { + "name": "nodejs-oslogin", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.oslogin.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_async", + "title": "OsLoginService deletePosixAccount Sample", + "origin": "API_DEFINITION", + "description": " Deletes a POSIX account.", + "canonical": true, + "file": "os_login_service.delete_posix_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePosixAccount", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.DeletePosixAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "DeletePosixAccount", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.DeletePosixAccount", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_async", + "title": "OsLoginService deleteSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes an SSH public key.", + "canonical": true, + "file": "os_login_service.delete_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.DeleteSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "DeleteSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.DeleteSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_GetLoginProfile_async", + "title": "OsLoginService getLoginProfile Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.", + "canonical": true, + "file": "os_login_service.get_login_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLoginProfile", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.GetLoginProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "system_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.v1beta.LoginProfile", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "GetLoginProfile", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.GetLoginProfile", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_async", + "title": "OsLoginService getSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Retrieves an SSH public key.", + "canonical": true, + "file": "os_login_service.get_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.GetSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.common.SshPublicKey", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "GetSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.GetSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_async", + "title": "OsLoginService importSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Adds an SSH public key and returns the profile information. Default POSIX account information is set when no username and UID exist as part of the login profile.", + "canonical": true, + "file": "os_login_service.import_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.ImportSshPublicKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "ssh_public_key", + "type": ".google.cloud.oslogin.common.SshPublicKey" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "ImportSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.ImportSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + }, + { + "regionTag": "oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_async", + "title": "OsLoginService updateSshPublicKey Sample", + "origin": "API_DEFINITION", + "description": " Updates an SSH public key and returns the profile information. This method supports patch semantics.", + "canonical": true, + "file": "os_login_service.update_ssh_public_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.UpdateSshPublicKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "ssh_public_key", + "type": ".google.cloud.oslogin.common.SshPublicKey" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.oslogin.common.SshPublicKey", + "client": { + "shortName": "OsLoginServiceClient", + "fullName": "google.cloud.oslogin.v1beta.OsLoginServiceClient" + }, + "method": { + "shortName": "UpdateSshPublicKey", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService.UpdateSshPublicKey", + "service": { + "shortName": "OsLoginService", + "fullName": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-oslogin/samples/package.json b/packages/google-cloud-oslogin/samples/package.json new file mode 100644 index 000000000000..47264f1a95bd --- /dev/null +++ b/packages/google-cloud-oslogin/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-docs-samples-os-login", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "repository": "googleapis/nodejs-os-login", + "private": true, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "@google-cloud/os-login": "^4.0.2" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-oslogin/samples/quickstart.js b/packages/google-cloud-oslogin/samples/quickstart.js new file mode 100644 index 000000000000..586ac2df5203 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/quickstart.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START oslogin_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The unique ID for the user in format `users/{user}`. + */ + // const name = 'abc123' + /** + * The project ID of the Google Cloud Platform project. + */ + // const projectId = 'abc123' + /** + * A system ID for filtering the results of the request. + */ + // const systemId = 'abc123' + + // Imports the Oslogin library + const {OsLoginServiceClient} = require('@google-cloud/os-login').v1; + + // Instantiates a client + const osloginClient = new OsLoginServiceClient(); + + async function callGetLoginProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await osloginClient.getLoginProfile(request); + console.log(response[0]); + } + + callGetLoginProfile(); + // [END oslogin_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-oslogin/samples/test/sample.test.js b/packages/google-cloud-oslogin/samples/test/sample.test.js new file mode 100644 index 000000000000..2aa01a15cb76 --- /dev/null +++ b/packages/google-cloud-oslogin/samples/test/sample.test.js @@ -0,0 +1,30 @@ +// Copyright 2019 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const {execSync} = require('child_process'); + +const exec = cmd => execSync(cmd, {encoding: 'utf8'}); + +describe('sample tests', () => { + it('should run the quickstart', () => { + const output = exec( + 'node quickstart users/kokoro-system-test@long-door-651.iam.gserviceaccount.com' + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-oslogin/src/index.ts b/packages/google-cloud-oslogin/src/index.ts new file mode 100644 index 000000000000..1dc4180a07a8 --- /dev/null +++ b/packages/google-cloud-oslogin/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta from './v1beta'; + +const OsLoginServiceClient = v1.OsLoginServiceClient; +type OsLoginServiceClient = v1.OsLoginServiceClient; + +export {v1, v1beta, OsLoginServiceClient}; +export default {v1, v1beta, OsLoginServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-oslogin/src/v1/gapic_metadata.json b/packages/google-cloud-oslogin/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..f89ea9a8605d --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.oslogin.v1", + "libraryPackage": "@google-cloud/os-login", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "OsLoginServiceClient", + "rpcs": { + "DeletePosixAccount": { + "methods": [ + "deletePosixAccount" + ] + }, + "DeleteSshPublicKey": { + "methods": [ + "deleteSshPublicKey" + ] + }, + "GetLoginProfile": { + "methods": [ + "getLoginProfile" + ] + }, + "GetSshPublicKey": { + "methods": [ + "getSshPublicKey" + ] + }, + "ImportSshPublicKey": { + "methods": [ + "importSshPublicKey" + ] + }, + "UpdateSshPublicKey": { + "methods": [ + "updateSshPublicKey" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OsLoginServiceClient", + "rpcs": { + "DeletePosixAccount": { + "methods": [ + "deletePosixAccount" + ] + }, + "DeleteSshPublicKey": { + "methods": [ + "deleteSshPublicKey" + ] + }, + "GetLoginProfile": { + "methods": [ + "getLoginProfile" + ] + }, + "GetSshPublicKey": { + "methods": [ + "getSshPublicKey" + ] + }, + "ImportSshPublicKey": { + "methods": [ + "importSshPublicKey" + ] + }, + "UpdateSshPublicKey": { + "methods": [ + "updateSshPublicKey" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-oslogin/src/v1/index.ts b/packages/google-cloud-oslogin/src/v1/index.ts new file mode 100644 index 000000000000..d3f167933f9a --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {OsLoginServiceClient} from './os_login_service_client'; diff --git a/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts b/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts new file mode 100644 index 000000000000..7d4b6790c93b --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1/os_login_service_client.ts @@ -0,0 +1,1007 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/os_login_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './os_login_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud OS Login API + * + * The Cloud OS Login API allows you to manage users and their associated SSH + * public keys for logging into virtual machines on Google Cloud Platform. + * @class + * @memberof v1 + */ +export class OsLoginServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + osLoginServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OsLoginServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 OsLoginServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof OsLoginServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + posixAccountPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/projects/{project}' + ), + sshPublicKeyPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/sshPublicKeys/{fingerprint}' + ), + userPathTemplate: new this._gaxModule.PathTemplate('users/{user}'), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.oslogin.v1.OsLoginService', + 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.osLoginServiceStub) { + return this.osLoginServiceStub; + } + + // Put together the "service stub" for + // google.cloud.oslogin.v1.OsLoginService. + this.osLoginServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.oslogin.v1.OsLoginService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.oslogin.v1.OsLoginService, + 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 osLoginServiceStubMethods = [ + 'deletePosixAccount', + 'deleteSshPublicKey', + 'getLoginProfile', + 'getSshPublicKey', + 'importSshPublicKey', + 'updateSshPublicKey', + ]; + for (const methodName of osLoginServiceStubMethods) { + const callPromise = this.osLoginServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.osLoginServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'oslogin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'oslogin.googleapis.com'; + } + + /** + * 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/compute', + ]; + } + + 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 -- + // ------------------- + /** + * Deletes a POSIX account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX + * account is in format `users/{user}/projects/{project}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.delete_posix_account.js + * region_tag:oslogin_v1_generated_OsLoginService_DeletePosixAccount_async + */ + deletePosixAccount( + request?: protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest | undefined, + {} | undefined + ] + >; + deletePosixAccount( + request: protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePosixAccount( + request: protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePosixAccount( + request?: protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1.IDeletePosixAccountRequest | 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.deletePosixAccount(request, options, callback); + } + /** + * Deletes an SSH public key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.delete_ssh_public_key.js + * region_tag:oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_async + */ + deleteSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + deleteSshPublicKey( + request: protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSshPublicKey( + request: protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1.IDeleteSshPublicKeyRequest | 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.deleteSshPublicKey(request, options, callback); + } + /** + * Retrieves the profile information used for logging in to a virtual machine + * on Google Compute Engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique ID for the user in format `users/{user}`. + * @param {string} request.projectId + * The project ID of the Google Cloud Platform project. + * @param {string} request.systemId + * A system ID for filtering the results of the request. + * @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 [LoginProfile]{@link google.cloud.oslogin.v1.LoginProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.get_login_profile.js + * region_tag:oslogin_v1_generated_OsLoginService_GetLoginProfile_async + */ + getLoginProfile( + request?: protos.google.cloud.oslogin.v1.IGetLoginProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.v1.ILoginProfile, + protos.google.cloud.oslogin.v1.IGetLoginProfileRequest | undefined, + {} | undefined + ] + >; + getLoginProfile( + request: protos.google.cloud.oslogin.v1.IGetLoginProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.v1.ILoginProfile, + protos.google.cloud.oslogin.v1.IGetLoginProfileRequest | null | undefined, + {} | null | undefined + > + ): void; + getLoginProfile( + request: protos.google.cloud.oslogin.v1.IGetLoginProfileRequest, + callback: Callback< + protos.google.cloud.oslogin.v1.ILoginProfile, + protos.google.cloud.oslogin.v1.IGetLoginProfileRequest | null | undefined, + {} | null | undefined + > + ): void; + getLoginProfile( + request?: protos.google.cloud.oslogin.v1.IGetLoginProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.v1.ILoginProfile, + | protos.google.cloud.oslogin.v1.IGetLoginProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.v1.ILoginProfile, + protos.google.cloud.oslogin.v1.IGetLoginProfileRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.v1.ILoginProfile, + protos.google.cloud.oslogin.v1.IGetLoginProfileRequest | 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.getLoginProfile(request, options, callback); + } + /** + * Retrieves an SSH public key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in + * format `users/{user}/sshPublicKeys/{fingerprint}`. + * @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 [SshPublicKey]{@link google.cloud.oslogin.common.SshPublicKey}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.get_ssh_public_key.js + * region_tag:oslogin_v1_generated_OsLoginService_GetSshPublicKey_async + */ + getSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + getSshPublicKey( + request: protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest | null | undefined, + {} | null | undefined + > + ): void; + getSshPublicKey( + request: protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest | null | undefined, + {} | null | undefined + > + ): void; + getSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IGetSshPublicKeyRequest | 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.getSshPublicKey(request, options, callback); + } + /** + * Adds an SSH public key and returns the profile information. Default POSIX + * account information is set when no username and UID exist as part of the + * login profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The unique ID for the user in format `users/{user}`. + * @param {google.cloud.oslogin.common.SshPublicKey} [request.sshPublicKey] + * Optional. The SSH public key and expiration time. + * @param {string} request.projectId + * The project ID of the Google Cloud Platform project. + * @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 [ImportSshPublicKeyResponse]{@link google.cloud.oslogin.v1.ImportSshPublicKeyResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.import_ssh_public_key.js + * region_tag:oslogin_v1_generated_OsLoginService_ImportSshPublicKey_async + */ + importSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + importSshPublicKey( + request: protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + importSshPublicKey( + request: protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + importSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse, + protos.google.cloud.oslogin.v1.IImportSshPublicKeyRequest | 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.importSshPublicKey(request, options, callback); + } + /** + * Updates an SSH public key and returns the profile information. This method + * supports patch semantics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {google.cloud.oslogin.common.SshPublicKey} request.sshPublicKey + * Required. The SSH public key and expiration time. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. Updates all if not present. + * @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 [SshPublicKey]{@link google.cloud.oslogin.common.SshPublicKey}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/os_login_service.update_ssh_public_key.js + * region_tag:oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_async + */ + updateSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + updateSshPublicKey( + request: protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSshPublicKey( + request: protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSshPublicKey( + request?: protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1.IUpdateSshPublicKeyRequest | 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.updateSshPublicKey(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified posixAccount resource name string. + * + * @param {string} user + * @param {string} project + * @returns {string} Resource name string. + */ + posixAccountPath(user: string, project: string) { + return this.pathTemplates.posixAccountPathTemplate.render({ + user: user, + project: project, + }); + } + + /** + * Parse the user from PosixAccount resource. + * + * @param {string} posixAccountName + * A fully-qualified path representing PosixAccount resource. + * @returns {string} A string representing the user. + */ + matchUserFromPosixAccountName(posixAccountName: string) { + return this.pathTemplates.posixAccountPathTemplate.match(posixAccountName) + .user; + } + + /** + * Parse the project from PosixAccount resource. + * + * @param {string} posixAccountName + * A fully-qualified path representing PosixAccount resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPosixAccountName(posixAccountName: string) { + return this.pathTemplates.posixAccountPathTemplate.match(posixAccountName) + .project; + } + + /** + * Return a fully-qualified sshPublicKey resource name string. + * + * @param {string} user + * @param {string} fingerprint + * @returns {string} Resource name string. + */ + sshPublicKeyPath(user: string, fingerprint: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.render({ + user: user, + fingerprint: fingerprint, + }); + } + + /** + * Parse the user from SshPublicKey resource. + * + * @param {string} sshPublicKeyName + * A fully-qualified path representing SshPublicKey resource. + * @returns {string} A string representing the user. + */ + matchUserFromSshPublicKeyName(sshPublicKeyName: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.match(sshPublicKeyName) + .user; + } + + /** + * Parse the fingerprint from SshPublicKey resource. + * + * @param {string} sshPublicKeyName + * A fully-qualified path representing SshPublicKey resource. + * @returns {string} A string representing the fingerprint. + */ + matchFingerprintFromSshPublicKeyName(sshPublicKeyName: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.match(sshPublicKeyName) + .fingerprint; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(user: string) { + return this.pathTemplates.userPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * 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.osLoginServiceStub && !this._terminated) { + return this.osLoginServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-oslogin/src/v1/os_login_service_client_config.json b/packages/google-cloud-oslogin/src/v1/os_login_service_client_config.json new file mode 100644 index 000000000000..fc7cef92246d --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1/os_login_service_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.cloud.oslogin.v1.OsLoginService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "DeletePosixAccount": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetLoginProfile": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-oslogin/src/v1/os_login_service_proto_list.json b/packages/google-cloud-oslogin/src/v1/os_login_service_proto_list.json new file mode 100644 index 000000000000..46f125ed586f --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1/os_login_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/oslogin/common/common.proto", + "../../protos/google/cloud/oslogin/v1/oslogin.proto" +] diff --git a/packages/google-cloud-oslogin/src/v1beta/gapic_metadata.json b/packages/google-cloud-oslogin/src/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..10c49f7afb67 --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1beta/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.oslogin.v1beta", + "libraryPackage": "@google-cloud/os-login", + "services": { + "OsLoginService": { + "clients": { + "grpc": { + "libraryClient": "OsLoginServiceClient", + "rpcs": { + "DeletePosixAccount": { + "methods": [ + "deletePosixAccount" + ] + }, + "DeleteSshPublicKey": { + "methods": [ + "deleteSshPublicKey" + ] + }, + "GetLoginProfile": { + "methods": [ + "getLoginProfile" + ] + }, + "GetSshPublicKey": { + "methods": [ + "getSshPublicKey" + ] + }, + "ImportSshPublicKey": { + "methods": [ + "importSshPublicKey" + ] + }, + "UpdateSshPublicKey": { + "methods": [ + "updateSshPublicKey" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OsLoginServiceClient", + "rpcs": { + "DeletePosixAccount": { + "methods": [ + "deletePosixAccount" + ] + }, + "DeleteSshPublicKey": { + "methods": [ + "deleteSshPublicKey" + ] + }, + "GetLoginProfile": { + "methods": [ + "getLoginProfile" + ] + }, + "GetSshPublicKey": { + "methods": [ + "getSshPublicKey" + ] + }, + "ImportSshPublicKey": { + "methods": [ + "importSshPublicKey" + ] + }, + "UpdateSshPublicKey": { + "methods": [ + "updateSshPublicKey" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-oslogin/src/v1beta/index.ts b/packages/google-cloud-oslogin/src/v1beta/index.ts new file mode 100644 index 000000000000..d3f167933f9a --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {OsLoginServiceClient} from './os_login_service_client'; diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts new file mode 100644 index 000000000000..1a09589b039c --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts @@ -0,0 +1,1021 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta/os_login_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './os_login_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud OS Login API + * + * The Cloud OS Login API allows you to manage users and their associated SSH + * public keys for logging into virtual machines on Google Cloud Platform. + * @class + * @memberof v1beta + */ +export class OsLoginServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + osLoginServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OsLoginServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 OsLoginServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof OsLoginServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + posixAccountPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/projects/{project}' + ), + sshPublicKeyPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/sshPublicKeys/{fingerprint}' + ), + userPathTemplate: new this._gaxModule.PathTemplate('users/{user}'), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.oslogin.v1beta.OsLoginService', + 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.osLoginServiceStub) { + return this.osLoginServiceStub; + } + + // Put together the "service stub" for + // google.cloud.oslogin.v1beta.OsLoginService. + this.osLoginServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.oslogin.v1beta.OsLoginService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.oslogin.v1beta.OsLoginService, + 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 osLoginServiceStubMethods = [ + 'deletePosixAccount', + 'deleteSshPublicKey', + 'getLoginProfile', + 'getSshPublicKey', + 'importSshPublicKey', + 'updateSshPublicKey', + ]; + for (const methodName of osLoginServiceStubMethods) { + const callPromise = this.osLoginServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.osLoginServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'oslogin.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'oslogin.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + ]; + } + + 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 -- + // ------------------- + /** + * Deletes a POSIX account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A reference to the POSIX account to update. POSIX accounts are identified + * by the project ID they are associated with. A reference to the POSIX + * account is in format `users/{user}/projects/{project}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.delete_posix_account.js + * region_tag:oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_async + */ + deletePosixAccount( + request?: protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest | undefined, + {} | undefined + ] + >; + deletePosixAccount( + request: protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePosixAccount( + request: protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePosixAccount( + request?: protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1beta.IDeletePosixAccountRequest | 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.deletePosixAccount(request, options, callback); + } + /** + * Deletes an SSH public key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.delete_ssh_public_key.js + * region_tag:oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_async + */ + deleteSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + deleteSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.oslogin.v1beta.IDeleteSshPublicKeyRequest | 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.deleteSshPublicKey(request, options, callback); + } + /** + * Retrieves the profile information used for logging in to a virtual machine + * on Google Compute Engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique ID for the user in format `users/{user}`. + * @param {string} request.projectId + * The project ID of the Google Cloud Platform project. + * @param {string} request.systemId + * A system ID for filtering the results of the request. + * @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 [LoginProfile]{@link google.cloud.oslogin.v1beta.LoginProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.get_login_profile.js + * region_tag:oslogin_v1beta_generated_OsLoginService_GetLoginProfile_async + */ + getLoginProfile( + request?: protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.v1beta.ILoginProfile, + protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest | undefined, + {} | undefined + ] + >; + getLoginProfile( + request: protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.v1beta.ILoginProfile, + | protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getLoginProfile( + request: protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest, + callback: Callback< + protos.google.cloud.oslogin.v1beta.ILoginProfile, + | protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getLoginProfile( + request?: protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.v1beta.ILoginProfile, + | protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.v1beta.ILoginProfile, + | protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.v1beta.ILoginProfile, + protos.google.cloud.oslogin.v1beta.IGetLoginProfileRequest | 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.getLoginProfile(request, options, callback); + } + /** + * Retrieves an SSH public key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to retrieve. Public keys are identified + * by their SHA-256 fingerprint. The fingerprint of the public key is in + * format `users/{user}/sshPublicKeys/{fingerprint}`. + * @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 [SshPublicKey]{@link google.cloud.oslogin.common.SshPublicKey}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.get_ssh_public_key.js + * region_tag:oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_async + */ + getSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + getSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1beta.IGetSshPublicKeyRequest | 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.getSshPublicKey(request, options, callback); + } + /** + * Adds an SSH public key and returns the profile information. Default POSIX + * account information is set when no username and UID exist as part of the + * login profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The unique ID for the user in format `users/{user}`. + * @param {google.cloud.oslogin.common.SshPublicKey} request.sshPublicKey + * Required. The SSH public key and expiration time. + * @param {string} request.projectId + * The project ID of the Google Cloud Platform project. + * @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 [ImportSshPublicKeyResponse]{@link google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.import_ssh_public_key.js + * region_tag:oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_async + */ + importSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + importSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + importSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + importSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + | protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse, + protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyRequest | 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.importSshPublicKey(request, options, callback); + } + /** + * Updates an SSH public key and returns the profile information. This method + * supports patch semantics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fingerprint of the public key to update. Public keys are identified by + * their SHA-256 fingerprint. The fingerprint of the public key is in format + * `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {google.cloud.oslogin.common.SshPublicKey} request.sshPublicKey + * Required. The SSH public key and expiration time. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask to control which fields get updated. Updates all if not present. + * @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 [SshPublicKey]{@link google.cloud.oslogin.common.SshPublicKey}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/os_login_service.update_ssh_public_key.js + * region_tag:oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_async + */ + updateSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest | undefined, + {} | undefined + ] + >; + updateSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSshPublicKey( + request: protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, + callback: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSshPublicKey( + request?: protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.oslogin.common.ISshPublicKey, + | protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.oslogin.common.ISshPublicKey, + protos.google.cloud.oslogin.v1beta.IUpdateSshPublicKeyRequest | 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.updateSshPublicKey(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified posixAccount resource name string. + * + * @param {string} user + * @param {string} project + * @returns {string} Resource name string. + */ + posixAccountPath(user: string, project: string) { + return this.pathTemplates.posixAccountPathTemplate.render({ + user: user, + project: project, + }); + } + + /** + * Parse the user from PosixAccount resource. + * + * @param {string} posixAccountName + * A fully-qualified path representing PosixAccount resource. + * @returns {string} A string representing the user. + */ + matchUserFromPosixAccountName(posixAccountName: string) { + return this.pathTemplates.posixAccountPathTemplate.match(posixAccountName) + .user; + } + + /** + * Parse the project from PosixAccount resource. + * + * @param {string} posixAccountName + * A fully-qualified path representing PosixAccount resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPosixAccountName(posixAccountName: string) { + return this.pathTemplates.posixAccountPathTemplate.match(posixAccountName) + .project; + } + + /** + * Return a fully-qualified sshPublicKey resource name string. + * + * @param {string} user + * @param {string} fingerprint + * @returns {string} Resource name string. + */ + sshPublicKeyPath(user: string, fingerprint: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.render({ + user: user, + fingerprint: fingerprint, + }); + } + + /** + * Parse the user from SshPublicKey resource. + * + * @param {string} sshPublicKeyName + * A fully-qualified path representing SshPublicKey resource. + * @returns {string} A string representing the user. + */ + matchUserFromSshPublicKeyName(sshPublicKeyName: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.match(sshPublicKeyName) + .user; + } + + /** + * Parse the fingerprint from SshPublicKey resource. + * + * @param {string} sshPublicKeyName + * A fully-qualified path representing SshPublicKey resource. + * @returns {string} A string representing the fingerprint. + */ + matchFingerprintFromSshPublicKeyName(sshPublicKeyName: string) { + return this.pathTemplates.sshPublicKeyPathTemplate.match(sshPublicKeyName) + .fingerprint; + } + + /** + * Return a fully-qualified user resource name string. + * + * @param {string} user + * @returns {string} Resource name string. + */ + userPath(user: string) { + return this.pathTemplates.userPathTemplate.render({ + user: user, + }); + } + + /** + * Parse the user from User resource. + * + * @param {string} userName + * A fully-qualified path representing User resource. + * @returns {string} A string representing the user. + */ + matchUserFromUserName(userName: string) { + return this.pathTemplates.userPathTemplate.match(userName).user; + } + + /** + * 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.osLoginServiceStub && !this._terminated) { + return this.osLoginServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client_config.json b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client_config.json new file mode 100644 index 000000000000..6dba4859a32a --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.cloud.oslogin.v1beta.OsLoginService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "DeletePosixAccount": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetLoginProfile": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateSshPublicKey": { + "timeout_millis": 10000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_proto_list.json b/packages/google-cloud-oslogin/src/v1beta/os_login_service_proto_list.json new file mode 100644 index 000000000000..078ed1d537d1 --- /dev/null +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/oslogin/common/common.proto", + "../../protos/google/cloud/oslogin/v1beta/oslogin.proto" +] diff --git a/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.js b/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..080554f99475 --- /dev/null +++ b/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const oslogin = require('@google-cloud/os-login'); + +function main() { + const osLoginServiceClient = new oslogin.OsLoginServiceClient(); +} + +main(); diff --git a/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..b5eb626ee88a --- /dev/null +++ b/packages/google-cloud-oslogin/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {OsLoginServiceClient} from '@google-cloud/os-login'; + +// check that the client class type name can be used +function doStuffWithOsLoginServiceClient(client: OsLoginServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const osLoginServiceClient = new OsLoginServiceClient(); + doStuffWithOsLoginServiceClient(osLoginServiceClient); +} + +main(); diff --git a/packages/google-cloud-oslogin/system-test/install.ts b/packages/google-cloud-oslogin/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-oslogin/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts new file mode 100644 index 000000000000..782c2f881cdb --- /dev/null +++ b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1.ts @@ -0,0 +1,1088 @@ +// Copyright 2022 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 osloginserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1.OsLoginServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + osloginserviceModule.v1.OsLoginServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + osloginserviceModule.v1.OsLoginServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = osloginserviceModule.v1.OsLoginServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osLoginServiceStub, undefined); + await client.initialize(); + assert(client.osLoginServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.osLoginServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osLoginServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + 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 osloginserviceModule.v1.OsLoginServiceClient({ + 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('deletePosixAccount', () => { + it('invokes deletePosixAccount without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePosixAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePosixAccount( + 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.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePosixAccount = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePosixAccount(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePosixAccount(request), expectedError); + }); + }); + + describe('deleteSshPublicKey', () => { + it('invokes deleteSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSshPublicKey( + 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.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSshPublicKey(request), expectedError); + }); + }); + + describe('getLoginProfile', () => { + it('invokes getLoginProfile without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1.LoginProfile() + ); + client.innerApiCalls.getLoginProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getLoginProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1.LoginProfile() + ); + client.innerApiCalls.getLoginProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLoginProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.v1.ILoginProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLoginProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getLoginProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getLoginProfile(request), expectedError); + }); + }); + + describe('getSshPublicKey', () => { + it('invokes getSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.getSshPublicKey = stubSimpleCall(expectedResponse); + const [response] = await client.getSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.getSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.common.ISshPublicKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSshPublicKey(request), expectedError); + }); + }); + + describe('importSshPublicKey', () => { + it('invokes importSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyResponse() + ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.importSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyResponse() + ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.v1.IImportSshPublicKeyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.importSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importSshPublicKey(request), expectedError); + }); + }); + + describe('updateSshPublicKey', () => { + it('invokes updateSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.common.ISshPublicKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSshPublicKey(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('posixAccount', () => { + const fakePath = '/rendered/path/posixAccount'; + const expectedParameters = { + user: 'userValue', + project: 'projectValue', + }; + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.posixAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.posixAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('posixAccountPath', () => { + const result = client.posixAccountPath('userValue', 'projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.posixAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromPosixAccountName', () => { + const result = client.matchUserFromPosixAccountName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.posixAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProjectFromPosixAccountName', () => { + const result = client.matchProjectFromPosixAccountName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.posixAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('sshPublicKey', () => { + const fakePath = '/rendered/path/sshPublicKey'; + const expectedParameters = { + user: 'userValue', + fingerprint: 'fingerprintValue', + }; + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sshPublicKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sshPublicKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sshPublicKeyPath', () => { + const result = client.sshPublicKeyPath('userValue', 'fingerprintValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromSshPublicKeyName', () => { + const result = client.matchUserFromSshPublicKeyName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFingerprintFromSshPublicKeyName', () => { + const result = client.matchFingerprintFromSshPublicKeyName(fakePath); + assert.strictEqual(result, 'fingerprintValue'); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + user: 'userValue', + }; + const client = new osloginserviceModule.v1.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts new file mode 100644 index 000000000000..2569ed64caa4 --- /dev/null +++ b/packages/google-cloud-oslogin/test/gapic_os_login_service_v1beta.ts @@ -0,0 +1,1088 @@ +// Copyright 2022 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 osloginserviceModule from '../src'; + +import {protobuf} 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); +} + +describe('v1beta.OsLoginServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + osloginserviceModule.v1beta.OsLoginServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + osloginserviceModule.v1beta.OsLoginServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = osloginserviceModule.v1beta.OsLoginServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osLoginServiceStub, undefined); + await client.initialize(); + assert(client.osLoginServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.osLoginServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.osLoginServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + 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 osloginserviceModule.v1beta.OsLoginServiceClient({ + 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('deletePosixAccount', () => { + it('invokes deletePosixAccount without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePosixAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePosixAccount = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePosixAccount( + 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.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePosixAccount = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePosixAccount(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePosixAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePosixAccount with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeletePosixAccountRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeletePosixAccountRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePosixAccount(request), expectedError); + }); + }); + + describe('deleteSshPublicKey', () => { + it('invokes deleteSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSshPublicKey( + 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.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSshPublicKey(request), expectedError); + }); + }); + + describe('getLoginProfile', () => { + it('invokes getLoginProfile without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.LoginProfile() + ); + client.innerApiCalls.getLoginProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getLoginProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.LoginProfile() + ); + client.innerApiCalls.getLoginProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLoginProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.v1beta.ILoginProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLoginProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getLoginProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoginProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoginProfile with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetLoginProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetLoginProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getLoginProfile(request), expectedError); + }); + }); + + describe('getSshPublicKey', () => { + it('invokes getSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.getSshPublicKey = stubSimpleCall(expectedResponse); + const [response] = await client.getSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.getSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.common.ISshPublicKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.GetSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSshPublicKey(request), expectedError); + }); + }); + + describe('importSshPublicKey', () => { + it('invokes importSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse() + ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.importSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse() + ); + client.innerApiCalls.importSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.v1beta.IImportSshPublicKeyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.importSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importSshPublicKey(request), expectedError); + }); + }); + + describe('updateSshPublicKey', () => { + it('invokes updateSshPublicKey without error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSshPublicKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey without error using callback', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.oslogin.common.SshPublicKey() + ); + client.innerApiCalls.updateSshPublicKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSshPublicKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.oslogin.common.ISshPublicKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey with error', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSshPublicKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSshPublicKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSshPublicKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSshPublicKey with closed client', async () => { + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSshPublicKey(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('posixAccount', () => { + const fakePath = '/rendered/path/posixAccount'; + const expectedParameters = { + user: 'userValue', + project: 'projectValue', + }; + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.posixAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.posixAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('posixAccountPath', () => { + const result = client.posixAccountPath('userValue', 'projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.posixAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromPosixAccountName', () => { + const result = client.matchUserFromPosixAccountName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.posixAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProjectFromPosixAccountName', () => { + const result = client.matchProjectFromPosixAccountName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.posixAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('sshPublicKey', () => { + const fakePath = '/rendered/path/sshPublicKey'; + const expectedParameters = { + user: 'userValue', + fingerprint: 'fingerprintValue', + }; + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sshPublicKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sshPublicKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sshPublicKeyPath', () => { + const result = client.sshPublicKeyPath('userValue', 'fingerprintValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromSshPublicKeyName', () => { + const result = client.matchUserFromSshPublicKeyName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFingerprintFromSshPublicKeyName', () => { + const result = client.matchFingerprintFromSshPublicKeyName(fakePath); + assert.strictEqual(result, 'fingerprintValue'); + assert( + (client.pathTemplates.sshPublicKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('user', () => { + const fakePath = '/rendered/path/user'; + const expectedParameters = { + user: 'userValue', + }; + const client = new osloginserviceModule.v1beta.OsLoginServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.userPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.userPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('userPath', () => { + const result = client.userPath('userValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.userPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromUserName', () => { + const result = client.matchUserFromUserName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.userPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-oslogin/tsconfig.json b/packages/google-cloud-oslogin/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-oslogin/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/packages/google-cloud-oslogin/webpack.config.js b/packages/google-cloud-oslogin/webpack.config.js new file mode 100644 index 000000000000..dfb7148c4550 --- /dev/null +++ b/packages/google-cloud-oslogin/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: 'OsLoginService', + filename: './os-login-service.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/packages/google-cloud-phishingprotection/.OwlBot.yaml b/packages/google-cloud-phishingprotection/.OwlBot.yaml new file mode 100644 index 000000000000..19ca20e51d96 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/phishingprotection/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-phishingprotection/$1 diff --git a/packages/google-cloud-phishingprotection/.eslintignore b/packages/google-cloud-phishingprotection/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-phishingprotection/.eslintrc.json b/packages/google-cloud-phishingprotection/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-phishingprotection/.gitattributes b/packages/google-cloud-phishingprotection/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-phishingprotection/.gitignore b/packages/google-cloud-phishingprotection/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.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/packages/google-cloud-phishingprotection/.jsdoc.js b/packages/google-cloud-phishingprotection/.jsdoc.js new file mode 100644 index 000000000000..45bc57209eac --- /dev/null +++ b/packages/google-cloud-phishingprotection/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/phishing-protection', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-phishingprotection/.mocharc.js b/packages/google-cloud-phishingprotection/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-phishingprotection/.nycrc b/packages/google-cloud-phishingprotection/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-phishingprotection/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-phishingprotection/.prettierignore b/packages/google-cloud-phishingprotection/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-phishingprotection/.prettierrc.js b/packages/google-cloud-phishingprotection/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-phishingprotection/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-phishingprotection/.repo-metadata.json b/packages/google-cloud-phishingprotection/.repo-metadata.json new file mode 100644 index 000000000000..8e54656176db --- /dev/null +++ b/packages/google-cloud-phishingprotection/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "phishing-protection", + "name_pretty": "Phishing Protection", + "product_documentation": "https://cloud.google.com/phishing-protection/docs/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/phishing-protection/latest", + "issue_tracker": "", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/phishing-protection", + "api_id": "phishingprotection.googleapis.com", + "requires_billing": true, + "default_version": "v1beta1", + "api_shortname": "phishingprotection", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-phishingprotection/CHANGELOG.md b/packages/google-cloud-phishingprotection/CHANGELOG.md new file mode 100644 index 000000000000..819f55490fb3 --- /dev/null +++ b/packages/google-cloud-phishingprotection/CHANGELOG.md @@ -0,0 +1,312 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/phishing-protection?activeTab=versions + +## [3.0.4](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.3...v3.0.4) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#411](https://github.com/googleapis/nodejs-phishing-protection/issues/411)) ([61c49e2](https://github.com/googleapis/nodejs-phishing-protection/commit/61c49e2196a3df81f5d2e337a136081efc108282)) + +## [3.0.3](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.2...v3.0.3) (2022-09-08) + + +### Bug Fixes + +* **build:** Enable release-please for tagging releases ([e5d75ea](https://github.com/googleapis/nodejs-phishing-protection/commit/e5d75eaa69f67db2e1d905a77b8d0ffc19f25f88)) + +## [3.0.2](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.1...v3.0.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#407](https://github.com/googleapis/nodejs-phishing-protection/issues/407)) ([33e1faa](https://github.com/googleapis/nodejs-phishing-protection/commit/33e1faa0ca2408612796e491f20ab15e25c96bc6)) +* Better support for fallback mode ([#402](https://github.com/googleapis/nodejs-phishing-protection/issues/402)) ([9490c72](https://github.com/googleapis/nodejs-phishing-protection/commit/9490c7233ab25fd4cae6379cf283be6b955f424b)) +* Change import long to require ([#403](https://github.com/googleapis/nodejs-phishing-protection/issues/403)) ([5ff8e2f](https://github.com/googleapis/nodejs-phishing-protection/commit/5ff8e2f645a224a5aac6319bd4347ab6af8494b4)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-phishing-protection/issues/1553)) ([#406](https://github.com/googleapis/nodejs-phishing-protection/issues/406)) ([54ef38f](https://github.com/googleapis/nodejs-phishing-protection/commit/54ef38f0c9ce81bdaf4ac22faf579de80917bc82)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-phishing-protection/issues/1546)) ([#405](https://github.com/googleapis/nodejs-phishing-protection/issues/405)) ([5347c0e](https://github.com/googleapis/nodejs-phishing-protection/commit/5347c0e94fa416c201c424a719d2cf607d31a3e5)) + +## [3.0.1](https://github.com/googleapis/nodejs-phishing-protection/compare/v3.0.0...v3.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#392](https://github.com/googleapis/nodejs-phishing-protection/issues/392)) ([fa7610b](https://github.com/googleapis/nodejs-phishing-protection/commit/fa7610bb1c8efdd2ff30964e6d18eaea81591f71)) + +## [3.0.0](https://github.com/googleapis/nodejs-phishing-protection/compare/v2.5.0...v3.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#386) + +### Build System + +* update library to use Node 12 ([#386](https://github.com/googleapis/nodejs-phishing-protection/issues/386)) ([4c8fc7d](https://github.com/googleapis/nodejs-phishing-protection/commit/4c8fc7d1fbcb90d18c7c74b73c1cc42db139cc39)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.7...v2.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#335](https://www.github.com/googleapis/nodejs-phishing-protection/issues/335)) ([4187b70](https://www.github.com/googleapis/nodejs-phishing-protection/commit/4187b706e5eb5842719cefb117c1253485a39152)) + +### [2.4.7](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.6...v2.4.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#333](https://www.github.com/googleapis/nodejs-phishing-protection/issues/333)) ([60f816a](https://www.github.com/googleapis/nodejs-phishing-protection/commit/60f816a42aa198aa36ddeceee49ca38553fddb4b)) + +### [2.4.6](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.5...v2.4.6) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#326](https://www.github.com/googleapis/nodejs-phishing-protection/issues/326)) ([729ef44](https://www.github.com/googleapis/nodejs-phishing-protection/commit/729ef44c3f353c5c7b173df9bf4b6b8da065ef42)) + +### [2.4.5](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.4...v2.4.5) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#320](https://www.github.com/googleapis/nodejs-phishing-protection/issues/320)) ([a3e6fa0](https://www.github.com/googleapis/nodejs-phishing-protection/commit/a3e6fa03485bb63eea70243554aa9c636b725bcd)) + +### [2.4.4](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.3...v2.4.4) (2021-06-16) + + +### Bug Fixes + +* **docs:** generate docs with updated primary branch ([#310](https://www.github.com/googleapis/nodejs-phishing-protection/issues/310)) ([2218b9c](https://www.github.com/googleapis/nodejs-phishing-protection/commit/2218b9c3f3ddcf77495bb5c0442f6d8977962a80)) + +### [2.4.3](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.2...v2.4.3) (2021-06-16) + + +### Bug Fixes + +* **branch:** primary branch is now main ([#307](https://www.github.com/googleapis/nodejs-phishing-protection/issues/307)) ([840d522](https://www.github.com/googleapis/nodejs-phishing-protection/commit/840d52211d33d221f01e15769414225f980e0f38)) + +### [2.4.2](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.1...v2.4.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#298](https://www.github.com/googleapis/nodejs-phishing-protection/issues/298)) ([ea669a8](https://www.github.com/googleapis/nodejs-phishing-protection/commit/ea669a8485c1744dd61fa83774ca39bdfcff5a07)) + +### [2.4.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.4.0...v2.4.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#288](https://www.github.com/googleapis/nodejs-phishing-protection/issues/288)) ([cc7cbcd](https://www.github.com/googleapis/nodejs-phishing-protection/commit/cc7cbcd44ffce28a7471a663b38c59af050d5a03)) +* use require() to load JSON protos ([#291](https://www.github.com/googleapis/nodejs-phishing-protection/issues/291)) ([d7273f7](https://www.github.com/googleapis/nodejs-phishing-protection/commit/d7273f733e729df389fe409b55ae6df98255c3e4)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.3...v2.4.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#233](https://www.github.com/googleapis/nodejs-phishing-protection/issues/233)) ([f276eaf](https://www.github.com/googleapis/nodejs-phishing-protection/commit/f276eaf70ed7d0dad754554b10b0039e670d0ea5)) + +### [2.3.3](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.2...v2.3.3) (2021-01-07) + + +### Bug Fixes + +* check for fetch on window ([6d3eef2](https://www.github.com/googleapis/nodejs-phishing-protection/commit/6d3eef2af1fdce2bc34682d1f1364f4935d36885)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.1...v2.3.2) (2020-11-12) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#220](https://www.github.com/googleapis/nodejs-phishing-protection/issues/220)) ([951b9ef](https://www.github.com/googleapis/nodejs-phishing-protection/commit/951b9ef0b357e57e54246ed54fa7fdae1e2198c4)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.3.0...v2.3.1) (2020-10-02) + + +### Bug Fixes + +* **build:** pass AUTORELEASE_PR variable ([#205](https://www.github.com/googleapis/nodejs-phishing-protection/issues/205)) ([70e0401](https://www.github.com/googleapis/nodejs-phishing-protection/commit/70e0401f60fc820e2c728e57e58a36e7ec7d1295)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.2.0...v2.3.0) (2020-10-01) + + +### Features + +* **trampoline_v2:** generate trampoline v2 configuration ([#202](https://www.github.com/googleapis/nodejs-phishing-protection/issues/202)) ([10759cd](https://www.github.com/googleapis/nodejs-phishing-protection/commit/10759cd7ea01eefbc5e4b84cfb16efc5ce815a75)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.1.1...v2.2.0) (2020-08-31) + + +### Features + +* **build:** add github summary check workflow ([#179](https://www.github.com/googleapis/nodejs-phishing-protection/issues/179)) ([529ee95](https://www.github.com/googleapis/nodejs-phishing-protection/commit/529ee95b59af65b8ce4b78ad3dc436e838bee6d5)) + + +### Bug Fixes + +* modify apiCall ([#193](https://www.github.com/googleapis/nodejs-phishing-protection/issues/193)) ([8270582](https://www.github.com/googleapis/nodejs-phishing-protection/commit/82705827fe107c2f52bcd9ec599466152476cff8)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.1.0...v2.1.1) (2020-07-06) + + +### Bug Fixes + +* update node issue template ([#156](https://www.github.com/googleapis/nodejs-phishing-protection/issues/156)) ([e8104f1](https://www.github.com/googleapis/nodejs-phishing-protection/commit/e8104f1cd9b350e6c3c1c3f37842bb2cb5e1448c)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.0.1...v2.1.0) (2020-06-15) + + +### Features + +* move ts target to es2018 from es2016 ([#151](https://www.github.com/googleapis/nodejs-phishing-protection/issues/151)) ([f30f164](https://www.github.com/googleapis/nodejs-phishing-protection/commit/f30f164139c18728e33a997d16c900867831389f)) + + +### Bug Fixes + +* proper fallback option handling ([1ed6184](https://www.github.com/googleapis/nodejs-phishing-protection/commit/1ed618420da99608c90b762c94f8a33c79fa2634)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v2.0.0...v2.0.1) (2020-06-04) + + +### Bug Fixes + +* regenerate unit tests ([#144](https://www.github.com/googleapis/nodejs-phishing-protection/issues/144)) ([04040e7](https://www.github.com/googleapis/nodejs-phishing-protection/commit/04040e7ad95097e91239b16fca19be2ec8198dae)) +* synth.py clean up for multiple version ([#146](https://www.github.com/googleapis/nodejs-phishing-protection/issues/146)) ([fb742da](https://www.github.com/googleapis/nodejs-phishing-protection/commit/fb742da98a4dfce28925b3cc0c903da0df816fab)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.7.0...v2.0.0) (2020-04-14) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* drop node8 support ([#123](https://www.github.com/googleapis/nodejs-phishing-protection/issues/123)) ([fe53a97](https://www.github.com/googleapis/nodejs-phishing-protection/commit/fe53a97b06dcc5123482f3459312ad2c9ff3534d)) + + +### Bug Fixes + +* drop unused files from package ([#137](https://www.github.com/googleapis/nodejs-phishing-protection/issues/137)) ([9738564](https://www.github.com/googleapis/nodejs-phishing-protection/commit/9738564b5fe1e74e20a9e1fd6cb8ab4af954a817)) +* export explicit version from protos.js ([#128](https://www.github.com/googleapis/nodejs-phishing-protection/issues/128)) ([e71e492](https://www.github.com/googleapis/nodejs-phishing-protection/commit/e71e49252a8e67a03c55af2919a12a34ee121726)) +* remove eslint, update gax, fix generated protos, run the generator ([#133](https://www.github.com/googleapis/nodejs-phishing-protection/issues/133)) ([f530cee](https://www.github.com/googleapis/nodejs-phishing-protection/commit/f530cee08819d7e5faea57f1df2a514e23552067)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.6.0...v1.7.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#108](https://www.github.com/googleapis/nodejs-phishing-protection/issues/108)) ([1552963](https://www.github.com/googleapis/nodejs-phishing-protection/commit/1552963ecd210fa5a50abe17f95bf343d502cc3a)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.5.1...v1.6.0) (2020-02-28) + + +### Features + +* export protos in src/index.ts ([a33f101](https://www.github.com/googleapis/nodejs-phishing-protection/commit/a33f1015e429fd0fa2d6492c48818c32e0dc075d)) + +### [1.5.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.5.0...v1.5.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([2002577](https://www.github.com/googleapis/nodejs-phishing-protection/commit/2002577d39528d0a817b5788830704f5ef397033)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.4.0...v1.5.0) (2020-01-03) + + +### Features + +* move to typescript code generation ([#66](https://www.github.com/googleapis/nodejs-phishing-protection/issues/66)) ([9a8ee35](https://www.github.com/googleapis/nodejs-phishing-protection/commit/9a8ee35359e586ecf49b4ab67ade5705580fa496)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.3.2...v1.4.0) (2019-12-05) + + +### Features + +* add plural and singular resource descriptor ([#56](https://www.github.com/googleapis/nodejs-phishing-protection/issues/56)) ([85e99f9](https://www.github.com/googleapis/nodejs-phishing-protection/commit/85e99f9e9d15def40bdf1043b43eb1e941eb98f0)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([758a2f3](https://www.github.com/googleapis/nodejs-phishing-protection/commit/758a2f3a10a59c8ed6fd13a3ef76ffda07997a1b)) + +### [1.3.2](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.3.1...v1.3.2) (2019-11-15) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#52](https://www.github.com/googleapis/nodejs-phishing-protection/issues/52)) ([b53e568](https://www.github.com/googleapis/nodejs-phishing-protection/commit/b53e568715e9755c717c0ac9d32926ffc612f381)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.3.0...v1.3.1) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#46](https://www.github.com/googleapis/nodejs-phishing-protection/issues/46)) ([e749be5](https://www.github.com/googleapis/nodejs-phishing-protection/commit/e749be552f02943788056cd667fe1647c6bd1564)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.2.0...v1.3.0) (2019-10-09) + + +### Bug Fixes + +* use compatible version of google-gax ([68ead9e](https://www.github.com/googleapis/nodejs-phishing-protection/commit/68ead9e)) + + +### Features + +* support new phishing protection proto options ([#37](https://www.github.com/googleapis/nodejs-phishing-protection/issues/37)) ([eae9f69](https://www.github.com/googleapis/nodejs-phishing-protection/commit/eae9f69)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.1.4...v1.2.0) (2019-09-16) + + +### Features + +* load protos from JSON, grpc-fallback support ([406f60e](https://www.github.com/googleapis/nodejs-phishing-protection/commit/406f60e)) + +### [1.1.4](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.1.3...v1.1.4) (2019-08-26) + + +### Bug Fixes + +* include the correct version of node in a header ([#26](https://www.github.com/googleapis/nodejs-phishing-protection/issues/26)) ([430699a](https://www.github.com/googleapis/nodejs-phishing-protection/commit/430699a)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.1.2...v1.1.3) (2019-08-03) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([025c1a6](https://www.github.com/googleapis/nodejs-phishing-protection/commit/025c1a6)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#13](https://www.github.com/googleapis/nodejs-phishing-protection/issues/13)) ([d07028b](https://www.github.com/googleapis/nodejs-phishing-protection/commit/d07028b)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#9](https://www.github.com/googleapis/nodejs-phishing-protection/issues/9)) ([6527bf9](https://www.github.com/googleapis/nodejs-phishing-protection/commit/6527bf9)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-phishing-protection/compare/v1.0.0...v1.1.0) (2019-06-06) + + +### Features + +* support apiEndpoint override in client constructor ([#7](https://www.github.com/googleapis/nodejs-phishing-protection/issues/7)) ([368a004](https://www.github.com/googleapis/nodejs-phishing-protection/commit/368a004)) + +## 1.0.0 (2019-05-23) + + +### Features + +* initial release of library ([8da53bd](https://www.github.com/googleapis/nodejs-phishing-protection/commit/8da53bd)) diff --git a/packages/google-cloud-phishingprotection/CODE_OF_CONDUCT.md b/packages/google-cloud-phishingprotection/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-phishingprotection/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-phishingprotection/CONTRIBUTING.md b/packages/google-cloud-phishingprotection/CONTRIBUTING.md new file mode 100644 index 000000000000..1b94e8ec0c81 --- /dev/null +++ b/packages/google-cloud-phishingprotection/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Phishing Protection API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=phishingprotection.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-phishingprotection/LICENSE b/packages/google-cloud-phishingprotection/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-phishingprotection/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-phishingprotection/README.md b/packages/google-cloud-phishingprotection/README.md new file mode 100644 index 000000000000..804c633c6199 --- /dev/null +++ b/packages/google-cloud-phishingprotection/README.md @@ -0,0 +1,157 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Phishing Protection: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/phishing-protection.svg)](https://www.npmjs.org/package/@google-cloud/phishing-protection) + + + + +Phishing Protection API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Phishing Protection Node.js Client API Reference][client-docs] +* [Phishing Protection Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Phishing Protection API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/phishing-protection +``` + + +### Using the client library + +```javascript +const { + PhishingProtectionServiceV1Beta1Client, +} = require('@google-cloud/phishing-protection'); +const client = new PhishingProtectionServiceV1Beta1Client(); + +// the numeric project ID. +const formattedParent = client.projectPath(projectId); +const request = { + parent: formattedParent, + uri: uri, // the URI to report to Phishing API. +}; + +await client.reportPhishing(request); + +console.info(`reported ${uri} to Phishing Protection API`); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Phishing_protection_service_v1_beta1.report_phishing | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/test/quickstart.js,samples/README.md) | + + + +The [Phishing Protection Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/phishing-protection@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/phishing-protection/latest +[product-docs]: https://cloud.google.com/phishing-protection/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=phishingprotection.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-phishingprotection/linkinator.config.json b/packages/google-cloud-phishingprotection/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-phishingprotection/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-phishingprotection/owlbot.py b/packages/google-cloud-phishingprotection/owlbot.py new file mode 100644 index 000000000000..e6f45149ff59 --- /dev/null +++ b/packages/google-cloud-phishingprotection/owlbot.py @@ -0,0 +1,17 @@ +# 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. + +import synthtool.languages.node as node + +node.owlbot_main(templates_excludes=[".github/release-please.yml"]) diff --git a/packages/google-cloud-phishingprotection/package.json b/packages/google-cloud-phishingprotection/package.json new file mode 100644 index 000000000000..88d8aa4e8d0b --- /dev/null +++ b/packages/google-cloud-phishingprotection/package.json @@ -0,0 +1,68 @@ +{ + "repository": "googleapis/nodejs-phishing-protection", + "name": "@google-cloud/phishing-protection", + "version": "3.0.4", + "author": "Google LLC", + "description": "Phishing Protection API client for Node.js", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google phishingprotection", + "phishingprotection", + "Phishing Protection API" + ], + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "chai": "^4.2.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.2", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "scripts": { + "test": "c8 mocha build/test", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "fix": "gts fix", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-phishingprotection/protos/google/cloud/common_resources.proto b/packages/google-cloud-phishingprotection/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000000..56c9f800d5e3 --- /dev/null +++ b/packages/google-cloud-phishingprotection/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-phishingprotection/protos/google/cloud/phishingprotection/v1beta1/phishingprotection.proto b/packages/google-cloud-phishingprotection/protos/google/cloud/phishingprotection/v1beta1/phishingprotection.proto new file mode 100644 index 000000000000..01a89ec2bb10 --- /dev/null +++ b/packages/google-cloud-phishingprotection/protos/google/cloud/phishingprotection/v1beta1/phishingprotection.proto @@ -0,0 +1,73 @@ +// Copyright 2019 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.cloud.phishingprotection.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.PhishingProtection.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/phishingprotection/v1beta1;phishingprotection"; +option java_multiple_files = true; +option java_outer_classname = "PhishingProtectionProto"; +option java_package = "com.google.phishingprotection.v1beta1"; +option objc_class_prefix = "GCPP"; +option php_namespace = "Google\\Cloud\\PhishingProtection\\V1beta1"; +option ruby_package = "Google::Cloud::PhishingProtection::V1beta1"; + +// Service to report phishing URIs. +service PhishingProtectionServiceV1Beta1 { + option (google.api.default_host) = "phishingprotection.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Reports a URI suspected of containing phishing content to be reviewed. Once + // the report review is complete, its result can be found in the Cloud + // Security Command Center findings dashboard for Phishing Protection. If the + // result verifies the existence of malicious phishing content, the site will + // be added the to [Google's Social Engineering + // lists](https://support.google.com/webmasters/answer/6350487/) in order to + // protect users that could get exposed to this threat in the future. + rpc ReportPhishing(ReportPhishingRequest) returns (ReportPhishingResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/phishing:report" + body: "*" + }; + option (google.api.method_signature) = "parent,uri"; + } +} + +// The ReportPhishing request message. +message ReportPhishingRequest { + // Required. The name of the project for which the report will be created, + // in the format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The URI that is being reported for phishing content to be analyzed. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The ReportPhishing (empty) response message. +message ReportPhishingResponse { + +} diff --git a/packages/google-cloud-phishingprotection/protos/protos.d.ts b/packages/google-cloud-phishingprotection/protos/protos.d.ts new file mode 100644 index 000000000000..0a6042a71a08 --- /dev/null +++ b/packages/google-cloud-phishingprotection/protos/protos.d.ts @@ -0,0 +1,4245 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace phishingprotection. */ + namespace phishingprotection { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a PhishingProtectionServiceV1Beta1 */ + class PhishingProtectionServiceV1Beta1 extends $protobuf.rpc.Service { + + /** + * Constructs a new PhishingProtectionServiceV1Beta1 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 PhishingProtectionServiceV1Beta1 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): PhishingProtectionServiceV1Beta1; + + /** + * Calls ReportPhishing. + * @param request ReportPhishingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReportPhishingResponse + */ + public reportPhishing(request: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, callback: google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1.ReportPhishingCallback): void; + + /** + * Calls ReportPhishing. + * @param request ReportPhishingRequest message or plain object + * @returns Promise + */ + public reportPhishing(request: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest): Promise; + } + + namespace PhishingProtectionServiceV1Beta1 { + + /** + * Callback as used by {@link google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1|reportPhishing}. + * @param error Error, if any + * @param [response] ReportPhishingResponse + */ + type ReportPhishingCallback = (error: (Error|null), response?: google.cloud.phishingprotection.v1beta1.ReportPhishingResponse) => void; + } + + /** Properties of a ReportPhishingRequest. */ + interface IReportPhishingRequest { + + /** ReportPhishingRequest parent */ + parent?: (string|null); + + /** ReportPhishingRequest uri */ + uri?: (string|null); + } + + /** Represents a ReportPhishingRequest. */ + class ReportPhishingRequest implements IReportPhishingRequest { + + /** + * Constructs a new ReportPhishingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest); + + /** ReportPhishingRequest parent. */ + public parent: string; + + /** ReportPhishingRequest uri. */ + public uri: string; + + /** + * Creates a new ReportPhishingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportPhishingRequest instance + */ + public static create(properties?: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest): google.cloud.phishingprotection.v1beta1.ReportPhishingRequest; + + /** + * Encodes the specified ReportPhishingRequest message. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingRequest.verify|verify} messages. + * @param message ReportPhishingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportPhishingRequest message, length delimited. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingRequest.verify|verify} messages. + * @param message ReportPhishingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportPhishingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportPhishingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.phishingprotection.v1beta1.ReportPhishingRequest; + + /** + * Decodes a ReportPhishingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportPhishingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.phishingprotection.v1beta1.ReportPhishingRequest; + + /** + * Verifies a ReportPhishingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportPhishingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportPhishingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.phishingprotection.v1beta1.ReportPhishingRequest; + + /** + * Creates a plain object from a ReportPhishingRequest message. Also converts values to other types if specified. + * @param message ReportPhishingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.phishingprotection.v1beta1.ReportPhishingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportPhishingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportPhishingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReportPhishingResponse. */ + interface IReportPhishingResponse { + } + + /** Represents a ReportPhishingResponse. */ + class ReportPhishingResponse implements IReportPhishingResponse { + + /** + * Constructs a new ReportPhishingResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.phishingprotection.v1beta1.IReportPhishingResponse); + + /** + * Creates a new ReportPhishingResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportPhishingResponse instance + */ + public static create(properties?: google.cloud.phishingprotection.v1beta1.IReportPhishingResponse): google.cloud.phishingprotection.v1beta1.ReportPhishingResponse; + + /** + * Encodes the specified ReportPhishingResponse message. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse.verify|verify} messages. + * @param message ReportPhishingResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportPhishingResponse message, length delimited. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse.verify|verify} messages. + * @param message ReportPhishingResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportPhishingResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportPhishingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.phishingprotection.v1beta1.ReportPhishingResponse; + + /** + * Decodes a ReportPhishingResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportPhishingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.phishingprotection.v1beta1.ReportPhishingResponse; + + /** + * Verifies a ReportPhishingResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportPhishingResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportPhishingResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.phishingprotection.v1beta1.ReportPhishingResponse; + + /** + * Creates a plain object from a ReportPhishingResponse message. Also converts values to other types if specified. + * @param message ReportPhishingResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.phishingprotection.v1beta1.ReportPhishingResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportPhishingResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportPhishingResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 + } + } + } + } +} diff --git a/packages/google-cloud-phishingprotection/protos/protos.js b/packages/google-cloud-phishingprotection/protos/protos.js new file mode 100644 index 000000000000..079980a5d0c7 --- /dev/null +++ b/packages/google-cloud-phishingprotection/protos/protos.js @@ -0,0 +1,11565 @@ +// Copyright 2022 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_phishing_protection_protos || ($protobuf.roots._google_cloud_phishing_protection_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.phishingprotection = (function() { + + /** + * Namespace phishingprotection. + * @memberof google.cloud + * @namespace + */ + var phishingprotection = {}; + + phishingprotection.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.phishingprotection + * @namespace + */ + var v1beta1 = {}; + + v1beta1.PhishingProtectionServiceV1Beta1 = (function() { + + /** + * Constructs a new PhishingProtectionServiceV1Beta1 service. + * @memberof google.cloud.phishingprotection.v1beta1 + * @classdesc Represents a PhishingProtectionServiceV1Beta1 + * @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 PhishingProtectionServiceV1Beta1(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PhishingProtectionServiceV1Beta1.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PhishingProtectionServiceV1Beta1; + + /** + * Creates new PhishingProtectionServiceV1Beta1 service using the specified rpc implementation. + * @function create + * @memberof google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1 + * @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 {PhishingProtectionServiceV1Beta1} RPC service. Useful where requests and/or responses are streamed. + */ + PhishingProtectionServiceV1Beta1.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1|reportPhishing}. + * @memberof google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1 + * @typedef ReportPhishingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} [response] ReportPhishingResponse + */ + + /** + * Calls ReportPhishing. + * @function reportPhishing + * @memberof google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1 + * @instance + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest} request ReportPhishingRequest message or plain object + * @param {google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1.ReportPhishingCallback} callback Node-style callback called with the error, if any, and ReportPhishingResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PhishingProtectionServiceV1Beta1.prototype.reportPhishing = function reportPhishing(request, callback) { + return this.rpcCall(reportPhishing, $root.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest, $root.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse, request, callback); + }, "name", { value: "ReportPhishing" }); + + /** + * Calls ReportPhishing. + * @function reportPhishing + * @memberof google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1 + * @instance + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest} request ReportPhishingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PhishingProtectionServiceV1Beta1; + })(); + + v1beta1.ReportPhishingRequest = (function() { + + /** + * Properties of a ReportPhishingRequest. + * @memberof google.cloud.phishingprotection.v1beta1 + * @interface IReportPhishingRequest + * @property {string|null} [parent] ReportPhishingRequest parent + * @property {string|null} [uri] ReportPhishingRequest uri + */ + + /** + * Constructs a new ReportPhishingRequest. + * @memberof google.cloud.phishingprotection.v1beta1 + * @classdesc Represents a ReportPhishingRequest. + * @implements IReportPhishingRequest + * @constructor + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest=} [properties] Properties to set + */ + function ReportPhishingRequest(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]]; + } + + /** + * ReportPhishingRequest parent. + * @member {string} parent + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @instance + */ + ReportPhishingRequest.prototype.parent = ""; + + /** + * ReportPhishingRequest uri. + * @member {string} uri + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @instance + */ + ReportPhishingRequest.prototype.uri = ""; + + /** + * Creates a new ReportPhishingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest=} [properties] Properties to set + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingRequest} ReportPhishingRequest instance + */ + ReportPhishingRequest.create = function create(properties) { + return new ReportPhishingRequest(properties); + }; + + /** + * Encodes the specified ReportPhishingRequest message. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest} message ReportPhishingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportPhishingRequest.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.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified ReportPhishingRequest message, length delimited. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingRequest} message ReportPhishingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportPhishingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportPhishingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingRequest} ReportPhishingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportPhishingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportPhishingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingRequest} ReportPhishingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportPhishingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportPhishingRequest message. + * @function verify + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportPhishingRequest.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.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a ReportPhishingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingRequest} ReportPhishingRequest + */ + ReportPhishingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest) + return object; + var message = new $root.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a ReportPhishingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {google.cloud.phishingprotection.v1beta1.ReportPhishingRequest} message ReportPhishingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportPhishingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.uri = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this ReportPhishingRequest to JSON. + * @function toJSON + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @instance + * @returns {Object.} JSON object + */ + ReportPhishingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportPhishingRequest + * @function getTypeUrl + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportPhishingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.phishingprotection.v1beta1.ReportPhishingRequest"; + }; + + return ReportPhishingRequest; + })(); + + v1beta1.ReportPhishingResponse = (function() { + + /** + * Properties of a ReportPhishingResponse. + * @memberof google.cloud.phishingprotection.v1beta1 + * @interface IReportPhishingResponse + */ + + /** + * Constructs a new ReportPhishingResponse. + * @memberof google.cloud.phishingprotection.v1beta1 + * @classdesc Represents a ReportPhishingResponse. + * @implements IReportPhishingResponse + * @constructor + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingResponse=} [properties] Properties to set + */ + function ReportPhishingResponse(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 ReportPhishingResponse instance using the specified properties. + * @function create + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingResponse=} [properties] Properties to set + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} ReportPhishingResponse instance + */ + ReportPhishingResponse.create = function create(properties) { + return new ReportPhishingResponse(properties); + }; + + /** + * Encodes the specified ReportPhishingResponse message. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingResponse} message ReportPhishingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportPhishingResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReportPhishingResponse message, length delimited. Does not implicitly {@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {google.cloud.phishingprotection.v1beta1.IReportPhishingResponse} message ReportPhishingResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportPhishingResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportPhishingResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} ReportPhishingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportPhishingResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportPhishingResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} ReportPhishingResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportPhishingResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportPhishingResponse message. + * @function verify + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportPhishingResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReportPhishingResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} ReportPhishingResponse + */ + ReportPhishingResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse) + return object; + return new $root.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse(); + }; + + /** + * Creates a plain object from a ReportPhishingResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {google.cloud.phishingprotection.v1beta1.ReportPhishingResponse} message ReportPhishingResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportPhishingResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ReportPhishingResponse to JSON. + * @function toJSON + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @instance + * @returns {Object.} JSON object + */ + ReportPhishingResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportPhishingResponse + * @function getTypeUrl + * @memberof google.cloud.phishingprotection.v1beta1.ReportPhishingResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportPhishingResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.phishingprotection.v1beta1.ReportPhishingResponse"; + }; + + return ReportPhishingResponse; + })(); + + return v1beta1; + })(); + + return phishingprotection; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-phishingprotection/protos/protos.json b/packages/google-cloud-phishingprotection/protos/protos.json new file mode 100644 index 000000000000..38e6a8a57595 --- /dev/null +++ b/packages/google-cloud-phishingprotection/protos/protos.json @@ -0,0 +1,1223 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "phishingprotection": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.PhishingProtection.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/phishingprotection/v1beta1;phishingprotection", + "java_multiple_files": true, + "java_outer_classname": "PhishingProtectionProto", + "java_package": "com.google.phishingprotection.v1beta1", + "objc_class_prefix": "GCPP", + "php_namespace": "Google\\Cloud\\PhishingProtection\\V1beta1", + "ruby_package": "Google::Cloud::PhishingProtection::V1beta1" + }, + "nested": { + "PhishingProtectionServiceV1Beta1": { + "options": { + "(google.api.default_host)": "phishingprotection.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ReportPhishing": { + "requestType": "ReportPhishingRequest", + "responseType": "ReportPhishingResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*}/phishing:report", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,uri" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*}/phishing:report", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,uri" + } + ] + } + } + }, + "ReportPhishingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "uri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReportPhishingResponse": { + "fields": {} + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-phishingprotection/samples/.eslintrc.yml b/packages/google-cloud-phishingprotection/samples/.eslintrc.yml new file mode 100644 index 000000000000..282535f55f6a --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-phishingprotection/samples/README.md b/packages/google-cloud-phishingprotection/samples/README.md new file mode 100644 index 000000000000..facca3b6e95e --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/README.md @@ -0,0 +1,86 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Phishing Protection: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Phishing_protection_service_v1_beta1.report_phishing](#phishing_protection_service_v1_beta1.report_phishing) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Phishing_protection_service_v1_beta1.report_phishing + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-phishingprotection/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-phishingprotection/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-phishingprotection/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-phishingprotection/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/phishing-protection/docs/ diff --git a/packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js b/packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js new file mode 100644 index 000000000000..85e4b74ff338 --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(parent, uri) { + // [START phishingprotection_v1beta1_generated_PhishingProtectionServiceV1Beta1_ReportPhishing_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project for which the report will be created, + * in the format "projects/{project_number}". + */ + // const parent = 'abc123' + /** + * Required. The URI that is being reported for phishing content to be analyzed. + */ + // const uri = 'abc123' + + // Imports the Phishingprotection library + const {PhishingProtectionServiceV1Beta1Client} = require('@google-cloud/phishing-protection').v1beta1; + + // Instantiates a client + const phishingprotectionClient = new PhishingProtectionServiceV1Beta1Client(); + + async function callReportPhishing() { + // Construct request + const request = { + parent, + uri, + }; + + // Run request + const response = await phishingprotectionClient.reportPhishing(request); + console.log(response); + } + + callReportPhishing(); + // [END phishingprotection_v1beta1_generated_PhishingProtectionServiceV1Beta1_ReportPhishing_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-phishingprotection/samples/generated/v1beta1/snippet_metadata.google.cloud.phishingprotection.v1beta1.json b/packages/google-cloud-phishingprotection/samples/generated/v1beta1/snippet_metadata.google.cloud.phishingprotection.v1beta1.json new file mode 100644 index 000000000000..4d0922d18279 --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/generated/v1beta1/snippet_metadata.google.cloud.phishingprotection.v1beta1.json @@ -0,0 +1,59 @@ +{ + "clientLibrary": { + "name": "nodejs-phishingprotection", + "version": "3.0.4", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.phishingprotection.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "phishingprotection_v1beta1_generated_PhishingProtectionServiceV1Beta1_ReportPhishing_async", + "title": "PhishingProtectionServiceV1Beta1 reportPhishing Sample", + "origin": "API_DEFINITION", + "description": " Reports a URI suspected of containing phishing content to be reviewed. Once the report review is complete, its result can be found in the Cloud Security Command Center findings dashboard for Phishing Protection. If the result verifies the existence of malicious phishing content, the site will be added the to [Google's Social Engineering lists](https://support.google.com/webmasters/answer/6350487/) in order to protect users that could get exposed to this threat in the future.", + "canonical": true, + "file": "phishing_protection_service_v1_beta1.report_phishing.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReportPhishing", + "fullName": "google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1.ReportPhishing", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "uri", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.phishingprotection.v1beta1.ReportPhishingResponse", + "client": { + "shortName": "PhishingProtectionServiceV1Beta1Client", + "fullName": "google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1Client" + }, + "method": { + "shortName": "ReportPhishing", + "fullName": "google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1.ReportPhishing", + "service": { + "shortName": "PhishingProtectionServiceV1Beta1", + "fullName": "google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-phishingprotection/samples/package.json b/packages/google-cloud-phishingprotection/samples/package.json new file mode 100644 index 000000000000..7a866a6bdcbf --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/package.json @@ -0,0 +1,22 @@ +{ + "name": "nodejs-phishing-protection-client", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/phishing-protection": "^3.0.4" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-phishingprotection/samples/quickstart.js b/packages/google-cloud-phishingprotection/samples/quickstart.js new file mode 100644 index 000000000000..44cd80517d89 --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/quickstart.js @@ -0,0 +1,45 @@ +// Copyright 2019 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. + +'use strict'; + +/** + * Report URL to Phishing Protection API. + * @param {string} URL to report to Phishing Protection API + * @param {number} projectId numeric project identifier. + */ +async function main(uri, projectId) { + // [START phishing_protection_quickstart] + const { + PhishingProtectionServiceV1Beta1Client, + } = require('@google-cloud/phishing-protection'); + const client = new PhishingProtectionServiceV1Beta1Client(); + + // the numeric project ID. + const formattedParent = client.projectPath(projectId); + const request = { + parent: formattedParent, + uri: uri, // the URI to report to Phishing API. + }; + + await client.reportPhishing(request); + + console.info(`reported ${uri} to Phishing Protection API`); + // [END phishing_protection_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-phishingprotection/samples/test/quickstart.js b/packages/google-cloud-phishingprotection/samples/test/quickstart.js new file mode 100644 index 000000000000..4dabf41eda3e --- /dev/null +++ b/packages/google-cloud-phishingprotection/samples/test/quickstart.js @@ -0,0 +1,40 @@ +// Copyright 2019 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. + +'use strict'; + +const path = require('path'); +const {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const PROJECT_ID = '1046198160504'; +const URI = 'http://example.com'; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + try { + execSync(`node ./quickstart.js ${URI} ${PROJECT_ID}`, {cwd}); + } catch (err) { + if (err.toString().match(/This submission was recently received/)) { + return; + } else { + throw err; + } + } + }); +}); diff --git a/packages/google-cloud-phishingprotection/src/index.ts b/packages/google-cloud-phishingprotection/src/index.ts new file mode 100644 index 000000000000..10b62c62b79a --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; + +const PhishingProtectionServiceV1Beta1Client = + v1beta1.PhishingProtectionServiceV1Beta1Client; +type PhishingProtectionServiceV1Beta1Client = + v1beta1.PhishingProtectionServiceV1Beta1Client; + +export {v1beta1, PhishingProtectionServiceV1Beta1Client}; +export default {v1beta1, PhishingProtectionServiceV1Beta1Client}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/gapic_metadata.json b/packages/google-cloud-phishingprotection/src/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..1840cf8dbd5e --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/v1beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.phishingprotection.v1beta1", + "libraryPackage": "@google-cloud/phishing-protection", + "services": { + "PhishingProtectionServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "PhishingProtectionServiceV1Beta1Client", + "rpcs": { + "ReportPhishing": { + "methods": [ + "reportPhishing" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PhishingProtectionServiceV1Beta1Client", + "rpcs": { + "ReportPhishing": { + "methods": [ + "reportPhishing" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/index.ts b/packages/google-cloud-phishingprotection/src/v1beta1/index.ts new file mode 100644 index 000000000000..58fbf4b1ffae --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {PhishingProtectionServiceV1Beta1Client} from './phishing_protection_service_v1_beta1_client'; diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.ts b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.ts new file mode 100644 index 000000000000..f7e750b3954c --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.ts @@ -0,0 +1,464 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/phishing_protection_service_v1_beta1_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './phishing_protection_service_v1_beta1_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to report phishing URIs. + * @class + * @memberof v1beta1 + */ +export class PhishingProtectionServiceV1Beta1Client { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + phishingProtectionServiceV1Beta1Stub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PhishingProtectionServiceV1Beta1Client. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 PhishingProtectionServiceV1Beta1Client({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof PhishingProtectionServiceV1Beta1Client; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1', + 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.phishingProtectionServiceV1Beta1Stub) { + return this.phishingProtectionServiceV1Beta1Stub; + } + + // Put together the "service stub" for + // google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1. + this.phishingProtectionServiceV1Beta1Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.phishingprotection.v1beta1 + .PhishingProtectionServiceV1Beta1, + 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 phishingProtectionServiceV1Beta1StubMethods = ['reportPhishing']; + for (const methodName of phishingProtectionServiceV1Beta1StubMethods) { + const callPromise = this.phishingProtectionServiceV1Beta1Stub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.phishingProtectionServiceV1Beta1Stub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'phishingprotection.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'phishingprotection.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Reports a URI suspected of containing phishing content to be reviewed. Once + * the report review is complete, its result can be found in the Cloud + * Security Command Center findings dashboard for Phishing Protection. If the + * result verifies the existence of malicious phishing content, the site will + * be added the to [Google's Social Engineering + * lists](https://support.google.com/webmasters/answer/6350487/) in order to + * protect users that could get exposed to this threat in the future. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project for which the report will be created, + * in the format "projects/{project_number}". + * @param {string} request.uri + * Required. The URI that is being reported for phishing content to be analyzed. + * @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 [ReportPhishingResponse]{@link google.cloud.phishingprotection.v1beta1.ReportPhishingResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/phishing_protection_service_v1_beta1.report_phishing.js + * region_tag:phishingprotection_v1beta1_generated_PhishingProtectionServiceV1Beta1_ReportPhishing_async + */ + reportPhishing( + request?: protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + ( + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | undefined + ), + {} | undefined + ] + >; + reportPhishing( + request: protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + reportPhishing( + request: protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, + callback: Callback< + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + reportPhishing( + request?: protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse, + ( + | protos.google.cloud.phishingprotection.v1beta1.IReportPhishingRequest + | 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.reportPhishing(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; + } + + /** + * 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.phishingProtectionServiceV1Beta1Stub && !this._terminated) { + return this.phishingProtectionServiceV1Beta1Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client_config.json b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client_config.json new file mode 100644 index 000000000000..44b8db8ab62a --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.phishingprotection.v1beta1.PhishingProtectionServiceV1Beta1": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "ReportPhishing": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_proto_list.json b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_proto_list.json new file mode 100644 index 000000000000..55a8764d3ea4 --- /dev/null +++ b/packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/phishingprotection/v1beta1/phishingprotection.proto" +] diff --git a/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.js b/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..1f723b745977 --- /dev/null +++ b/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const phishingprotection = require('@google-cloud/phishing-protection'); + +function main() { + const phishingProtectionServiceV1Beta1Client = + new phishingprotection.PhishingProtectionServiceV1Beta1Client(); +} + +main(); diff --git a/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..6a6ead00d95c --- /dev/null +++ b/packages/google-cloud-phishingprotection/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,37 @@ +// Copyright 2022 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 {PhishingProtectionServiceV1Beta1Client} from '@google-cloud/phishing-protection'; + +// check that the client class type name can be used +function doStuffWithPhishingProtectionServiceV1Beta1Client( + client: PhishingProtectionServiceV1Beta1Client +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const phishingProtectionServiceV1Beta1Client = + new PhishingProtectionServiceV1Beta1Client(); + doStuffWithPhishingProtectionServiceV1Beta1Client( + phishingProtectionServiceV1Beta1Client + ); +} + +main(); diff --git a/packages/google-cloud-phishingprotection/system-test/install.ts b/packages/google-cloud-phishingprotection/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-phishingprotection/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-phishingprotection/test/gapic_phishing_protection_service_v1_beta1_v1beta1.ts b/packages/google-cloud-phishingprotection/test/gapic_phishing_protection_service_v1_beta1_v1beta1.ts new file mode 100644 index 000000000000..fb1bc0129483 --- /dev/null +++ b/packages/google-cloud-phishingprotection/test/gapic_phishing_protection_service_v1_beta1_v1beta1.ts @@ -0,0 +1,380 @@ +// Copyright 2022 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 phishingprotectionservicev1beta1Module from '../src'; + +import {protobuf} 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); +} + +describe('v1beta1.PhishingProtectionServiceV1Beta1Client', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + phishingprotectionservicev1beta1Module.v1beta1 + .PhishingProtectionServiceV1Beta1Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + phishingprotectionservicev1beta1Module.v1beta1 + .PhishingProtectionServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + phishingprotectionservicev1beta1Module.v1beta1 + .PhishingProtectionServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.phishingProtectionServiceV1Beta1Stub, + undefined + ); + await client.initialize(); + assert(client.phishingProtectionServiceV1Beta1Stub); + }); + + it('has close method for the initialized client', done => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.phishingProtectionServiceV1Beta1Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.phishingProtectionServiceV1Beta1Stub, + undefined + ); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + 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 phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + 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('reportPhishing', () => { + it('invokes reportPhishing without error', async () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse() + ); + client.innerApiCalls.reportPhishing = stubSimpleCall(expectedResponse); + const [response] = await client.reportPhishing(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reportPhishing without error using callback', async () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingResponse() + ); + client.innerApiCalls.reportPhishing = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reportPhishing( + request, + ( + err?: Error | null, + result?: protos.google.cloud.phishingprotection.v1beta1.IReportPhishingResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reportPhishing with error', async () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.reportPhishing = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.reportPhishing(request), expectedError); + const actualRequest = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.reportPhishing as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reportPhishing with closed client', async () => { + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.phishingprotection.v1beta1.ReportPhishingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.reportPhishing(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new phishingprotectionservicev1beta1Module.v1beta1.PhishingProtectionServiceV1Beta1Client( + { + 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) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-phishingprotection/tsconfig.json b/packages/google-cloud-phishingprotection/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-phishingprotection/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/packages/google-cloud-phishingprotection/webpack.config.js b/packages/google-cloud-phishingprotection/webpack.config.js new file mode 100644 index 000000000000..a762c8d658ff --- /dev/null +++ b/packages/google-cloud-phishingprotection/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: 'PhishingProtectionServiceV1Beta1', + filename: './phishing-protection-service-v1-beta1.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/packages/google-cloud-policytroubleshooter/.OwlBot.yaml b/packages/google-cloud-policytroubleshooter/.OwlBot.yaml new file mode 100644 index 000000000000..39b2ec41fbc6 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.OwlBot.yaml @@ -0,0 +1,21 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/policytroubleshooter/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-policytroubleshooter/$1 + diff --git a/packages/google-cloud-policytroubleshooter/.eslintignore b/packages/google-cloud-policytroubleshooter/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-policytroubleshooter/.eslintrc.json b/packages/google-cloud-policytroubleshooter/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-policytroubleshooter/.gitattributes b/packages/google-cloud-policytroubleshooter/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-policytroubleshooter/.gitignore b/packages/google-cloud-policytroubleshooter/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.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/packages/google-cloud-policytroubleshooter/.jsdoc.js b/packages/google-cloud-policytroubleshooter/.jsdoc.js new file mode 100644 index 000000000000..8e49f2f2905f --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/policy-troubleshooter', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-policytroubleshooter/.mocharc.js b/packages/google-cloud-policytroubleshooter/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-policytroubleshooter/.nycrc b/packages/google-cloud-policytroubleshooter/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-policytroubleshooter/.prettierignore b/packages/google-cloud-policytroubleshooter/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-policytroubleshooter/.prettierrc.js b/packages/google-cloud-policytroubleshooter/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-policytroubleshooter/.repo-metadata.json b/packages/google-cloud-policytroubleshooter/.repo-metadata.json new file mode 100644 index 000000000000..9572fbdd3154 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/policy-troubleshooter/latest", + "api_id": "policytroubleshooter.googleapis.com", + "distribution_name": "@google-cloud/policy-troubleshooter", + "release_level": "stable", + "default_version": "v1", + "language": "nodejs", + "name_pretty": "IAM Policy Troubleshooter API", + "repo": "googleapis/google-cloud-node", + "product_documentation": "https://cloud.google.com/iam/docs/troubleshooting-access#rest-api/", + "requires_billing": true, + "name": "policytroubleshooter", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "api_shortname": "policytroubleshooter", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-policytroubleshooter/CHANGELOG.md b/packages/google-cloud-policytroubleshooter/CHANGELOG.md new file mode 100644 index 000000000000..2e8348126f3b --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/CHANGELOG.md @@ -0,0 +1,121 @@ +# Changelog + +## [2.0.4](https://github.com/googleapis/nodejs-policy-troubleshooter/compare/v2.0.3...v2.0.4) (2022-09-14) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#142](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/142)) ([98500d1](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/98500d13ecdfa585aa500d507760c58e52ccf1bc)) + +## [2.0.3](https://github.com/googleapis/nodejs-policy-troubleshooter/compare/v2.0.2...v2.0.3) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#140](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/140)) ([f8bd6b4](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/f8bd6b4000f7b11b0e5f5e1a3c199a5d5f8f57e8)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/1553)) ([#139](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/139)) ([a5d502f](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/a5d502f7ce2a43f62c1bfeaa55fe9f6bc1796982)) + +## [2.0.2](https://github.com/googleapis/nodejs-policy-troubleshooter/compare/v2.0.1...v2.0.2) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#135](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/135)) ([7acbd17](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/7acbd17c45d76cac504436fbcd7a2f6463c3d3ef)) +* change import long to require ([#136](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/136)) ([05699c7](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/05699c7f0d17826d3635618803e41557ebc377d7)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/1546)) ([#138](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/138)) ([2b8a030](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/2b8a030f81a00161baf08a9aafd4add86528d082)) + +## [2.0.1](https://github.com/googleapis/nodejs-policy-troubleshooter/compare/v2.0.0...v2.0.1) (2022-06-30) + + +### Bug Fixes + +* **docs:** describe fallback rest option ([#129](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/129)) ([e84320f](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/e84320ffdea95006a57a29db73b5e0e4286de5a7)) + +## [2.0.0](https://github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.1.1...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#122) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/local-auth to v2 ([#123](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/123)) ([f5d7541](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/f5d7541fe61c1b17ca9ccd339d28759a937e1252)) + + +### Build System + +* update library to use Node 12 ([#122](https://github.com/googleapis/nodejs-policy-troubleshooter/issues/122)) ([f15ace8](https://github.com/googleapis/nodejs-policy-troubleshooter/commit/f15ace8726ead0dcdf6c643b0e403f7717f85e5c)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.1.0...v1.1.1) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#76](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/76)) ([dd536c5](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/dd536c5796007a1c5c42c30bbd672b40b7bc5e60)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.6...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#72](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/72)) ([cb9e610](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/cb9e61019ea6ec71201b30de68c84b1e93b1045e)) + +### [1.0.6](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.5...v1.0.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#70](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/70)) ([59d1051](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/59d10517aaa5964d319cae1bfbad2da7b652e3a4)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.4...v1.0.5) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#62](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/62)) ([6ec256b](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/6ec256b64e1b95b369fc6a7dc22a1f0c37df1202)) + +### [1.0.4](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.3...v1.0.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#60](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/60)) ([de32784](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/de32784b45be401f2fec066e2778f7334f89201b)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.2...v1.0.3) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#57](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/57)) ([59bbea3](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/59bbea300af0b1e36236cef7da3120507e9f321c)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.1...v1.0.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#46](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/46)) ([59e135f](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/59e135ff3cf2e39f0b8805ecd74bd5a8de1bdb93)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-policy-troubleshooter/compare/v1.0.0...v1.0.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#38](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/38)) ([962dfae](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/962dfae3d9440dec5f8477a66efb0516d4f5fff2)) +* use require() to load JSON protos ([#41](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/41)) ([4bc12ce](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/4bc12ce5ea6e4ab3a1eb3978c2a646523b0d3b13)) + +## 1.0.0 (2021-02-23) + + +### ⚠ BREAKING CHANGES + +* initial stub of library + +### Features + +* initial stub of library ([4749c7f](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/4749c7fa902cd909f9b878c8f5554751998747a6)) + + +### Bug Fixes + +* naming on repo for status checks and submit samples ([#11](https://www.github.com/googleapis/nodejs-policy-troubleshooter/issues/11)) ([0232dce](https://www.github.com/googleapis/nodejs-policy-troubleshooter/commit/0232dce5f27bcaad08fa58aa2113aa928cf0b517)) diff --git a/packages/google-cloud-policytroubleshooter/CODE_OF_CONDUCT.md b/packages/google-cloud-policytroubleshooter/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-policytroubleshooter/CONTRIBUTING.md b/packages/google-cloud-policytroubleshooter/CONTRIBUTING.md new file mode 100644 index 000000000000..bfbf3886e9e5 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the IAM Policy Troubleshooter API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=policytroubleshooter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-policytroubleshooter/LICENSE b/packages/google-cloud-policytroubleshooter/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-policytroubleshooter/README.md b/packages/google-cloud-policytroubleshooter/README.md new file mode 100644 index 000000000000..d4a8234ec43d --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/README.md @@ -0,0 +1,165 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [IAM Policy Troubleshooter API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/policy-troubleshooter.svg)](https://www.npmjs.org/package/@google-cloud/policy-troubleshooter) + + + + +Policytroubleshooter client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [IAM Policy Troubleshooter API Node.js Client API Reference][client-docs] +* [IAM Policy Troubleshooter API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the IAM Policy Troubleshooter API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/policy-troubleshooter +``` + + +### Using the client library + +```javascript + +// Imports the Google Cloud client library +const {IamCheckerClient} = require('@google-cloud/policy-troubleshooter'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' + +// Creates a client +const client = new IamCheckerClient(); + +async function troubelshootPolicy() { + const policy = await client.troubleshootIamPolicy({ + accessTuple: { + principal, + fullResourceName, + permission, + }, + }); + console.log(policy); +} + +troubelshootPolicy(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Iam_checker.troubleshoot_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/test/quickstart.js,samples/README.md) | + + + +The [IAM Policy Troubleshooter API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/policy-troubleshooter@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/policy-troubleshooter/latest +[product-docs]: https://cloud.google.com/iam/docs/troubleshooting-access#rest-api/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=policytroubleshooter.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-policytroubleshooter/linkinator.config.json b/packages/google-cloud-policytroubleshooter/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-policytroubleshooter/package.json b/packages/google-cloud-policytroubleshooter/package.json new file mode 100644 index 000000000000..2ba59a087b92 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/policy-troubleshooter", + "version": "2.0.4", + "description": "Policytroubleshooter client for Node.js", + "repository": "googleapis/nodejs-policy-troubleshooter", + "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 policytroubleshooter", + "policytroubleshooter", + "iam checker" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/checker.proto b/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/checker.proto new file mode 100644 index 000000000000..1b20892ec70a --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/checker.proto @@ -0,0 +1,74 @@ +// Copyright 2019 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.cloud.policytroubleshooter.v1; + +import public "google/cloud/policytroubleshooter/v1/explanations.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PolicyTroubleshooter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/policytroubleshooter/v1;policytroubleshooter"; +option java_multiple_files = true; +option java_outer_classname = "IAMCheckerProto"; +option java_package = "com.google.cloud.policytroubleshooter.v1"; +option php_namespace = "Google\\Cloud\\PolicyTroubleshooter\\V1"; +option ruby_package = "Google::Cloud::PolicyTroubleshooter::V1"; + +// IAM Policy Troubleshooter service. +// +// This service helps you troubleshoot access issues for Google Cloud resources. +service IamChecker { + option (google.api.default_host) = "policytroubleshooter.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Checks whether a member has a specific permission for a specific resource, + // and explains why the member does or does not have that permission. + rpc TroubleshootIamPolicy(TroubleshootIamPolicyRequest) returns (TroubleshootIamPolicyResponse) { + option (google.api.http) = { + post: "/v1/iam:troubleshoot" + body: "*" + }; + } +} + +// Request for [TroubleshootIamPolicy][google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy]. +message TroubleshootIamPolicyRequest { + // The information to use for checking whether a member has a permission for a + // resource. + AccessTuple access_tuple = 1; +} + +// Response for [TroubleshootIamPolicy][google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy]. +message TroubleshootIamPolicyResponse { + // Indicates whether the member has the specified permission for the specified + // resource, based on evaluating all of the applicable IAM policies. + AccessState access = 1; + + // List of IAM policies that were evaluated to check the member's permissions, + // with annotations to indicate how each policy contributed to the final + // result. + // + // The list of policies can include the policy for the resource itself. It can + // also include policies that are inherited from higher levels of the resource + // hierarchy, including the organization, the folder, and the project. + // + // To learn more about the resource hierarchy, see + // https://cloud.google.com/iam/help/resource-hierarchy. + repeated ExplainedPolicy explained_policies = 2; +} diff --git a/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/explanations.proto b/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/explanations.proto new file mode 100644 index 000000000000..1eb2a58ce7bc --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/protos/google/cloud/policytroubleshooter/v1/explanations.proto @@ -0,0 +1,245 @@ +// Copyright 2019 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.cloud.policytroubleshooter.v1; + +import "google/api/field_behavior.proto"; +import "google/iam/v1/policy.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.PolicyTroubleshooter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/policytroubleshooter/v1;policytroubleshooter"; +option php_namespace = "Google\\Cloud\\PolicyTroubleshooter\\V1"; +option ruby_package = "Google::Cloud::PolicyTroubleshooter::V1"; + +// Information about the member, resource, and permission to check. +message AccessTuple { + // Required. The member, or principal, whose access you want to check, in the form of + // the email address that represents that member. For example, + // `alice@example.com` or + // `my-service-account@my-project.iam.gserviceaccount.com`. + // + // The member must be a Google Account or a service account. Other types of + // members are not supported. + string principal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The full resource name that identifies the resource. For example, + // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + // + // For examples of full resource names for Google Cloud services, see + // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + string full_resource_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IAM permission to check for the specified member and resource. + // + // For a complete list of IAM permissions, see + // https://cloud.google.com/iam/help/permissions/reference. + // + // For a complete list of predefined IAM roles and the permissions in each + // role, see https://cloud.google.com/iam/help/roles/reference. + string permission = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Details about how a specific IAM [Policy][google.iam.v1.Policy] contributed +// to the access check. +message ExplainedPolicy { + // Indicates whether _this policy_ provides the specified permission to the + // specified member for the specified resource. + // + // This field does _not_ indicate whether the member actually has the + // permission for the resource. There might be another policy that overrides + // this policy. To determine whether the member actually has the permission, + // use the `access` field in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + AccessState access = 1; + + // The full resource name that identifies the resource. For example, + // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + // + // If the sender of the request does not have access to the policy, this field + // is omitted. + // + // For examples of full resource names for Google Cloud services, see + // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + string full_resource_name = 2; + + // The IAM policy attached to the resource. + // + // If the sender of the request does not have access to the policy, this field + // is empty. + google.iam.v1.Policy policy = 3; + + // Details about how each binding in the policy affects the member's ability, + // or inability, to use the permission for the resource. + // + // If the sender of the request does not have access to the policy, this field + // is omitted. + repeated BindingExplanation binding_explanations = 4; + + // The relevance of this policy to the overall determination in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + // + // If the sender of the request does not have access to the policy, this field + // is omitted. + HeuristicRelevance relevance = 5; +} + +// Details about how a binding in a policy affects a member's ability to use a +// permission. +message BindingExplanation { + // Details about whether the binding includes the member. + message AnnotatedMembership { + // Indicates whether the binding includes the member. + Membership membership = 1; + + // The relevance of the member's status to the overall determination for the + // binding. + HeuristicRelevance relevance = 2; + } + + // Whether a role includes a specific permission. + enum RolePermission { + // Reserved for future use. + ROLE_PERMISSION_UNSPECIFIED = 0; + + // The permission is included in the role. + ROLE_PERMISSION_INCLUDED = 1; + + // The permission is not included in the role. + ROLE_PERMISSION_NOT_INCLUDED = 2; + + // The sender of the request is not allowed to access the binding. + ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + } + + // Whether the binding includes the member. + enum Membership { + // Reserved for future use. + MEMBERSHIP_UNSPECIFIED = 0; + + // The binding includes the member. The member can be included directly + // or indirectly. For example: + // + // * A member is included directly if that member is listed in the binding. + // * A member is included indirectly if that member is in a Google group or + // G Suite domain that is listed in the binding. + MEMBERSHIP_INCLUDED = 1; + + // The binding does not include the member. + MEMBERSHIP_NOT_INCLUDED = 2; + + // The sender of the request is not allowed to access the binding. + MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + + // The member is an unsupported type. Only Google Accounts and service + // accounts are supported. + MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + } + + // Required. Indicates whether _this binding_ provides the specified permission to the + // specified member for the specified resource. + // + // This field does _not_ indicate whether the member actually has the + // permission for the resource. There might be another binding that overrides + // this binding. To determine whether the member actually has the permission, + // use the `access` field in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + AccessState access = 1 [(google.api.field_behavior) = REQUIRED]; + + // The role that this binding grants. For example, + // `roles/compute.serviceAgent`. + // + // For a complete list of predefined IAM roles, as well as the permissions in + // each role, see https://cloud.google.com/iam/help/roles/reference. + string role = 2; + + // Indicates whether the role granted by this binding contains the specified + // permission. + RolePermission role_permission = 3; + + // The relevance of the permission's existence, or nonexistence, in the role + // to the overall determination for the entire policy. + HeuristicRelevance role_permission_relevance = 4; + + // Indicates whether each member in the binding includes the member specified + // in the request, either directly or indirectly. Each key identifies a member + // in the binding, and each value indicates whether the member in the binding + // includes the member in the request. + // + // For example, suppose that a binding includes the following members: + // + // * `user:alice@example.com` + // * `group:product-eng@example.com` + // + // You want to troubleshoot access for `user:bob@example.com`. This user is a + // member of the group `group:product-eng@example.com`. + // + // For the first member in the binding, the key is `user:alice@example.com`, + // and the `membership` field in the value is set to + // `MEMBERSHIP_NOT_INCLUDED`. + // + // For the second member in the binding, the key is + // `group:product-eng@example.com`, and the `membership` field in the value is + // set to `MEMBERSHIP_INCLUDED`. + map memberships = 5; + + // The relevance of this binding to the overall determination for the entire + // policy. + HeuristicRelevance relevance = 6; + + // A condition expression that prevents access unless the expression evaluates + // to `true`. + // + // To learn about IAM Conditions, see + // http://cloud.google.com/iam/help/conditions/overview. + google.type.Expr condition = 7; +} + +// Whether a member has a permission for a resource. +enum AccessState { + // Reserved for future use. + ACCESS_STATE_UNSPECIFIED = 0; + + // The member has the permission. + GRANTED = 1; + + // The member does not have the permission. + NOT_GRANTED = 2; + + // The member has the permission only if a condition expression evaluates to + // `true`. + UNKNOWN_CONDITIONAL = 3; + + // The sender of the request does not have access to all of the policies that + // Policy Troubleshooter needs to evaluate. + UNKNOWN_INFO_DENIED = 4; +} + +// The extent to which a single data point contributes to an overall +// determination. +enum HeuristicRelevance { + // Reserved for future use. + HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + + // The data point has a limited effect on the result. Changing the data point + // is unlikely to affect the overall determination. + NORMAL = 1; + + // The data point has a strong effect on the result. Changing the data point + // is likely to affect the overall determination. + HIGH = 2; +} diff --git a/packages/google-cloud-policytroubleshooter/protos/protos.d.ts b/packages/google-cloud-policytroubleshooter/protos/protos.d.ts new file mode 100644 index 000000000000..fa54ca92c564 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/protos/protos.d.ts @@ -0,0 +1,5413 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace policytroubleshooter. */ + namespace policytroubleshooter { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an IamChecker */ + class IamChecker extends $protobuf.rpc.Service { + + /** + * Constructs a new IamChecker 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 IamChecker 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): IamChecker; + + /** + * Calls TroubleshootIamPolicy. + * @param request TroubleshootIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TroubleshootIamPolicyResponse + */ + public troubleshootIamPolicy(request: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, callback: google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicyCallback): void; + + /** + * Calls TroubleshootIamPolicy. + * @param request TroubleshootIamPolicyRequest message or plain object + * @returns Promise + */ + public troubleshootIamPolicy(request: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest): Promise; + } + + namespace IamChecker { + + /** + * Callback as used by {@link google.cloud.policytroubleshooter.v1.IamChecker|troubleshootIamPolicy}. + * @param error Error, if any + * @param [response] TroubleshootIamPolicyResponse + */ + type TroubleshootIamPolicyCallback = (error: (Error|null), response?: google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse) => void; + } + + /** Properties of a TroubleshootIamPolicyRequest. */ + interface ITroubleshootIamPolicyRequest { + + /** TroubleshootIamPolicyRequest accessTuple */ + accessTuple?: (google.cloud.policytroubleshooter.v1.IAccessTuple|null); + } + + /** Represents a TroubleshootIamPolicyRequest. */ + class TroubleshootIamPolicyRequest implements ITroubleshootIamPolicyRequest { + + /** + * Constructs a new TroubleshootIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest); + + /** TroubleshootIamPolicyRequest accessTuple. */ + public accessTuple?: (google.cloud.policytroubleshooter.v1.IAccessTuple|null); + + /** + * Creates a new TroubleshootIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TroubleshootIamPolicyRequest instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest; + + /** + * Encodes the specified TroubleshootIamPolicyRequest message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest.verify|verify} messages. + * @param message TroubleshootIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TroubleshootIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest.verify|verify} messages. + * @param message TroubleshootIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TroubleshootIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TroubleshootIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest; + + /** + * Decodes a TroubleshootIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TroubleshootIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest; + + /** + * Verifies a TroubleshootIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TroubleshootIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TroubleshootIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest; + + /** + * Creates a plain object from a TroubleshootIamPolicyRequest message. Also converts values to other types if specified. + * @param message TroubleshootIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TroubleshootIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TroubleshootIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TroubleshootIamPolicyResponse. */ + interface ITroubleshootIamPolicyResponse { + + /** TroubleshootIamPolicyResponse access */ + access?: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState|null); + + /** TroubleshootIamPolicyResponse explainedPolicies */ + explainedPolicies?: (google.cloud.policytroubleshooter.v1.IExplainedPolicy[]|null); + } + + /** Represents a TroubleshootIamPolicyResponse. */ + class TroubleshootIamPolicyResponse implements ITroubleshootIamPolicyResponse { + + /** + * Constructs a new TroubleshootIamPolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse); + + /** TroubleshootIamPolicyResponse access. */ + public access: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState); + + /** TroubleshootIamPolicyResponse explainedPolicies. */ + public explainedPolicies: google.cloud.policytroubleshooter.v1.IExplainedPolicy[]; + + /** + * Creates a new TroubleshootIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TroubleshootIamPolicyResponse instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse; + + /** + * Encodes the specified TroubleshootIamPolicyResponse message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.verify|verify} messages. + * @param message TroubleshootIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TroubleshootIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.verify|verify} messages. + * @param message TroubleshootIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TroubleshootIamPolicyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TroubleshootIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse; + + /** + * Decodes a TroubleshootIamPolicyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TroubleshootIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse; + + /** + * Verifies a TroubleshootIamPolicyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TroubleshootIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TroubleshootIamPolicyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse; + + /** + * Creates a plain object from a TroubleshootIamPolicyResponse message. Also converts values to other types if specified. + * @param message TroubleshootIamPolicyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TroubleshootIamPolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TroubleshootIamPolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessTuple. */ + interface IAccessTuple { + + /** AccessTuple principal */ + principal?: (string|null); + + /** AccessTuple fullResourceName */ + fullResourceName?: (string|null); + + /** AccessTuple permission */ + permission?: (string|null); + } + + /** Represents an AccessTuple. */ + class AccessTuple implements IAccessTuple { + + /** + * Constructs a new AccessTuple. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.IAccessTuple); + + /** AccessTuple principal. */ + public principal: string; + + /** AccessTuple fullResourceName. */ + public fullResourceName: string; + + /** AccessTuple permission. */ + public permission: string; + + /** + * Creates a new AccessTuple instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessTuple instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.IAccessTuple): google.cloud.policytroubleshooter.v1.AccessTuple; + + /** + * Encodes the specified AccessTuple message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.AccessTuple.verify|verify} messages. + * @param message AccessTuple message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.IAccessTuple, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessTuple message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.AccessTuple.verify|verify} messages. + * @param message AccessTuple message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.IAccessTuple, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessTuple message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.AccessTuple; + + /** + * Decodes an AccessTuple message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.AccessTuple; + + /** + * Verifies an AccessTuple message. + * @param message Plain 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 AccessTuple message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessTuple + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.AccessTuple; + + /** + * Creates a plain object from an AccessTuple message. Also converts values to other types if specified. + * @param message AccessTuple + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.AccessTuple, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessTuple to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessTuple + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplainedPolicy. */ + interface IExplainedPolicy { + + /** ExplainedPolicy access */ + access?: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState|null); + + /** ExplainedPolicy fullResourceName */ + fullResourceName?: (string|null); + + /** ExplainedPolicy policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** ExplainedPolicy bindingExplanations */ + bindingExplanations?: (google.cloud.policytroubleshooter.v1.IBindingExplanation[]|null); + + /** ExplainedPolicy relevance */ + relevance?: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance|null); + } + + /** Represents an ExplainedPolicy. */ + class ExplainedPolicy implements IExplainedPolicy { + + /** + * Constructs a new ExplainedPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.IExplainedPolicy); + + /** ExplainedPolicy access. */ + public access: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState); + + /** ExplainedPolicy fullResourceName. */ + public fullResourceName: string; + + /** ExplainedPolicy policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** ExplainedPolicy bindingExplanations. */ + public bindingExplanations: google.cloud.policytroubleshooter.v1.IBindingExplanation[]; + + /** ExplainedPolicy relevance. */ + public relevance: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance); + + /** + * Creates a new ExplainedPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainedPolicy instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.IExplainedPolicy): google.cloud.policytroubleshooter.v1.ExplainedPolicy; + + /** + * Encodes the specified ExplainedPolicy message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.ExplainedPolicy.verify|verify} messages. + * @param message ExplainedPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.IExplainedPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainedPolicy message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.ExplainedPolicy.verify|verify} messages. + * @param message ExplainedPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.IExplainedPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.ExplainedPolicy; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.ExplainedPolicy; + + /** + * Verifies an ExplainedPolicy message. + * @param message Plain 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 ExplainedPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainedPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.ExplainedPolicy; + + /** + * Creates a plain object from an ExplainedPolicy message. Also converts values to other types if specified. + * @param message ExplainedPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.ExplainedPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainedPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainedPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingExplanation. */ + interface IBindingExplanation { + + /** BindingExplanation access */ + access?: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState|null); + + /** BindingExplanation role */ + role?: (string|null); + + /** BindingExplanation rolePermission */ + rolePermission?: (google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission|keyof typeof google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission|null); + + /** BindingExplanation rolePermissionRelevance */ + rolePermissionRelevance?: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance|null); + + /** BindingExplanation memberships */ + memberships?: ({ [k: string]: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership }|null); + + /** BindingExplanation relevance */ + relevance?: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance|null); + + /** BindingExplanation condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingExplanation. */ + class BindingExplanation implements IBindingExplanation { + + /** + * Constructs a new BindingExplanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.IBindingExplanation); + + /** BindingExplanation access. */ + public access: (google.cloud.policytroubleshooter.v1.AccessState|keyof typeof google.cloud.policytroubleshooter.v1.AccessState); + + /** BindingExplanation role. */ + public role: string; + + /** BindingExplanation rolePermission. */ + public rolePermission: (google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission|keyof typeof google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission); + + /** BindingExplanation rolePermissionRelevance. */ + public rolePermissionRelevance: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance); + + /** BindingExplanation memberships. */ + public memberships: { [k: string]: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership }; + + /** BindingExplanation relevance. */ + public relevance: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance); + + /** BindingExplanation condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingExplanation instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingExplanation instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.IBindingExplanation): google.cloud.policytroubleshooter.v1.BindingExplanation; + + /** + * Encodes the specified BindingExplanation message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.verify|verify} messages. + * @param message BindingExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.IBindingExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingExplanation message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.verify|verify} messages. + * @param message BindingExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.IBindingExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.BindingExplanation; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.BindingExplanation; + + /** + * Verifies a BindingExplanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingExplanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingExplanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.BindingExplanation; + + /** + * Creates a plain object from a BindingExplanation message. Also converts values to other types if specified. + * @param message BindingExplanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.BindingExplanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingExplanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingExplanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingExplanation { + + /** Properties of an AnnotatedMembership. */ + interface IAnnotatedMembership { + + /** AnnotatedMembership membership */ + membership?: (google.cloud.policytroubleshooter.v1.BindingExplanation.Membership|keyof typeof google.cloud.policytroubleshooter.v1.BindingExplanation.Membership|null); + + /** AnnotatedMembership relevance */ + relevance?: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance|null); + } + + /** Represents an AnnotatedMembership. */ + class AnnotatedMembership implements IAnnotatedMembership { + + /** + * Constructs a new AnnotatedMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership); + + /** AnnotatedMembership membership. */ + public membership: (google.cloud.policytroubleshooter.v1.BindingExplanation.Membership|keyof typeof google.cloud.policytroubleshooter.v1.BindingExplanation.Membership); + + /** AnnotatedMembership relevance. */ + public relevance: (google.cloud.policytroubleshooter.v1.HeuristicRelevance|keyof typeof google.cloud.policytroubleshooter.v1.HeuristicRelevance); + + /** + * Creates a new AnnotatedMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedMembership instance + */ + public static create(properties?: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership): google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership; + + /** + * Encodes the specified AnnotatedMembership message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @param message AnnotatedMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedMembership message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @param message AnnotatedMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership; + + /** + * Verifies an AnnotatedMembership message. + * @param message Plain 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 AnnotatedMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership; + + /** + * Creates a plain object from an AnnotatedMembership message. Also converts values to other types if specified. + * @param message AnnotatedMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatedMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RolePermission enum. */ + enum RolePermission { + ROLE_PERMISSION_UNSPECIFIED = 0, + ROLE_PERMISSION_INCLUDED = 1, + ROLE_PERMISSION_NOT_INCLUDED = 2, + ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3 + } + + /** Membership enum. */ + enum Membership { + MEMBERSHIP_UNSPECIFIED = 0, + MEMBERSHIP_INCLUDED = 1, + MEMBERSHIP_NOT_INCLUDED = 2, + MEMBERSHIP_UNKNOWN_INFO_DENIED = 3, + MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4 + } + } + + /** AccessState enum. */ + enum AccessState { + ACCESS_STATE_UNSPECIFIED = 0, + GRANTED = 1, + NOT_GRANTED = 2, + UNKNOWN_CONDITIONAL = 3, + UNKNOWN_INFO_DENIED = 4 + } + + /** HeuristicRelevance enum. */ + enum HeuristicRelevance { + HEURISTIC_RELEVANCE_UNSPECIFIED = 0, + NORMAL = 1, + HIGH = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 phpGenericServices. */ + public phpGenericServices: 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 + } + } + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-policytroubleshooter/protos/protos.js b/packages/google-cloud-policytroubleshooter/protos/protos.js new file mode 100644 index 000000000000..604b8a6dafe1 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/protos/protos.js @@ -0,0 +1,14642 @@ +// Copyright 2022 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_policy_troubleshooter_protos || ($protobuf.roots._google_cloud_policy_troubleshooter_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.policytroubleshooter = (function() { + + /** + * Namespace policytroubleshooter. + * @memberof google.cloud + * @namespace + */ + var policytroubleshooter = {}; + + policytroubleshooter.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.policytroubleshooter + * @namespace + */ + var v1 = {}; + + v1.IamChecker = (function() { + + /** + * Constructs a new IamChecker service. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents an IamChecker + * @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 IamChecker(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IamChecker.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IamChecker; + + /** + * Creates new IamChecker service using the specified rpc implementation. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.IamChecker + * @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 {IamChecker} RPC service. Useful where requests and/or responses are streamed. + */ + IamChecker.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.policytroubleshooter.v1.IamChecker|troubleshootIamPolicy}. + * @memberof google.cloud.policytroubleshooter.v1.IamChecker + * @typedef TroubleshootIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} [response] TroubleshootIamPolicyResponse + */ + + /** + * Calls TroubleshootIamPolicy. + * @function troubleshootIamPolicy + * @memberof google.cloud.policytroubleshooter.v1.IamChecker + * @instance + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest} request TroubleshootIamPolicyRequest message or plain object + * @param {google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicyCallback} callback Node-style callback called with the error, if any, and TroubleshootIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IamChecker.prototype.troubleshootIamPolicy = function troubleshootIamPolicy(request, callback) { + return this.rpcCall(troubleshootIamPolicy, $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest, $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse, request, callback); + }, "name", { value: "TroubleshootIamPolicy" }); + + /** + * Calls TroubleshootIamPolicy. + * @function troubleshootIamPolicy + * @memberof google.cloud.policytroubleshooter.v1.IamChecker + * @instance + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest} request TroubleshootIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IamChecker; + })(); + + v1.TroubleshootIamPolicyRequest = (function() { + + /** + * Properties of a TroubleshootIamPolicyRequest. + * @memberof google.cloud.policytroubleshooter.v1 + * @interface ITroubleshootIamPolicyRequest + * @property {google.cloud.policytroubleshooter.v1.IAccessTuple|null} [accessTuple] TroubleshootIamPolicyRequest accessTuple + */ + + /** + * Constructs a new TroubleshootIamPolicyRequest. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents a TroubleshootIamPolicyRequest. + * @implements ITroubleshootIamPolicyRequest + * @constructor + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest=} [properties] Properties to set + */ + function TroubleshootIamPolicyRequest(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]]; + } + + /** + * TroubleshootIamPolicyRequest accessTuple. + * @member {google.cloud.policytroubleshooter.v1.IAccessTuple|null|undefined} accessTuple + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @instance + */ + TroubleshootIamPolicyRequest.prototype.accessTuple = null; + + /** + * Creates a new TroubleshootIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest} TroubleshootIamPolicyRequest instance + */ + TroubleshootIamPolicyRequest.create = function create(properties) { + return new TroubleshootIamPolicyRequest(properties); + }; + + /** + * Encodes the specified TroubleshootIamPolicyRequest message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest} message TroubleshootIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TroubleshootIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessTuple != null && Object.hasOwnProperty.call(message, "accessTuple")) + $root.google.cloud.policytroubleshooter.v1.AccessTuple.encode(message.accessTuple, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TroubleshootIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest} message TroubleshootIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TroubleshootIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TroubleshootIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest} TroubleshootIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TroubleshootIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessTuple = $root.google.cloud.policytroubleshooter.v1.AccessTuple.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TroubleshootIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest} TroubleshootIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TroubleshootIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TroubleshootIamPolicyRequest message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TroubleshootIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessTuple != null && message.hasOwnProperty("accessTuple")) { + var error = $root.google.cloud.policytroubleshooter.v1.AccessTuple.verify(message.accessTuple); + if (error) + return "accessTuple." + error; + } + return null; + }; + + /** + * Creates a TroubleshootIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest} TroubleshootIamPolicyRequest + */ + TroubleshootIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest(); + if (object.accessTuple != null) { + if (typeof object.accessTuple !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest.accessTuple: object expected"); + message.accessTuple = $root.google.cloud.policytroubleshooter.v1.AccessTuple.fromObject(object.accessTuple); + } + return message; + }; + + /** + * Creates a plain object from a TroubleshootIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest} message TroubleshootIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TroubleshootIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.accessTuple = null; + if (message.accessTuple != null && message.hasOwnProperty("accessTuple")) + object.accessTuple = $root.google.cloud.policytroubleshooter.v1.AccessTuple.toObject(message.accessTuple, options); + return object; + }; + + /** + * Converts this TroubleshootIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + TroubleshootIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TroubleshootIamPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TroubleshootIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest"; + }; + + return TroubleshootIamPolicyRequest; + })(); + + v1.TroubleshootIamPolicyResponse = (function() { + + /** + * Properties of a TroubleshootIamPolicyResponse. + * @memberof google.cloud.policytroubleshooter.v1 + * @interface ITroubleshootIamPolicyResponse + * @property {google.cloud.policytroubleshooter.v1.AccessState|null} [access] TroubleshootIamPolicyResponse access + * @property {Array.|null} [explainedPolicies] TroubleshootIamPolicyResponse explainedPolicies + */ + + /** + * Constructs a new TroubleshootIamPolicyResponse. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents a TroubleshootIamPolicyResponse. + * @implements ITroubleshootIamPolicyResponse + * @constructor + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse=} [properties] Properties to set + */ + function TroubleshootIamPolicyResponse(properties) { + this.explainedPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TroubleshootIamPolicyResponse access. + * @member {google.cloud.policytroubleshooter.v1.AccessState} access + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @instance + */ + TroubleshootIamPolicyResponse.prototype.access = 0; + + /** + * TroubleshootIamPolicyResponse explainedPolicies. + * @member {Array.} explainedPolicies + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @instance + */ + TroubleshootIamPolicyResponse.prototype.explainedPolicies = $util.emptyArray; + + /** + * Creates a new TroubleshootIamPolicyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} TroubleshootIamPolicyResponse instance + */ + TroubleshootIamPolicyResponse.create = function create(properties) { + return new TroubleshootIamPolicyResponse(properties); + }; + + /** + * Encodes the specified TroubleshootIamPolicyResponse message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse} message TroubleshootIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TroubleshootIamPolicyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.access); + if (message.explainedPolicies != null && message.explainedPolicies.length) + for (var i = 0; i < message.explainedPolicies.length; ++i) + $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy.encode(message.explainedPolicies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TroubleshootIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse} message TroubleshootIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TroubleshootIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TroubleshootIamPolicyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} TroubleshootIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TroubleshootIamPolicyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.access = reader.int32(); + break; + } + case 2: { + if (!(message.explainedPolicies && message.explainedPolicies.length)) + message.explainedPolicies = []; + message.explainedPolicies.push($root.google.cloud.policytroubleshooter.v1.ExplainedPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TroubleshootIamPolicyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} TroubleshootIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TroubleshootIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TroubleshootIamPolicyResponse message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TroubleshootIamPolicyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.access != null && message.hasOwnProperty("access")) + switch (message.access) { + default: + return "access: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.explainedPolicies != null && message.hasOwnProperty("explainedPolicies")) { + if (!Array.isArray(message.explainedPolicies)) + return "explainedPolicies: array expected"; + for (var i = 0; i < message.explainedPolicies.length; ++i) { + var error = $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy.verify(message.explainedPolicies[i]); + if (error) + return "explainedPolicies." + error; + } + } + return null; + }; + + /** + * Creates a TroubleshootIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} TroubleshootIamPolicyResponse + */ + TroubleshootIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse(); + switch (object.access) { + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.access = 0; + break; + case "GRANTED": + case 1: + message.access = 1; + break; + case "NOT_GRANTED": + case 2: + message.access = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.access = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.access = 4; + break; + } + if (object.explainedPolicies) { + if (!Array.isArray(object.explainedPolicies)) + throw TypeError(".google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.explainedPolicies: array expected"); + message.explainedPolicies = []; + for (var i = 0; i < object.explainedPolicies.length; ++i) { + if (typeof object.explainedPolicies[i] !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse.explainedPolicies: object expected"); + message.explainedPolicies[i] = $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy.fromObject(object.explainedPolicies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TroubleshootIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse} message TroubleshootIamPolicyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TroubleshootIamPolicyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.explainedPolicies = []; + if (options.defaults) + object.access = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + if (message.access != null && message.hasOwnProperty("access")) + object.access = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.AccessState[message.access] : message.access; + if (message.explainedPolicies && message.explainedPolicies.length) { + object.explainedPolicies = []; + for (var j = 0; j < message.explainedPolicies.length; ++j) + object.explainedPolicies[j] = $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy.toObject(message.explainedPolicies[j], options); + } + return object; + }; + + /** + * Converts this TroubleshootIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + TroubleshootIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TroubleshootIamPolicyResponse + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TroubleshootIamPolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse"; + }; + + return TroubleshootIamPolicyResponse; + })(); + + v1.AccessTuple = (function() { + + /** + * Properties of an AccessTuple. + * @memberof google.cloud.policytroubleshooter.v1 + * @interface IAccessTuple + * @property {string|null} [principal] AccessTuple principal + * @property {string|null} [fullResourceName] AccessTuple fullResourceName + * @property {string|null} [permission] AccessTuple permission + */ + + /** + * Constructs a new AccessTuple. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents an AccessTuple. + * @implements IAccessTuple + * @constructor + * @param {google.cloud.policytroubleshooter.v1.IAccessTuple=} [properties] Properties to set + */ + function AccessTuple(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]]; + } + + /** + * AccessTuple principal. + * @member {string} principal + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.principal = ""; + + /** + * AccessTuple fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.fullResourceName = ""; + + /** + * AccessTuple permission. + * @member {string} permission + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.permission = ""; + + /** + * Creates a new AccessTuple instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {google.cloud.policytroubleshooter.v1.IAccessTuple=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.AccessTuple} AccessTuple instance + */ + AccessTuple.create = function create(properties) { + return new AccessTuple(properties); + }; + + /** + * Encodes the specified AccessTuple message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.AccessTuple.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {google.cloud.policytroubleshooter.v1.IAccessTuple} message AccessTuple message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessTuple.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principal); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.permission); + return writer; + }; + + /** + * Encodes the specified AccessTuple message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.AccessTuple.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {google.cloud.policytroubleshooter.v1.IAccessTuple} message AccessTuple message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessTuple.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessTuple message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.AccessTuple} AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessTuple.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.AccessTuple(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principal = reader.string(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } + case 3: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessTuple message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.AccessTuple} AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessTuple.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessTuple message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessTuple.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + if (!$util.isString(message.principal)) + return "principal: string expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.permission != null && message.hasOwnProperty("permission")) + if (!$util.isString(message.permission)) + return "permission: string expected"; + return null; + }; + + /** + * Creates an AccessTuple message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.AccessTuple} AccessTuple + */ + AccessTuple.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.AccessTuple) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.AccessTuple(); + if (object.principal != null) + message.principal = String(object.principal); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from an AccessTuple message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {google.cloud.policytroubleshooter.v1.AccessTuple} message AccessTuple + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessTuple.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principal = ""; + object.fullResourceName = ""; + object.permission = ""; + } + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = message.principal; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = message.permission; + return object; + }; + + /** + * Converts this AccessTuple to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @instance + * @returns {Object.} JSON object + */ + AccessTuple.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessTuple + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.AccessTuple + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessTuple.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.AccessTuple"; + }; + + return AccessTuple; + })(); + + v1.ExplainedPolicy = (function() { + + /** + * Properties of an ExplainedPolicy. + * @memberof google.cloud.policytroubleshooter.v1 + * @interface IExplainedPolicy + * @property {google.cloud.policytroubleshooter.v1.AccessState|null} [access] ExplainedPolicy access + * @property {string|null} [fullResourceName] ExplainedPolicy fullResourceName + * @property {google.iam.v1.IPolicy|null} [policy] ExplainedPolicy policy + * @property {Array.|null} [bindingExplanations] ExplainedPolicy bindingExplanations + * @property {google.cloud.policytroubleshooter.v1.HeuristicRelevance|null} [relevance] ExplainedPolicy relevance + */ + + /** + * Constructs a new ExplainedPolicy. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents an ExplainedPolicy. + * @implements IExplainedPolicy + * @constructor + * @param {google.cloud.policytroubleshooter.v1.IExplainedPolicy=} [properties] Properties to set + */ + function ExplainedPolicy(properties) { + this.bindingExplanations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainedPolicy access. + * @member {google.cloud.policytroubleshooter.v1.AccessState} access + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.access = 0; + + /** + * ExplainedPolicy fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.fullResourceName = ""; + + /** + * ExplainedPolicy policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.policy = null; + + /** + * ExplainedPolicy bindingExplanations. + * @member {Array.} bindingExplanations + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.bindingExplanations = $util.emptyArray; + + /** + * ExplainedPolicy relevance. + * @member {google.cloud.policytroubleshooter.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.relevance = 0; + + /** + * Creates a new ExplainedPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {google.cloud.policytroubleshooter.v1.IExplainedPolicy=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.ExplainedPolicy} ExplainedPolicy instance + */ + ExplainedPolicy.create = function create(properties) { + return new ExplainedPolicy(properties); + }; + + /** + * Encodes the specified ExplainedPolicy message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.ExplainedPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {google.cloud.policytroubleshooter.v1.IExplainedPolicy} message ExplainedPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.access); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bindingExplanations != null && message.bindingExplanations.length) + for (var i = 0; i < message.bindingExplanations.length; ++i) + $root.google.cloud.policytroubleshooter.v1.BindingExplanation.encode(message.bindingExplanations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.relevance); + return writer; + }; + + /** + * Encodes the specified ExplainedPolicy message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.ExplainedPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {google.cloud.policytroubleshooter.v1.IExplainedPolicy} message ExplainedPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.ExplainedPolicy} ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.access = reader.int32(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } + case 3: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.bindingExplanations && message.bindingExplanations.length)) + message.bindingExplanations = []; + message.bindingExplanations.push($root.google.cloud.policytroubleshooter.v1.BindingExplanation.decode(reader, reader.uint32())); + break; + } + case 5: { + message.relevance = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.ExplainedPolicy} ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainedPolicy message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainedPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.access != null && message.hasOwnProperty("access")) + switch (message.access) { + default: + return "access: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.bindingExplanations != null && message.hasOwnProperty("bindingExplanations")) { + if (!Array.isArray(message.bindingExplanations)) + return "bindingExplanations: array expected"; + for (var i = 0; i < message.bindingExplanations.length; ++i) { + var error = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.verify(message.bindingExplanations[i]); + if (error) + return "bindingExplanations." + error; + } + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExplainedPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.ExplainedPolicy} ExplainedPolicy + */ + ExplainedPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.ExplainedPolicy(); + switch (object.access) { + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.access = 0; + break; + case "GRANTED": + case 1: + message.access = 1; + break; + case "NOT_GRANTED": + case 2: + message.access = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.access = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.access = 4; + break; + } + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.ExplainedPolicy.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.bindingExplanations) { + if (!Array.isArray(object.bindingExplanations)) + throw TypeError(".google.cloud.policytroubleshooter.v1.ExplainedPolicy.bindingExplanations: array expected"); + message.bindingExplanations = []; + for (var i = 0; i < object.bindingExplanations.length; ++i) { + if (typeof object.bindingExplanations[i] !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.ExplainedPolicy.bindingExplanations: object expected"); + message.bindingExplanations[i] = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.fromObject(object.bindingExplanations[i]); + } + } + switch (object.relevance) { + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplainedPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {google.cloud.policytroubleshooter.v1.ExplainedPolicy} message ExplainedPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainedPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindingExplanations = []; + if (options.defaults) { + object.access = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.fullResourceName = ""; + object.policy = null; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + } + if (message.access != null && message.hasOwnProperty("access")) + object.access = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.AccessState[message.access] : message.access; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.bindingExplanations && message.bindingExplanations.length) { + object.bindingExplanations = []; + for (var j = 0; j < message.bindingExplanations.length; ++j) + object.bindingExplanations[j] = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.toObject(message.bindingExplanations[j], options); + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.HeuristicRelevance[message.relevance] : message.relevance; + return object; + }; + + /** + * Converts this ExplainedPolicy to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @instance + * @returns {Object.} JSON object + */ + ExplainedPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainedPolicy + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.ExplainedPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainedPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.ExplainedPolicy"; + }; + + return ExplainedPolicy; + })(); + + v1.BindingExplanation = (function() { + + /** + * Properties of a BindingExplanation. + * @memberof google.cloud.policytroubleshooter.v1 + * @interface IBindingExplanation + * @property {google.cloud.policytroubleshooter.v1.AccessState|null} [access] BindingExplanation access + * @property {string|null} [role] BindingExplanation role + * @property {google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission|null} [rolePermission] BindingExplanation rolePermission + * @property {google.cloud.policytroubleshooter.v1.HeuristicRelevance|null} [rolePermissionRelevance] BindingExplanation rolePermissionRelevance + * @property {Object.|null} [memberships] BindingExplanation memberships + * @property {google.cloud.policytroubleshooter.v1.HeuristicRelevance|null} [relevance] BindingExplanation relevance + * @property {google.type.IExpr|null} [condition] BindingExplanation condition + */ + + /** + * Constructs a new BindingExplanation. + * @memberof google.cloud.policytroubleshooter.v1 + * @classdesc Represents a BindingExplanation. + * @implements IBindingExplanation + * @constructor + * @param {google.cloud.policytroubleshooter.v1.IBindingExplanation=} [properties] Properties to set + */ + function BindingExplanation(properties) { + this.memberships = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingExplanation access. + * @member {google.cloud.policytroubleshooter.v1.AccessState} access + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.access = 0; + + /** + * BindingExplanation role. + * @member {string} role + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.role = ""; + + /** + * BindingExplanation rolePermission. + * @member {google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission} rolePermission + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.rolePermission = 0; + + /** + * BindingExplanation rolePermissionRelevance. + * @member {google.cloud.policytroubleshooter.v1.HeuristicRelevance} rolePermissionRelevance + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.rolePermissionRelevance = 0; + + /** + * BindingExplanation memberships. + * @member {Object.} memberships + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.memberships = $util.emptyObject; + + /** + * BindingExplanation relevance. + * @member {google.cloud.policytroubleshooter.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.relevance = 0; + + /** + * BindingExplanation condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.condition = null; + + /** + * Creates a new BindingExplanation instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {google.cloud.policytroubleshooter.v1.IBindingExplanation=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation} BindingExplanation instance + */ + BindingExplanation.create = function create(properties) { + return new BindingExplanation(properties); + }; + + /** + * Encodes the specified BindingExplanation message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {google.cloud.policytroubleshooter.v1.IBindingExplanation} message BindingExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingExplanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.access); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.rolePermission != null && Object.hasOwnProperty.call(message, "rolePermission")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rolePermission); + if (message.rolePermissionRelevance != null && Object.hasOwnProperty.call(message, "rolePermissionRelevance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rolePermissionRelevance); + if (message.memberships != null && Object.hasOwnProperty.call(message, "memberships")) + for (var keys = Object.keys(message.memberships), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.encode(message.memberships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.relevance); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingExplanation message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {google.cloud.policytroubleshooter.v1.IBindingExplanation} message BindingExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingExplanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation} BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingExplanation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.BindingExplanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.access = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.rolePermission = reader.int32(); + break; + } + case 4: { + message.rolePermissionRelevance = reader.int32(); + break; + } + case 5: { + if (message.memberships === $util.emptyObject) + message.memberships = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.memberships[key] = value; + break; + } + case 6: { + message.relevance = reader.int32(); + break; + } + case 7: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation} BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingExplanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingExplanation message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingExplanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.access != null && message.hasOwnProperty("access")) + switch (message.access) { + default: + return "access: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.rolePermission != null && message.hasOwnProperty("rolePermission")) + switch (message.rolePermission) { + default: + return "rolePermission: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.rolePermissionRelevance != null && message.hasOwnProperty("rolePermissionRelevance")) + switch (message.rolePermissionRelevance) { + default: + return "rolePermissionRelevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!$util.isObject(message.memberships)) + return "memberships: object expected"; + var key = Object.keys(message.memberships); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.verify(message.memberships[key[i]]); + if (error) + return "memberships." + error; + } + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingExplanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation} BindingExplanation + */ + BindingExplanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.BindingExplanation) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.BindingExplanation(); + switch (object.access) { + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.access = 0; + break; + case "GRANTED": + case 1: + message.access = 1; + break; + case "NOT_GRANTED": + case 2: + message.access = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.access = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.access = 4; + break; + } + if (object.role != null) + message.role = String(object.role); + switch (object.rolePermission) { + case "ROLE_PERMISSION_UNSPECIFIED": + case 0: + message.rolePermission = 0; + break; + case "ROLE_PERMISSION_INCLUDED": + case 1: + message.rolePermission = 1; + break; + case "ROLE_PERMISSION_NOT_INCLUDED": + case 2: + message.rolePermission = 2; + break; + case "ROLE_PERMISSION_UNKNOWN_INFO_DENIED": + case 3: + message.rolePermission = 3; + break; + } + switch (object.rolePermissionRelevance) { + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.rolePermissionRelevance = 0; + break; + case "NORMAL": + case 1: + message.rolePermissionRelevance = 1; + break; + case "HIGH": + case 2: + message.rolePermissionRelevance = 2; + break; + } + if (object.memberships) { + if (typeof object.memberships !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.BindingExplanation.memberships: object expected"); + message.memberships = {}; + for (var keys = Object.keys(object.memberships), i = 0; i < keys.length; ++i) { + if (typeof object.memberships[keys[i]] !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.BindingExplanation.memberships: object expected"); + message.memberships[keys[i]] = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.fromObject(object.memberships[keys[i]]); + } + } + switch (object.relevance) { + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.policytroubleshooter.v1.BindingExplanation.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingExplanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation} message BindingExplanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingExplanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.memberships = {}; + if (options.defaults) { + object.access = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.role = ""; + object.rolePermission = options.enums === String ? "ROLE_PERMISSION_UNSPECIFIED" : 0; + object.rolePermissionRelevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + object.condition = null; + } + if (message.access != null && message.hasOwnProperty("access")) + object.access = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.AccessState[message.access] : message.access; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.rolePermission != null && message.hasOwnProperty("rolePermission")) + object.rolePermission = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission[message.rolePermission] : message.rolePermission; + if (message.rolePermissionRelevance != null && message.hasOwnProperty("rolePermissionRelevance")) + object.rolePermissionRelevance = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.HeuristicRelevance[message.rolePermissionRelevance] : message.rolePermissionRelevance; + var keys2; + if (message.memberships && (keys2 = Object.keys(message.memberships)).length) { + object.memberships = {}; + for (var j = 0; j < keys2.length; ++j) + object.memberships[keys2[j]] = $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.toObject(message.memberships[keys2[j]], options); + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.HeuristicRelevance[message.relevance] : message.relevance; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingExplanation to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @instance + * @returns {Object.} JSON object + */ + BindingExplanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingExplanation + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingExplanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.BindingExplanation"; + }; + + BindingExplanation.AnnotatedMembership = (function() { + + /** + * Properties of an AnnotatedMembership. + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @interface IAnnotatedMembership + * @property {google.cloud.policytroubleshooter.v1.BindingExplanation.Membership|null} [membership] AnnotatedMembership membership + * @property {google.cloud.policytroubleshooter.v1.HeuristicRelevance|null} [relevance] AnnotatedMembership relevance + */ + + /** + * Constructs a new AnnotatedMembership. + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation + * @classdesc Represents an AnnotatedMembership. + * @implements IAnnotatedMembership + * @constructor + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership=} [properties] Properties to set + */ + function AnnotatedMembership(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]]; + } + + /** + * AnnotatedMembership membership. + * @member {google.cloud.policytroubleshooter.v1.BindingExplanation.Membership} membership + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @instance + */ + AnnotatedMembership.prototype.membership = 0; + + /** + * AnnotatedMembership relevance. + * @member {google.cloud.policytroubleshooter.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @instance + */ + AnnotatedMembership.prototype.relevance = 0; + + /** + * Creates a new AnnotatedMembership instance using the specified properties. + * @function create + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership=} [properties] Properties to set + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership instance + */ + AnnotatedMembership.create = function create(properties) { + return new AnnotatedMembership(properties); + }; + + /** + * Encodes the specified AnnotatedMembership message. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership} message AnnotatedMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.membership); + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relevance); + return writer; + }; + + /** + * Encodes the specified AnnotatedMembership message, length delimited. Does not implicitly {@link google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation.IAnnotatedMembership} message AnnotatedMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = reader.int32(); + break; + } + case 2: { + message.relevance = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedMembership message. + * @function verify + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) + switch (message.membership) { + default: + return "membership: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnnotatedMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + */ + AnnotatedMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership) + return object; + var message = new $root.google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership(); + switch (object.membership) { + case "MEMBERSHIP_UNSPECIFIED": + case 0: + message.membership = 0; + break; + case "MEMBERSHIP_INCLUDED": + case 1: + message.membership = 1; + break; + case "MEMBERSHIP_NOT_INCLUDED": + case 2: + message.membership = 2; + break; + case "MEMBERSHIP_UNKNOWN_INFO_DENIED": + case 3: + message.membership = 3; + break; + case "MEMBERSHIP_UNKNOWN_UNSUPPORTED": + case 4: + message.membership = 4; + break; + } + switch (object.relevance) { + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership} message AnnotatedMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.membership = options.enums === String ? "MEMBERSHIP_UNSPECIFIED" : 0; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + } + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.BindingExplanation.Membership[message.membership] : message.membership; + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policytroubleshooter.v1.HeuristicRelevance[message.relevance] : message.relevance; + return object; + }; + + /** + * Converts this AnnotatedMembership to JSON. + * @function toJSON + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @instance + * @returns {Object.} JSON object + */ + AnnotatedMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotatedMembership + * @function getTypeUrl + * @memberof google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatedMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policytroubleshooter.v1.BindingExplanation.AnnotatedMembership"; + }; + + return AnnotatedMembership; + })(); + + /** + * RolePermission enum. + * @name google.cloud.policytroubleshooter.v1.BindingExplanation.RolePermission + * @enum {number} + * @property {number} ROLE_PERMISSION_UNSPECIFIED=0 ROLE_PERMISSION_UNSPECIFIED value + * @property {number} ROLE_PERMISSION_INCLUDED=1 ROLE_PERMISSION_INCLUDED value + * @property {number} ROLE_PERMISSION_NOT_INCLUDED=2 ROLE_PERMISSION_NOT_INCLUDED value + * @property {number} ROLE_PERMISSION_UNKNOWN_INFO_DENIED=3 ROLE_PERMISSION_UNKNOWN_INFO_DENIED value + */ + BindingExplanation.RolePermission = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_PERMISSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE_PERMISSION_INCLUDED"] = 1; + values[valuesById[2] = "ROLE_PERMISSION_NOT_INCLUDED"] = 2; + values[valuesById[3] = "ROLE_PERMISSION_UNKNOWN_INFO_DENIED"] = 3; + return values; + })(); + + /** + * Membership enum. + * @name google.cloud.policytroubleshooter.v1.BindingExplanation.Membership + * @enum {number} + * @property {number} MEMBERSHIP_UNSPECIFIED=0 MEMBERSHIP_UNSPECIFIED value + * @property {number} MEMBERSHIP_INCLUDED=1 MEMBERSHIP_INCLUDED value + * @property {number} MEMBERSHIP_NOT_INCLUDED=2 MEMBERSHIP_NOT_INCLUDED value + * @property {number} MEMBERSHIP_UNKNOWN_INFO_DENIED=3 MEMBERSHIP_UNKNOWN_INFO_DENIED value + * @property {number} MEMBERSHIP_UNKNOWN_UNSUPPORTED=4 MEMBERSHIP_UNKNOWN_UNSUPPORTED value + */ + BindingExplanation.Membership = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMBERSHIP_INCLUDED"] = 1; + values[valuesById[2] = "MEMBERSHIP_NOT_INCLUDED"] = 2; + values[valuesById[3] = "MEMBERSHIP_UNKNOWN_INFO_DENIED"] = 3; + values[valuesById[4] = "MEMBERSHIP_UNKNOWN_UNSUPPORTED"] = 4; + return values; + })(); + + return BindingExplanation; + })(); + + /** + * AccessState enum. + * @name google.cloud.policytroubleshooter.v1.AccessState + * @enum {number} + * @property {number} ACCESS_STATE_UNSPECIFIED=0 ACCESS_STATE_UNSPECIFIED value + * @property {number} GRANTED=1 GRANTED value + * @property {number} NOT_GRANTED=2 NOT_GRANTED value + * @property {number} UNKNOWN_CONDITIONAL=3 UNKNOWN_CONDITIONAL value + * @property {number} UNKNOWN_INFO_DENIED=4 UNKNOWN_INFO_DENIED value + */ + v1.AccessState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRANTED"] = 1; + values[valuesById[2] = "NOT_GRANTED"] = 2; + values[valuesById[3] = "UNKNOWN_CONDITIONAL"] = 3; + values[valuesById[4] = "UNKNOWN_INFO_DENIED"] = 4; + return values; + })(); + + /** + * HeuristicRelevance enum. + * @name google.cloud.policytroubleshooter.v1.HeuristicRelevance + * @enum {number} + * @property {number} HEURISTIC_RELEVANCE_UNSPECIFIED=0 HEURISTIC_RELEVANCE_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} HIGH=2 HIGH value + */ + v1.HeuristicRelevance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HEURISTIC_RELEVANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + return values; + })(); + + return v1; + })(); + + return policytroubleshooter; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + return values; + })(); + + 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; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} 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; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.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: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + 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) { + 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.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: + 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; + } + } + 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.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; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-policytroubleshooter/protos/protos.json b/packages/google-cloud-policytroubleshooter/protos/protos.json new file mode 100644 index 000000000000..3f3c32e0a856 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/protos/protos.json @@ -0,0 +1,1469 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "policytroubleshooter": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.PolicyTroubleshooter.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/policytroubleshooter/v1;policytroubleshooter", + "java_multiple_files": true, + "java_outer_classname": "IAMCheckerProto", + "java_package": "com.google.cloud.policytroubleshooter.v1", + "php_namespace": "Google\\Cloud\\PolicyTroubleshooter\\V1", + "ruby_package": "Google::Cloud::PolicyTroubleshooter::V1" + }, + "nested": { + "IamChecker": { + "options": { + "(google.api.default_host)": "policytroubleshooter.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "TroubleshootIamPolicy": { + "requestType": "TroubleshootIamPolicyRequest", + "responseType": "TroubleshootIamPolicyResponse", + "options": { + "(google.api.http).post": "/v1/iam:troubleshoot", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/iam:troubleshoot", + "body": "*" + } + } + ] + } + } + }, + "TroubleshootIamPolicyRequest": { + "fields": { + "accessTuple": { + "type": "AccessTuple", + "id": 1 + } + } + }, + "TroubleshootIamPolicyResponse": { + "fields": { + "access": { + "type": "AccessState", + "id": 1 + }, + "explainedPolicies": { + "rule": "repeated", + "type": "ExplainedPolicy", + "id": 2 + } + } + }, + "AccessTuple": { + "fields": { + "principal": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fullResourceName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "permission": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExplainedPolicy": { + "fields": { + "access": { + "type": "AccessState", + "id": 1 + }, + "fullResourceName": { + "type": "string", + "id": 2 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 3 + }, + "bindingExplanations": { + "rule": "repeated", + "type": "BindingExplanation", + "id": 4 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 5 + } + } + }, + "BindingExplanation": { + "fields": { + "access": { + "type": "AccessState", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "role": { + "type": "string", + "id": 2 + }, + "rolePermission": { + "type": "RolePermission", + "id": 3 + }, + "rolePermissionRelevance": { + "type": "HeuristicRelevance", + "id": 4 + }, + "memberships": { + "keyType": "string", + "type": "AnnotatedMembership", + "id": 5 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 6 + }, + "condition": { + "type": "google.type.Expr", + "id": 7 + } + }, + "nested": { + "AnnotatedMembership": { + "fields": { + "membership": { + "type": "Membership", + "id": 1 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 2 + } + } + }, + "RolePermission": { + "values": { + "ROLE_PERMISSION_UNSPECIFIED": 0, + "ROLE_PERMISSION_INCLUDED": 1, + "ROLE_PERMISSION_NOT_INCLUDED": 2, + "ROLE_PERMISSION_UNKNOWN_INFO_DENIED": 3 + } + }, + "Membership": { + "values": { + "MEMBERSHIP_UNSPECIFIED": 0, + "MEMBERSHIP_INCLUDED": 1, + "MEMBERSHIP_NOT_INCLUDED": 2, + "MEMBERSHIP_UNKNOWN_INFO_DENIED": 3, + "MEMBERSHIP_UNKNOWN_UNSUPPORTED": 4 + } + } + } + }, + "AccessState": { + "values": { + "ACCESS_STATE_UNSPECIFIED": 0, + "GRANTED": 1, + "NOT_GRANTED": 2, + "UNKNOWN_CONDITIONAL": 3, + "UNKNOWN_INFO_DENIED": 4 + } + }, + "HeuristicRelevance": { + "values": { + "HEURISTIC_RELEVANCE_UNSPECIFIED": 0, + "NORMAL": 1, + "HIGH": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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" + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-policytroubleshooter/samples/README.md b/packages/google-cloud-policytroubleshooter/samples/README.md new file mode 100644 index 000000000000..223b92d392ed --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/README.md @@ -0,0 +1,86 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [IAM Policy Troubleshooter API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Iam_checker.troubleshoot_iam_policy](#iam_checker.troubleshoot_iam_policy) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Iam_checker.troubleshoot_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policytroubleshooter/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-policytroubleshooter/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policytroubleshooter/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/iam/docs/troubleshooting-access#rest-api/ diff --git a/packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js b/packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js new file mode 100644 index 000000000000..98d3a10511f7 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/generated/v1/iam_checker.troubleshoot_iam_policy.js @@ -0,0 +1,61 @@ +// Copyright 2022 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'; + +function main() { + // [START policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The information to use for checking whether a member has a permission for a + * resource. + */ + // const accessTuple = {} + + // Imports the Policytroubleshooter library + const {IamCheckerClient} = require('@google-cloud/policy-troubleshooter').v1; + + // Instantiates a client + const policytroubleshooterClient = new IamCheckerClient(); + + async function callTroubleshootIamPolicy() { + // Construct request + const request = { + }; + + // Run request + const response = await policytroubleshooterClient.troubleshootIamPolicy(request); + console.log(response); + } + + callTroubleshootIamPolicy(); + // [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-policytroubleshooter/samples/generated/v1/snippet_metadata.google.cloud.policytroubleshooter.v1.json b/packages/google-cloud-policytroubleshooter/samples/generated/v1/snippet_metadata.google.cloud.policytroubleshooter.v1.json new file mode 100644 index 000000000000..357c6a16d461 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/generated/v1/snippet_metadata.google.cloud.policytroubleshooter.v1.json @@ -0,0 +1,55 @@ +{ + "clientLibrary": { + "name": "nodejs-policytroubleshooter", + "version": "2.0.4", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.policytroubleshooter.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_async", + "title": "IamChecker troubleshootIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Checks whether a member has a specific permission for a specific resource, and explains why the member does or does not have that permission.", + "canonical": true, + "file": "iam_checker.troubleshoot_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TroubleshootIamPolicy", + "fullName": "google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy", + "async": true, + "parameters": [ + { + "name": "access_tuple", + "type": ".google.cloud.policytroubleshooter.v1.AccessTuple" + } + ], + "resultType": ".google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse", + "client": { + "shortName": "IamCheckerClient", + "fullName": "google.cloud.policytroubleshooter.v1.IamCheckerClient" + }, + "method": { + "shortName": "TroubleshootIamPolicy", + "fullName": "google.cloud.policytroubleshooter.v1.IamChecker.TroubleshootIamPolicy", + "service": { + "shortName": "IamChecker", + "fullName": "google.cloud.policytroubleshooter.v1.IamChecker" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-policytroubleshooter/samples/package.json b/packages/google-cloud-policytroubleshooter/samples/package.json new file mode 100644 index 000000000000..204f6334b0c3 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "nodejs-policy-troubleshooter", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/local-auth": "^2.0.0", + "@google-cloud/policy-troubleshooter": "^2.0.4" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-policytroubleshooter/samples/quickstart.js b/packages/google-cloud-policytroubleshooter/samples/quickstart.js new file mode 100644 index 000000000000..4e5bf99c641b --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/quickstart.js @@ -0,0 +1,50 @@ +// 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. +// + +'use strict'; + +async function main(principal, fullResourceName, permission) { + // [START nodejs_policy_troubleshooter_quickstart] + + // Imports the Google Cloud client library + const {IamCheckerClient} = require('@google-cloud/policy-troubleshooter'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + const client = new IamCheckerClient(); + + async function troubelshootPolicy() { + const policy = await client.troubleshootIamPolicy({ + accessTuple: { + principal, + fullResourceName, + permission, + }, + }); + console.log(policy); + } + + troubelshootPolicy(); + // [END nodejs_policy_troubleshooter_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-policytroubleshooter/samples/test/quickstart.js b/packages/google-cloud-policytroubleshooter/samples/test/quickstart.js new file mode 100644 index 000000000000..02410235e489 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/samples/test/quickstart.js @@ -0,0 +1,46 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const {IamCheckerClient} = require('@google-cloud/policy-troubleshooter'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new IamCheckerClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync( + `node ./quickstart.js example@example.com //cloudresourcemanager.googleapis.com/projects/${projectId} accessapproval.requests.approve`, + {cwd} + ); + assert.match(stdout, /'UNKNOWN_INFO_DENIED'/); + }); +}); diff --git a/packages/google-cloud-policytroubleshooter/src/index.ts b/packages/google-cloud-policytroubleshooter/src/index.ts new file mode 100644 index 000000000000..f0e845925b6b --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const IamCheckerClient = v1.IamCheckerClient; +type IamCheckerClient = v1.IamCheckerClient; + +export {v1, IamCheckerClient}; +export default {v1, IamCheckerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-policytroubleshooter/src/v1/gapic_metadata.json b/packages/google-cloud-policytroubleshooter/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..daff31dc6c14 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.policytroubleshooter.v1", + "libraryPackage": "@google-cloud/policy-troubleshooter", + "services": { + "IamChecker": { + "clients": { + "grpc": { + "libraryClient": "IamCheckerClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ + "troubleshootIamPolicy" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IamCheckerClient", + "rpcs": { + "TroubleshootIamPolicy": { + "methods": [ + "troubleshootIamPolicy" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client.ts b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client.ts new file mode 100644 index 000000000000..884a6f0a4216 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client.ts @@ -0,0 +1,416 @@ +// Copyright 2022 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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/iam_checker_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './iam_checker_client_config.json'; +const version = require('../../../package.json').version; + +/** + * IAM Policy Troubleshooter service. + * + * This service helps you troubleshoot access issues for Google Cloud resources. + * @class + * @memberof v1 + */ +export class IamCheckerClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamCheckerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of IamCheckerClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 IamCheckerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof IamCheckerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.policytroubleshooter.v1.IamChecker', + 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.iamCheckerStub) { + return this.iamCheckerStub; + } + + // Put together the "service stub" for + // google.cloud.policytroubleshooter.v1.IamChecker. + this.iamCheckerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.policytroubleshooter.v1.IamChecker' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.policytroubleshooter.v1.IamChecker, + 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 iamCheckerStubMethods = ['troubleshootIamPolicy']; + for (const methodName of iamCheckerStubMethods) { + const callPromise = this.iamCheckerStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.iamCheckerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'policytroubleshooter.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'policytroubleshooter.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + /** + * Checks whether a member has a specific permission for a specific resource, + * and explains why the member does or does not have that permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.policytroubleshooter.v1.AccessTuple} request.accessTuple + * The information to use for checking whether a member has a permission for a + * resource. + * @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 [TroubleshootIamPolicyResponse]{@link google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/iam_checker.troubleshoot_iam_policy.js + * region_tag:policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_async + */ + troubleshootIamPolicy( + request?: protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + ( + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | undefined + ), + {} | undefined + ] + >; + troubleshootIamPolicy( + request: protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + troubleshootIamPolicy( + request: protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, + callback: Callback< + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + troubleshootIamPolicy( + request?: protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse, + ( + | protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyRequest + | 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 || {}; + this.initialize(); + return this.innerApiCalls.troubleshootIamPolicy(request, options, callback); + } + + /** + * 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.iamCheckerStub && !this._terminated) { + return this.iamCheckerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client_config.json b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client_config.json new file mode 100644 index 000000000000..6d70cf67ac3d --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.policytroubleshooter.v1.IamChecker": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "TroubleshootIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_proto_list.json b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_proto_list.json new file mode 100644 index 000000000000..3da19f410cc7 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/v1/iam_checker_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/policytroubleshooter/v1/checker.proto", + "../../protos/google/cloud/policytroubleshooter/v1/explanations.proto" +] diff --git a/packages/google-cloud-policytroubleshooter/src/v1/index.ts b/packages/google-cloud-policytroubleshooter/src/v1/index.ts new file mode 100644 index 000000000000..9610c4c44558 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {IamCheckerClient} from './iam_checker_client'; diff --git a/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.js b/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..c536c3106704 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const policytroubleshooter = require('@google-cloud/policy-troubleshooter'); + +function main() { + const iamCheckerClient = new policytroubleshooter.IamCheckerClient(); +} + +main(); diff --git a/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..bbddec218779 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {IamCheckerClient} from '@google-cloud/policy-troubleshooter'; + +// check that the client class type name can be used +function doStuffWithIamCheckerClient(client: IamCheckerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const iamCheckerClient = new IamCheckerClient(); + doStuffWithIamCheckerClient(iamCheckerClient); +} + +main(); diff --git a/packages/google-cloud-policytroubleshooter/system-test/install.ts b/packages/google-cloud-policytroubleshooter/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-policytroubleshooter/test/gapic_iam_checker_v1.ts b/packages/google-cloud-policytroubleshooter/test/gapic_iam_checker_v1.ts new file mode 100644 index 000000000000..7b47814df485 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/test/gapic_iam_checker_v1.ts @@ -0,0 +1,254 @@ +// Copyright 2022 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 iamcheckerModule from '../src'; + +import {protobuf} 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); +} + +describe('v1.IamCheckerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = iamcheckerModule.v1.IamCheckerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = iamcheckerModule.v1.IamCheckerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = iamcheckerModule.v1.IamCheckerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new iamcheckerModule.v1.IamCheckerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.iamCheckerStub, undefined); + await client.initialize(); + assert(client.iamCheckerStub); + }); + + it('has close method for the initialized client', done => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.iamCheckerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.iamCheckerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new iamcheckerModule.v1.IamCheckerClient({ + 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 iamcheckerModule.v1.IamCheckerClient({ + 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('troubleshootIamPolicy', () => { + it('invokes troubleshootIamPolicy without error', async () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse() + ); + client.innerApiCalls.troubleshootIamPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.troubleshootIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes troubleshootIamPolicy without error using callback', async () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyResponse() + ); + client.innerApiCalls.troubleshootIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.troubleshootIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.policytroubleshooter.v1.ITroubleshootIamPolicyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes troubleshootIamPolicy with error', async () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.troubleshootIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.troubleshootIamPolicy(request), + expectedError + ); + }); + + it('invokes troubleshootIamPolicy with closed client', async () => { + const client = new iamcheckerModule.v1.IamCheckerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policytroubleshooter.v1.TroubleshootIamPolicyRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.troubleshootIamPolicy(request), + expectedError + ); + }); + }); +}); diff --git a/packages/google-cloud-policytroubleshooter/tsconfig.json b/packages/google-cloud-policytroubleshooter/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/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/packages/google-cloud-policytroubleshooter/webpack.config.js b/packages/google-cloud-policytroubleshooter/webpack.config.js new file mode 100644 index 000000000000..f5a14136b2db --- /dev/null +++ b/packages/google-cloud-policytroubleshooter/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: 'IamChecker', + filename: './iam-checker.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/packages/google-cloud-recommender/.OwlBot.yaml b/packages/google-cloud-recommender/.OwlBot.yaml new file mode 100644 index 000000000000..479e024d3a6c --- /dev/null +++ b/packages/google-cloud-recommender/.OwlBot.yaml @@ -0,0 +1,23 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /recommender/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-recommender/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-recommender/.eslintignore b/packages/google-cloud-recommender/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-recommender/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-recommender/.eslintrc.json b/packages/google-cloud-recommender/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-recommender/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-recommender/.gitattributes b/packages/google-cloud-recommender/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-recommender/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-recommender/.gitignore b/packages/google-cloud-recommender/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-recommender/.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/packages/google-cloud-recommender/.jsdoc.js b/packages/google-cloud-recommender/.jsdoc.js new file mode 100644 index 000000000000..020db4c57e85 --- /dev/null +++ b/packages/google-cloud-recommender/.jsdoc.js @@ -0,0 +1,55 @@ +// 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. +// +// ** 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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/recommender', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-recommender/.mocharc.js b/packages/google-cloud-recommender/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-recommender/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-recommender/.nycrc b/packages/google-cloud-recommender/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-recommender/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-recommender/.prettierignore b/packages/google-cloud-recommender/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-recommender/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-recommender/.prettierrc.js b/packages/google-cloud-recommender/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-recommender/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-recommender/.repo-metadata.json b/packages/google-cloud-recommender/.repo-metadata.json new file mode 100644 index 000000000000..184423380ab2 --- /dev/null +++ b/packages/google-cloud-recommender/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "name": "recommender", + "issue_tracker": "", + "default_version": "v1", + "api_id": "recommender.googleapis.com", + "distribution_name": "@google-cloud/recommender", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/recommender/docs", + "codeowner_team": "@googleapis/ml-apis", + "name_pretty": "Recommender", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/recommender/latest", + "release_level": "stable", + "api_shortname": "recommender", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-recommender/CHANGELOG.md b/packages/google-cloud-recommender/CHANGELOG.md new file mode 100644 index 000000000000..b03a36d51195 --- /dev/null +++ b/packages/google-cloud-recommender/CHANGELOG.md @@ -0,0 +1,200 @@ +# Changelog + +## [5.0.2](https://github.com/googleapis/nodejs-recommender/compare/v5.0.1...v5.0.2) (2022-08-27) + + +### Bug Fixes + +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-recommender/issues/1553)) ([#242](https://github.com/googleapis/nodejs-recommender/issues/242)) ([ecc0511](https://github.com/googleapis/nodejs-recommender/commit/ecc05119d6119f1e9840ad1819c45fb7640515e2)) +* use google-gax v3.3.0 ([ecc0511](https://github.com/googleapis/nodejs-recommender/commit/ecc05119d6119f1e9840ad1819c45fb7640515e2)) + +## [5.0.1](https://github.com/googleapis/nodejs-recommender/compare/v5.0.0...v5.0.1) (2022-08-23) + + +### Bug Fixes + +* change import long to require ([#239](https://github.com/googleapis/nodejs-recommender/issues/239)) ([a25747e](https://github.com/googleapis/nodejs-recommender/commit/a25747ef09f8ca018b7507e2af66a046098fb4e1)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-recommender/issues/1546)) ([#241](https://github.com/googleapis/nodejs-recommender/issues/241)) ([a7b3598](https://github.com/googleapis/nodejs-recommender/commit/a7b35986d32e9fedb8d7f9c2956ca35a500262d0)) + +## [5.0.0](https://github.com/googleapis/nodejs-recommender/compare/v4.2.5...v5.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#233) + +### Build System + +* update library to use Node 12 ([#233](https://github.com/googleapis/nodejs-recommender/issues/233)) ([d4aabcc](https://github.com/googleapis/nodejs-recommender/commit/d4aabccf3b372e58e6093da2b6d1a3597895dd8c)) + +### [4.2.5](https://www.github.com/googleapis/nodejs-recommender/compare/v4.2.4...v4.2.5) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#194](https://www.github.com/googleapis/nodejs-recommender/issues/194)) ([f2b12a1](https://www.github.com/googleapis/nodejs-recommender/commit/f2b12a15de8f81a3d3ab626ca3422b694d4ed3d6)) + +### [4.2.4](https://www.github.com/googleapis/nodejs-recommender/compare/v4.2.3...v4.2.4) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#191](https://www.github.com/googleapis/nodejs-recommender/issues/191)) ([92792f8](https://www.github.com/googleapis/nodejs-recommender/commit/92792f82b70c8fe850a12243a7c6287efc1e447e)) + +### [4.2.3](https://www.github.com/googleapis/nodejs-recommender/compare/v4.2.2...v4.2.3) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#185](https://www.github.com/googleapis/nodejs-recommender/issues/185)) ([595de84](https://www.github.com/googleapis/nodejs-recommender/commit/595de84919798b7ee43e6466f071f809cb2a3b98)) + +### [4.2.2](https://www.github.com/googleapis/nodejs-recommender/compare/v4.2.1...v4.2.2) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#182](https://www.github.com/googleapis/nodejs-recommender/issues/182)) ([232819a](https://www.github.com/googleapis/nodejs-recommender/commit/232819acbb7a42b01178affcfb791ad84f03305b)) + +### [4.2.1](https://www.github.com/googleapis/nodejs-recommender/compare/v4.2.0...v4.2.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#167](https://www.github.com/googleapis/nodejs-recommender/issues/167)) ([01f400c](https://www.github.com/googleapis/nodejs-recommender/commit/01f400cbc89403727c5fd8b55c151d30dd8bd78c)) + +## [4.2.0](https://www.github.com/googleapis/nodejs-recommender/compare/v4.1.0...v4.2.0) (2021-01-27) + + +### Features + +* add bindings for folder/org type resources for protos in recommendations, insights and recommender_service to enable v1 api for folder/org ([5ec8c2d](https://www.github.com/googleapis/nodejs-recommender/commit/5ec8c2daf1c5ad58e568761d372bb8de3e5c0063)) +* Add support for "billingAccounts" as another parent resource name for recommendations and insights APIs. ([5ec8c2d](https://www.github.com/googleapis/nodejs-recommender/commit/5ec8c2daf1c5ad58e568761d372bb8de3e5c0063)) + +## [4.1.0](https://www.github.com/googleapis/nodejs-recommender/compare/v4.0.0...v4.1.0) (2021-01-12) + + +### Features + +* introduce style enumeration ([#141](https://www.github.com/googleapis/nodejs-recommender/issues/141)) ([478a062](https://www.github.com/googleapis/nodejs-recommender/commit/478a06281fe0845035ec8bb48e531eae25066c66)) + +## [4.0.0](https://www.github.com/googleapis/nodejs-recommender/compare/v3.2.2...v4.0.0) (2021-01-07) + + +### ⚠ BREAKING CHANGES + +* resource path helper recommenderPath has been removed + +### Features + +* Add support for "billingAccounts" as another parent resource name for recommendations and insights APIs. ([#138](https://www.github.com/googleapis/nodejs-recommender/issues/138)) ([42d07c5](https://www.github.com/googleapis/nodejs-recommender/commit/42d07c5a4e802882f94a1e3272ad8591cb370236)) + +### [3.2.2](https://www.github.com/googleapis/nodejs-recommender/compare/v3.2.1...v3.2.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([733f1d3](https://www.github.com/googleapis/nodejs-recommender/commit/733f1d3fb81fcf435be32aded223fcae0a9c414e)) + +### [3.2.1](https://www.github.com/googleapis/nodejs-recommender/compare/v3.2.0...v3.2.1) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#131](https://www.github.com/googleapis/nodejs-recommender/issues/131)) ([3c11c71](https://www.github.com/googleapis/nodejs-recommender/commit/3c11c71f11a42930227cda2cbc939728afdc11fe)) +* updating the v1 retry params name for ListInsights, GetInsight, and MarkInsightAccepted. ([#128](https://www.github.com/googleapis/nodejs-recommender/issues/128)) ([7785604](https://www.github.com/googleapis/nodejs-recommender/commit/7785604f0bcc763224dc3bd13d552578c3cddb30)) + +## [3.2.0](https://www.github.com/googleapis/nodejs-recommender/compare/v3.1.1...v3.2.0) (2020-07-13) + + +### Features + +* adds methods for interacting with insights ([#96](https://www.github.com/googleapis/nodejs-recommender/issues/96)) ([0004d75](https://www.github.com/googleapis/nodejs-recommender/commit/0004d75f5681e0231473ab2abd167c1c1eeb3b8c)) + +### [3.1.1](https://www.github.com/googleapis/nodejs-recommender/compare/v3.1.0...v3.1.1) (2020-07-12) + + +### Bug Fixes + +* update node issue template ([#86](https://www.github.com/googleapis/nodejs-recommender/issues/86)) ([93654e9](https://www.github.com/googleapis/nodejs-recommender/commit/93654e9fe772bc7a9adbcd8d69ddd731be26810d)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-recommender/compare/v3.0.0...v3.1.0) (2020-06-12) + + +### Features + +* **secrets:** begin migration to secret manager from keystore ([#82](https://www.github.com/googleapis/nodejs-recommender/issues/82)) ([40a4cc3](https://www.github.com/googleapis/nodejs-recommender/commit/40a4cc30711eef85439b538f4da62091777bd79c)) + + +### Bug Fixes + +* handle fallback option properly ([#85](https://www.github.com/googleapis/nodejs-recommender/issues/85)) ([21a6a00](https://www.github.com/googleapis/nodejs-recommender/commit/21a6a00b7283a8761e412a5a1b005359d0470e37)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-recommender/compare/v2.2.0...v3.0.0) (2020-05-14) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* drop node8 support, support for async iterators ([#53](https://www.github.com/googleapis/nodejs-recommender/issues/53)) ([71ad927](https://www.github.com/googleapis/nodejs-recommender/commit/71ad9276016222d46e4b30c43fbe1196e2731485)) +* promote to GA ([#78](https://www.github.com/googleapis/nodejs-recommender/issues/78)) ([fa7e7b8](https://www.github.com/googleapis/nodejs-recommender/commit/fa7e7b86018346768e83caea64ee02048efb50ee)), closes [#10](https://www.github.com/googleapis/nodejs-recommender/issues/10) + + +### Bug Fixes + +* export explicit version from protos.js ([#58](https://www.github.com/googleapis/nodejs-recommender/issues/58)) ([d1608ef](https://www.github.com/googleapis/nodejs-recommender/commit/d1608ef4d2642fd4f067f58eafb53c8998c7f1db)) +* regen protos and tests, formatting ([#75](https://www.github.com/googleapis/nodejs-recommender/issues/75)) ([76f952f](https://www.github.com/googleapis/nodejs-recommender/commit/76f952f57c1c3467b959ca4700a07a320e1e2f31)) +* remove eslint, update gax, fix generated protos, run the generator ([#63](https://www.github.com/googleapis/nodejs-recommender/issues/63)) ([0095142](https://www.github.com/googleapis/nodejs-recommender/commit/0095142c26068397aa2cf84f65e8fe2c2da0bd26)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-recommender/compare/v2.1.0...v2.2.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#38](https://www.github.com/googleapis/nodejs-recommender/issues/38)) ([6a19840](https://www.github.com/googleapis/nodejs-recommender/commit/6a19840c1d51ff7b930ea7969dbbe32beda0fefd)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-recommender/compare/v2.0.2...v2.1.0) (2020-02-29) + + +### Features + +* export protos in src/index.ts ([941ad76](https://www.github.com/googleapis/nodejs-recommender/commit/941ad7602b582311abd5d50eb45bdba92a4b2497)) + +### [2.0.2](https://www.github.com/googleapis/nodejs-recommender/compare/v2.0.1...v2.0.2) (2020-02-12) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([acea090](https://www.github.com/googleapis/nodejs-recommender/commit/acea09085a4caddfaa69c35f37dd83f32ed81987)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-recommender/compare/v2.0.0...v2.0.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([3934bd8](https://www.github.com/googleapis/nodejs-recommender/commit/3934bd8d2aaac6985adb40b0f74b83448015008e)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-recommender/compare/v1.0.0...v2.0.0) (2020-01-22) + + +### ⚠ BREAKING CHANGES + +* upgrade to v1 client (#8) + +### Features + +* upgrade to v1 client ([#8](https://www.github.com/googleapis/nodejs-recommender/issues/8)) ([d31c634](https://www.github.com/googleapis/nodejs-recommender/commit/d31c634bffe0db521348d81180780d9da223d58d)) + +## 1.0.0 (2020-01-14) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#1) + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-recommender/issues/1)) ([a5187e5](https://www.github.com/googleapis/nodejs-recommender/commit/a5187e50120a0bd2bba5514acd945ad9ef5a4dcb)) +* stub out initial version of library ([c27ee9f](https://www.github.com/googleapis/nodejs-recommender/commit/c27ee9fb6bf1ec3821c72df77a0aef269e86f2fd)) diff --git a/packages/google-cloud-recommender/CODE_OF_CONDUCT.md b/packages/google-cloud-recommender/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-recommender/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-recommender/CONTRIBUTING.md b/packages/google-cloud-recommender/CONTRIBUTING.md new file mode 100644 index 000000000000..444b2106756d --- /dev/null +++ b/packages/google-cloud-recommender/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Recommender API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-recommender/LICENSE b/packages/google-cloud-recommender/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-recommender/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-recommender/README.md b/packages/google-cloud-recommender/README.md new file mode 100644 index 000000000000..aafc48bf02d1 --- /dev/null +++ b/packages/google-cloud-recommender/README.md @@ -0,0 +1,163 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Recommender: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/recommender.svg)](https://www.npmjs.org/package/@google-cloud/recommender) + + + + +Recommender client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Recommender Node.js Client API Reference][client-docs] +* [Recommender Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Recommender API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/recommender +``` + + +### Using the client library + +```javascript +async function listRecommendations() { + const {RecommenderClient} = require('@google-cloud/recommender'); + const recommender = new RecommenderClient(); + + // parent = 'projects/my-project'; // Project to fetch recommendations for. + // recommenderId = 'google.compute.instance.MachineTypeRecommender'; + + const [recommendations] = await recommender.listRecommendations({ + parent: recommender.projectLocationRecommenderPath( + project, + 'global', + recommenderId + ), + }); + console.info(`recommendations for ${recommenderId}:`); + for (const recommendation of recommendations) { + console.info(recommendation); + } + return recommendations; +} +const recommendations = await listRecommendations(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recommender/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recommender/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recommender/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recommender/samples/test/quickstart.js,samples/README.md) | + + + +The [Recommender Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/recommender@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/recommender/latest +[product-docs]: https://cloud.google.com/recommender/docs +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=recommender.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-recommender/linkinator.config.json b/packages/google-cloud-recommender/linkinator.config.json new file mode 100644 index 000000000000..29a223b6db64 --- /dev/null +++ b/packages/google-cloud-recommender/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-recommender/package.json b/packages/google-cloud-recommender/package.json new file mode 100644 index 000000000000..1b76feecbb0a --- /dev/null +++ b/packages/google-cloud-recommender/package.json @@ -0,0 +1,54 @@ +{ + "name": "@google-cloud/recommender", + "version": "5.0.2", + "description": "Recommender client for Node.js", + "repository": "googleapis/nodejs-recommender", + "license": "Apache-2.0", + "author": "Google LLC", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "test": "c8 mocha build/test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-recommender/protos/google/cloud/common_resources.proto b/packages/google-cloud-recommender/protos/google/cloud/common_resources.proto new file mode 100644 index 000000000000..56c9f800d5e3 --- /dev/null +++ b/packages/google-cloud-recommender/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto new file mode 100644 index 000000000000..e561b8381800 --- /dev/null +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto @@ -0,0 +1,141 @@ +// Copyright 2020 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.cloud.recommender.v1; + +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Recommender.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommender/v1;recommender"; +option java_multiple_files = true; +option java_outer_classname = "InsightProto"; +option java_package = "com.google.cloud.recommender.v1"; +option objc_class_prefix = "CREC"; +option (google.api.resource_definition) = { + type: "recommender.googleapis.com/InsightType" + pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}" + pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}" + pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}" + pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}" +}; + +// An insight along with the information used to derive the insight. The insight +// may have associated recomendations as well. +message Insight { + option (google.api.resource) = { + type: "recommender.googleapis.com/Insight" + pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + pattern: "folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + pattern: "organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + }; + + // Reference to an associated recommendation. + message RecommendationReference { + // Recommendation resource name, e.g. + // projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID] + string recommendation = 1; + } + + // Insight category. + enum Category { + // Unspecified category. + CATEGORY_UNSPECIFIED = 0; + + // The insight is related to cost. + COST = 1; + + // The insight is related to security. + SECURITY = 2; + + // The insight is related to performance. + PERFORMANCE = 3; + + // This insight is related to manageability. + MANAGEABILITY = 4; + } + + // Name of the insight. + string name = 1; + + // Free-form human readable summary in English. The maximum length is 500 + // characters. + string description = 2; + + // Fully qualified resource names that this insight is targeting. + repeated string target_resources = 9; + + // Insight subtype. Insight content schema will be stable for a given subtype. + string insight_subtype = 10; + + // A struct of custom fields to explain the insight. + // Example: "grantedPermissionsCount": "1000" + google.protobuf.Struct content = 3; + + // Timestamp of the latest data used to generate the insight. + google.protobuf.Timestamp last_refresh_time = 4; + + // Observation period that led to the insight. The source data used to + // generate the insight ends at last_refresh_time and begins at + // (last_refresh_time - observation_period). + google.protobuf.Duration observation_period = 5; + + // Information state and metadata. + InsightStateInfo state_info = 6; + + // Category being targeted by the insight. + Category category = 7; + + // Fingerprint of the Insight. Provides optimistic locking when updating + // states. + string etag = 11; + + // Recommendations derived from this insight. + repeated RecommendationReference associated_recommendations = 8; +} + +// Information related to insight state. +message InsightStateInfo { + // Represents insight state. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Insight is active. Content for ACTIVE insights can be updated by Google. + // ACTIVE insights can be marked DISMISSED OR ACCEPTED. + ACTIVE = 1; + + // Some action has been taken based on this insight. Insights become + // accepted when a recommendation derived from the insight has been marked + // CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked + // ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED + // insights can only be marked ACCEPTED (which may update state metadata). + ACCEPTED = 2; + + // Insight is dismissed. Content for DISMISSED insights can be updated by + // Google. DISMISSED insights can be marked as ACTIVE. + DISMISSED = 3; + } + + // Insight state. + State state = 1; + + // A map of metadata for the state, provided by user or automations systems. + map state_metadata = 2; +} diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto new file mode 100644 index 000000000000..78f8f10c278b --- /dev/null +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto @@ -0,0 +1,292 @@ +// Copyright 2020 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.cloud.recommender.v1; + +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/money.proto"; + +option csharp_namespace = "Google.Cloud.Recommender.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommender/v1;recommender"; +option java_multiple_files = true; +option java_package = "com.google.cloud.recommender.v1"; +option objc_class_prefix = "CREC"; +option (google.api.resource_definition) = { + type: "recommender.googleapis.com/Recommender" + pattern: "projects/{project}/locations/{location}/recommenders/{recommender}" + pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}" + pattern: "folders/{folder}/locations/{location}/recommenders/{recommender}" + pattern: "organizations/{organization}/locations/{location}/recommenders/{recommender}" +}; + +// A recommendation along with a suggested action. E.g., a rightsizing +// recommendation for an underutilized VM, IAM role recommendations, etc +message Recommendation { + option (google.api.resource) = { + type: "recommender.googleapis.com/Recommendation" + pattern: "projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + pattern: "folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + pattern: "organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + }; + + // Reference to an associated insight. + message InsightReference { + // Insight resource name, e.g. + // projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID] + string insight = 1; + } + + // Name of recommendation. + string name = 1; + + // Free-form human readable summary in English. The maximum length is 500 + // characters. + string description = 2; + + // Contains an identifier for a subtype of recommendations produced for the + // same recommender. Subtype is a function of content and impact, meaning a + // new subtype might be added when significant changes to `content` or + // `primary_impact.category` are introduced. See the Recommenders section + // to see a list of subtypes for a given Recommender. + // + // Examples: + // For recommender = "google.iam.policy.Recommender", + // recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE" + string recommender_subtype = 12; + + // Last time this recommendation was refreshed by the system that created it + // in the first place. + google.protobuf.Timestamp last_refresh_time = 4; + + // The primary impact that this recommendation can have while trying to + // optimize for one category. + Impact primary_impact = 5; + + // Optional set of additional impact that this recommendation may have when + // trying to optimize for the primary category. These may be positive + // or negative. + repeated Impact additional_impact = 6; + + // Content of the recommendation describing recommended changes to resources. + RecommendationContent content = 7; + + // Information for state. Contains state and metadata. + RecommendationStateInfo state_info = 10; + + // Fingerprint of the Recommendation. Provides optimistic locking when + // updating states. + string etag = 11; + + // Insights that led to this recommendation. + repeated InsightReference associated_insights = 14; +} + +// Contains what resources are changing and how they are changing. +message RecommendationContent { + // Operations to one or more Google Cloud resources grouped in such a way + // that, all operations within one group are expected to be performed + // atomically and in an order. + repeated OperationGroup operation_groups = 2; +} + +// Group of operations that need to be performed atomically. +message OperationGroup { + // List of operations across one or more resources that belong to this group. + // Loosely based on RFC6902 and should be performed in the order they appear. + repeated Operation operations = 1; +} + +// Contains an operation for a resource loosely based on the JSON-PATCH format +// with support for: +// +// * Custom filters for describing partial array patch. +// * Extended path values for describing nested arrays. +// * Custom fields for describing the resource for which the operation is being +// described. +// * Allows extension to custom operations not natively supported by RFC6902. +// See https://tools.ietf.org/html/rfc6902 for details on the original RFC. +message Operation { + // Type of this operation. Contains one of 'and', 'remove', 'replace', 'move', + // 'copy', 'test' and custom operations. This field is case-insensitive and + // always populated. + string action = 1; + + // Type of GCP resource being modified/tested. This field is always populated. + // Example: cloudresourcemanager.googleapis.com/Project, + // compute.googleapis.com/Instance + string resource_type = 2; + + // Contains the fully qualified resource name. This field is always populated. + // ex: //cloudresourcemanager.googleapis.com/projects/foo. + string resource = 3; + + // Path to the target field being operated on. If the operation is at the + // resource level, then path should be "/". This field is always populated. + string path = 4; + + // Can be set with action 'copy' to copy resource configuration across + // different resources of the same type. Example: A resource clone can be + // done via action = 'copy', path = "/", from = "/", + // source_resource = and resource_name = . + // This field is empty for all other values of `action`. + string source_resource = 5; + + // Can be set with action 'copy' or 'move' to indicate the source field within + // resource or source_resource, ignored if provided for other operation types. + string source_path = 6; + + // One of the fields in the following block will be set and intend to + // describe a value for 'path' field. + oneof path_value { + // Value for the `path` field. Will be set for actions:'add'/'replace'. + // Maybe set for action: 'test'. Either this or `value_matcher` will be set + // for 'test' operation. An exact match must be performed. + google.protobuf.Value value = 7; + + // Can be set for action 'test' for advanced matching for the value of + // 'path' field. Either this or `value` will be set for 'test' operation. + ValueMatcher value_matcher = 10; + } + + // Set of filters to apply if `path` refers to array elements or nested array + // elements in order to narrow down to a single unique element that is being + // tested/modified. + // This is intended to be an exact match per filter. To perform advanced + // matching, use path_value_matchers. + // + // * Example: { + // "/versions/*/name" : "it-123" + // "/versions/*/targetSize/percent": 20 + // } + // * Example: { + // "/bindings/*/role": "roles/owner" + // "/bindings/*/condition" : null + // } + // * Example: { + // "/bindings/*/role": "roles/owner" + // "/bindings/*/members/*" : ["x@example.com", "y@example.com"] + // } + // When both path_filters and path_value_matchers are set, an implicit AND + // must be performed. + map path_filters = 8; + + // Similar to path_filters, this contains set of filters to apply if `path` + // field referes to array elements. This is meant to support value matching + // beyond exact match. To perform exact match, use path_filters. + // When both path_filters and path_value_matchers are set, an implicit AND + // must be performed. + map path_value_matchers = 11; +} + +// Contains various matching options for values for a GCP resource field. +message ValueMatcher { + oneof match_variant { + // To be used for full regex matching. The regular expression is using the + // Google RE2 syntax (https://github.com/google/re2/wiki/Syntax), so to be + // used with RE2::FullMatch + string matches_pattern = 1; + } +} + +// Contains metadata about how much money a recommendation can save or incur. +message CostProjection { + // An approximate projection on amount saved or amount incurred. Negative cost + // units indicate cost savings and positive cost units indicate increase. + // See google.type.Money documentation for positive/negative units. + google.type.Money cost = 1; + + // Duration for which this cost applies. + google.protobuf.Duration duration = 2; +} + +// Contains the impact a recommendation can have for a given category. +message Impact { + // The category of the impact. + enum Category { + // Default unspecified category. Don't use directly. + CATEGORY_UNSPECIFIED = 0; + + // Indicates a potential increase or decrease in cost. + COST = 1; + + // Indicates a potential increase or decrease in security. + SECURITY = 2; + + // Indicates a potential increase or decrease in performance. + PERFORMANCE = 3; + + // Indicates a potential increase or decrease in manageability. + MANAGEABILITY = 4; + } + + // Category that is being targeted. + Category category = 1; + + // Contains projections (if any) for this category. + oneof projection { + // Use with CategoryType.COST + CostProjection cost_projection = 100; + } +} + +// Information for state. Contains state and metadata. +message RecommendationStateInfo { + // Represents Recommendation State. + enum State { + // Default state. Don't use directly. + STATE_UNSPECIFIED = 0; + + // Recommendation is active and can be applied. Recommendations content can + // be updated by Google. + // + // ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + ACTIVE = 1; + + // Recommendation is in claimed state. Recommendations content is + // immutable and cannot be updated by Google. + // + // CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. + CLAIMED = 6; + + // Recommendation is in succeeded state. Recommendations content is + // immutable and cannot be updated by Google. + // + // SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED. + SUCCEEDED = 3; + + // Recommendation is in failed state. Recommendations content is immutable + // and cannot be updated by Google. + // + // FAILED recommendations can be marked as SUCCEEDED, or FAILED. + FAILED = 4; + + // Recommendation is in dismissed state. Recommendation content can be + // updated by Google. + // + // DISMISSED recommendations can be marked as ACTIVE. + DISMISSED = 5; + } + + // The state of the recommendation, Eg ACTIVE, SUCCEEDED, FAILED. + State state = 1; + + // A map of metadata for the state, provided by user or automations systems. + map state_metadata = 2; +} diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto new file mode 100644 index 000000000000..f8816a92471a --- /dev/null +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto @@ -0,0 +1,423 @@ +// Copyright 2020 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.cloud.recommender.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/recommender/v1/insight.proto"; +import "google/cloud/recommender/v1/recommendation.proto"; + +option csharp_namespace = "Google.Cloud.Recommender.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recommender/v1;recommender"; +option java_multiple_files = true; +option java_outer_classname = "RecommenderProto"; +option java_package = "com.google.cloud.recommender.v1"; +option objc_class_prefix = "CREC"; + +// Provides insights and recommendations for cloud customers for various +// categories like performance optimization, cost savings, reliability, feature +// discovery, etc. Insights and recommendations are generated automatically +// based on analysis of user resources, configuration and monitoring metrics. +service Recommender { + option (google.api.default_host) = "recommender.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists insights for a Cloud project. Requires the recommender.*.list IAM + // permission for the specified insight type. + rpc ListInsights(ListInsightsRequest) returns (ListInsightsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights" + additional_bindings { + get: "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights" + } + additional_bindings { + get: "/v1/{parent=folders/*/locations/*/insightTypes/*}/insights" + } + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the requested insight. Requires the recommender.*.get IAM permission + // for the specified insight type. + rpc GetInsight(GetInsightRequest) returns (Insight) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}" + additional_bindings { + get: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}" + } + additional_bindings { + get: "/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}" + } + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Marks the Insight State as Accepted. Users can use this method to + // indicate to the Recommender API that they have applied some action based + // on the insight. This stops the insight content from being updated. + // + // MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + // the recommender.*.update IAM permission for the specified insight. + rpc MarkInsightAccepted(MarkInsightAcceptedRequest) returns (Insight) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted" + body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted" + body: "*" + } + additional_bindings { + post: "/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted" + body: "*" + } + }; + option (google.api.method_signature) = "name,state_metadata,etag"; + } + + // Lists recommendations for a Cloud project. Requires the recommender.*.list + // IAM permission for the specified recommender. + rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations" + additional_bindings { + get: "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations" + } + additional_bindings { + get: "/v1/{parent=folders/*/locations/*/recommenders/*}/recommendations" + } + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations" + } + }; + option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = "parent,filter"; + } + + // Gets the requested recommendation. Requires the recommender.*.get + // IAM permission for the specified recommender. + rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}" + additional_bindings { + get: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}" + } + additional_bindings { + get: "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}" + } + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Marks the Recommendation State as Claimed. Users can use this method to + // indicate to the Recommender API that they are starting to apply the + // recommendation themselves. This stops the recommendation content from being + // updated. Associated insights are frozen and placed in the ACCEPTED state. + // + // MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + // SUCCEEDED, FAILED, or ACTIVE state. + // + // Requires the recommender.*.update IAM permission for the specified + // recommender. + rpc MarkRecommendationClaimed(MarkRecommendationClaimedRequest) returns (Recommendation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed" + body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed" + body: "*" + } + additional_bindings { + post: "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed" + body: "*" + } + }; + option (google.api.method_signature) = "name,state_metadata,etag"; + } + + // Marks the Recommendation State as Succeeded. Users can use this method to + // indicate to the Recommender API that they have applied the recommendation + // themselves, and the operation was successful. This stops the recommendation + // content from being updated. Associated insights are frozen and placed in + // the ACCEPTED state. + // + // MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + // CLAIMED, SUCCEEDED, or FAILED state. + // + // Requires the recommender.*.update IAM permission for the specified + // recommender. + rpc MarkRecommendationSucceeded(MarkRecommendationSucceededRequest) returns (Recommendation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" + body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" + body: "*" + } + additional_bindings { + post: "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" + body: "*" + } + }; + option (google.api.method_signature) = "name,state_metadata,etag"; + } + + // Marks the Recommendation State as Failed. Users can use this method to + // indicate to the Recommender API that they have applied the recommendation + // themselves, and the operation failed. This stops the recommendation content + // from being updated. Associated insights are frozen and placed in the + // ACCEPTED state. + // + // MarkRecommendationFailed can be applied to recommendations in ACTIVE, + // CLAIMED, SUCCEEDED, or FAILED state. + // + // Requires the recommender.*.update IAM permission for the specified + // recommender. + rpc MarkRecommendationFailed(MarkRecommendationFailedRequest) returns (Recommendation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed" + body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed" + body: "*" + } + additional_bindings { + post: "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed" + body: "*" + } + additional_bindings { + post: "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed" + body: "*" + } + }; + option (google.api.method_signature) = "name,state_metadata,etag"; + } +} + +// Request for the `ListInsights` method. +message ListInsightsRequest { + // Required. The container resource on which to execute the request. + // Acceptable formats: + // + // 1. + // "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]", + // + // LOCATION here refers to GCP Locations: + // https://cloud.google.com/about/locations/ + // INSIGHT_TYPE_ID refers to supported insight types: + // https://cloud.google.com/recommender/docs/insights/insight-types.) + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/InsightType" + } + ]; + + // Optional. The maximum number of results to return from this request. Non-positive + // values are ignored. If not specified, the server will determine the number + // of results to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieves the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of other method parameters must be identical + // to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression to restrict the insights returned. Supported + // filter fields: state + // Eg: `state:"DISMISSED" or state:"ACTIVE" + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response to the `ListInsights` method. +message ListInsightsResponse { + // The set of insights for the `parent` resource. + repeated Insight insights = 1; + + // A token that can be used to request the next page of results. This field is + // empty if there are no additional results. + string next_page_token = 2; +} + +// Request to the `GetInsight` method. +message GetInsightRequest { + // Required. Name of the insight. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Insight" + } + ]; +} + +// Request for the `MarkInsightAccepted` method. +message MarkInsightAcceptedRequest { + // Required. Name of the insight. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Insight" + } + ]; + + // Optional. State properties user wish to include with this state. Full replace of the + // current state_metadata. + map state_metadata = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Fingerprint of the Insight. Provides optimistic locking. + string etag = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `ListRecommendations` method. +message ListRecommendationsRequest { + // Required. The container resource on which to execute the request. + // Acceptable formats: + // + // 1. + // "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", + // + // LOCATION here refers to GCP Locations: + // https://cloud.google.com/about/locations/ + // RECOMMENDER_ID refers to supported recommenders: + // https://cloud.google.com/recommender/docs/recommenders. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Recommender" + } + ]; + + // Optional. The maximum number of results to return from this request. Non-positive + // values are ignored. If not specified, the server will determine the number + // of results to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieves the next batch of results from the preceding call to + // this method. `page_token` must be the value of `next_page_token` from the + // previous response. The values of other method parameters must be identical + // to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Filter expression to restrict the recommendations returned. Supported + // filter fields: state_info.state + // Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" + string filter = 5; +} + +// Response to the `ListRecommendations` method. +message ListRecommendationsResponse { + // The set of recommendations for the `parent` resource. + repeated Recommendation recommendations = 1; + + // A token that can be used to request the next page of results. This field is + // empty if there are no additional results. + string next_page_token = 2; +} + +// Request to the `GetRecommendation` method. +message GetRecommendationRequest { + // Required. Name of the recommendation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Recommendation" + } + ]; +} + +// Request for the `MarkRecommendationClaimed` Method. +message MarkRecommendationClaimedRequest { + // Required. Name of the recommendation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Recommendation" + } + ]; + + // State properties to include with this state. Overwrites any existing + // `state_metadata`. + // Keys must match the regex /^[a-z0-9][a-z0-9_.-]{0,62}$/. + // Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + map state_metadata = 2; + + // Required. Fingerprint of the Recommendation. Provides optimistic locking. + string etag = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `MarkRecommendationSucceeded` Method. +message MarkRecommendationSucceededRequest { + // Required. Name of the recommendation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Recommendation" + } + ]; + + // State properties to include with this state. Overwrites any existing + // `state_metadata`. + // Keys must match the regex /^[a-z0-9][a-z0-9_.-]{0,62}$/. + // Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + map state_metadata = 2; + + // Required. Fingerprint of the Recommendation. Provides optimistic locking. + string etag = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `MarkRecommendationFailed` Method. +message MarkRecommendationFailedRequest { + // Required. Name of the recommendation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recommender.googleapis.com/Recommendation" + } + ]; + + // State properties to include with this state. Overwrites any existing + // `state_metadata`. + // Keys must match the regex /^[a-z0-9][a-z0-9_.-]{0,62}$/. + // Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + map state_metadata = 2; + + // Required. Fingerprint of the Recommendation. Provides optimistic locking. + string etag = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-recommender/protos/protos.d.ts b/packages/google-cloud-recommender/protos/protos.d.ts new file mode 100644 index 000000000000..1e591dc42bbc --- /dev/null +++ b/packages/google-cloud-recommender/protos/protos.d.ts @@ -0,0 +1,7328 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace recommender. */ + namespace recommender { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Insight. */ + interface IInsight { + + /** Insight name */ + name?: (string|null); + + /** Insight description */ + description?: (string|null); + + /** Insight targetResources */ + targetResources?: (string[]|null); + + /** Insight insightSubtype */ + insightSubtype?: (string|null); + + /** Insight content */ + content?: (google.protobuf.IStruct|null); + + /** Insight lastRefreshTime */ + lastRefreshTime?: (google.protobuf.ITimestamp|null); + + /** Insight observationPeriod */ + observationPeriod?: (google.protobuf.IDuration|null); + + /** Insight stateInfo */ + stateInfo?: (google.cloud.recommender.v1.IInsightStateInfo|null); + + /** Insight category */ + category?: (google.cloud.recommender.v1.Insight.Category|keyof typeof google.cloud.recommender.v1.Insight.Category|null); + + /** Insight etag */ + etag?: (string|null); + + /** Insight associatedRecommendations */ + associatedRecommendations?: (google.cloud.recommender.v1.Insight.IRecommendationReference[]|null); + } + + /** Represents an Insight. */ + class Insight implements IInsight { + + /** + * Constructs a new Insight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IInsight); + + /** Insight name. */ + public name: string; + + /** Insight description. */ + public description: string; + + /** Insight targetResources. */ + public targetResources: string[]; + + /** Insight insightSubtype. */ + public insightSubtype: string; + + /** Insight content. */ + public content?: (google.protobuf.IStruct|null); + + /** Insight lastRefreshTime. */ + public lastRefreshTime?: (google.protobuf.ITimestamp|null); + + /** Insight observationPeriod. */ + public observationPeriod?: (google.protobuf.IDuration|null); + + /** Insight stateInfo. */ + public stateInfo?: (google.cloud.recommender.v1.IInsightStateInfo|null); + + /** Insight category. */ + public category: (google.cloud.recommender.v1.Insight.Category|keyof typeof google.cloud.recommender.v1.Insight.Category); + + /** Insight etag. */ + public etag: string; + + /** Insight associatedRecommendations. */ + public associatedRecommendations: google.cloud.recommender.v1.Insight.IRecommendationReference[]; + + /** + * Creates a new Insight instance using the specified properties. + * @param [properties] Properties to set + * @returns Insight instance + */ + public static create(properties?: google.cloud.recommender.v1.IInsight): google.cloud.recommender.v1.Insight; + + /** + * Encodes the specified Insight message. Does not implicitly {@link google.cloud.recommender.v1.Insight.verify|verify} messages. + * @param message Insight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Insight message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Insight.verify|verify} messages. + * @param message Insight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Insight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Insight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Insight; + + /** + * Decodes an Insight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Insight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Insight; + + /** + * Verifies an Insight message. + * @param message Plain 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 Insight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Insight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Insight; + + /** + * Creates a plain object from an Insight message. Also converts values to other types if specified. + * @param message Insight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Insight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Insight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Insight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Insight { + + /** Properties of a RecommendationReference. */ + interface IRecommendationReference { + + /** RecommendationReference recommendation */ + recommendation?: (string|null); + } + + /** Represents a RecommendationReference. */ + class RecommendationReference implements IRecommendationReference { + + /** + * Constructs a new RecommendationReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.Insight.IRecommendationReference); + + /** RecommendationReference recommendation. */ + public recommendation: string; + + /** + * Creates a new RecommendationReference instance using the specified properties. + * @param [properties] Properties to set + * @returns RecommendationReference instance + */ + public static create(properties?: google.cloud.recommender.v1.Insight.IRecommendationReference): google.cloud.recommender.v1.Insight.RecommendationReference; + + /** + * Encodes the specified RecommendationReference message. Does not implicitly {@link google.cloud.recommender.v1.Insight.RecommendationReference.verify|verify} messages. + * @param message RecommendationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.Insight.IRecommendationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecommendationReference message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Insight.RecommendationReference.verify|verify} messages. + * @param message RecommendationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.Insight.IRecommendationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecommendationReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecommendationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Insight.RecommendationReference; + + /** + * Decodes a RecommendationReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecommendationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Insight.RecommendationReference; + + /** + * Verifies a RecommendationReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecommendationReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecommendationReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Insight.RecommendationReference; + + /** + * Creates a plain object from a RecommendationReference message. Also converts values to other types if specified. + * @param message RecommendationReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Insight.RecommendationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecommendationReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecommendationReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Category enum. */ + enum Category { + CATEGORY_UNSPECIFIED = 0, + COST = 1, + SECURITY = 2, + PERFORMANCE = 3, + MANAGEABILITY = 4 + } + } + + /** Properties of an InsightStateInfo. */ + interface IInsightStateInfo { + + /** InsightStateInfo state */ + state?: (google.cloud.recommender.v1.InsightStateInfo.State|keyof typeof google.cloud.recommender.v1.InsightStateInfo.State|null); + + /** InsightStateInfo stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + } + + /** Represents an InsightStateInfo. */ + class InsightStateInfo implements IInsightStateInfo { + + /** + * Constructs a new InsightStateInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IInsightStateInfo); + + /** InsightStateInfo state. */ + public state: (google.cloud.recommender.v1.InsightStateInfo.State|keyof typeof google.cloud.recommender.v1.InsightStateInfo.State); + + /** InsightStateInfo stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** + * Creates a new InsightStateInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns InsightStateInfo instance + */ + public static create(properties?: google.cloud.recommender.v1.IInsightStateInfo): google.cloud.recommender.v1.InsightStateInfo; + + /** + * Encodes the specified InsightStateInfo message. Does not implicitly {@link google.cloud.recommender.v1.InsightStateInfo.verify|verify} messages. + * @param message InsightStateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IInsightStateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsightStateInfo message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.InsightStateInfo.verify|verify} messages. + * @param message InsightStateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IInsightStateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsightStateInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsightStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.InsightStateInfo; + + /** + * Decodes an InsightStateInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsightStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.InsightStateInfo; + + /** + * Verifies an InsightStateInfo message. + * @param message Plain 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 InsightStateInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsightStateInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.InsightStateInfo; + + /** + * Creates a plain object from an InsightStateInfo message. Also converts values to other types if specified. + * @param message InsightStateInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.InsightStateInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsightStateInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsightStateInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InsightStateInfo { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + ACCEPTED = 2, + DISMISSED = 3 + } + } + + /** Properties of a Recommendation. */ + interface IRecommendation { + + /** Recommendation name */ + name?: (string|null); + + /** Recommendation description */ + description?: (string|null); + + /** Recommendation recommenderSubtype */ + recommenderSubtype?: (string|null); + + /** Recommendation lastRefreshTime */ + lastRefreshTime?: (google.protobuf.ITimestamp|null); + + /** Recommendation primaryImpact */ + primaryImpact?: (google.cloud.recommender.v1.IImpact|null); + + /** Recommendation additionalImpact */ + additionalImpact?: (google.cloud.recommender.v1.IImpact[]|null); + + /** Recommendation content */ + content?: (google.cloud.recommender.v1.IRecommendationContent|null); + + /** Recommendation stateInfo */ + stateInfo?: (google.cloud.recommender.v1.IRecommendationStateInfo|null); + + /** Recommendation etag */ + etag?: (string|null); + + /** Recommendation associatedInsights */ + associatedInsights?: (google.cloud.recommender.v1.Recommendation.IInsightReference[]|null); + } + + /** Represents a Recommendation. */ + class Recommendation implements IRecommendation { + + /** + * Constructs a new Recommendation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IRecommendation); + + /** Recommendation name. */ + public name: string; + + /** Recommendation description. */ + public description: string; + + /** Recommendation recommenderSubtype. */ + public recommenderSubtype: string; + + /** Recommendation lastRefreshTime. */ + public lastRefreshTime?: (google.protobuf.ITimestamp|null); + + /** Recommendation primaryImpact. */ + public primaryImpact?: (google.cloud.recommender.v1.IImpact|null); + + /** Recommendation additionalImpact. */ + public additionalImpact: google.cloud.recommender.v1.IImpact[]; + + /** Recommendation content. */ + public content?: (google.cloud.recommender.v1.IRecommendationContent|null); + + /** Recommendation stateInfo. */ + public stateInfo?: (google.cloud.recommender.v1.IRecommendationStateInfo|null); + + /** Recommendation etag. */ + public etag: string; + + /** Recommendation associatedInsights. */ + public associatedInsights: google.cloud.recommender.v1.Recommendation.IInsightReference[]; + + /** + * Creates a new Recommendation instance using the specified properties. + * @param [properties] Properties to set + * @returns Recommendation instance + */ + public static create(properties?: google.cloud.recommender.v1.IRecommendation): google.cloud.recommender.v1.Recommendation; + + /** + * Encodes the specified Recommendation message. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.verify|verify} messages. + * @param message Recommendation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IRecommendation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Recommendation message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.verify|verify} messages. + * @param message Recommendation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IRecommendation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Recommendation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Recommendation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Recommendation; + + /** + * Decodes a Recommendation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Recommendation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Recommendation; + + /** + * Verifies a Recommendation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Recommendation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Recommendation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Recommendation; + + /** + * Creates a plain object from a Recommendation message. Also converts values to other types if specified. + * @param message Recommendation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Recommendation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Recommendation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Recommendation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Recommendation { + + /** Properties of an InsightReference. */ + interface IInsightReference { + + /** InsightReference insight */ + insight?: (string|null); + } + + /** Represents an InsightReference. */ + class InsightReference implements IInsightReference { + + /** + * Constructs a new InsightReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.Recommendation.IInsightReference); + + /** InsightReference insight. */ + public insight: string; + + /** + * Creates a new InsightReference instance using the specified properties. + * @param [properties] Properties to set + * @returns InsightReference instance + */ + public static create(properties?: google.cloud.recommender.v1.Recommendation.IInsightReference): google.cloud.recommender.v1.Recommendation.InsightReference; + + /** + * Encodes the specified InsightReference message. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.InsightReference.verify|verify} messages. + * @param message InsightReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.Recommendation.IInsightReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsightReference message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.InsightReference.verify|verify} messages. + * @param message InsightReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.Recommendation.IInsightReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsightReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsightReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Recommendation.InsightReference; + + /** + * Decodes an InsightReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsightReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Recommendation.InsightReference; + + /** + * Verifies an InsightReference message. + * @param message Plain 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 InsightReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsightReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Recommendation.InsightReference; + + /** + * Creates a plain object from an InsightReference message. Also converts values to other types if specified. + * @param message InsightReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Recommendation.InsightReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsightReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsightReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecommendationContent. */ + interface IRecommendationContent { + + /** RecommendationContent operationGroups */ + operationGroups?: (google.cloud.recommender.v1.IOperationGroup[]|null); + } + + /** Represents a RecommendationContent. */ + class RecommendationContent implements IRecommendationContent { + + /** + * Constructs a new RecommendationContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IRecommendationContent); + + /** RecommendationContent operationGroups. */ + public operationGroups: google.cloud.recommender.v1.IOperationGroup[]; + + /** + * Creates a new RecommendationContent instance using the specified properties. + * @param [properties] Properties to set + * @returns RecommendationContent instance + */ + public static create(properties?: google.cloud.recommender.v1.IRecommendationContent): google.cloud.recommender.v1.RecommendationContent; + + /** + * Encodes the specified RecommendationContent message. Does not implicitly {@link google.cloud.recommender.v1.RecommendationContent.verify|verify} messages. + * @param message RecommendationContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IRecommendationContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecommendationContent message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.RecommendationContent.verify|verify} messages. + * @param message RecommendationContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IRecommendationContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecommendationContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecommendationContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.RecommendationContent; + + /** + * Decodes a RecommendationContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecommendationContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.RecommendationContent; + + /** + * Verifies a RecommendationContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecommendationContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecommendationContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.RecommendationContent; + + /** + * Creates a plain object from a RecommendationContent message. Also converts values to other types if specified. + * @param message RecommendationContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.RecommendationContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecommendationContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecommendationContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationGroup. */ + interface IOperationGroup { + + /** OperationGroup operations */ + operations?: (google.cloud.recommender.v1.IOperation[]|null); + } + + /** Represents an OperationGroup. */ + class OperationGroup implements IOperationGroup { + + /** + * Constructs a new OperationGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IOperationGroup); + + /** OperationGroup operations. */ + public operations: google.cloud.recommender.v1.IOperation[]; + + /** + * Creates a new OperationGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationGroup instance + */ + public static create(properties?: google.cloud.recommender.v1.IOperationGroup): google.cloud.recommender.v1.OperationGroup; + + /** + * Encodes the specified OperationGroup message. Does not implicitly {@link google.cloud.recommender.v1.OperationGroup.verify|verify} messages. + * @param message OperationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IOperationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationGroup message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.OperationGroup.verify|verify} messages. + * @param message OperationGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IOperationGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.OperationGroup; + + /** + * Decodes an OperationGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.OperationGroup; + + /** + * Verifies an OperationGroup message. + * @param message Plain 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 OperationGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.OperationGroup; + + /** + * Creates a plain object from an OperationGroup message. Also converts values to other types if specified. + * @param message OperationGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.OperationGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation action */ + action?: (string|null); + + /** Operation resourceType */ + resourceType?: (string|null); + + /** Operation resource */ + resource?: (string|null); + + /** Operation path */ + path?: (string|null); + + /** Operation sourceResource */ + sourceResource?: (string|null); + + /** Operation sourcePath */ + sourcePath?: (string|null); + + /** Operation value */ + value?: (google.protobuf.IValue|null); + + /** Operation valueMatcher */ + valueMatcher?: (google.cloud.recommender.v1.IValueMatcher|null); + + /** Operation pathFilters */ + pathFilters?: ({ [k: string]: google.protobuf.IValue }|null); + + /** Operation pathValueMatchers */ + pathValueMatchers?: ({ [k: string]: google.cloud.recommender.v1.IValueMatcher }|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IOperation); + + /** Operation action. */ + public action: string; + + /** Operation resourceType. */ + public resourceType: string; + + /** Operation resource. */ + public resource: string; + + /** Operation path. */ + public path: string; + + /** Operation sourceResource. */ + public sourceResource: string; + + /** Operation sourcePath. */ + public sourcePath: string; + + /** Operation value. */ + public value?: (google.protobuf.IValue|null); + + /** Operation valueMatcher. */ + public valueMatcher?: (google.cloud.recommender.v1.IValueMatcher|null); + + /** Operation pathFilters. */ + public pathFilters: { [k: string]: google.protobuf.IValue }; + + /** Operation pathValueMatchers. */ + public pathValueMatchers: { [k: string]: google.cloud.recommender.v1.IValueMatcher }; + + /** Operation pathValue. */ + public pathValue?: ("value"|"valueMatcher"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.cloud.recommender.v1.IOperation): google.cloud.recommender.v1.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.cloud.recommender.v1.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValueMatcher. */ + interface IValueMatcher { + + /** ValueMatcher matchesPattern */ + matchesPattern?: (string|null); + } + + /** Represents a ValueMatcher. */ + class ValueMatcher implements IValueMatcher { + + /** + * Constructs a new ValueMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IValueMatcher); + + /** ValueMatcher matchesPattern. */ + public matchesPattern?: (string|null); + + /** ValueMatcher matchVariant. */ + public matchVariant?: "matchesPattern"; + + /** + * Creates a new ValueMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueMatcher instance + */ + public static create(properties?: google.cloud.recommender.v1.IValueMatcher): google.cloud.recommender.v1.ValueMatcher; + + /** + * Encodes the specified ValueMatcher message. Does not implicitly {@link google.cloud.recommender.v1.ValueMatcher.verify|verify} messages. + * @param message ValueMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IValueMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueMatcher message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ValueMatcher.verify|verify} messages. + * @param message ValueMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IValueMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.ValueMatcher; + + /** + * Decodes a ValueMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.ValueMatcher; + + /** + * Verifies a ValueMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValueMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.ValueMatcher; + + /** + * Creates a plain object from a ValueMatcher message. Also converts values to other types if specified. + * @param message ValueMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.ValueMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValueMatcher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CostProjection. */ + interface ICostProjection { + + /** CostProjection cost */ + cost?: (google.type.IMoney|null); + + /** CostProjection duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a CostProjection. */ + class CostProjection implements ICostProjection { + + /** + * Constructs a new CostProjection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.ICostProjection); + + /** CostProjection cost. */ + public cost?: (google.type.IMoney|null); + + /** CostProjection duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new CostProjection instance using the specified properties. + * @param [properties] Properties to set + * @returns CostProjection instance + */ + public static create(properties?: google.cloud.recommender.v1.ICostProjection): google.cloud.recommender.v1.CostProjection; + + /** + * Encodes the specified CostProjection message. Does not implicitly {@link google.cloud.recommender.v1.CostProjection.verify|verify} messages. + * @param message CostProjection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.ICostProjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CostProjection message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.CostProjection.verify|verify} messages. + * @param message CostProjection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.ICostProjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CostProjection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CostProjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.CostProjection; + + /** + * Decodes a CostProjection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CostProjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.CostProjection; + + /** + * Verifies a CostProjection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CostProjection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CostProjection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.CostProjection; + + /** + * Creates a plain object from a CostProjection message. Also converts values to other types if specified. + * @param message CostProjection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.CostProjection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CostProjection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CostProjection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Impact. */ + interface IImpact { + + /** Impact category */ + category?: (google.cloud.recommender.v1.Impact.Category|keyof typeof google.cloud.recommender.v1.Impact.Category|null); + + /** Impact costProjection */ + costProjection?: (google.cloud.recommender.v1.ICostProjection|null); + } + + /** Represents an Impact. */ + class Impact implements IImpact { + + /** + * Constructs a new Impact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IImpact); + + /** Impact category. */ + public category: (google.cloud.recommender.v1.Impact.Category|keyof typeof google.cloud.recommender.v1.Impact.Category); + + /** Impact costProjection. */ + public costProjection?: (google.cloud.recommender.v1.ICostProjection|null); + + /** Impact projection. */ + public projection?: "costProjection"; + + /** + * Creates a new Impact instance using the specified properties. + * @param [properties] Properties to set + * @returns Impact instance + */ + public static create(properties?: google.cloud.recommender.v1.IImpact): google.cloud.recommender.v1.Impact; + + /** + * Encodes the specified Impact message. Does not implicitly {@link google.cloud.recommender.v1.Impact.verify|verify} messages. + * @param message Impact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Impact.verify|verify} messages. + * @param message Impact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Impact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.Impact; + + /** + * Decodes an Impact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.Impact; + + /** + * Verifies an Impact message. + * @param message Plain 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 Impact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Impact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.Impact; + + /** + * Creates a plain object from an Impact message. Also converts values to other types if specified. + * @param message Impact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.Impact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Impact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Impact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Impact { + + /** Category enum. */ + enum Category { + CATEGORY_UNSPECIFIED = 0, + COST = 1, + SECURITY = 2, + PERFORMANCE = 3, + MANAGEABILITY = 4 + } + } + + /** Properties of a RecommendationStateInfo. */ + interface IRecommendationStateInfo { + + /** RecommendationStateInfo state */ + state?: (google.cloud.recommender.v1.RecommendationStateInfo.State|keyof typeof google.cloud.recommender.v1.RecommendationStateInfo.State|null); + + /** RecommendationStateInfo stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + } + + /** Represents a RecommendationStateInfo. */ + class RecommendationStateInfo implements IRecommendationStateInfo { + + /** + * Constructs a new RecommendationStateInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IRecommendationStateInfo); + + /** RecommendationStateInfo state. */ + public state: (google.cloud.recommender.v1.RecommendationStateInfo.State|keyof typeof google.cloud.recommender.v1.RecommendationStateInfo.State); + + /** RecommendationStateInfo stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** + * Creates a new RecommendationStateInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RecommendationStateInfo instance + */ + public static create(properties?: google.cloud.recommender.v1.IRecommendationStateInfo): google.cloud.recommender.v1.RecommendationStateInfo; + + /** + * Encodes the specified RecommendationStateInfo message. Does not implicitly {@link google.cloud.recommender.v1.RecommendationStateInfo.verify|verify} messages. + * @param message RecommendationStateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IRecommendationStateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecommendationStateInfo message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.RecommendationStateInfo.verify|verify} messages. + * @param message RecommendationStateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IRecommendationStateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecommendationStateInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecommendationStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.RecommendationStateInfo; + + /** + * Decodes a RecommendationStateInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecommendationStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.RecommendationStateInfo; + + /** + * Verifies a RecommendationStateInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecommendationStateInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecommendationStateInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.RecommendationStateInfo; + + /** + * Creates a plain object from a RecommendationStateInfo message. Also converts values to other types if specified. + * @param message RecommendationStateInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.RecommendationStateInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecommendationStateInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecommendationStateInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RecommendationStateInfo { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CLAIMED = 6, + SUCCEEDED = 3, + FAILED = 4, + DISMISSED = 5 + } + } + + /** Represents a Recommender */ + class Recommender extends $protobuf.rpc.Service { + + /** + * Constructs a new Recommender 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 Recommender 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): Recommender; + + /** + * Calls ListInsights. + * @param request ListInsightsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInsightsResponse + */ + public listInsights(request: google.cloud.recommender.v1.IListInsightsRequest, callback: google.cloud.recommender.v1.Recommender.ListInsightsCallback): void; + + /** + * Calls ListInsights. + * @param request ListInsightsRequest message or plain object + * @returns Promise + */ + public listInsights(request: google.cloud.recommender.v1.IListInsightsRequest): Promise; + + /** + * Calls GetInsight. + * @param request GetInsightRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Insight + */ + public getInsight(request: google.cloud.recommender.v1.IGetInsightRequest, callback: google.cloud.recommender.v1.Recommender.GetInsightCallback): void; + + /** + * Calls GetInsight. + * @param request GetInsightRequest message or plain object + * @returns Promise + */ + public getInsight(request: google.cloud.recommender.v1.IGetInsightRequest): Promise; + + /** + * Calls MarkInsightAccepted. + * @param request MarkInsightAcceptedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Insight + */ + public markInsightAccepted(request: google.cloud.recommender.v1.IMarkInsightAcceptedRequest, callback: google.cloud.recommender.v1.Recommender.MarkInsightAcceptedCallback): void; + + /** + * Calls MarkInsightAccepted. + * @param request MarkInsightAcceptedRequest message or plain object + * @returns Promise + */ + public markInsightAccepted(request: google.cloud.recommender.v1.IMarkInsightAcceptedRequest): Promise; + + /** + * Calls ListRecommendations. + * @param request ListRecommendationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRecommendationsResponse + */ + public listRecommendations(request: google.cloud.recommender.v1.IListRecommendationsRequest, callback: google.cloud.recommender.v1.Recommender.ListRecommendationsCallback): void; + + /** + * Calls ListRecommendations. + * @param request ListRecommendationsRequest message or plain object + * @returns Promise + */ + public listRecommendations(request: google.cloud.recommender.v1.IListRecommendationsRequest): Promise; + + /** + * Calls GetRecommendation. + * @param request GetRecommendationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Recommendation + */ + public getRecommendation(request: google.cloud.recommender.v1.IGetRecommendationRequest, callback: google.cloud.recommender.v1.Recommender.GetRecommendationCallback): void; + + /** + * Calls GetRecommendation. + * @param request GetRecommendationRequest message or plain object + * @returns Promise + */ + public getRecommendation(request: google.cloud.recommender.v1.IGetRecommendationRequest): Promise; + + /** + * Calls MarkRecommendationClaimed. + * @param request MarkRecommendationClaimedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Recommendation + */ + public markRecommendationClaimed(request: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, callback: google.cloud.recommender.v1.Recommender.MarkRecommendationClaimedCallback): void; + + /** + * Calls MarkRecommendationClaimed. + * @param request MarkRecommendationClaimedRequest message or plain object + * @returns Promise + */ + public markRecommendationClaimed(request: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest): Promise; + + /** + * Calls MarkRecommendationSucceeded. + * @param request MarkRecommendationSucceededRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Recommendation + */ + public markRecommendationSucceeded(request: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, callback: google.cloud.recommender.v1.Recommender.MarkRecommendationSucceededCallback): void; + + /** + * Calls MarkRecommendationSucceeded. + * @param request MarkRecommendationSucceededRequest message or plain object + * @returns Promise + */ + public markRecommendationSucceeded(request: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest): Promise; + + /** + * Calls MarkRecommendationFailed. + * @param request MarkRecommendationFailedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Recommendation + */ + public markRecommendationFailed(request: google.cloud.recommender.v1.IMarkRecommendationFailedRequest, callback: google.cloud.recommender.v1.Recommender.MarkRecommendationFailedCallback): void; + + /** + * Calls MarkRecommendationFailed. + * @param request MarkRecommendationFailedRequest message or plain object + * @returns Promise + */ + public markRecommendationFailed(request: google.cloud.recommender.v1.IMarkRecommendationFailedRequest): Promise; + } + + namespace Recommender { + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|listInsights}. + * @param error Error, if any + * @param [response] ListInsightsResponse + */ + type ListInsightsCallback = (error: (Error|null), response?: google.cloud.recommender.v1.ListInsightsResponse) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|getInsight}. + * @param error Error, if any + * @param [response] Insight + */ + type GetInsightCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Insight) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markInsightAccepted}. + * @param error Error, if any + * @param [response] Insight + */ + type MarkInsightAcceptedCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Insight) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|listRecommendations}. + * @param error Error, if any + * @param [response] ListRecommendationsResponse + */ + type ListRecommendationsCallback = (error: (Error|null), response?: google.cloud.recommender.v1.ListRecommendationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|getRecommendation}. + * @param error Error, if any + * @param [response] Recommendation + */ + type GetRecommendationCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Recommendation) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationClaimed}. + * @param error Error, if any + * @param [response] Recommendation + */ + type MarkRecommendationClaimedCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Recommendation) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationSucceeded}. + * @param error Error, if any + * @param [response] Recommendation + */ + type MarkRecommendationSucceededCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Recommendation) => void; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationFailed}. + * @param error Error, if any + * @param [response] Recommendation + */ + type MarkRecommendationFailedCallback = (error: (Error|null), response?: google.cloud.recommender.v1.Recommendation) => void; + } + + /** Properties of a ListInsightsRequest. */ + interface IListInsightsRequest { + + /** ListInsightsRequest parent */ + parent?: (string|null); + + /** ListInsightsRequest pageSize */ + pageSize?: (number|null); + + /** ListInsightsRequest pageToken */ + pageToken?: (string|null); + + /** ListInsightsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInsightsRequest. */ + class ListInsightsRequest implements IListInsightsRequest { + + /** + * Constructs a new ListInsightsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IListInsightsRequest); + + /** ListInsightsRequest parent. */ + public parent: string; + + /** ListInsightsRequest pageSize. */ + public pageSize: number; + + /** ListInsightsRequest pageToken. */ + public pageToken: string; + + /** ListInsightsRequest filter. */ + public filter: string; + + /** + * Creates a new ListInsightsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInsightsRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IListInsightsRequest): google.cloud.recommender.v1.ListInsightsRequest; + + /** + * Encodes the specified ListInsightsRequest message. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsRequest.verify|verify} messages. + * @param message ListInsightsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IListInsightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInsightsRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsRequest.verify|verify} messages. + * @param message ListInsightsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IListInsightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInsightsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.ListInsightsRequest; + + /** + * Decodes a ListInsightsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.ListInsightsRequest; + + /** + * Verifies a ListInsightsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInsightsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInsightsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.ListInsightsRequest; + + /** + * Creates a plain object from a ListInsightsRequest message. Also converts values to other types if specified. + * @param message ListInsightsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.ListInsightsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInsightsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInsightsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInsightsResponse. */ + interface IListInsightsResponse { + + /** ListInsightsResponse insights */ + insights?: (google.cloud.recommender.v1.IInsight[]|null); + + /** ListInsightsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInsightsResponse. */ + class ListInsightsResponse implements IListInsightsResponse { + + /** + * Constructs a new ListInsightsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IListInsightsResponse); + + /** ListInsightsResponse insights. */ + public insights: google.cloud.recommender.v1.IInsight[]; + + /** ListInsightsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInsightsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInsightsResponse instance + */ + public static create(properties?: google.cloud.recommender.v1.IListInsightsResponse): google.cloud.recommender.v1.ListInsightsResponse; + + /** + * Encodes the specified ListInsightsResponse message. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsResponse.verify|verify} messages. + * @param message ListInsightsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IListInsightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInsightsResponse message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsResponse.verify|verify} messages. + * @param message ListInsightsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IListInsightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInsightsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.ListInsightsResponse; + + /** + * Decodes a ListInsightsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.ListInsightsResponse; + + /** + * Verifies a ListInsightsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInsightsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInsightsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.ListInsightsResponse; + + /** + * Creates a plain object from a ListInsightsResponse message. Also converts values to other types if specified. + * @param message ListInsightsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.ListInsightsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInsightsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInsightsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInsightRequest. */ + interface IGetInsightRequest { + + /** GetInsightRequest name */ + name?: (string|null); + } + + /** Represents a GetInsightRequest. */ + class GetInsightRequest implements IGetInsightRequest { + + /** + * Constructs a new GetInsightRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IGetInsightRequest); + + /** GetInsightRequest name. */ + public name: string; + + /** + * Creates a new GetInsightRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInsightRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IGetInsightRequest): google.cloud.recommender.v1.GetInsightRequest; + + /** + * Encodes the specified GetInsightRequest message. Does not implicitly {@link google.cloud.recommender.v1.GetInsightRequest.verify|verify} messages. + * @param message GetInsightRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IGetInsightRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInsightRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.GetInsightRequest.verify|verify} messages. + * @param message GetInsightRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IGetInsightRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInsightRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInsightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.GetInsightRequest; + + /** + * Decodes a GetInsightRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInsightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.GetInsightRequest; + + /** + * Verifies a GetInsightRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInsightRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInsightRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.GetInsightRequest; + + /** + * Creates a plain object from a GetInsightRequest message. Also converts values to other types if specified. + * @param message GetInsightRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.GetInsightRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInsightRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInsightRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MarkInsightAcceptedRequest. */ + interface IMarkInsightAcceptedRequest { + + /** MarkInsightAcceptedRequest name */ + name?: (string|null); + + /** MarkInsightAcceptedRequest stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + + /** MarkInsightAcceptedRequest etag */ + etag?: (string|null); + } + + /** Represents a MarkInsightAcceptedRequest. */ + class MarkInsightAcceptedRequest implements IMarkInsightAcceptedRequest { + + /** + * Constructs a new MarkInsightAcceptedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IMarkInsightAcceptedRequest); + + /** MarkInsightAcceptedRequest name. */ + public name: string; + + /** MarkInsightAcceptedRequest stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** MarkInsightAcceptedRequest etag. */ + public etag: string; + + /** + * Creates a new MarkInsightAcceptedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MarkInsightAcceptedRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IMarkInsightAcceptedRequest): google.cloud.recommender.v1.MarkInsightAcceptedRequest; + + /** + * Encodes the specified MarkInsightAcceptedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkInsightAcceptedRequest.verify|verify} messages. + * @param message MarkInsightAcceptedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IMarkInsightAcceptedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarkInsightAcceptedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkInsightAcceptedRequest.verify|verify} messages. + * @param message MarkInsightAcceptedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IMarkInsightAcceptedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarkInsightAcceptedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarkInsightAcceptedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.MarkInsightAcceptedRequest; + + /** + * Decodes a MarkInsightAcceptedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarkInsightAcceptedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.MarkInsightAcceptedRequest; + + /** + * Verifies a MarkInsightAcceptedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarkInsightAcceptedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarkInsightAcceptedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.MarkInsightAcceptedRequest; + + /** + * Creates a plain object from a MarkInsightAcceptedRequest message. Also converts values to other types if specified. + * @param message MarkInsightAcceptedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.MarkInsightAcceptedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarkInsightAcceptedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarkInsightAcceptedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRecommendationsRequest. */ + interface IListRecommendationsRequest { + + /** ListRecommendationsRequest parent */ + parent?: (string|null); + + /** ListRecommendationsRequest pageSize */ + pageSize?: (number|null); + + /** ListRecommendationsRequest pageToken */ + pageToken?: (string|null); + + /** ListRecommendationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRecommendationsRequest. */ + class ListRecommendationsRequest implements IListRecommendationsRequest { + + /** + * Constructs a new ListRecommendationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IListRecommendationsRequest); + + /** ListRecommendationsRequest parent. */ + public parent: string; + + /** ListRecommendationsRequest pageSize. */ + public pageSize: number; + + /** ListRecommendationsRequest pageToken. */ + public pageToken: string; + + /** ListRecommendationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListRecommendationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRecommendationsRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IListRecommendationsRequest): google.cloud.recommender.v1.ListRecommendationsRequest; + + /** + * Encodes the specified ListRecommendationsRequest message. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsRequest.verify|verify} messages. + * @param message ListRecommendationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IListRecommendationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRecommendationsRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsRequest.verify|verify} messages. + * @param message ListRecommendationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IListRecommendationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRecommendationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRecommendationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.ListRecommendationsRequest; + + /** + * Decodes a ListRecommendationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRecommendationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.ListRecommendationsRequest; + + /** + * Verifies a ListRecommendationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRecommendationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRecommendationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.ListRecommendationsRequest; + + /** + * Creates a plain object from a ListRecommendationsRequest message. Also converts values to other types if specified. + * @param message ListRecommendationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.ListRecommendationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRecommendationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRecommendationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRecommendationsResponse. */ + interface IListRecommendationsResponse { + + /** ListRecommendationsResponse recommendations */ + recommendations?: (google.cloud.recommender.v1.IRecommendation[]|null); + + /** ListRecommendationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRecommendationsResponse. */ + class ListRecommendationsResponse implements IListRecommendationsResponse { + + /** + * Constructs a new ListRecommendationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IListRecommendationsResponse); + + /** ListRecommendationsResponse recommendations. */ + public recommendations: google.cloud.recommender.v1.IRecommendation[]; + + /** ListRecommendationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRecommendationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRecommendationsResponse instance + */ + public static create(properties?: google.cloud.recommender.v1.IListRecommendationsResponse): google.cloud.recommender.v1.ListRecommendationsResponse; + + /** + * Encodes the specified ListRecommendationsResponse message. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsResponse.verify|verify} messages. + * @param message ListRecommendationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IListRecommendationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRecommendationsResponse message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsResponse.verify|verify} messages. + * @param message ListRecommendationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IListRecommendationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRecommendationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRecommendationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.ListRecommendationsResponse; + + /** + * Decodes a ListRecommendationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRecommendationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.ListRecommendationsResponse; + + /** + * Verifies a ListRecommendationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRecommendationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRecommendationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.ListRecommendationsResponse; + + /** + * Creates a plain object from a ListRecommendationsResponse message. Also converts values to other types if specified. + * @param message ListRecommendationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.ListRecommendationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRecommendationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRecommendationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRecommendationRequest. */ + interface IGetRecommendationRequest { + + /** GetRecommendationRequest name */ + name?: (string|null); + } + + /** Represents a GetRecommendationRequest. */ + class GetRecommendationRequest implements IGetRecommendationRequest { + + /** + * Constructs a new GetRecommendationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IGetRecommendationRequest); + + /** GetRecommendationRequest name. */ + public name: string; + + /** + * Creates a new GetRecommendationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRecommendationRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IGetRecommendationRequest): google.cloud.recommender.v1.GetRecommendationRequest; + + /** + * Encodes the specified GetRecommendationRequest message. Does not implicitly {@link google.cloud.recommender.v1.GetRecommendationRequest.verify|verify} messages. + * @param message GetRecommendationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IGetRecommendationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRecommendationRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.GetRecommendationRequest.verify|verify} messages. + * @param message GetRecommendationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IGetRecommendationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRecommendationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRecommendationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.GetRecommendationRequest; + + /** + * Decodes a GetRecommendationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRecommendationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.GetRecommendationRequest; + + /** + * Verifies a GetRecommendationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRecommendationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRecommendationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.GetRecommendationRequest; + + /** + * Creates a plain object from a GetRecommendationRequest message. Also converts values to other types if specified. + * @param message GetRecommendationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.GetRecommendationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRecommendationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRecommendationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MarkRecommendationClaimedRequest. */ + interface IMarkRecommendationClaimedRequest { + + /** MarkRecommendationClaimedRequest name */ + name?: (string|null); + + /** MarkRecommendationClaimedRequest stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + + /** MarkRecommendationClaimedRequest etag */ + etag?: (string|null); + } + + /** Represents a MarkRecommendationClaimedRequest. */ + class MarkRecommendationClaimedRequest implements IMarkRecommendationClaimedRequest { + + /** + * Constructs a new MarkRecommendationClaimedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest); + + /** MarkRecommendationClaimedRequest name. */ + public name: string; + + /** MarkRecommendationClaimedRequest stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** MarkRecommendationClaimedRequest etag. */ + public etag: string; + + /** + * Creates a new MarkRecommendationClaimedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MarkRecommendationClaimedRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest): google.cloud.recommender.v1.MarkRecommendationClaimedRequest; + + /** + * Encodes the specified MarkRecommendationClaimedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationClaimedRequest.verify|verify} messages. + * @param message MarkRecommendationClaimedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarkRecommendationClaimedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationClaimedRequest.verify|verify} messages. + * @param message MarkRecommendationClaimedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarkRecommendationClaimedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarkRecommendationClaimedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.MarkRecommendationClaimedRequest; + + /** + * Decodes a MarkRecommendationClaimedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarkRecommendationClaimedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.MarkRecommendationClaimedRequest; + + /** + * Verifies a MarkRecommendationClaimedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarkRecommendationClaimedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarkRecommendationClaimedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.MarkRecommendationClaimedRequest; + + /** + * Creates a plain object from a MarkRecommendationClaimedRequest message. Also converts values to other types if specified. + * @param message MarkRecommendationClaimedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.MarkRecommendationClaimedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarkRecommendationClaimedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarkRecommendationClaimedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MarkRecommendationSucceededRequest. */ + interface IMarkRecommendationSucceededRequest { + + /** MarkRecommendationSucceededRequest name */ + name?: (string|null); + + /** MarkRecommendationSucceededRequest stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + + /** MarkRecommendationSucceededRequest etag */ + etag?: (string|null); + } + + /** Represents a MarkRecommendationSucceededRequest. */ + class MarkRecommendationSucceededRequest implements IMarkRecommendationSucceededRequest { + + /** + * Constructs a new MarkRecommendationSucceededRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest); + + /** MarkRecommendationSucceededRequest name. */ + public name: string; + + /** MarkRecommendationSucceededRequest stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** MarkRecommendationSucceededRequest etag. */ + public etag: string; + + /** + * Creates a new MarkRecommendationSucceededRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MarkRecommendationSucceededRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest): google.cloud.recommender.v1.MarkRecommendationSucceededRequest; + + /** + * Encodes the specified MarkRecommendationSucceededRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationSucceededRequest.verify|verify} messages. + * @param message MarkRecommendationSucceededRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarkRecommendationSucceededRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationSucceededRequest.verify|verify} messages. + * @param message MarkRecommendationSucceededRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarkRecommendationSucceededRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarkRecommendationSucceededRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.MarkRecommendationSucceededRequest; + + /** + * Decodes a MarkRecommendationSucceededRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarkRecommendationSucceededRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.MarkRecommendationSucceededRequest; + + /** + * Verifies a MarkRecommendationSucceededRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarkRecommendationSucceededRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarkRecommendationSucceededRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.MarkRecommendationSucceededRequest; + + /** + * Creates a plain object from a MarkRecommendationSucceededRequest message. Also converts values to other types if specified. + * @param message MarkRecommendationSucceededRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.MarkRecommendationSucceededRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarkRecommendationSucceededRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarkRecommendationSucceededRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MarkRecommendationFailedRequest. */ + interface IMarkRecommendationFailedRequest { + + /** MarkRecommendationFailedRequest name */ + name?: (string|null); + + /** MarkRecommendationFailedRequest stateMetadata */ + stateMetadata?: ({ [k: string]: string }|null); + + /** MarkRecommendationFailedRequest etag */ + etag?: (string|null); + } + + /** Represents a MarkRecommendationFailedRequest. */ + class MarkRecommendationFailedRequest implements IMarkRecommendationFailedRequest { + + /** + * Constructs a new MarkRecommendationFailedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recommender.v1.IMarkRecommendationFailedRequest); + + /** MarkRecommendationFailedRequest name. */ + public name: string; + + /** MarkRecommendationFailedRequest stateMetadata. */ + public stateMetadata: { [k: string]: string }; + + /** MarkRecommendationFailedRequest etag. */ + public etag: string; + + /** + * Creates a new MarkRecommendationFailedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MarkRecommendationFailedRequest instance + */ + public static create(properties?: google.cloud.recommender.v1.IMarkRecommendationFailedRequest): google.cloud.recommender.v1.MarkRecommendationFailedRequest; + + /** + * Encodes the specified MarkRecommendationFailedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationFailedRequest.verify|verify} messages. + * @param message MarkRecommendationFailedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recommender.v1.IMarkRecommendationFailedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarkRecommendationFailedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationFailedRequest.verify|verify} messages. + * @param message MarkRecommendationFailedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recommender.v1.IMarkRecommendationFailedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarkRecommendationFailedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarkRecommendationFailedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recommender.v1.MarkRecommendationFailedRequest; + + /** + * Decodes a MarkRecommendationFailedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarkRecommendationFailedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recommender.v1.MarkRecommendationFailedRequest; + + /** + * Verifies a MarkRecommendationFailedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarkRecommendationFailedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarkRecommendationFailedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recommender.v1.MarkRecommendationFailedRequest; + + /** + * Creates a plain object from a MarkRecommendationFailedRequest message. Also converts values to other types if specified. + * @param message MarkRecommendationFailedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recommender.v1.MarkRecommendationFailedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarkRecommendationFailedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarkRecommendationFailedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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; + } + + /** 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; + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @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; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-recommender/protos/protos.js b/packages/google-cloud-recommender/protos/protos.js new file mode 100644 index 000000000000..da962bb180b3 --- /dev/null +++ b/packages/google-cloud-recommender/protos/protos.js @@ -0,0 +1,19391 @@ +// Copyright 2022 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_recommender_protos || ($protobuf.roots._google_cloud_recommender_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.recommender = (function() { + + /** + * Namespace recommender. + * @memberof google.cloud + * @namespace + */ + var recommender = {}; + + recommender.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.recommender + * @namespace + */ + var v1 = {}; + + v1.Insight = (function() { + + /** + * Properties of an Insight. + * @memberof google.cloud.recommender.v1 + * @interface IInsight + * @property {string|null} [name] Insight name + * @property {string|null} [description] Insight description + * @property {Array.|null} [targetResources] Insight targetResources + * @property {string|null} [insightSubtype] Insight insightSubtype + * @property {google.protobuf.IStruct|null} [content] Insight content + * @property {google.protobuf.ITimestamp|null} [lastRefreshTime] Insight lastRefreshTime + * @property {google.protobuf.IDuration|null} [observationPeriod] Insight observationPeriod + * @property {google.cloud.recommender.v1.IInsightStateInfo|null} [stateInfo] Insight stateInfo + * @property {google.cloud.recommender.v1.Insight.Category|null} [category] Insight category + * @property {string|null} [etag] Insight etag + * @property {Array.|null} [associatedRecommendations] Insight associatedRecommendations + */ + + /** + * Constructs a new Insight. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents an Insight. + * @implements IInsight + * @constructor + * @param {google.cloud.recommender.v1.IInsight=} [properties] Properties to set + */ + function Insight(properties) { + this.targetResources = []; + this.associatedRecommendations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Insight name. + * @member {string} name + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.name = ""; + + /** + * Insight description. + * @member {string} description + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.description = ""; + + /** + * Insight targetResources. + * @member {Array.} targetResources + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.targetResources = $util.emptyArray; + + /** + * Insight insightSubtype. + * @member {string} insightSubtype + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.insightSubtype = ""; + + /** + * Insight content. + * @member {google.protobuf.IStruct|null|undefined} content + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.content = null; + + /** + * Insight lastRefreshTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastRefreshTime + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.lastRefreshTime = null; + + /** + * Insight observationPeriod. + * @member {google.protobuf.IDuration|null|undefined} observationPeriod + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.observationPeriod = null; + + /** + * Insight stateInfo. + * @member {google.cloud.recommender.v1.IInsightStateInfo|null|undefined} stateInfo + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.stateInfo = null; + + /** + * Insight category. + * @member {google.cloud.recommender.v1.Insight.Category} category + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.category = 0; + + /** + * Insight etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.etag = ""; + + /** + * Insight associatedRecommendations. + * @member {Array.} associatedRecommendations + * @memberof google.cloud.recommender.v1.Insight + * @instance + */ + Insight.prototype.associatedRecommendations = $util.emptyArray; + + /** + * Creates a new Insight instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {google.cloud.recommender.v1.IInsight=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Insight} Insight instance + */ + Insight.create = function create(properties) { + return new Insight(properties); + }; + + /** + * Encodes the specified Insight message. Does not implicitly {@link google.cloud.recommender.v1.Insight.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {google.cloud.recommender.v1.IInsight} message Insight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Insight.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.protobuf.Struct.encode(message.content, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastRefreshTime != null && Object.hasOwnProperty.call(message, "lastRefreshTime")) + $root.google.protobuf.Timestamp.encode(message.lastRefreshTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.observationPeriod != null && Object.hasOwnProperty.call(message, "observationPeriod")) + $root.google.protobuf.Duration.encode(message.observationPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.stateInfo != null && Object.hasOwnProperty.call(message, "stateInfo")) + $root.google.cloud.recommender.v1.InsightStateInfo.encode(message.stateInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.category); + if (message.associatedRecommendations != null && message.associatedRecommendations.length) + for (var i = 0; i < message.associatedRecommendations.length; ++i) + $root.google.cloud.recommender.v1.Insight.RecommendationReference.encode(message.associatedRecommendations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.targetResources != null && message.targetResources.length) + for (var i = 0; i < message.targetResources.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.targetResources[i]); + if (message.insightSubtype != null && Object.hasOwnProperty.call(message, "insightSubtype")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.insightSubtype); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Insight message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Insight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {google.cloud.recommender.v1.IInsight} message Insight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Insight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Insight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Insight} Insight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Insight.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Insight(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 9: { + if (!(message.targetResources && message.targetResources.length)) + message.targetResources = []; + message.targetResources.push(reader.string()); + break; + } + case 10: { + message.insightSubtype = reader.string(); + break; + } + case 3: { + message.content = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lastRefreshTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.observationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.stateInfo = $root.google.cloud.recommender.v1.InsightStateInfo.decode(reader, reader.uint32()); + break; + } + case 7: { + message.category = reader.int32(); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 8: { + if (!(message.associatedRecommendations && message.associatedRecommendations.length)) + message.associatedRecommendations = []; + message.associatedRecommendations.push($root.google.cloud.recommender.v1.Insight.RecommendationReference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Insight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Insight} Insight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Insight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Insight message. + * @function verify + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Insight.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.targetResources != null && message.hasOwnProperty("targetResources")) { + if (!Array.isArray(message.targetResources)) + return "targetResources: array expected"; + for (var i = 0; i < message.targetResources.length; ++i) + if (!$util.isString(message.targetResources[i])) + return "targetResources: string[] expected"; + } + if (message.insightSubtype != null && message.hasOwnProperty("insightSubtype")) + if (!$util.isString(message.insightSubtype)) + return "insightSubtype: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.protobuf.Struct.verify(message.content); + if (error) + return "content." + error; + } + if (message.lastRefreshTime != null && message.hasOwnProperty("lastRefreshTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastRefreshTime); + if (error) + return "lastRefreshTime." + error; + } + if (message.observationPeriod != null && message.hasOwnProperty("observationPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.observationPeriod); + if (error) + return "observationPeriod." + error; + } + if (message.stateInfo != null && message.hasOwnProperty("stateInfo")) { + var error = $root.google.cloud.recommender.v1.InsightStateInfo.verify(message.stateInfo); + if (error) + return "stateInfo." + error; + } + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.associatedRecommendations != null && message.hasOwnProperty("associatedRecommendations")) { + if (!Array.isArray(message.associatedRecommendations)) + return "associatedRecommendations: array expected"; + for (var i = 0; i < message.associatedRecommendations.length; ++i) { + var error = $root.google.cloud.recommender.v1.Insight.RecommendationReference.verify(message.associatedRecommendations[i]); + if (error) + return "associatedRecommendations." + error; + } + } + return null; + }; + + /** + * Creates an Insight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Insight} Insight + */ + Insight.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Insight) + return object; + var message = new $root.google.cloud.recommender.v1.Insight(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.targetResources) { + if (!Array.isArray(object.targetResources)) + throw TypeError(".google.cloud.recommender.v1.Insight.targetResources: array expected"); + message.targetResources = []; + for (var i = 0; i < object.targetResources.length; ++i) + message.targetResources[i] = String(object.targetResources[i]); + } + if (object.insightSubtype != null) + message.insightSubtype = String(object.insightSubtype); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.recommender.v1.Insight.content: object expected"); + message.content = $root.google.protobuf.Struct.fromObject(object.content); + } + if (object.lastRefreshTime != null) { + if (typeof object.lastRefreshTime !== "object") + throw TypeError(".google.cloud.recommender.v1.Insight.lastRefreshTime: object expected"); + message.lastRefreshTime = $root.google.protobuf.Timestamp.fromObject(object.lastRefreshTime); + } + if (object.observationPeriod != null) { + if (typeof object.observationPeriod !== "object") + throw TypeError(".google.cloud.recommender.v1.Insight.observationPeriod: object expected"); + message.observationPeriod = $root.google.protobuf.Duration.fromObject(object.observationPeriod); + } + if (object.stateInfo != null) { + if (typeof object.stateInfo !== "object") + throw TypeError(".google.cloud.recommender.v1.Insight.stateInfo: object expected"); + message.stateInfo = $root.google.cloud.recommender.v1.InsightStateInfo.fromObject(object.stateInfo); + } + switch (object.category) { + case "CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "COST": + case 1: + message.category = 1; + break; + case "SECURITY": + case 2: + message.category = 2; + break; + case "PERFORMANCE": + case 3: + message.category = 3; + break; + case "MANAGEABILITY": + case 4: + message.category = 4; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.associatedRecommendations) { + if (!Array.isArray(object.associatedRecommendations)) + throw TypeError(".google.cloud.recommender.v1.Insight.associatedRecommendations: array expected"); + message.associatedRecommendations = []; + for (var i = 0; i < object.associatedRecommendations.length; ++i) { + if (typeof object.associatedRecommendations[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.Insight.associatedRecommendations: object expected"); + message.associatedRecommendations[i] = $root.google.cloud.recommender.v1.Insight.RecommendationReference.fromObject(object.associatedRecommendations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Insight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {google.cloud.recommender.v1.Insight} message Insight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Insight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedRecommendations = []; + object.targetResources = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.content = null; + object.lastRefreshTime = null; + object.observationPeriod = null; + object.stateInfo = null; + object.category = options.enums === String ? "CATEGORY_UNSPECIFIED" : 0; + object.insightSubtype = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.protobuf.Struct.toObject(message.content, options); + if (message.lastRefreshTime != null && message.hasOwnProperty("lastRefreshTime")) + object.lastRefreshTime = $root.google.protobuf.Timestamp.toObject(message.lastRefreshTime, options); + if (message.observationPeriod != null && message.hasOwnProperty("observationPeriod")) + object.observationPeriod = $root.google.protobuf.Duration.toObject(message.observationPeriod, options); + if (message.stateInfo != null && message.hasOwnProperty("stateInfo")) + object.stateInfo = $root.google.cloud.recommender.v1.InsightStateInfo.toObject(message.stateInfo, options); + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.recommender.v1.Insight.Category[message.category] : message.category; + if (message.associatedRecommendations && message.associatedRecommendations.length) { + object.associatedRecommendations = []; + for (var j = 0; j < message.associatedRecommendations.length; ++j) + object.associatedRecommendations[j] = $root.google.cloud.recommender.v1.Insight.RecommendationReference.toObject(message.associatedRecommendations[j], options); + } + if (message.targetResources && message.targetResources.length) { + object.targetResources = []; + for (var j = 0; j < message.targetResources.length; ++j) + object.targetResources[j] = message.targetResources[j]; + } + if (message.insightSubtype != null && message.hasOwnProperty("insightSubtype")) + object.insightSubtype = message.insightSubtype; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Insight to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Insight + * @instance + * @returns {Object.} JSON object + */ + Insight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Insight + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Insight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Insight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Insight"; + }; + + Insight.RecommendationReference = (function() { + + /** + * Properties of a RecommendationReference. + * @memberof google.cloud.recommender.v1.Insight + * @interface IRecommendationReference + * @property {string|null} [recommendation] RecommendationReference recommendation + */ + + /** + * Constructs a new RecommendationReference. + * @memberof google.cloud.recommender.v1.Insight + * @classdesc Represents a RecommendationReference. + * @implements IRecommendationReference + * @constructor + * @param {google.cloud.recommender.v1.Insight.IRecommendationReference=} [properties] Properties to set + */ + function RecommendationReference(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]]; + } + + /** + * RecommendationReference recommendation. + * @member {string} recommendation + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @instance + */ + RecommendationReference.prototype.recommendation = ""; + + /** + * Creates a new RecommendationReference instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {google.cloud.recommender.v1.Insight.IRecommendationReference=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Insight.RecommendationReference} RecommendationReference instance + */ + RecommendationReference.create = function create(properties) { + return new RecommendationReference(properties); + }; + + /** + * Encodes the specified RecommendationReference message. Does not implicitly {@link google.cloud.recommender.v1.Insight.RecommendationReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {google.cloud.recommender.v1.Insight.IRecommendationReference} message RecommendationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recommendation != null && Object.hasOwnProperty.call(message, "recommendation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recommendation); + return writer; + }; + + /** + * Encodes the specified RecommendationReference message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Insight.RecommendationReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {google.cloud.recommender.v1.Insight.IRecommendationReference} message RecommendationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecommendationReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Insight.RecommendationReference} RecommendationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Insight.RecommendationReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recommendation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecommendationReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Insight.RecommendationReference} RecommendationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecommendationReference message. + * @function verify + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecommendationReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recommendation != null && message.hasOwnProperty("recommendation")) + if (!$util.isString(message.recommendation)) + return "recommendation: string expected"; + return null; + }; + + /** + * Creates a RecommendationReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Insight.RecommendationReference} RecommendationReference + */ + RecommendationReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Insight.RecommendationReference) + return object; + var message = new $root.google.cloud.recommender.v1.Insight.RecommendationReference(); + if (object.recommendation != null) + message.recommendation = String(object.recommendation); + return message; + }; + + /** + * Creates a plain object from a RecommendationReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {google.cloud.recommender.v1.Insight.RecommendationReference} message RecommendationReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecommendationReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recommendation = ""; + if (message.recommendation != null && message.hasOwnProperty("recommendation")) + object.recommendation = message.recommendation; + return object; + }; + + /** + * Converts this RecommendationReference to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @instance + * @returns {Object.} JSON object + */ + RecommendationReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecommendationReference + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Insight.RecommendationReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecommendationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Insight.RecommendationReference"; + }; + + return RecommendationReference; + })(); + + /** + * Category enum. + * @name google.cloud.recommender.v1.Insight.Category + * @enum {number} + * @property {number} CATEGORY_UNSPECIFIED=0 CATEGORY_UNSPECIFIED value + * @property {number} COST=1 COST value + * @property {number} SECURITY=2 SECURITY value + * @property {number} PERFORMANCE=3 PERFORMANCE value + * @property {number} MANAGEABILITY=4 MANAGEABILITY value + */ + Insight.Category = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "COST"] = 1; + values[valuesById[2] = "SECURITY"] = 2; + values[valuesById[3] = "PERFORMANCE"] = 3; + values[valuesById[4] = "MANAGEABILITY"] = 4; + return values; + })(); + + return Insight; + })(); + + v1.InsightStateInfo = (function() { + + /** + * Properties of an InsightStateInfo. + * @memberof google.cloud.recommender.v1 + * @interface IInsightStateInfo + * @property {google.cloud.recommender.v1.InsightStateInfo.State|null} [state] InsightStateInfo state + * @property {Object.|null} [stateMetadata] InsightStateInfo stateMetadata + */ + + /** + * Constructs a new InsightStateInfo. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents an InsightStateInfo. + * @implements IInsightStateInfo + * @constructor + * @param {google.cloud.recommender.v1.IInsightStateInfo=} [properties] Properties to set + */ + function InsightStateInfo(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsightStateInfo state. + * @member {google.cloud.recommender.v1.InsightStateInfo.State} state + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @instance + */ + InsightStateInfo.prototype.state = 0; + + /** + * InsightStateInfo stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @instance + */ + InsightStateInfo.prototype.stateMetadata = $util.emptyObject; + + /** + * Creates a new InsightStateInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {google.cloud.recommender.v1.IInsightStateInfo=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.InsightStateInfo} InsightStateInfo instance + */ + InsightStateInfo.create = function create(properties) { + return new InsightStateInfo(properties); + }; + + /** + * Encodes the specified InsightStateInfo message. Does not implicitly {@link google.cloud.recommender.v1.InsightStateInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {google.cloud.recommender.v1.IInsightStateInfo} message InsightStateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightStateInfo.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsightStateInfo message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.InsightStateInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {google.cloud.recommender.v1.IInsightStateInfo} message InsightStateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightStateInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsightStateInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.InsightStateInfo} InsightStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightStateInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.InsightStateInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsightStateInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.InsightStateInfo} InsightStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightStateInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsightStateInfo message. + * @function verify + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsightStateInfo.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: + break; + } + if (message.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InsightStateInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.InsightStateInfo} InsightStateInfo + */ + InsightStateInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.InsightStateInfo) + return object; + var message = new $root.google.cloud.recommender.v1.InsightStateInfo(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "ACCEPTED": + case 2: + message.state = 2; + break; + case "DISMISSED": + case 3: + message.state = 3; + break; + } + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.InsightStateInfo.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InsightStateInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {google.cloud.recommender.v1.InsightStateInfo} message InsightStateInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsightStateInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.recommender.v1.InsightStateInfo.State[message.state] : message.state; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this InsightStateInfo to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @instance + * @returns {Object.} JSON object + */ + InsightStateInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsightStateInfo + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.InsightStateInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsightStateInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.InsightStateInfo"; + }; + + /** + * State enum. + * @name google.cloud.recommender.v1.InsightStateInfo.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} ACCEPTED=2 ACCEPTED value + * @property {number} DISMISSED=3 DISMISSED value + */ + InsightStateInfo.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "ACCEPTED"] = 2; + values[valuesById[3] = "DISMISSED"] = 3; + return values; + })(); + + return InsightStateInfo; + })(); + + v1.Recommendation = (function() { + + /** + * Properties of a Recommendation. + * @memberof google.cloud.recommender.v1 + * @interface IRecommendation + * @property {string|null} [name] Recommendation name + * @property {string|null} [description] Recommendation description + * @property {string|null} [recommenderSubtype] Recommendation recommenderSubtype + * @property {google.protobuf.ITimestamp|null} [lastRefreshTime] Recommendation lastRefreshTime + * @property {google.cloud.recommender.v1.IImpact|null} [primaryImpact] Recommendation primaryImpact + * @property {Array.|null} [additionalImpact] Recommendation additionalImpact + * @property {google.cloud.recommender.v1.IRecommendationContent|null} [content] Recommendation content + * @property {google.cloud.recommender.v1.IRecommendationStateInfo|null} [stateInfo] Recommendation stateInfo + * @property {string|null} [etag] Recommendation etag + * @property {Array.|null} [associatedInsights] Recommendation associatedInsights + */ + + /** + * Constructs a new Recommendation. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a Recommendation. + * @implements IRecommendation + * @constructor + * @param {google.cloud.recommender.v1.IRecommendation=} [properties] Properties to set + */ + function Recommendation(properties) { + this.additionalImpact = []; + this.associatedInsights = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Recommendation name. + * @member {string} name + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.name = ""; + + /** + * Recommendation description. + * @member {string} description + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.description = ""; + + /** + * Recommendation recommenderSubtype. + * @member {string} recommenderSubtype + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.recommenderSubtype = ""; + + /** + * Recommendation lastRefreshTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastRefreshTime + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.lastRefreshTime = null; + + /** + * Recommendation primaryImpact. + * @member {google.cloud.recommender.v1.IImpact|null|undefined} primaryImpact + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.primaryImpact = null; + + /** + * Recommendation additionalImpact. + * @member {Array.} additionalImpact + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.additionalImpact = $util.emptyArray; + + /** + * Recommendation content. + * @member {google.cloud.recommender.v1.IRecommendationContent|null|undefined} content + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.content = null; + + /** + * Recommendation stateInfo. + * @member {google.cloud.recommender.v1.IRecommendationStateInfo|null|undefined} stateInfo + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.stateInfo = null; + + /** + * Recommendation etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.etag = ""; + + /** + * Recommendation associatedInsights. + * @member {Array.} associatedInsights + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + */ + Recommendation.prototype.associatedInsights = $util.emptyArray; + + /** + * Creates a new Recommendation instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {google.cloud.recommender.v1.IRecommendation=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Recommendation} Recommendation instance + */ + Recommendation.create = function create(properties) { + return new Recommendation(properties); + }; + + /** + * Encodes the specified Recommendation message. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {google.cloud.recommender.v1.IRecommendation} message Recommendation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recommendation.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.lastRefreshTime != null && Object.hasOwnProperty.call(message, "lastRefreshTime")) + $root.google.protobuf.Timestamp.encode(message.lastRefreshTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.primaryImpact != null && Object.hasOwnProperty.call(message, "primaryImpact")) + $root.google.cloud.recommender.v1.Impact.encode(message.primaryImpact, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.additionalImpact != null && message.additionalImpact.length) + for (var i = 0; i < message.additionalImpact.length; ++i) + $root.google.cloud.recommender.v1.Impact.encode(message.additionalImpact[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.recommender.v1.RecommendationContent.encode(message.content, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.stateInfo != null && Object.hasOwnProperty.call(message, "stateInfo")) + $root.google.cloud.recommender.v1.RecommendationStateInfo.encode(message.stateInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.recommenderSubtype != null && Object.hasOwnProperty.call(message, "recommenderSubtype")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.recommenderSubtype); + if (message.associatedInsights != null && message.associatedInsights.length) + for (var i = 0; i < message.associatedInsights.length; ++i) + $root.google.cloud.recommender.v1.Recommendation.InsightReference.encode(message.associatedInsights[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Recommendation message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {google.cloud.recommender.v1.IRecommendation} message Recommendation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recommendation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Recommendation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Recommendation} Recommendation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recommendation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Recommendation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 12: { + message.recommenderSubtype = reader.string(); + break; + } + case 4: { + message.lastRefreshTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.primaryImpact = $root.google.cloud.recommender.v1.Impact.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.additionalImpact && message.additionalImpact.length)) + message.additionalImpact = []; + message.additionalImpact.push($root.google.cloud.recommender.v1.Impact.decode(reader, reader.uint32())); + break; + } + case 7: { + message.content = $root.google.cloud.recommender.v1.RecommendationContent.decode(reader, reader.uint32()); + break; + } + case 10: { + message.stateInfo = $root.google.cloud.recommender.v1.RecommendationStateInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 14: { + if (!(message.associatedInsights && message.associatedInsights.length)) + message.associatedInsights = []; + message.associatedInsights.push($root.google.cloud.recommender.v1.Recommendation.InsightReference.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Recommendation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Recommendation} Recommendation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recommendation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Recommendation message. + * @function verify + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Recommendation.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.recommenderSubtype != null && message.hasOwnProperty("recommenderSubtype")) + if (!$util.isString(message.recommenderSubtype)) + return "recommenderSubtype: string expected"; + if (message.lastRefreshTime != null && message.hasOwnProperty("lastRefreshTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastRefreshTime); + if (error) + return "lastRefreshTime." + error; + } + if (message.primaryImpact != null && message.hasOwnProperty("primaryImpact")) { + var error = $root.google.cloud.recommender.v1.Impact.verify(message.primaryImpact); + if (error) + return "primaryImpact." + error; + } + if (message.additionalImpact != null && message.hasOwnProperty("additionalImpact")) { + if (!Array.isArray(message.additionalImpact)) + return "additionalImpact: array expected"; + for (var i = 0; i < message.additionalImpact.length; ++i) { + var error = $root.google.cloud.recommender.v1.Impact.verify(message.additionalImpact[i]); + if (error) + return "additionalImpact." + error; + } + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.recommender.v1.RecommendationContent.verify(message.content); + if (error) + return "content." + error; + } + if (message.stateInfo != null && message.hasOwnProperty("stateInfo")) { + var error = $root.google.cloud.recommender.v1.RecommendationStateInfo.verify(message.stateInfo); + if (error) + return "stateInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.associatedInsights != null && message.hasOwnProperty("associatedInsights")) { + if (!Array.isArray(message.associatedInsights)) + return "associatedInsights: array expected"; + for (var i = 0; i < message.associatedInsights.length; ++i) { + var error = $root.google.cloud.recommender.v1.Recommendation.InsightReference.verify(message.associatedInsights[i]); + if (error) + return "associatedInsights." + error; + } + } + return null; + }; + + /** + * Creates a Recommendation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Recommendation} Recommendation + */ + Recommendation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Recommendation) + return object; + var message = new $root.google.cloud.recommender.v1.Recommendation(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.recommenderSubtype != null) + message.recommenderSubtype = String(object.recommenderSubtype); + if (object.lastRefreshTime != null) { + if (typeof object.lastRefreshTime !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.lastRefreshTime: object expected"); + message.lastRefreshTime = $root.google.protobuf.Timestamp.fromObject(object.lastRefreshTime); + } + if (object.primaryImpact != null) { + if (typeof object.primaryImpact !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.primaryImpact: object expected"); + message.primaryImpact = $root.google.cloud.recommender.v1.Impact.fromObject(object.primaryImpact); + } + if (object.additionalImpact) { + if (!Array.isArray(object.additionalImpact)) + throw TypeError(".google.cloud.recommender.v1.Recommendation.additionalImpact: array expected"); + message.additionalImpact = []; + for (var i = 0; i < object.additionalImpact.length; ++i) { + if (typeof object.additionalImpact[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.additionalImpact: object expected"); + message.additionalImpact[i] = $root.google.cloud.recommender.v1.Impact.fromObject(object.additionalImpact[i]); + } + } + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.content: object expected"); + message.content = $root.google.cloud.recommender.v1.RecommendationContent.fromObject(object.content); + } + if (object.stateInfo != null) { + if (typeof object.stateInfo !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.stateInfo: object expected"); + message.stateInfo = $root.google.cloud.recommender.v1.RecommendationStateInfo.fromObject(object.stateInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.associatedInsights) { + if (!Array.isArray(object.associatedInsights)) + throw TypeError(".google.cloud.recommender.v1.Recommendation.associatedInsights: array expected"); + message.associatedInsights = []; + for (var i = 0; i < object.associatedInsights.length; ++i) { + if (typeof object.associatedInsights[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.Recommendation.associatedInsights: object expected"); + message.associatedInsights[i] = $root.google.cloud.recommender.v1.Recommendation.InsightReference.fromObject(object.associatedInsights[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Recommendation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {google.cloud.recommender.v1.Recommendation} message Recommendation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Recommendation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.additionalImpact = []; + object.associatedInsights = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.lastRefreshTime = null; + object.primaryImpact = null; + object.content = null; + object.stateInfo = null; + object.etag = ""; + object.recommenderSubtype = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.lastRefreshTime != null && message.hasOwnProperty("lastRefreshTime")) + object.lastRefreshTime = $root.google.protobuf.Timestamp.toObject(message.lastRefreshTime, options); + if (message.primaryImpact != null && message.hasOwnProperty("primaryImpact")) + object.primaryImpact = $root.google.cloud.recommender.v1.Impact.toObject(message.primaryImpact, options); + if (message.additionalImpact && message.additionalImpact.length) { + object.additionalImpact = []; + for (var j = 0; j < message.additionalImpact.length; ++j) + object.additionalImpact[j] = $root.google.cloud.recommender.v1.Impact.toObject(message.additionalImpact[j], options); + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.recommender.v1.RecommendationContent.toObject(message.content, options); + if (message.stateInfo != null && message.hasOwnProperty("stateInfo")) + object.stateInfo = $root.google.cloud.recommender.v1.RecommendationStateInfo.toObject(message.stateInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.recommenderSubtype != null && message.hasOwnProperty("recommenderSubtype")) + object.recommenderSubtype = message.recommenderSubtype; + if (message.associatedInsights && message.associatedInsights.length) { + object.associatedInsights = []; + for (var j = 0; j < message.associatedInsights.length; ++j) + object.associatedInsights[j] = $root.google.cloud.recommender.v1.Recommendation.InsightReference.toObject(message.associatedInsights[j], options); + } + return object; + }; + + /** + * Converts this Recommendation to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Recommendation + * @instance + * @returns {Object.} JSON object + */ + Recommendation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Recommendation + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Recommendation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Recommendation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Recommendation"; + }; + + Recommendation.InsightReference = (function() { + + /** + * Properties of an InsightReference. + * @memberof google.cloud.recommender.v1.Recommendation + * @interface IInsightReference + * @property {string|null} [insight] InsightReference insight + */ + + /** + * Constructs a new InsightReference. + * @memberof google.cloud.recommender.v1.Recommendation + * @classdesc Represents an InsightReference. + * @implements IInsightReference + * @constructor + * @param {google.cloud.recommender.v1.Recommendation.IInsightReference=} [properties] Properties to set + */ + function InsightReference(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]]; + } + + /** + * InsightReference insight. + * @member {string} insight + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @instance + */ + InsightReference.prototype.insight = ""; + + /** + * Creates a new InsightReference instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {google.cloud.recommender.v1.Recommendation.IInsightReference=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Recommendation.InsightReference} InsightReference instance + */ + InsightReference.create = function create(properties) { + return new InsightReference(properties); + }; + + /** + * Encodes the specified InsightReference message. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.InsightReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {google.cloud.recommender.v1.Recommendation.IInsightReference} message InsightReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insight != null && Object.hasOwnProperty.call(message, "insight")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.insight); + return writer; + }; + + /** + * Encodes the specified InsightReference message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Recommendation.InsightReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {google.cloud.recommender.v1.Recommendation.IInsightReference} message InsightReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsightReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsightReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Recommendation.InsightReference} InsightReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Recommendation.InsightReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.insight = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsightReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Recommendation.InsightReference} InsightReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsightReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsightReference message. + * @function verify + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsightReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.insight != null && message.hasOwnProperty("insight")) + if (!$util.isString(message.insight)) + return "insight: string expected"; + return null; + }; + + /** + * Creates an InsightReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Recommendation.InsightReference} InsightReference + */ + InsightReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Recommendation.InsightReference) + return object; + var message = new $root.google.cloud.recommender.v1.Recommendation.InsightReference(); + if (object.insight != null) + message.insight = String(object.insight); + return message; + }; + + /** + * Creates a plain object from an InsightReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {google.cloud.recommender.v1.Recommendation.InsightReference} message InsightReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsightReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.insight = ""; + if (message.insight != null && message.hasOwnProperty("insight")) + object.insight = message.insight; + return object; + }; + + /** + * Converts this InsightReference to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @instance + * @returns {Object.} JSON object + */ + InsightReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsightReference + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Recommendation.InsightReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsightReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Recommendation.InsightReference"; + }; + + return InsightReference; + })(); + + return Recommendation; + })(); + + v1.RecommendationContent = (function() { + + /** + * Properties of a RecommendationContent. + * @memberof google.cloud.recommender.v1 + * @interface IRecommendationContent + * @property {Array.|null} [operationGroups] RecommendationContent operationGroups + */ + + /** + * Constructs a new RecommendationContent. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a RecommendationContent. + * @implements IRecommendationContent + * @constructor + * @param {google.cloud.recommender.v1.IRecommendationContent=} [properties] Properties to set + */ + function RecommendationContent(properties) { + this.operationGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecommendationContent operationGroups. + * @member {Array.} operationGroups + * @memberof google.cloud.recommender.v1.RecommendationContent + * @instance + */ + RecommendationContent.prototype.operationGroups = $util.emptyArray; + + /** + * Creates a new RecommendationContent instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {google.cloud.recommender.v1.IRecommendationContent=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.RecommendationContent} RecommendationContent instance + */ + RecommendationContent.create = function create(properties) { + return new RecommendationContent(properties); + }; + + /** + * Encodes the specified RecommendationContent message. Does not implicitly {@link google.cloud.recommender.v1.RecommendationContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {google.cloud.recommender.v1.IRecommendationContent} message RecommendationContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationGroups != null && message.operationGroups.length) + for (var i = 0; i < message.operationGroups.length; ++i) + $root.google.cloud.recommender.v1.OperationGroup.encode(message.operationGroups[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecommendationContent message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.RecommendationContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {google.cloud.recommender.v1.IRecommendationContent} message RecommendationContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecommendationContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.RecommendationContent} RecommendationContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.RecommendationContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.operationGroups && message.operationGroups.length)) + message.operationGroups = []; + message.operationGroups.push($root.google.cloud.recommender.v1.OperationGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecommendationContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.RecommendationContent} RecommendationContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecommendationContent message. + * @function verify + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecommendationContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationGroups != null && message.hasOwnProperty("operationGroups")) { + if (!Array.isArray(message.operationGroups)) + return "operationGroups: array expected"; + for (var i = 0; i < message.operationGroups.length; ++i) { + var error = $root.google.cloud.recommender.v1.OperationGroup.verify(message.operationGroups[i]); + if (error) + return "operationGroups." + error; + } + } + return null; + }; + + /** + * Creates a RecommendationContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.RecommendationContent} RecommendationContent + */ + RecommendationContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.RecommendationContent) + return object; + var message = new $root.google.cloud.recommender.v1.RecommendationContent(); + if (object.operationGroups) { + if (!Array.isArray(object.operationGroups)) + throw TypeError(".google.cloud.recommender.v1.RecommendationContent.operationGroups: array expected"); + message.operationGroups = []; + for (var i = 0; i < object.operationGroups.length; ++i) { + if (typeof object.operationGroups[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.RecommendationContent.operationGroups: object expected"); + message.operationGroups[i] = $root.google.cloud.recommender.v1.OperationGroup.fromObject(object.operationGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RecommendationContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {google.cloud.recommender.v1.RecommendationContent} message RecommendationContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecommendationContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operationGroups = []; + if (message.operationGroups && message.operationGroups.length) { + object.operationGroups = []; + for (var j = 0; j < message.operationGroups.length; ++j) + object.operationGroups[j] = $root.google.cloud.recommender.v1.OperationGroup.toObject(message.operationGroups[j], options); + } + return object; + }; + + /** + * Converts this RecommendationContent to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.RecommendationContent + * @instance + * @returns {Object.} JSON object + */ + RecommendationContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecommendationContent + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.RecommendationContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecommendationContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.RecommendationContent"; + }; + + return RecommendationContent; + })(); + + v1.OperationGroup = (function() { + + /** + * Properties of an OperationGroup. + * @memberof google.cloud.recommender.v1 + * @interface IOperationGroup + * @property {Array.|null} [operations] OperationGroup operations + */ + + /** + * Constructs a new OperationGroup. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents an OperationGroup. + * @implements IOperationGroup + * @constructor + * @param {google.cloud.recommender.v1.IOperationGroup=} [properties] Properties to set + */ + function OperationGroup(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationGroup operations. + * @member {Array.} operations + * @memberof google.cloud.recommender.v1.OperationGroup + * @instance + */ + OperationGroup.prototype.operations = $util.emptyArray; + + /** + * Creates a new OperationGroup instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {google.cloud.recommender.v1.IOperationGroup=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.OperationGroup} OperationGroup instance + */ + OperationGroup.create = function create(properties) { + return new OperationGroup(properties); + }; + + /** + * Encodes the specified OperationGroup message. Does not implicitly {@link google.cloud.recommender.v1.OperationGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {google.cloud.recommender.v1.IOperationGroup} message OperationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.cloud.recommender.v1.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationGroup message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.OperationGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {google.cloud.recommender.v1.IOperationGroup} message OperationGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.OperationGroup} OperationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.OperationGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.cloud.recommender.v1.Operation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.OperationGroup} OperationGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationGroup message. + * @function verify + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.cloud.recommender.v1.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + return null; + }; + + /** + * Creates an OperationGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.OperationGroup} OperationGroup + */ + OperationGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.OperationGroup) + return object; + var message = new $root.google.cloud.recommender.v1.OperationGroup(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.cloud.recommender.v1.OperationGroup.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.OperationGroup.operations: object expected"); + message.operations[i] = $root.google.cloud.recommender.v1.Operation.fromObject(object.operations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OperationGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {google.cloud.recommender.v1.OperationGroup} message OperationGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.cloud.recommender.v1.Operation.toObject(message.operations[j], options); + } + return object; + }; + + /** + * Converts this OperationGroup to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.OperationGroup + * @instance + * @returns {Object.} JSON object + */ + OperationGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationGroup + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.OperationGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.OperationGroup"; + }; + + return OperationGroup; + })(); + + v1.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.cloud.recommender.v1 + * @interface IOperation + * @property {string|null} [action] Operation action + * @property {string|null} [resourceType] Operation resourceType + * @property {string|null} [resource] Operation resource + * @property {string|null} [path] Operation path + * @property {string|null} [sourceResource] Operation sourceResource + * @property {string|null} [sourcePath] Operation sourcePath + * @property {google.protobuf.IValue|null} [value] Operation value + * @property {google.cloud.recommender.v1.IValueMatcher|null} [valueMatcher] Operation valueMatcher + * @property {Object.|null} [pathFilters] Operation pathFilters + * @property {Object.|null} [pathValueMatchers] Operation pathValueMatchers + */ + + /** + * Constructs a new Operation. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.cloud.recommender.v1.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + this.pathFilters = {}; + this.pathValueMatchers = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation action. + * @member {string} action + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.action = ""; + + /** + * Operation resourceType. + * @member {string} resourceType + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.resourceType = ""; + + /** + * Operation resource. + * @member {string} resource + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.resource = ""; + + /** + * Operation path. + * @member {string} path + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.path = ""; + + /** + * Operation sourceResource. + * @member {string} sourceResource + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.sourceResource = ""; + + /** + * Operation sourcePath. + * @member {string} sourcePath + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.sourcePath = ""; + + /** + * Operation value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.value = null; + + /** + * Operation valueMatcher. + * @member {google.cloud.recommender.v1.IValueMatcher|null|undefined} valueMatcher + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.valueMatcher = null; + + /** + * Operation pathFilters. + * @member {Object.} pathFilters + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.pathFilters = $util.emptyObject; + + /** + * Operation pathValueMatchers. + * @member {Object.} pathValueMatchers + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Operation.prototype.pathValueMatchers = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation pathValue. + * @member {"value"|"valueMatcher"|undefined} pathValue + * @memberof google.cloud.recommender.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "pathValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "valueMatcher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {google.cloud.recommender.v1.IOperation=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.cloud.recommender.v1.Operation.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {google.cloud.recommender.v1.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.path); + if (message.sourceResource != null && Object.hasOwnProperty.call(message, "sourceResource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceResource); + if (message.sourcePath != null && Object.hasOwnProperty.call(message, "sourcePath")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sourcePath); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pathFilters != null && Object.hasOwnProperty.call(message, "pathFilters")) + for (var keys = Object.keys(message.pathFilters), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.pathFilters[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.valueMatcher != null && Object.hasOwnProperty.call(message, "valueMatcher")) + $root.google.cloud.recommender.v1.ValueMatcher.encode(message.valueMatcher, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.pathValueMatchers != null && Object.hasOwnProperty.call(message, "pathValueMatchers")) + for (var keys = Object.keys(message.pathValueMatchers), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.recommender.v1.ValueMatcher.encode(message.pathValueMatchers[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {google.cloud.recommender.v1.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Operation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.path = reader.string(); + break; + } + case 5: { + message.sourceResource = reader.string(); + break; + } + case 6: { + message.sourcePath = reader.string(); + break; + } + case 7: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 10: { + message.valueMatcher = $root.google.cloud.recommender.v1.ValueMatcher.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.pathFilters === $util.emptyObject) + message.pathFilters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.pathFilters[key] = value; + break; + } + case 11: { + if (message.pathValueMatchers === $util.emptyObject) + message.pathValueMatchers = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.recommender.v1.ValueMatcher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.pathValueMatchers[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.sourceResource != null && message.hasOwnProperty("sourceResource")) + if (!$util.isString(message.sourceResource)) + return "sourceResource: string expected"; + if (message.sourcePath != null && message.hasOwnProperty("sourcePath")) + if (!$util.isString(message.sourcePath)) + return "sourcePath: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + properties.pathValue = 1; + { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + } + if (message.valueMatcher != null && message.hasOwnProperty("valueMatcher")) { + if (properties.pathValue === 1) + return "pathValue: multiple values"; + properties.pathValue = 1; + { + var error = $root.google.cloud.recommender.v1.ValueMatcher.verify(message.valueMatcher); + if (error) + return "valueMatcher." + error; + } + } + if (message.pathFilters != null && message.hasOwnProperty("pathFilters")) { + if (!$util.isObject(message.pathFilters)) + return "pathFilters: object expected"; + var key = Object.keys(message.pathFilters); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.pathFilters[key[i]]); + if (error) + return "pathFilters." + error; + } + } + if (message.pathValueMatchers != null && message.hasOwnProperty("pathValueMatchers")) { + if (!$util.isObject(message.pathValueMatchers)) + return "pathValueMatchers: object expected"; + var key = Object.keys(message.pathValueMatchers); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.recommender.v1.ValueMatcher.verify(message.pathValueMatchers[key[i]]); + if (error) + return "pathValueMatchers." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Operation) + return object; + var message = new $root.google.cloud.recommender.v1.Operation(); + if (object.action != null) + message.action = String(object.action); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resource != null) + message.resource = String(object.resource); + if (object.path != null) + message.path = String(object.path); + if (object.sourceResource != null) + message.sourceResource = String(object.sourceResource); + if (object.sourcePath != null) + message.sourcePath = String(object.sourcePath); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + if (object.valueMatcher != null) { + if (typeof object.valueMatcher !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.valueMatcher: object expected"); + message.valueMatcher = $root.google.cloud.recommender.v1.ValueMatcher.fromObject(object.valueMatcher); + } + if (object.pathFilters) { + if (typeof object.pathFilters !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.pathFilters: object expected"); + message.pathFilters = {}; + for (var keys = Object.keys(object.pathFilters), i = 0; i < keys.length; ++i) { + if (typeof object.pathFilters[keys[i]] !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.pathFilters: object expected"); + message.pathFilters[keys[i]] = $root.google.protobuf.Value.fromObject(object.pathFilters[keys[i]]); + } + } + if (object.pathValueMatchers) { + if (typeof object.pathValueMatchers !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.pathValueMatchers: object expected"); + message.pathValueMatchers = {}; + for (var keys = Object.keys(object.pathValueMatchers), i = 0; i < keys.length; ++i) { + if (typeof object.pathValueMatchers[keys[i]] !== "object") + throw TypeError(".google.cloud.recommender.v1.Operation.pathValueMatchers: object expected"); + message.pathValueMatchers[keys[i]] = $root.google.cloud.recommender.v1.ValueMatcher.fromObject(object.pathValueMatchers[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {google.cloud.recommender.v1.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.pathFilters = {}; + object.pathValueMatchers = {}; + } + if (options.defaults) { + object.action = ""; + object.resourceType = ""; + object.resource = ""; + object.path = ""; + object.sourceResource = ""; + object.sourcePath = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.sourceResource != null && message.hasOwnProperty("sourceResource")) + object.sourceResource = message.sourceResource; + if (message.sourcePath != null && message.hasOwnProperty("sourcePath")) + object.sourcePath = message.sourcePath; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (options.oneofs) + object.pathValue = "value"; + } + var keys2; + if (message.pathFilters && (keys2 = Object.keys(message.pathFilters)).length) { + object.pathFilters = {}; + for (var j = 0; j < keys2.length; ++j) + object.pathFilters[keys2[j]] = $root.google.protobuf.Value.toObject(message.pathFilters[keys2[j]], options); + } + if (message.valueMatcher != null && message.hasOwnProperty("valueMatcher")) { + object.valueMatcher = $root.google.cloud.recommender.v1.ValueMatcher.toObject(message.valueMatcher, options); + if (options.oneofs) + object.pathValue = "valueMatcher"; + } + if (message.pathValueMatchers && (keys2 = Object.keys(message.pathValueMatchers)).length) { + object.pathValueMatchers = {}; + for (var j = 0; j < keys2.length; ++j) + object.pathValueMatchers[keys2[j]] = $root.google.cloud.recommender.v1.ValueMatcher.toObject(message.pathValueMatchers[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Operation"; + }; + + return Operation; + })(); + + v1.ValueMatcher = (function() { + + /** + * Properties of a ValueMatcher. + * @memberof google.cloud.recommender.v1 + * @interface IValueMatcher + * @property {string|null} [matchesPattern] ValueMatcher matchesPattern + */ + + /** + * Constructs a new ValueMatcher. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a ValueMatcher. + * @implements IValueMatcher + * @constructor + * @param {google.cloud.recommender.v1.IValueMatcher=} [properties] Properties to set + */ + function ValueMatcher(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]]; + } + + /** + * ValueMatcher matchesPattern. + * @member {string|null|undefined} matchesPattern + * @memberof google.cloud.recommender.v1.ValueMatcher + * @instance + */ + ValueMatcher.prototype.matchesPattern = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValueMatcher matchVariant. + * @member {"matchesPattern"|undefined} matchVariant + * @memberof google.cloud.recommender.v1.ValueMatcher + * @instance + */ + Object.defineProperty(ValueMatcher.prototype, "matchVariant", { + get: $util.oneOfGetter($oneOfFields = ["matchesPattern"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValueMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {google.cloud.recommender.v1.IValueMatcher=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.ValueMatcher} ValueMatcher instance + */ + ValueMatcher.create = function create(properties) { + return new ValueMatcher(properties); + }; + + /** + * Encodes the specified ValueMatcher message. Does not implicitly {@link google.cloud.recommender.v1.ValueMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {google.cloud.recommender.v1.IValueMatcher} message ValueMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchesPattern != null && Object.hasOwnProperty.call(message, "matchesPattern")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.matchesPattern); + return writer; + }; + + /** + * Encodes the specified ValueMatcher message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ValueMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {google.cloud.recommender.v1.IValueMatcher} message ValueMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.ValueMatcher} ValueMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.ValueMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.matchesPattern = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.ValueMatcher} ValueMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueMatcher message. + * @function verify + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.matchesPattern != null && message.hasOwnProperty("matchesPattern")) { + properties.matchVariant = 1; + if (!$util.isString(message.matchesPattern)) + return "matchesPattern: string expected"; + } + return null; + }; + + /** + * Creates a ValueMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.ValueMatcher} ValueMatcher + */ + ValueMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.ValueMatcher) + return object; + var message = new $root.google.cloud.recommender.v1.ValueMatcher(); + if (object.matchesPattern != null) + message.matchesPattern = String(object.matchesPattern); + return message; + }; + + /** + * Creates a plain object from a ValueMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {google.cloud.recommender.v1.ValueMatcher} message ValueMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.matchesPattern != null && message.hasOwnProperty("matchesPattern")) { + object.matchesPattern = message.matchesPattern; + if (options.oneofs) + object.matchVariant = "matchesPattern"; + } + return object; + }; + + /** + * Converts this ValueMatcher to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.ValueMatcher + * @instance + * @returns {Object.} JSON object + */ + ValueMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValueMatcher + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.ValueMatcher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueMatcher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.ValueMatcher"; + }; + + return ValueMatcher; + })(); + + v1.CostProjection = (function() { + + /** + * Properties of a CostProjection. + * @memberof google.cloud.recommender.v1 + * @interface ICostProjection + * @property {google.type.IMoney|null} [cost] CostProjection cost + * @property {google.protobuf.IDuration|null} [duration] CostProjection duration + */ + + /** + * Constructs a new CostProjection. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a CostProjection. + * @implements ICostProjection + * @constructor + * @param {google.cloud.recommender.v1.ICostProjection=} [properties] Properties to set + */ + function CostProjection(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]]; + } + + /** + * CostProjection cost. + * @member {google.type.IMoney|null|undefined} cost + * @memberof google.cloud.recommender.v1.CostProjection + * @instance + */ + CostProjection.prototype.cost = null; + + /** + * CostProjection duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.recommender.v1.CostProjection + * @instance + */ + CostProjection.prototype.duration = null; + + /** + * Creates a new CostProjection instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {google.cloud.recommender.v1.ICostProjection=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.CostProjection} CostProjection instance + */ + CostProjection.create = function create(properties) { + return new CostProjection(properties); + }; + + /** + * Encodes the specified CostProjection message. Does not implicitly {@link google.cloud.recommender.v1.CostProjection.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {google.cloud.recommender.v1.ICostProjection} message CostProjection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CostProjection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + $root.google.type.Money.encode(message.cost, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CostProjection message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.CostProjection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {google.cloud.recommender.v1.ICostProjection} message CostProjection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CostProjection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CostProjection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.CostProjection} CostProjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CostProjection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.CostProjection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cost = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CostProjection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.CostProjection} CostProjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CostProjection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CostProjection message. + * @function verify + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CostProjection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cost != null && message.hasOwnProperty("cost")) { + var error = $root.google.type.Money.verify(message.cost); + if (error) + return "cost." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a CostProjection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.CostProjection} CostProjection + */ + CostProjection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.CostProjection) + return object; + var message = new $root.google.cloud.recommender.v1.CostProjection(); + if (object.cost != null) { + if (typeof object.cost !== "object") + throw TypeError(".google.cloud.recommender.v1.CostProjection.cost: object expected"); + message.cost = $root.google.type.Money.fromObject(object.cost); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.recommender.v1.CostProjection.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a CostProjection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {google.cloud.recommender.v1.CostProjection} message CostProjection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CostProjection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cost = null; + object.duration = null; + } + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = $root.google.type.Money.toObject(message.cost, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this CostProjection to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.CostProjection + * @instance + * @returns {Object.} JSON object + */ + CostProjection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CostProjection + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.CostProjection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CostProjection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.CostProjection"; + }; + + return CostProjection; + })(); + + v1.Impact = (function() { + + /** + * Properties of an Impact. + * @memberof google.cloud.recommender.v1 + * @interface IImpact + * @property {google.cloud.recommender.v1.Impact.Category|null} [category] Impact category + * @property {google.cloud.recommender.v1.ICostProjection|null} [costProjection] Impact costProjection + */ + + /** + * Constructs a new Impact. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents an Impact. + * @implements IImpact + * @constructor + * @param {google.cloud.recommender.v1.IImpact=} [properties] Properties to set + */ + function Impact(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]]; + } + + /** + * Impact category. + * @member {google.cloud.recommender.v1.Impact.Category} category + * @memberof google.cloud.recommender.v1.Impact + * @instance + */ + Impact.prototype.category = 0; + + /** + * Impact costProjection. + * @member {google.cloud.recommender.v1.ICostProjection|null|undefined} costProjection + * @memberof google.cloud.recommender.v1.Impact + * @instance + */ + Impact.prototype.costProjection = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Impact projection. + * @member {"costProjection"|undefined} projection + * @memberof google.cloud.recommender.v1.Impact + * @instance + */ + Object.defineProperty(Impact.prototype, "projection", { + get: $util.oneOfGetter($oneOfFields = ["costProjection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Impact instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {google.cloud.recommender.v1.IImpact=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.Impact} Impact instance + */ + Impact.create = function create(properties) { + return new Impact(properties); + }; + + /** + * Encodes the specified Impact message. Does not implicitly {@link google.cloud.recommender.v1.Impact.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {google.cloud.recommender.v1.IImpact} message Impact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Impact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.category); + if (message.costProjection != null && Object.hasOwnProperty.call(message, "costProjection")) + $root.google.cloud.recommender.v1.CostProjection.encode(message.costProjection, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.Impact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {google.cloud.recommender.v1.IImpact} message Impact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Impact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Impact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.Impact} Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Impact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.Impact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.category = reader.int32(); + break; + } + case 100: { + message.costProjection = $root.google.cloud.recommender.v1.CostProjection.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Impact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.Impact} Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Impact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Impact message. + * @function verify + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Impact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.costProjection != null && message.hasOwnProperty("costProjection")) { + properties.projection = 1; + { + var error = $root.google.cloud.recommender.v1.CostProjection.verify(message.costProjection); + if (error) + return "costProjection." + error; + } + } + return null; + }; + + /** + * Creates an Impact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.Impact} Impact + */ + Impact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.Impact) + return object; + var message = new $root.google.cloud.recommender.v1.Impact(); + switch (object.category) { + case "CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "COST": + case 1: + message.category = 1; + break; + case "SECURITY": + case 2: + message.category = 2; + break; + case "PERFORMANCE": + case 3: + message.category = 3; + break; + case "MANAGEABILITY": + case 4: + message.category = 4; + break; + } + if (object.costProjection != null) { + if (typeof object.costProjection !== "object") + throw TypeError(".google.cloud.recommender.v1.Impact.costProjection: object expected"); + message.costProjection = $root.google.cloud.recommender.v1.CostProjection.fromObject(object.costProjection); + } + return message; + }; + + /** + * Creates a plain object from an Impact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {google.cloud.recommender.v1.Impact} message Impact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Impact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.category = options.enums === String ? "CATEGORY_UNSPECIFIED" : 0; + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.cloud.recommender.v1.Impact.Category[message.category] : message.category; + if (message.costProjection != null && message.hasOwnProperty("costProjection")) { + object.costProjection = $root.google.cloud.recommender.v1.CostProjection.toObject(message.costProjection, options); + if (options.oneofs) + object.projection = "costProjection"; + } + return object; + }; + + /** + * Converts this Impact to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.Impact + * @instance + * @returns {Object.} JSON object + */ + Impact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Impact + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.Impact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Impact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.Impact"; + }; + + /** + * Category enum. + * @name google.cloud.recommender.v1.Impact.Category + * @enum {number} + * @property {number} CATEGORY_UNSPECIFIED=0 CATEGORY_UNSPECIFIED value + * @property {number} COST=1 COST value + * @property {number} SECURITY=2 SECURITY value + * @property {number} PERFORMANCE=3 PERFORMANCE value + * @property {number} MANAGEABILITY=4 MANAGEABILITY value + */ + Impact.Category = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "COST"] = 1; + values[valuesById[2] = "SECURITY"] = 2; + values[valuesById[3] = "PERFORMANCE"] = 3; + values[valuesById[4] = "MANAGEABILITY"] = 4; + return values; + })(); + + return Impact; + })(); + + v1.RecommendationStateInfo = (function() { + + /** + * Properties of a RecommendationStateInfo. + * @memberof google.cloud.recommender.v1 + * @interface IRecommendationStateInfo + * @property {google.cloud.recommender.v1.RecommendationStateInfo.State|null} [state] RecommendationStateInfo state + * @property {Object.|null} [stateMetadata] RecommendationStateInfo stateMetadata + */ + + /** + * Constructs a new RecommendationStateInfo. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a RecommendationStateInfo. + * @implements IRecommendationStateInfo + * @constructor + * @param {google.cloud.recommender.v1.IRecommendationStateInfo=} [properties] Properties to set + */ + function RecommendationStateInfo(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecommendationStateInfo state. + * @member {google.cloud.recommender.v1.RecommendationStateInfo.State} state + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @instance + */ + RecommendationStateInfo.prototype.state = 0; + + /** + * RecommendationStateInfo stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @instance + */ + RecommendationStateInfo.prototype.stateMetadata = $util.emptyObject; + + /** + * Creates a new RecommendationStateInfo instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {google.cloud.recommender.v1.IRecommendationStateInfo=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.RecommendationStateInfo} RecommendationStateInfo instance + */ + RecommendationStateInfo.create = function create(properties) { + return new RecommendationStateInfo(properties); + }; + + /** + * Encodes the specified RecommendationStateInfo message. Does not implicitly {@link google.cloud.recommender.v1.RecommendationStateInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {google.cloud.recommender.v1.IRecommendationStateInfo} message RecommendationStateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationStateInfo.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecommendationStateInfo message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.RecommendationStateInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {google.cloud.recommender.v1.IRecommendationStateInfo} message RecommendationStateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecommendationStateInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecommendationStateInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.RecommendationStateInfo} RecommendationStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationStateInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.RecommendationStateInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecommendationStateInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.RecommendationStateInfo} RecommendationStateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecommendationStateInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecommendationStateInfo message. + * @function verify + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecommendationStateInfo.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 6: + case 3: + case 4: + case 5: + break; + } + if (message.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a RecommendationStateInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.RecommendationStateInfo} RecommendationStateInfo + */ + RecommendationStateInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.RecommendationStateInfo) + return object; + var message = new $root.google.cloud.recommender.v1.RecommendationStateInfo(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CLAIMED": + case 6: + message.state = 6; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "DISMISSED": + case 5: + message.state = 5; + break; + } + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.RecommendationStateInfo.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a RecommendationStateInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {google.cloud.recommender.v1.RecommendationStateInfo} message RecommendationStateInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecommendationStateInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.recommender.v1.RecommendationStateInfo.State[message.state] : message.state; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this RecommendationStateInfo to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @instance + * @returns {Object.} JSON object + */ + RecommendationStateInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecommendationStateInfo + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.RecommendationStateInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecommendationStateInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.RecommendationStateInfo"; + }; + + /** + * State enum. + * @name google.cloud.recommender.v1.RecommendationStateInfo.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CLAIMED=6 CLAIMED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} DISMISSED=5 DISMISSED value + */ + RecommendationStateInfo.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[6] = "CLAIMED"] = 6; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "DISMISSED"] = 5; + return values; + })(); + + return RecommendationStateInfo; + })(); + + v1.Recommender = (function() { + + /** + * Constructs a new Recommender service. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a Recommender + * @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 Recommender(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Recommender.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Recommender; + + /** + * Creates new Recommender service using the specified rpc implementation. + * @function create + * @memberof google.cloud.recommender.v1.Recommender + * @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 {Recommender} RPC service. Useful where requests and/or responses are streamed. + */ + Recommender.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|listInsights}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef ListInsightsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.ListInsightsResponse} [response] ListInsightsResponse + */ + + /** + * Calls ListInsights. + * @function listInsights + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IListInsightsRequest} request ListInsightsRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.ListInsightsCallback} callback Node-style callback called with the error, if any, and ListInsightsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.listInsights = function listInsights(request, callback) { + return this.rpcCall(listInsights, $root.google.cloud.recommender.v1.ListInsightsRequest, $root.google.cloud.recommender.v1.ListInsightsResponse, request, callback); + }, "name", { value: "ListInsights" }); + + /** + * Calls ListInsights. + * @function listInsights + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IListInsightsRequest} request ListInsightsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|getInsight}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef GetInsightCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Insight} [response] Insight + */ + + /** + * Calls GetInsight. + * @function getInsight + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IGetInsightRequest} request GetInsightRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.GetInsightCallback} callback Node-style callback called with the error, if any, and Insight + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.getInsight = function getInsight(request, callback) { + return this.rpcCall(getInsight, $root.google.cloud.recommender.v1.GetInsightRequest, $root.google.cloud.recommender.v1.Insight, request, callback); + }, "name", { value: "GetInsight" }); + + /** + * Calls GetInsight. + * @function getInsight + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IGetInsightRequest} request GetInsightRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markInsightAccepted}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef MarkInsightAcceptedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Insight} [response] Insight + */ + + /** + * Calls MarkInsightAccepted. + * @function markInsightAccepted + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest} request MarkInsightAcceptedRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.MarkInsightAcceptedCallback} callback Node-style callback called with the error, if any, and Insight + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.markInsightAccepted = function markInsightAccepted(request, callback) { + return this.rpcCall(markInsightAccepted, $root.google.cloud.recommender.v1.MarkInsightAcceptedRequest, $root.google.cloud.recommender.v1.Insight, request, callback); + }, "name", { value: "MarkInsightAccepted" }); + + /** + * Calls MarkInsightAccepted. + * @function markInsightAccepted + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest} request MarkInsightAcceptedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|listRecommendations}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef ListRecommendationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.ListRecommendationsResponse} [response] ListRecommendationsResponse + */ + + /** + * Calls ListRecommendations. + * @function listRecommendations + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IListRecommendationsRequest} request ListRecommendationsRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.ListRecommendationsCallback} callback Node-style callback called with the error, if any, and ListRecommendationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.listRecommendations = function listRecommendations(request, callback) { + return this.rpcCall(listRecommendations, $root.google.cloud.recommender.v1.ListRecommendationsRequest, $root.google.cloud.recommender.v1.ListRecommendationsResponse, request, callback); + }, "name", { value: "ListRecommendations" }); + + /** + * Calls ListRecommendations. + * @function listRecommendations + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IListRecommendationsRequest} request ListRecommendationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|getRecommendation}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef GetRecommendationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Recommendation} [response] Recommendation + */ + + /** + * Calls GetRecommendation. + * @function getRecommendation + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IGetRecommendationRequest} request GetRecommendationRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.GetRecommendationCallback} callback Node-style callback called with the error, if any, and Recommendation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.getRecommendation = function getRecommendation(request, callback) { + return this.rpcCall(getRecommendation, $root.google.cloud.recommender.v1.GetRecommendationRequest, $root.google.cloud.recommender.v1.Recommendation, request, callback); + }, "name", { value: "GetRecommendation" }); + + /** + * Calls GetRecommendation. + * @function getRecommendation + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IGetRecommendationRequest} request GetRecommendationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationClaimed}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef MarkRecommendationClaimedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Recommendation} [response] Recommendation + */ + + /** + * Calls MarkRecommendationClaimed. + * @function markRecommendationClaimed + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest} request MarkRecommendationClaimedRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.MarkRecommendationClaimedCallback} callback Node-style callback called with the error, if any, and Recommendation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.markRecommendationClaimed = function markRecommendationClaimed(request, callback) { + return this.rpcCall(markRecommendationClaimed, $root.google.cloud.recommender.v1.MarkRecommendationClaimedRequest, $root.google.cloud.recommender.v1.Recommendation, request, callback); + }, "name", { value: "MarkRecommendationClaimed" }); + + /** + * Calls MarkRecommendationClaimed. + * @function markRecommendationClaimed + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest} request MarkRecommendationClaimedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationSucceeded}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef MarkRecommendationSucceededCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Recommendation} [response] Recommendation + */ + + /** + * Calls MarkRecommendationSucceeded. + * @function markRecommendationSucceeded + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest} request MarkRecommendationSucceededRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.MarkRecommendationSucceededCallback} callback Node-style callback called with the error, if any, and Recommendation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.markRecommendationSucceeded = function markRecommendationSucceeded(request, callback) { + return this.rpcCall(markRecommendationSucceeded, $root.google.cloud.recommender.v1.MarkRecommendationSucceededRequest, $root.google.cloud.recommender.v1.Recommendation, request, callback); + }, "name", { value: "MarkRecommendationSucceeded" }); + + /** + * Calls MarkRecommendationSucceeded. + * @function markRecommendationSucceeded + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest} request MarkRecommendationSucceededRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.recommender.v1.Recommender|markRecommendationFailed}. + * @memberof google.cloud.recommender.v1.Recommender + * @typedef MarkRecommendationFailedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.recommender.v1.Recommendation} [response] Recommendation + */ + + /** + * Calls MarkRecommendationFailed. + * @function markRecommendationFailed + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest} request MarkRecommendationFailedRequest message or plain object + * @param {google.cloud.recommender.v1.Recommender.MarkRecommendationFailedCallback} callback Node-style callback called with the error, if any, and Recommendation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Recommender.prototype.markRecommendationFailed = function markRecommendationFailed(request, callback) { + return this.rpcCall(markRecommendationFailed, $root.google.cloud.recommender.v1.MarkRecommendationFailedRequest, $root.google.cloud.recommender.v1.Recommendation, request, callback); + }, "name", { value: "MarkRecommendationFailed" }); + + /** + * Calls MarkRecommendationFailed. + * @function markRecommendationFailed + * @memberof google.cloud.recommender.v1.Recommender + * @instance + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest} request MarkRecommendationFailedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Recommender; + })(); + + v1.ListInsightsRequest = (function() { + + /** + * Properties of a ListInsightsRequest. + * @memberof google.cloud.recommender.v1 + * @interface IListInsightsRequest + * @property {string|null} [parent] ListInsightsRequest parent + * @property {number|null} [pageSize] ListInsightsRequest pageSize + * @property {string|null} [pageToken] ListInsightsRequest pageToken + * @property {string|null} [filter] ListInsightsRequest filter + */ + + /** + * Constructs a new ListInsightsRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a ListInsightsRequest. + * @implements IListInsightsRequest + * @constructor + * @param {google.cloud.recommender.v1.IListInsightsRequest=} [properties] Properties to set + */ + function ListInsightsRequest(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]]; + } + + /** + * ListInsightsRequest parent. + * @member {string} parent + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @instance + */ + ListInsightsRequest.prototype.parent = ""; + + /** + * ListInsightsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @instance + */ + ListInsightsRequest.prototype.pageSize = 0; + + /** + * ListInsightsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @instance + */ + ListInsightsRequest.prototype.pageToken = ""; + + /** + * ListInsightsRequest filter. + * @member {string} filter + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @instance + */ + ListInsightsRequest.prototype.filter = ""; + + /** + * Creates a new ListInsightsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {google.cloud.recommender.v1.IListInsightsRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.ListInsightsRequest} ListInsightsRequest instance + */ + ListInsightsRequest.create = function create(properties) { + return new ListInsightsRequest(properties); + }; + + /** + * Encodes the specified ListInsightsRequest message. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {google.cloud.recommender.v1.IListInsightsRequest} message ListInsightsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInsightsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInsightsRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {google.cloud.recommender.v1.IListInsightsRequest} message ListInsightsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInsightsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInsightsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.ListInsightsRequest} ListInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInsightsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.ListInsightsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInsightsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.ListInsightsRequest} ListInsightsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInsightsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInsightsRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInsightsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInsightsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.ListInsightsRequest} ListInsightsRequest + */ + ListInsightsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.ListInsightsRequest) + return object; + var message = new $root.google.cloud.recommender.v1.ListInsightsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInsightsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {google.cloud.recommender.v1.ListInsightsRequest} message ListInsightsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInsightsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInsightsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInsightsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInsightsRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.ListInsightsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInsightsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.ListInsightsRequest"; + }; + + return ListInsightsRequest; + })(); + + v1.ListInsightsResponse = (function() { + + /** + * Properties of a ListInsightsResponse. + * @memberof google.cloud.recommender.v1 + * @interface IListInsightsResponse + * @property {Array.|null} [insights] ListInsightsResponse insights + * @property {string|null} [nextPageToken] ListInsightsResponse nextPageToken + */ + + /** + * Constructs a new ListInsightsResponse. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a ListInsightsResponse. + * @implements IListInsightsResponse + * @constructor + * @param {google.cloud.recommender.v1.IListInsightsResponse=} [properties] Properties to set + */ + function ListInsightsResponse(properties) { + this.insights = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInsightsResponse insights. + * @member {Array.} insights + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @instance + */ + ListInsightsResponse.prototype.insights = $util.emptyArray; + + /** + * ListInsightsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @instance + */ + ListInsightsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInsightsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {google.cloud.recommender.v1.IListInsightsResponse=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.ListInsightsResponse} ListInsightsResponse instance + */ + ListInsightsResponse.create = function create(properties) { + return new ListInsightsResponse(properties); + }; + + /** + * Encodes the specified ListInsightsResponse message. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {google.cloud.recommender.v1.IListInsightsResponse} message ListInsightsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInsightsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.insights != null && message.insights.length) + for (var i = 0; i < message.insights.length; ++i) + $root.google.cloud.recommender.v1.Insight.encode(message.insights[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 ListInsightsResponse message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListInsightsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {google.cloud.recommender.v1.IListInsightsResponse} message ListInsightsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInsightsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInsightsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.ListInsightsResponse} ListInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInsightsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.ListInsightsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.insights && message.insights.length)) + message.insights = []; + message.insights.push($root.google.cloud.recommender.v1.Insight.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInsightsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.ListInsightsResponse} ListInsightsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInsightsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInsightsResponse message. + * @function verify + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInsightsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.insights != null && message.hasOwnProperty("insights")) { + if (!Array.isArray(message.insights)) + return "insights: array expected"; + for (var i = 0; i < message.insights.length; ++i) { + var error = $root.google.cloud.recommender.v1.Insight.verify(message.insights[i]); + if (error) + return "insights." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInsightsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.ListInsightsResponse} ListInsightsResponse + */ + ListInsightsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.ListInsightsResponse) + return object; + var message = new $root.google.cloud.recommender.v1.ListInsightsResponse(); + if (object.insights) { + if (!Array.isArray(object.insights)) + throw TypeError(".google.cloud.recommender.v1.ListInsightsResponse.insights: array expected"); + message.insights = []; + for (var i = 0; i < object.insights.length; ++i) { + if (typeof object.insights[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.ListInsightsResponse.insights: object expected"); + message.insights[i] = $root.google.cloud.recommender.v1.Insight.fromObject(object.insights[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInsightsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {google.cloud.recommender.v1.ListInsightsResponse} message ListInsightsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInsightsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.insights = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.insights && message.insights.length) { + object.insights = []; + for (var j = 0; j < message.insights.length; ++j) + object.insights[j] = $root.google.cloud.recommender.v1.Insight.toObject(message.insights[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInsightsResponse to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInsightsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInsightsResponse + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.ListInsightsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInsightsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.ListInsightsResponse"; + }; + + return ListInsightsResponse; + })(); + + v1.GetInsightRequest = (function() { + + /** + * Properties of a GetInsightRequest. + * @memberof google.cloud.recommender.v1 + * @interface IGetInsightRequest + * @property {string|null} [name] GetInsightRequest name + */ + + /** + * Constructs a new GetInsightRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a GetInsightRequest. + * @implements IGetInsightRequest + * @constructor + * @param {google.cloud.recommender.v1.IGetInsightRequest=} [properties] Properties to set + */ + function GetInsightRequest(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]]; + } + + /** + * GetInsightRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @instance + */ + GetInsightRequest.prototype.name = ""; + + /** + * Creates a new GetInsightRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {google.cloud.recommender.v1.IGetInsightRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.GetInsightRequest} GetInsightRequest instance + */ + GetInsightRequest.create = function create(properties) { + return new GetInsightRequest(properties); + }; + + /** + * Encodes the specified GetInsightRequest message. Does not implicitly {@link google.cloud.recommender.v1.GetInsightRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {google.cloud.recommender.v1.IGetInsightRequest} message GetInsightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInsightRequest.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 GetInsightRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.GetInsightRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {google.cloud.recommender.v1.IGetInsightRequest} message GetInsightRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInsightRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInsightRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.GetInsightRequest} GetInsightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInsightRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.GetInsightRequest(); + 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 GetInsightRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.GetInsightRequest} GetInsightRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInsightRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInsightRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInsightRequest.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 GetInsightRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.GetInsightRequest} GetInsightRequest + */ + GetInsightRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.GetInsightRequest) + return object; + var message = new $root.google.cloud.recommender.v1.GetInsightRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInsightRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {google.cloud.recommender.v1.GetInsightRequest} message GetInsightRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInsightRequest.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 GetInsightRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @instance + * @returns {Object.} JSON object + */ + GetInsightRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInsightRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.GetInsightRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInsightRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.GetInsightRequest"; + }; + + return GetInsightRequest; + })(); + + v1.MarkInsightAcceptedRequest = (function() { + + /** + * Properties of a MarkInsightAcceptedRequest. + * @memberof google.cloud.recommender.v1 + * @interface IMarkInsightAcceptedRequest + * @property {string|null} [name] MarkInsightAcceptedRequest name + * @property {Object.|null} [stateMetadata] MarkInsightAcceptedRequest stateMetadata + * @property {string|null} [etag] MarkInsightAcceptedRequest etag + */ + + /** + * Constructs a new MarkInsightAcceptedRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a MarkInsightAcceptedRequest. + * @implements IMarkInsightAcceptedRequest + * @constructor + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest=} [properties] Properties to set + */ + function MarkInsightAcceptedRequest(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarkInsightAcceptedRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @instance + */ + MarkInsightAcceptedRequest.prototype.name = ""; + + /** + * MarkInsightAcceptedRequest stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @instance + */ + MarkInsightAcceptedRequest.prototype.stateMetadata = $util.emptyObject; + + /** + * MarkInsightAcceptedRequest etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @instance + */ + MarkInsightAcceptedRequest.prototype.etag = ""; + + /** + * Creates a new MarkInsightAcceptedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.MarkInsightAcceptedRequest} MarkInsightAcceptedRequest instance + */ + MarkInsightAcceptedRequest.create = function create(properties) { + return new MarkInsightAcceptedRequest(properties); + }; + + /** + * Encodes the specified MarkInsightAcceptedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkInsightAcceptedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest} message MarkInsightAcceptedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkInsightAcceptedRequest.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified MarkInsightAcceptedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkInsightAcceptedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkInsightAcceptedRequest} message MarkInsightAcceptedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkInsightAcceptedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarkInsightAcceptedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.MarkInsightAcceptedRequest} MarkInsightAcceptedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkInsightAcceptedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.MarkInsightAcceptedRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarkInsightAcceptedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.MarkInsightAcceptedRequest} MarkInsightAcceptedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkInsightAcceptedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarkInsightAcceptedRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarkInsightAcceptedRequest.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.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a MarkInsightAcceptedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.MarkInsightAcceptedRequest} MarkInsightAcceptedRequest + */ + MarkInsightAcceptedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.MarkInsightAcceptedRequest) + return object; + var message = new $root.google.cloud.recommender.v1.MarkInsightAcceptedRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.MarkInsightAcceptedRequest.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a MarkInsightAcceptedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {google.cloud.recommender.v1.MarkInsightAcceptedRequest} message MarkInsightAcceptedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarkInsightAcceptedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this MarkInsightAcceptedRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @instance + * @returns {Object.} JSON object + */ + MarkInsightAcceptedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarkInsightAcceptedRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.MarkInsightAcceptedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarkInsightAcceptedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.MarkInsightAcceptedRequest"; + }; + + return MarkInsightAcceptedRequest; + })(); + + v1.ListRecommendationsRequest = (function() { + + /** + * Properties of a ListRecommendationsRequest. + * @memberof google.cloud.recommender.v1 + * @interface IListRecommendationsRequest + * @property {string|null} [parent] ListRecommendationsRequest parent + * @property {number|null} [pageSize] ListRecommendationsRequest pageSize + * @property {string|null} [pageToken] ListRecommendationsRequest pageToken + * @property {string|null} [filter] ListRecommendationsRequest filter + */ + + /** + * Constructs a new ListRecommendationsRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a ListRecommendationsRequest. + * @implements IListRecommendationsRequest + * @constructor + * @param {google.cloud.recommender.v1.IListRecommendationsRequest=} [properties] Properties to set + */ + function ListRecommendationsRequest(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]]; + } + + /** + * ListRecommendationsRequest parent. + * @member {string} parent + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @instance + */ + ListRecommendationsRequest.prototype.parent = ""; + + /** + * ListRecommendationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @instance + */ + ListRecommendationsRequest.prototype.pageSize = 0; + + /** + * ListRecommendationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @instance + */ + ListRecommendationsRequest.prototype.pageToken = ""; + + /** + * ListRecommendationsRequest filter. + * @member {string} filter + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @instance + */ + ListRecommendationsRequest.prototype.filter = ""; + + /** + * Creates a new ListRecommendationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.ListRecommendationsRequest} ListRecommendationsRequest instance + */ + ListRecommendationsRequest.create = function create(properties) { + return new ListRecommendationsRequest(properties); + }; + + /** + * Encodes the specified ListRecommendationsRequest message. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsRequest} message ListRecommendationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecommendationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRecommendationsRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsRequest} message ListRecommendationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecommendationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRecommendationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.ListRecommendationsRequest} ListRecommendationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecommendationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.ListRecommendationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRecommendationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.ListRecommendationsRequest} ListRecommendationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecommendationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRecommendationsRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRecommendationsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRecommendationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.ListRecommendationsRequest} ListRecommendationsRequest + */ + ListRecommendationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.ListRecommendationsRequest) + return object; + var message = new $root.google.cloud.recommender.v1.ListRecommendationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRecommendationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {google.cloud.recommender.v1.ListRecommendationsRequest} message ListRecommendationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRecommendationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRecommendationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRecommendationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRecommendationsRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.ListRecommendationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRecommendationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.ListRecommendationsRequest"; + }; + + return ListRecommendationsRequest; + })(); + + v1.ListRecommendationsResponse = (function() { + + /** + * Properties of a ListRecommendationsResponse. + * @memberof google.cloud.recommender.v1 + * @interface IListRecommendationsResponse + * @property {Array.|null} [recommendations] ListRecommendationsResponse recommendations + * @property {string|null} [nextPageToken] ListRecommendationsResponse nextPageToken + */ + + /** + * Constructs a new ListRecommendationsResponse. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a ListRecommendationsResponse. + * @implements IListRecommendationsResponse + * @constructor + * @param {google.cloud.recommender.v1.IListRecommendationsResponse=} [properties] Properties to set + */ + function ListRecommendationsResponse(properties) { + this.recommendations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRecommendationsResponse recommendations. + * @member {Array.} recommendations + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @instance + */ + ListRecommendationsResponse.prototype.recommendations = $util.emptyArray; + + /** + * ListRecommendationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @instance + */ + ListRecommendationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRecommendationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsResponse=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.ListRecommendationsResponse} ListRecommendationsResponse instance + */ + ListRecommendationsResponse.create = function create(properties) { + return new ListRecommendationsResponse(properties); + }; + + /** + * Encodes the specified ListRecommendationsResponse message. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsResponse} message ListRecommendationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecommendationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recommendations != null && message.recommendations.length) + for (var i = 0; i < message.recommendations.length; ++i) + $root.google.cloud.recommender.v1.Recommendation.encode(message.recommendations[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 ListRecommendationsResponse message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.ListRecommendationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {google.cloud.recommender.v1.IListRecommendationsResponse} message ListRecommendationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRecommendationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRecommendationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.ListRecommendationsResponse} ListRecommendationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecommendationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.ListRecommendationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.recommendations && message.recommendations.length)) + message.recommendations = []; + message.recommendations.push($root.google.cloud.recommender.v1.Recommendation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRecommendationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.ListRecommendationsResponse} ListRecommendationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRecommendationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRecommendationsResponse message. + * @function verify + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRecommendationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recommendations != null && message.hasOwnProperty("recommendations")) { + if (!Array.isArray(message.recommendations)) + return "recommendations: array expected"; + for (var i = 0; i < message.recommendations.length; ++i) { + var error = $root.google.cloud.recommender.v1.Recommendation.verify(message.recommendations[i]); + if (error) + return "recommendations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRecommendationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.ListRecommendationsResponse} ListRecommendationsResponse + */ + ListRecommendationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.ListRecommendationsResponse) + return object; + var message = new $root.google.cloud.recommender.v1.ListRecommendationsResponse(); + if (object.recommendations) { + if (!Array.isArray(object.recommendations)) + throw TypeError(".google.cloud.recommender.v1.ListRecommendationsResponse.recommendations: array expected"); + message.recommendations = []; + for (var i = 0; i < object.recommendations.length; ++i) { + if (typeof object.recommendations[i] !== "object") + throw TypeError(".google.cloud.recommender.v1.ListRecommendationsResponse.recommendations: object expected"); + message.recommendations[i] = $root.google.cloud.recommender.v1.Recommendation.fromObject(object.recommendations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRecommendationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {google.cloud.recommender.v1.ListRecommendationsResponse} message ListRecommendationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRecommendationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.recommendations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.recommendations && message.recommendations.length) { + object.recommendations = []; + for (var j = 0; j < message.recommendations.length; ++j) + object.recommendations[j] = $root.google.cloud.recommender.v1.Recommendation.toObject(message.recommendations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRecommendationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRecommendationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRecommendationsResponse + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.ListRecommendationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRecommendationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.ListRecommendationsResponse"; + }; + + return ListRecommendationsResponse; + })(); + + v1.GetRecommendationRequest = (function() { + + /** + * Properties of a GetRecommendationRequest. + * @memberof google.cloud.recommender.v1 + * @interface IGetRecommendationRequest + * @property {string|null} [name] GetRecommendationRequest name + */ + + /** + * Constructs a new GetRecommendationRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a GetRecommendationRequest. + * @implements IGetRecommendationRequest + * @constructor + * @param {google.cloud.recommender.v1.IGetRecommendationRequest=} [properties] Properties to set + */ + function GetRecommendationRequest(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]]; + } + + /** + * GetRecommendationRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @instance + */ + GetRecommendationRequest.prototype.name = ""; + + /** + * Creates a new GetRecommendationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {google.cloud.recommender.v1.IGetRecommendationRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.GetRecommendationRequest} GetRecommendationRequest instance + */ + GetRecommendationRequest.create = function create(properties) { + return new GetRecommendationRequest(properties); + }; + + /** + * Encodes the specified GetRecommendationRequest message. Does not implicitly {@link google.cloud.recommender.v1.GetRecommendationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {google.cloud.recommender.v1.IGetRecommendationRequest} message GetRecommendationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRecommendationRequest.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 GetRecommendationRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.GetRecommendationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {google.cloud.recommender.v1.IGetRecommendationRequest} message GetRecommendationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRecommendationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRecommendationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.GetRecommendationRequest} GetRecommendationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRecommendationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.GetRecommendationRequest(); + 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 GetRecommendationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.GetRecommendationRequest} GetRecommendationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRecommendationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRecommendationRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRecommendationRequest.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 GetRecommendationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.GetRecommendationRequest} GetRecommendationRequest + */ + GetRecommendationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.GetRecommendationRequest) + return object; + var message = new $root.google.cloud.recommender.v1.GetRecommendationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRecommendationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {google.cloud.recommender.v1.GetRecommendationRequest} message GetRecommendationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRecommendationRequest.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 GetRecommendationRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @instance + * @returns {Object.} JSON object + */ + GetRecommendationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRecommendationRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.GetRecommendationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRecommendationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.GetRecommendationRequest"; + }; + + return GetRecommendationRequest; + })(); + + v1.MarkRecommendationClaimedRequest = (function() { + + /** + * Properties of a MarkRecommendationClaimedRequest. + * @memberof google.cloud.recommender.v1 + * @interface IMarkRecommendationClaimedRequest + * @property {string|null} [name] MarkRecommendationClaimedRequest name + * @property {Object.|null} [stateMetadata] MarkRecommendationClaimedRequest stateMetadata + * @property {string|null} [etag] MarkRecommendationClaimedRequest etag + */ + + /** + * Constructs a new MarkRecommendationClaimedRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a MarkRecommendationClaimedRequest. + * @implements IMarkRecommendationClaimedRequest + * @constructor + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest=} [properties] Properties to set + */ + function MarkRecommendationClaimedRequest(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarkRecommendationClaimedRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @instance + */ + MarkRecommendationClaimedRequest.prototype.name = ""; + + /** + * MarkRecommendationClaimedRequest stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @instance + */ + MarkRecommendationClaimedRequest.prototype.stateMetadata = $util.emptyObject; + + /** + * MarkRecommendationClaimedRequest etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @instance + */ + MarkRecommendationClaimedRequest.prototype.etag = ""; + + /** + * Creates a new MarkRecommendationClaimedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.MarkRecommendationClaimedRequest} MarkRecommendationClaimedRequest instance + */ + MarkRecommendationClaimedRequest.create = function create(properties) { + return new MarkRecommendationClaimedRequest(properties); + }; + + /** + * Encodes the specified MarkRecommendationClaimedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationClaimedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest} message MarkRecommendationClaimedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationClaimedRequest.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified MarkRecommendationClaimedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationClaimedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationClaimedRequest} message MarkRecommendationClaimedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationClaimedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarkRecommendationClaimedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.MarkRecommendationClaimedRequest} MarkRecommendationClaimedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationClaimedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.MarkRecommendationClaimedRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarkRecommendationClaimedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.MarkRecommendationClaimedRequest} MarkRecommendationClaimedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationClaimedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarkRecommendationClaimedRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarkRecommendationClaimedRequest.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.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a MarkRecommendationClaimedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.MarkRecommendationClaimedRequest} MarkRecommendationClaimedRequest + */ + MarkRecommendationClaimedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.MarkRecommendationClaimedRequest) + return object; + var message = new $root.google.cloud.recommender.v1.MarkRecommendationClaimedRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.MarkRecommendationClaimedRequest.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a MarkRecommendationClaimedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {google.cloud.recommender.v1.MarkRecommendationClaimedRequest} message MarkRecommendationClaimedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarkRecommendationClaimedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this MarkRecommendationClaimedRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @instance + * @returns {Object.} JSON object + */ + MarkRecommendationClaimedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarkRecommendationClaimedRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.MarkRecommendationClaimedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarkRecommendationClaimedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.MarkRecommendationClaimedRequest"; + }; + + return MarkRecommendationClaimedRequest; + })(); + + v1.MarkRecommendationSucceededRequest = (function() { + + /** + * Properties of a MarkRecommendationSucceededRequest. + * @memberof google.cloud.recommender.v1 + * @interface IMarkRecommendationSucceededRequest + * @property {string|null} [name] MarkRecommendationSucceededRequest name + * @property {Object.|null} [stateMetadata] MarkRecommendationSucceededRequest stateMetadata + * @property {string|null} [etag] MarkRecommendationSucceededRequest etag + */ + + /** + * Constructs a new MarkRecommendationSucceededRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a MarkRecommendationSucceededRequest. + * @implements IMarkRecommendationSucceededRequest + * @constructor + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest=} [properties] Properties to set + */ + function MarkRecommendationSucceededRequest(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarkRecommendationSucceededRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @instance + */ + MarkRecommendationSucceededRequest.prototype.name = ""; + + /** + * MarkRecommendationSucceededRequest stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @instance + */ + MarkRecommendationSucceededRequest.prototype.stateMetadata = $util.emptyObject; + + /** + * MarkRecommendationSucceededRequest etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @instance + */ + MarkRecommendationSucceededRequest.prototype.etag = ""; + + /** + * Creates a new MarkRecommendationSucceededRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.MarkRecommendationSucceededRequest} MarkRecommendationSucceededRequest instance + */ + MarkRecommendationSucceededRequest.create = function create(properties) { + return new MarkRecommendationSucceededRequest(properties); + }; + + /** + * Encodes the specified MarkRecommendationSucceededRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationSucceededRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest} message MarkRecommendationSucceededRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationSucceededRequest.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified MarkRecommendationSucceededRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationSucceededRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationSucceededRequest} message MarkRecommendationSucceededRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationSucceededRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarkRecommendationSucceededRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.MarkRecommendationSucceededRequest} MarkRecommendationSucceededRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationSucceededRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.MarkRecommendationSucceededRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarkRecommendationSucceededRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.MarkRecommendationSucceededRequest} MarkRecommendationSucceededRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationSucceededRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarkRecommendationSucceededRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarkRecommendationSucceededRequest.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.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a MarkRecommendationSucceededRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.MarkRecommendationSucceededRequest} MarkRecommendationSucceededRequest + */ + MarkRecommendationSucceededRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.MarkRecommendationSucceededRequest) + return object; + var message = new $root.google.cloud.recommender.v1.MarkRecommendationSucceededRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.MarkRecommendationSucceededRequest.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a MarkRecommendationSucceededRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {google.cloud.recommender.v1.MarkRecommendationSucceededRequest} message MarkRecommendationSucceededRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarkRecommendationSucceededRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this MarkRecommendationSucceededRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @instance + * @returns {Object.} JSON object + */ + MarkRecommendationSucceededRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarkRecommendationSucceededRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.MarkRecommendationSucceededRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarkRecommendationSucceededRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.MarkRecommendationSucceededRequest"; + }; + + return MarkRecommendationSucceededRequest; + })(); + + v1.MarkRecommendationFailedRequest = (function() { + + /** + * Properties of a MarkRecommendationFailedRequest. + * @memberof google.cloud.recommender.v1 + * @interface IMarkRecommendationFailedRequest + * @property {string|null} [name] MarkRecommendationFailedRequest name + * @property {Object.|null} [stateMetadata] MarkRecommendationFailedRequest stateMetadata + * @property {string|null} [etag] MarkRecommendationFailedRequest etag + */ + + /** + * Constructs a new MarkRecommendationFailedRequest. + * @memberof google.cloud.recommender.v1 + * @classdesc Represents a MarkRecommendationFailedRequest. + * @implements IMarkRecommendationFailedRequest + * @constructor + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest=} [properties] Properties to set + */ + function MarkRecommendationFailedRequest(properties) { + this.stateMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarkRecommendationFailedRequest name. + * @member {string} name + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @instance + */ + MarkRecommendationFailedRequest.prototype.name = ""; + + /** + * MarkRecommendationFailedRequest stateMetadata. + * @member {Object.} stateMetadata + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @instance + */ + MarkRecommendationFailedRequest.prototype.stateMetadata = $util.emptyObject; + + /** + * MarkRecommendationFailedRequest etag. + * @member {string} etag + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @instance + */ + MarkRecommendationFailedRequest.prototype.etag = ""; + + /** + * Creates a new MarkRecommendationFailedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest=} [properties] Properties to set + * @returns {google.cloud.recommender.v1.MarkRecommendationFailedRequest} MarkRecommendationFailedRequest instance + */ + MarkRecommendationFailedRequest.create = function create(properties) { + return new MarkRecommendationFailedRequest(properties); + }; + + /** + * Encodes the specified MarkRecommendationFailedRequest message. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationFailedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest} message MarkRecommendationFailedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationFailedRequest.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.stateMetadata != null && Object.hasOwnProperty.call(message, "stateMetadata")) + for (var keys = Object.keys(message.stateMetadata), 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.stateMetadata[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified MarkRecommendationFailedRequest message, length delimited. Does not implicitly {@link google.cloud.recommender.v1.MarkRecommendationFailedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {google.cloud.recommender.v1.IMarkRecommendationFailedRequest} message MarkRecommendationFailedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarkRecommendationFailedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarkRecommendationFailedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recommender.v1.MarkRecommendationFailedRequest} MarkRecommendationFailedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationFailedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recommender.v1.MarkRecommendationFailedRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.stateMetadata === $util.emptyObject) + message.stateMetadata = {}; + 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.stateMetadata[key] = value; + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarkRecommendationFailedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recommender.v1.MarkRecommendationFailedRequest} MarkRecommendationFailedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarkRecommendationFailedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarkRecommendationFailedRequest message. + * @function verify + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarkRecommendationFailedRequest.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.stateMetadata != null && message.hasOwnProperty("stateMetadata")) { + if (!$util.isObject(message.stateMetadata)) + return "stateMetadata: object expected"; + var key = Object.keys(message.stateMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.stateMetadata[key[i]])) + return "stateMetadata: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a MarkRecommendationFailedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recommender.v1.MarkRecommendationFailedRequest} MarkRecommendationFailedRequest + */ + MarkRecommendationFailedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recommender.v1.MarkRecommendationFailedRequest) + return object; + var message = new $root.google.cloud.recommender.v1.MarkRecommendationFailedRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.stateMetadata) { + if (typeof object.stateMetadata !== "object") + throw TypeError(".google.cloud.recommender.v1.MarkRecommendationFailedRequest.stateMetadata: object expected"); + message.stateMetadata = {}; + for (var keys = Object.keys(object.stateMetadata), i = 0; i < keys.length; ++i) + message.stateMetadata[keys[i]] = String(object.stateMetadata[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a MarkRecommendationFailedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {google.cloud.recommender.v1.MarkRecommendationFailedRequest} message MarkRecommendationFailedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarkRecommendationFailedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stateMetadata = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.stateMetadata && (keys2 = Object.keys(message.stateMetadata)).length) { + object.stateMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.stateMetadata[keys2[j]] = message.stateMetadata[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this MarkRecommendationFailedRequest to JSON. + * @function toJSON + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @instance + * @returns {Object.} JSON object + */ + MarkRecommendationFailedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarkRecommendationFailedRequest + * @function getTypeUrl + * @memberof google.cloud.recommender.v1.MarkRecommendationFailedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarkRecommendationFailedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recommender.v1.MarkRecommendationFailedRequest"; + }; + + return MarkRecommendationFailedRequest; + })(); + + return v1; + })(); + + return recommender; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + return values; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $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; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.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.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; + } + 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: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + 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) { + 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.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.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"]); + } + 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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(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]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-recommender/protos/protos.json b/packages/google-cloud-recommender/protos/protos.json new file mode 100644 index 000000000000..0f25ea384d1d --- /dev/null +++ b/packages/google-cloud-recommender/protos/protos.json @@ -0,0 +1,2085 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "recommender": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Recommender.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/recommender/v1;recommender", + "java_multiple_files": true, + "java_outer_classname": "RecommenderProto", + "java_package": "com.google.cloud.recommender.v1", + "objc_class_prefix": "CREC", + "(google.api.resource_definition).type": "recommender.googleapis.com/Recommender", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}/recommenders/{recommender}" + }, + "nested": { + "Insight": { + "options": { + "(google.api.resource).type": "recommender.googleapis.com/Insight", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "targetResources": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "insightSubtype": { + "type": "string", + "id": 10 + }, + "content": { + "type": "google.protobuf.Struct", + "id": 3 + }, + "lastRefreshTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "observationPeriod": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "stateInfo": { + "type": "InsightStateInfo", + "id": 6 + }, + "category": { + "type": "Category", + "id": 7 + }, + "etag": { + "type": "string", + "id": 11 + }, + "associatedRecommendations": { + "rule": "repeated", + "type": "RecommendationReference", + "id": 8 + } + }, + "nested": { + "RecommendationReference": { + "fields": { + "recommendation": { + "type": "string", + "id": 1 + } + } + }, + "Category": { + "values": { + "CATEGORY_UNSPECIFIED": 0, + "COST": 1, + "SECURITY": 2, + "PERFORMANCE": 3, + "MANAGEABILITY": 4 + } + } + } + }, + "InsightStateInfo": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "ACCEPTED": 2, + "DISMISSED": 3 + } + } + } + }, + "Recommendation": { + "options": { + "(google.api.resource).type": "recommender.googleapis.com/Recommendation", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "recommenderSubtype": { + "type": "string", + "id": 12 + }, + "lastRefreshTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "primaryImpact": { + "type": "Impact", + "id": 5 + }, + "additionalImpact": { + "rule": "repeated", + "type": "Impact", + "id": 6 + }, + "content": { + "type": "RecommendationContent", + "id": 7 + }, + "stateInfo": { + "type": "RecommendationStateInfo", + "id": 10 + }, + "etag": { + "type": "string", + "id": 11 + }, + "associatedInsights": { + "rule": "repeated", + "type": "InsightReference", + "id": 14 + } + }, + "nested": { + "InsightReference": { + "fields": { + "insight": { + "type": "string", + "id": 1 + } + } + } + } + }, + "RecommendationContent": { + "fields": { + "operationGroups": { + "rule": "repeated", + "type": "OperationGroup", + "id": 2 + } + } + }, + "OperationGroup": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + } + } + }, + "Operation": { + "oneofs": { + "pathValue": { + "oneof": [ + "value", + "valueMatcher" + ] + } + }, + "fields": { + "action": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "string", + "id": 3 + }, + "path": { + "type": "string", + "id": 4 + }, + "sourceResource": { + "type": "string", + "id": 5 + }, + "sourcePath": { + "type": "string", + "id": 6 + }, + "value": { + "type": "google.protobuf.Value", + "id": 7 + }, + "valueMatcher": { + "type": "ValueMatcher", + "id": 10 + }, + "pathFilters": { + "keyType": "string", + "type": "google.protobuf.Value", + "id": 8 + }, + "pathValueMatchers": { + "keyType": "string", + "type": "ValueMatcher", + "id": 11 + } + } + }, + "ValueMatcher": { + "oneofs": { + "matchVariant": { + "oneof": [ + "matchesPattern" + ] + } + }, + "fields": { + "matchesPattern": { + "type": "string", + "id": 1 + } + } + }, + "CostProjection": { + "fields": { + "cost": { + "type": "google.type.Money", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "Impact": { + "oneofs": { + "projection": { + "oneof": [ + "costProjection" + ] + } + }, + "fields": { + "category": { + "type": "Category", + "id": 1 + }, + "costProjection": { + "type": "CostProjection", + "id": 100 + } + }, + "nested": { + "Category": { + "values": { + "CATEGORY_UNSPECIFIED": 0, + "COST": 1, + "SECURITY": 2, + "PERFORMANCE": 3, + "MANAGEABILITY": 4 + } + } + } + }, + "RecommendationStateInfo": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CLAIMED": 6, + "SUCCEEDED": 3, + "FAILED": 4, + "DISMISSED": 5 + } + } + } + }, + "Recommender": { + "options": { + "(google.api.default_host)": "recommender.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInsights": { + "requestType": "ListInsightsRequest", + "responseType": "ListInsightsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights", + "additional_bindings": [ + { + "get": "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights" + }, + { + "get": "/v1/{parent=folders/*/locations/*/insightTypes/*}/insights" + }, + { + "get": "/v1/{parent=organizations/*/locations/*/insightTypes/*}/insights" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInsight": { + "requestType": "GetInsightRequest", + "responseType": "Insight", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}", + "additional_bindings": [ + { + "get": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}" + }, + { + "get": "/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}" + }, + { + "get": "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "MarkInsightAccepted": { + "requestType": "MarkInsightAcceptedRequest", + "responseType": "Insight", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state_metadata,etag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "body": "*" + }, + { + "post": "/v1/{name=folders/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "body": "*" + }, + { + "post": "/v1/{name=organizations/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state_metadata,etag" + } + ] + }, + "ListRecommendations": { + "requestType": "ListRecommendationsRequest", + "responseType": "ListRecommendationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations", + "additional_bindings": [ + { + "get": "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations" + }, + { + "get": "/v1/{parent=folders/*/locations/*/recommenders/*}/recommendations" + }, + { + "get": "/v1/{parent=organizations/*/locations/*/recommenders/*}/recommendations" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "GetRecommendation": { + "requestType": "GetRecommendationRequest", + "responseType": "Recommendation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}", + "additional_bindings": [ + { + "get": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}" + }, + { + "get": "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}" + }, + { + "get": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "MarkRecommendationClaimed": { + "requestType": "MarkRecommendationClaimedRequest", + "responseType": "Recommendation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state_metadata,etag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "body": "*" + }, + { + "post": "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "body": "*" + }, + { + "post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state_metadata,etag" + } + ] + }, + "MarkRecommendationSucceeded": { + "requestType": "MarkRecommendationSucceededRequest", + "responseType": "Recommendation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state_metadata,etag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "body": "*" + }, + { + "post": "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "body": "*" + }, + { + "post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state_metadata,etag" + } + ] + }, + "MarkRecommendationFailed": { + "requestType": "MarkRecommendationFailedRequest", + "responseType": "Recommendation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,state_metadata,etag" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "body": "*", + "additional_bindings": [ + { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "body": "*" + }, + { + "post": "/v1/{name=folders/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "body": "*" + }, + { + "post": "/v1/{name=organizations/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,state_metadata,etag" + } + ] + } + } + }, + "ListInsightsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/InsightType" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInsightsResponse": { + "fields": { + "insights": { + "rule": "repeated", + "type": "Insight", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInsightRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Insight" + } + } + } + }, + "MarkInsightAcceptedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Insight" + } + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRecommendationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Recommender" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListRecommendationsResponse": { + "fields": { + "recommendations": { + "rule": "repeated", + "type": "Recommendation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetRecommendationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Recommendation" + } + } + } + }, + "MarkRecommendationClaimedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Recommendation" + } + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MarkRecommendationSucceededRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Recommendation" + } + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MarkRecommendationFailedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "recommender.googleapis.com/Recommendation" + } + }, + "stateMetadata": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "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 + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/money;money", + "java_multiple_files": true, + "java_outer_classname": "MoneyProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-recommender/samples/README.md b/packages/google-cloud-recommender/samples/README.md new file mode 100644 index 000000000000..ee912bd32f24 --- /dev/null +++ b/packages/google-cloud-recommender/samples/README.md @@ -0,0 +1,68 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Recommender: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recommender/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recommender/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-recommender/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-recommender/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-recommender/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-recommender/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/recommender/docs diff --git a/packages/google-cloud-recommender/samples/package.json b/packages/google-cloud-recommender/samples/package.json new file mode 100644 index 000000000000..bb78a8ed2133 --- /dev/null +++ b/packages/google-cloud-recommender/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-recommender", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/recommender": "^5.0.2" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-recommender/samples/quickstart.js b/packages/google-cloud-recommender/samples/quickstart.js new file mode 100644 index 000000000000..3ec850b519fb --- /dev/null +++ b/packages/google-cloud-recommender/samples/quickstart.js @@ -0,0 +1,56 @@ +// Copyright 2020 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. +// + +'use strict'; + +/** + * List usage recommendations for a given product. + * @param {string} project + * @param {string} recommenderName + */ +async function main( + project = 'my-project', + recommenderId = 'google.compute.instance.MachineTypeRecommender' +) { + // [START recommender_quickstart] + async function listRecommendations() { + const {RecommenderClient} = require('@google-cloud/recommender'); + const recommender = new RecommenderClient(); + + // parent = 'projects/my-project'; // Project to fetch recommendations for. + // recommenderId = 'google.compute.instance.MachineTypeRecommender'; + + const [recommendations] = await recommender.listRecommendations({ + parent: recommender.projectLocationRecommenderPath( + project, + 'global', + recommenderId + ), + }); + console.info(`recommendations for ${recommenderId}:`); + for (const recommendation of recommendations) { + console.info(recommendation); + } + return recommendations; + } + const recommendations = await listRecommendations(); + // [END recommender_quickstart] + return recommendations; +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-recommender/samples/test/quickstart.js b/packages/google-cloud-recommender/samples/test/quickstart.js new file mode 100644 index 000000000000..a62b5a3baf91 --- /dev/null +++ b/packages/google-cloud-recommender/samples/test/quickstart.js @@ -0,0 +1,41 @@ +// Copyright 2019 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'; + +const path = require('path'); +const cp = require('child_process'); +const {expect} = require('chai'); +const {before, describe, it} = require('mocha'); +const {RecommenderClient} = require('@google-cloud/recommender'); +const recommender = new RecommenderClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + before(async () => { + projectId = await recommender.getProjectId(); + }); + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + expect(stdout).to.include('recommendations for'); + }); +}); diff --git a/packages/google-cloud-recommender/src/index.ts b/packages/google-cloud-recommender/src/index.ts new file mode 100644 index 000000000000..68bd655a4c7b --- /dev/null +++ b/packages/google-cloud-recommender/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const RecommenderClient = v1.RecommenderClient; +type RecommenderClient = v1.RecommenderClient; + +export {v1, RecommenderClient}; +export default {v1, RecommenderClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-recommender/src/v1/gapic_metadata.json b/packages/google-cloud-recommender/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..55b21d43d2c7 --- /dev/null +++ b/packages/google-cloud-recommender/src/v1/gapic_metadata.json @@ -0,0 +1,111 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.recommender.v1", + "libraryPackage": "@google-cloud/recommender", + "services": { + "Recommender": { + "clients": { + "grpc": { + "libraryClient": "RecommenderClient", + "rpcs": { + "GetInsight": { + "methods": [ + "getInsight" + ] + }, + "MarkInsightAccepted": { + "methods": [ + "markInsightAccepted" + ] + }, + "GetRecommendation": { + "methods": [ + "getRecommendation" + ] + }, + "MarkRecommendationClaimed": { + "methods": [ + "markRecommendationClaimed" + ] + }, + "MarkRecommendationSucceeded": { + "methods": [ + "markRecommendationSucceeded" + ] + }, + "MarkRecommendationFailed": { + "methods": [ + "markRecommendationFailed" + ] + }, + "ListInsights": { + "methods": [ + "listInsights", + "listInsightsStream", + "listInsightsAsync" + ] + }, + "ListRecommendations": { + "methods": [ + "listRecommendations", + "listRecommendationsStream", + "listRecommendationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RecommenderClient", + "rpcs": { + "GetInsight": { + "methods": [ + "getInsight" + ] + }, + "MarkInsightAccepted": { + "methods": [ + "markInsightAccepted" + ] + }, + "GetRecommendation": { + "methods": [ + "getRecommendation" + ] + }, + "MarkRecommendationClaimed": { + "methods": [ + "markRecommendationClaimed" + ] + }, + "MarkRecommendationSucceeded": { + "methods": [ + "markRecommendationSucceeded" + ] + }, + "MarkRecommendationFailed": { + "methods": [ + "markRecommendationFailed" + ] + }, + "ListInsights": { + "methods": [ + "listInsights", + "listInsightsStream", + "listInsightsAsync" + ] + }, + "ListRecommendations": { + "methods": [ + "listRecommendations", + "listRecommendationsStream", + "listRecommendationsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-recommender/src/v1/index.ts b/packages/google-cloud-recommender/src/v1/index.ts new file mode 100644 index 000000000000..368aaebbc898 --- /dev/null +++ b/packages/google-cloud-recommender/src/v1/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** 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 {RecommenderClient} from './recommender_client'; diff --git a/packages/google-cloud-recommender/src/v1/recommender_client.ts b/packages/google-cloud-recommender/src/v1/recommender_client.ts new file mode 100644 index 000000000000..93f598d8e37a --- /dev/null +++ b/packages/google-cloud-recommender/src/v1/recommender_client.ts @@ -0,0 +1,2745 @@ +// 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. +// +// ** 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 * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/recommender_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './recommender_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Provides insights and recommendations for cloud customers for various + * categories like performance optimization, cost savings, reliability, feature + * discovery, etc. Insights and recommendations are generated automatically + * based on analysis of user resources, configuration and monitoring metrics. + * @class + * @memberof v1 + */ +export class RecommenderClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + recommenderStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RecommenderClient. + * + * @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/master/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 fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RecommenderClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // 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 the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + billingAccountLocationInsightTypePathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}' + ), + billingAccountLocationInsightTypeInsightPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + ), + billingAccountLocationRecommenderPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}' + ), + billingAccountLocationRecommenderRecommendationPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + ), + folderLocationInsightTypePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/insightTypes/{insight_type}' + ), + folderLocationInsightTypeInsightPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + ), + folderLocationRecommenderPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/recommenders/{recommender}' + ), + folderLocationRecommenderRecommendationPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + ), + organizationLocationInsightTypePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}' + ), + organizationLocationInsightTypeInsightPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + ), + organizationLocationRecommenderPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/recommenders/{recommender}' + ), + organizationLocationRecommenderRecommendationPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + ), + projectLocationInsightTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/insightTypes/{insight_type}' + ), + projectLocationInsightTypeInsightPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + ), + projectLocationRecommenderPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/recommenders/{recommender}' + ), + projectLocationRecommenderRecommendationPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + ), + }; + + // 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 = { + listInsights: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'insights' + ), + listRecommendations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'recommendations' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.recommender.v1.Recommender', + 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 = {}; + } + + /** + * 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.recommenderStub) { + return this.recommenderStub; + } + + // Put together the "service stub" for + // google.cloud.recommender.v1.Recommender. + this.recommenderStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.recommender.v1.Recommender' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.recommender.v1.Recommender, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const recommenderStubMethods = [ + 'listInsights', + 'getInsight', + 'markInsightAccepted', + 'listRecommendations', + 'getRecommendation', + 'markRecommendationClaimed', + 'markRecommendationSucceeded', + 'markRecommendationFailed', + ]; + for (const methodName of recommenderStubMethods) { + const callPromise = this.recommenderStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.recommenderStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'recommender.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'recommender.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + getInsight( + request: protos.google.cloud.recommender.v1.IGetInsightRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight, + protos.google.cloud.recommender.v1.IGetInsightRequest | undefined, + {} | undefined + ] + >; + getInsight( + request: protos.google.cloud.recommender.v1.IGetInsightRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IInsight, + protos.google.cloud.recommender.v1.IGetInsightRequest | null | undefined, + {} | null | undefined + > + ): void; + getInsight( + request: protos.google.cloud.recommender.v1.IGetInsightRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IInsight, + protos.google.cloud.recommender.v1.IGetInsightRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the requested insight. Requires the recommender.*.get IAM permission + * for the specified insight type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the insight. + * @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 [Insight]{@link google.cloud.recommender.v1.Insight}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getInsight(request); + */ + getInsight( + request: protos.google.cloud.recommender.v1.IGetInsightRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IInsight, + | protos.google.cloud.recommender.v1.IGetInsightRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IInsight, + protos.google.cloud.recommender.v1.IGetInsightRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight, + protos.google.cloud.recommender.v1.IGetInsightRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInsight(request, options, callback); + } + markInsightAccepted( + request: protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight, + ( + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | undefined + ), + {} | undefined + ] + >; + markInsightAccepted( + request: protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IInsight, + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + markInsightAccepted( + request: protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IInsight, + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Marks the Insight State as Accepted. Users can use this method to + * indicate to the Recommender API that they have applied some action based + * on the insight. This stops the insight content from being updated. + * + * MarkInsightAccepted can be applied to insights in ACTIVE state. Requires + * the recommender.*.update IAM permission for the specified insight. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the insight. + * @param {number[]} [request.stateMetadata] + * Optional. State properties user wish to include with this state. Full replace of the + * current state_metadata. + * @param {string} request.etag + * Required. Fingerprint of the Insight. Provides optimistic locking. + * @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 [Insight]{@link google.cloud.recommender.v1.Insight}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.markInsightAccepted(request); + */ + markInsightAccepted( + request: protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IInsight, + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IInsight, + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight, + ( + | protos.google.cloud.recommender.v1.IMarkInsightAcceptedRequest + | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.markInsightAccepted(request, options, callback); + } + getRecommendation( + request: protos.google.cloud.recommender.v1.IGetRecommendationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + protos.google.cloud.recommender.v1.IGetRecommendationRequest | undefined, + {} | undefined + ] + >; + getRecommendation( + request: protos.google.cloud.recommender.v1.IGetRecommendationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IGetRecommendationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRecommendation( + request: protos.google.cloud.recommender.v1.IGetRecommendationRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IGetRecommendationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the requested recommendation. Requires the recommender.*.get + * IAM permission for the specified recommender. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the recommendation. + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getRecommendation(request); + */ + getRecommendation( + request: protos.google.cloud.recommender.v1.IGetRecommendationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IGetRecommendationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IGetRecommendationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + protos.google.cloud.recommender.v1.IGetRecommendationRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getRecommendation(request, options, callback); + } + markRecommendationClaimed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | undefined + ), + {} | undefined + ] + >; + markRecommendationClaimed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + markRecommendationClaimed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Marks the Recommendation State as Claimed. Users can use this method to + * indicate to the Recommender API that they are starting to apply the + * recommendation themselves. This stops the recommendation content from being + * updated. Associated insights are frozen and placed in the ACCEPTED state. + * + * MarkRecommendationClaimed can be applied to recommendations in CLAIMED, + * SUCCEEDED, FAILED, or ACTIVE state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the recommendation. + * @param {number[]} request.stateMetadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex /^{@link a-z0-9_.-|a-z0-9}{0,62}$/. + * Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + * @param {string} request.etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.markRecommendationClaimed(request); + */ + markRecommendationClaimed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationClaimedRequest + | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.markRecommendationClaimed( + request, + options, + callback + ); + } + markRecommendationSucceeded( + request: protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | undefined + ), + {} | undefined + ] + >; + markRecommendationSucceeded( + request: protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | null + | undefined, + {} | null | undefined + > + ): void; + markRecommendationSucceeded( + request: protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Marks the Recommendation State as Succeeded. Users can use this method to + * indicate to the Recommender API that they have applied the recommendation + * themselves, and the operation was successful. This stops the recommendation + * content from being updated. Associated insights are frozen and placed in + * the ACCEPTED state. + * + * MarkRecommendationSucceeded can be applied to recommendations in ACTIVE, + * CLAIMED, SUCCEEDED, or FAILED state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the recommendation. + * @param {number[]} request.stateMetadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex /^{@link a-z0-9_.-|a-z0-9}{0,62}$/. + * Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + * @param {string} request.etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.markRecommendationSucceeded(request); + */ + markRecommendationSucceeded( + request: protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationSucceededRequest + | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.markRecommendationSucceeded( + request, + options, + callback + ); + } + markRecommendationFailed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | undefined + ), + {} | undefined + ] + >; + markRecommendationFailed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + markRecommendationFailed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest, + callback: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Marks the Recommendation State as Failed. Users can use this method to + * indicate to the Recommender API that they have applied the recommendation + * themselves, and the operation failed. This stops the recommendation content + * from being updated. Associated insights are frozen and placed in the + * ACCEPTED state. + * + * MarkRecommendationFailed can be applied to recommendations in ACTIVE, + * CLAIMED, SUCCEEDED, or FAILED state. + * + * Requires the recommender.*.update IAM permission for the specified + * recommender. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the recommendation. + * @param {number[]} request.stateMetadata + * State properties to include with this state. Overwrites any existing + * `state_metadata`. + * Keys must match the regex /^{@link a-z0-9_.-|a-z0-9}{0,62}$/. + * Values must match the regex /^[a-zA-Z0-9_./-]{0,255}$/. + * @param {string} request.etag + * Required. Fingerprint of the Recommendation. Provides optimistic locking. + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.markRecommendationFailed(request); + */ + markRecommendationFailed( + request: protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.recommender.v1.IRecommendation, + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation, + ( + | protos.google.cloud.recommender.v1.IMarkRecommendationFailedRequest + | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.markRecommendationFailed( + request, + options, + callback + ); + } + + listInsights( + request: protos.google.cloud.recommender.v1.IListInsightsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight[], + protos.google.cloud.recommender.v1.IListInsightsRequest | null, + protos.google.cloud.recommender.v1.IListInsightsResponse + ] + >; + listInsights( + request: protos.google.cloud.recommender.v1.IListInsightsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recommender.v1.IListInsightsRequest, + | protos.google.cloud.recommender.v1.IListInsightsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IInsight + > + ): void; + listInsights( + request: protos.google.cloud.recommender.v1.IListInsightsRequest, + callback: PaginationCallback< + protos.google.cloud.recommender.v1.IListInsightsRequest, + | protos.google.cloud.recommender.v1.IListInsightsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IInsight + > + ): void; + /** + * Lists insights for a Cloud project. Requires the recommender.*.list IAM + * permission for the specified insight type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} [request.filter] + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: state + * Eg: `state:"DISMISSED" or state:"ACTIVE" + * @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 [Insight]{@link google.cloud.recommender.v1.Insight}. + * 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 `listInsightsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInsights( + request: protos.google.cloud.recommender.v1.IListInsightsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.recommender.v1.IListInsightsRequest, + | protos.google.cloud.recommender.v1.IListInsightsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IInsight + >, + callback?: PaginationCallback< + protos.google.cloud.recommender.v1.IListInsightsRequest, + | protos.google.cloud.recommender.v1.IListInsightsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IInsight + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IInsight[], + protos.google.cloud.recommender.v1.IListInsightsRequest | null, + protos.google.cloud.recommender.v1.IListInsightsResponse + ] + > | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listInsights(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 container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} [request.filter] + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: state + * Eg: `state:"DISMISSED" or state:"ACTIVE" + * @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 [Insight]{@link google.cloud.recommender.v1.Insight} 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 `listInsightsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listInsightsStream( + request?: protos.google.cloud.recommender.v1.IListInsightsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInsights.createStream( + this.innerApiCalls.listInsights as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInsights`, 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 container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} [request.filter] + * Optional. Filter expression to restrict the insights returned. Supported + * filter fields: state + * Eg: `state:"DISMISSED" or state:"ACTIVE" + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Insight]{@link google.cloud.recommender.v1.Insight}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listInsightsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInsightsAsync( + request?: protos.google.cloud.recommender.v1.IListInsightsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInsights.asyncIterate( + this.innerApiCalls['listInsights'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listRecommendations( + request: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation[], + protos.google.cloud.recommender.v1.IListRecommendationsRequest | null, + protos.google.cloud.recommender.v1.IListRecommendationsResponse + ] + >; + listRecommendations( + request: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.recommender.v1.IListRecommendationsRequest, + | protos.google.cloud.recommender.v1.IListRecommendationsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IRecommendation + > + ): void; + listRecommendations( + request: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + callback: PaginationCallback< + protos.google.cloud.recommender.v1.IListRecommendationsRequest, + | protos.google.cloud.recommender.v1.IListRecommendationsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IRecommendation + > + ): void; + /** + * Lists recommendations for a Cloud project. Requires the recommender.*.list + * IAM permission for the specified recommender. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} request.filter + * Filter expression to restrict the recommendations returned. Supported + * filter fields: state_info.state + * Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. + * 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 `listRecommendationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRecommendations( + request: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.recommender.v1.IListRecommendationsRequest, + | protos.google.cloud.recommender.v1.IListRecommendationsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IRecommendation + >, + callback?: PaginationCallback< + protos.google.cloud.recommender.v1.IListRecommendationsRequest, + | protos.google.cloud.recommender.v1.IListRecommendationsResponse + | null + | undefined, + protos.google.cloud.recommender.v1.IRecommendation + > + ): Promise< + [ + protos.google.cloud.recommender.v1.IRecommendation[], + protos.google.cloud.recommender.v1.IListRecommendationsRequest | null, + protos.google.cloud.recommender.v1.IListRecommendationsResponse + ] + > | 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'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listRecommendations(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 container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} request.filter + * Filter expression to restrict the recommendations returned. Supported + * filter fields: state_info.state + * Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" + * @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 [Recommendation]{@link google.cloud.recommender.v1.Recommendation} 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 `listRecommendationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRecommendationsStream( + request?: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRecommendations.createStream( + this.innerApiCalls.listRecommendations as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRecommendations`, 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 container resource on which to execute the request. + * Acceptable formats: + * + * 1. + * "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]", + * + * LOCATION here refers to GCP Locations: + * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. Non-positive + * values are ignored. If not specified, the server will determine the number + * of results to return. + * @param {string} [request.pageToken] + * Optional. If present, retrieves the next batch of results from the preceding call to + * this method. `page_token` must be the value of `next_page_token` from the + * previous response. The values of other method parameters must be identical + * to those in the previous call. + * @param {string} request.filter + * Filter expression to restrict the recommendations returned. Supported + * filter fields: state_info.state + * Eg: `state_info.state:"DISMISSED" or state_info.state:"FAILED" + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Recommendation]{@link google.cloud.recommender.v1.Recommendation}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listRecommendationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listRecommendationsAsync( + request?: protos.google.cloud.recommender.v1.IListRecommendationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRecommendations.asyncIterate( + this.innerApiCalls['listRecommendations'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified billingAccountLocationInsightType resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} insight_type + * @returns {string} Resource name string. + */ + billingAccountLocationInsightTypePath( + billingAccount: string, + location: string, + insightType: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.render( + { + billing_account: billingAccount, + location: location, + insight_type: insightType, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).location; + } + + /** + * Parse the insight_type from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).insight_type; + } + + /** + * Return a fully-qualified billingAccountLocationInsightTypeInsight resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} insight_type + * @param {string} insight + * @returns {string} Resource name string. + */ + billingAccountLocationInsightTypeInsightPath( + billingAccount: string, + location: string, + insightType: string, + insight: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.render( + { + billing_account: billingAccount, + location: location, + insight_type: insightType, + insight: insight, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationInsightTypeInsight resource. + * + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationInsightTypeInsight resource. + * + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).location; + } + + /** + * Parse the insight_type from BillingAccountLocationInsightTypeInsight resource. + * + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).insight_type; + } + + /** + * Parse the insight from BillingAccountLocationInsightTypeInsight resource. + * + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. + * @returns {string} A string representing the insight. + */ + matchInsightFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).insight; + } + + /** + * Return a fully-qualified billingAccountLocationRecommender resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} recommender + * @returns {string} Resource name string. + */ + billingAccountLocationRecommenderPath( + billingAccount: string, + location: string, + recommender: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.render( + { + billing_account: billingAccount, + location: location, + recommender: recommender, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified billingAccountLocationRecommenderRecommendation resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + billingAccountLocationRecommenderRecommendationPath( + billingAccount: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.render( + { + billing_account: billingAccount, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).location; + } + + /** + * Parse the recommender from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).recommendation; + } + + /** + * Return a fully-qualified folderLocationInsightType resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} insight_type + * @returns {string} Resource name string. + */ + folderLocationInsightTypePath( + folder: string, + location: string, + insightType: string + ) { + return this.pathTemplates.folderLocationInsightTypePathTemplate.render({ + folder: folder, + location: location, + insight_type: insightType, + }); + } + + /** + * Parse the folder from FolderLocationInsightType resource. + * + * @param {string} folderLocationInsightTypeName + * A fully-qualified path representing folder_location_insight_type resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationInsightTypeName( + folderLocationInsightTypeName: string + ) { + return this.pathTemplates.folderLocationInsightTypePathTemplate.match( + folderLocationInsightTypeName + ).folder; + } + + /** + * Parse the location from FolderLocationInsightType resource. + * + * @param {string} folderLocationInsightTypeName + * A fully-qualified path representing folder_location_insight_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationInsightTypeName( + folderLocationInsightTypeName: string + ) { + return this.pathTemplates.folderLocationInsightTypePathTemplate.match( + folderLocationInsightTypeName + ).location; + } + + /** + * Parse the insight_type from FolderLocationInsightType resource. + * + * @param {string} folderLocationInsightTypeName + * A fully-qualified path representing folder_location_insight_type resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromFolderLocationInsightTypeName( + folderLocationInsightTypeName: string + ) { + return this.pathTemplates.folderLocationInsightTypePathTemplate.match( + folderLocationInsightTypeName + ).insight_type; + } + + /** + * Return a fully-qualified folderLocationInsightTypeInsight resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} insight_type + * @param {string} insight + * @returns {string} Resource name string. + */ + folderLocationInsightTypeInsightPath( + folder: string, + location: string, + insightType: string, + insight: string + ) { + return this.pathTemplates.folderLocationInsightTypeInsightPathTemplate.render( + { + folder: folder, + location: location, + insight_type: insightType, + insight: insight, + } + ); + } + + /** + * Parse the folder from FolderLocationInsightTypeInsight resource. + * + * @param {string} folderLocationInsightTypeInsightName + * A fully-qualified path representing folder_location_insight_type_insight resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationInsightTypeInsightName( + folderLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.folderLocationInsightTypeInsightPathTemplate.match( + folderLocationInsightTypeInsightName + ).folder; + } + + /** + * Parse the location from FolderLocationInsightTypeInsight resource. + * + * @param {string} folderLocationInsightTypeInsightName + * A fully-qualified path representing folder_location_insight_type_insight resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationInsightTypeInsightName( + folderLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.folderLocationInsightTypeInsightPathTemplate.match( + folderLocationInsightTypeInsightName + ).location; + } + + /** + * Parse the insight_type from FolderLocationInsightTypeInsight resource. + * + * @param {string} folderLocationInsightTypeInsightName + * A fully-qualified path representing folder_location_insight_type_insight resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromFolderLocationInsightTypeInsightName( + folderLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.folderLocationInsightTypeInsightPathTemplate.match( + folderLocationInsightTypeInsightName + ).insight_type; + } + + /** + * Parse the insight from FolderLocationInsightTypeInsight resource. + * + * @param {string} folderLocationInsightTypeInsightName + * A fully-qualified path representing folder_location_insight_type_insight resource. + * @returns {string} A string representing the insight. + */ + matchInsightFromFolderLocationInsightTypeInsightName( + folderLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.folderLocationInsightTypeInsightPathTemplate.match( + folderLocationInsightTypeInsightName + ).insight; + } + + /** + * Return a fully-qualified folderLocationRecommender resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} recommender + * @returns {string} Resource name string. + */ + folderLocationRecommenderPath( + folder: string, + location: string, + recommender: string + ) { + return this.pathTemplates.folderLocationRecommenderPathTemplate.render({ + folder: folder, + location: location, + recommender: recommender, + }); + } + + /** + * Parse the folder from FolderLocationRecommender resource. + * + * @param {string} folderLocationRecommenderName + * A fully-qualified path representing folder_location_recommender resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationRecommenderName( + folderLocationRecommenderName: string + ) { + return this.pathTemplates.folderLocationRecommenderPathTemplate.match( + folderLocationRecommenderName + ).folder; + } + + /** + * Parse the location from FolderLocationRecommender resource. + * + * @param {string} folderLocationRecommenderName + * A fully-qualified path representing folder_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationRecommenderName( + folderLocationRecommenderName: string + ) { + return this.pathTemplates.folderLocationRecommenderPathTemplate.match( + folderLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from FolderLocationRecommender resource. + * + * @param {string} folderLocationRecommenderName + * A fully-qualified path representing folder_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromFolderLocationRecommenderName( + folderLocationRecommenderName: string + ) { + return this.pathTemplates.folderLocationRecommenderPathTemplate.match( + folderLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified folderLocationRecommenderRecommendation resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + folderLocationRecommenderRecommendationPath( + folder: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.render( + { + folder: folder, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); + } + + /** + * Parse the folder from FolderLocationRecommenderRecommendation resource. + * + * @param {string} folderLocationRecommenderRecommendationName + * A fully-qualified path representing folder_location_recommender_recommendation resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationRecommenderRecommendationName( + folderLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.match( + folderLocationRecommenderRecommendationName + ).folder; + } + + /** + * Parse the location from FolderLocationRecommenderRecommendation resource. + * + * @param {string} folderLocationRecommenderRecommendationName + * A fully-qualified path representing folder_location_recommender_recommendation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationRecommenderRecommendationName( + folderLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.match( + folderLocationRecommenderRecommendationName + ).location; + } + + /** + * Parse the recommender from FolderLocationRecommenderRecommendation resource. + * + * @param {string} folderLocationRecommenderRecommendationName + * A fully-qualified path representing folder_location_recommender_recommendation resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromFolderLocationRecommenderRecommendationName( + folderLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.match( + folderLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from FolderLocationRecommenderRecommendation resource. + * + * @param {string} folderLocationRecommenderRecommendationName + * A fully-qualified path representing folder_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromFolderLocationRecommenderRecommendationName( + folderLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.match( + folderLocationRecommenderRecommendationName + ).recommendation; + } + + /** + * Return a fully-qualified organizationLocationInsightType resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} insight_type + * @returns {string} Resource name string. + */ + organizationLocationInsightTypePath( + organization: string, + location: string, + insightType: string + ) { + return this.pathTemplates.organizationLocationInsightTypePathTemplate.render( + { + organization: organization, + location: location, + insight_type: insightType, + } + ); + } + + /** + * Parse the organization from OrganizationLocationInsightType resource. + * + * @param {string} organizationLocationInsightTypeName + * A fully-qualified path representing organization_location_insight_type resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationInsightTypeName( + organizationLocationInsightTypeName: string + ) { + return this.pathTemplates.organizationLocationInsightTypePathTemplate.match( + organizationLocationInsightTypeName + ).organization; + } + + /** + * Parse the location from OrganizationLocationInsightType resource. + * + * @param {string} organizationLocationInsightTypeName + * A fully-qualified path representing organization_location_insight_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationInsightTypeName( + organizationLocationInsightTypeName: string + ) { + return this.pathTemplates.organizationLocationInsightTypePathTemplate.match( + organizationLocationInsightTypeName + ).location; + } + + /** + * Parse the insight_type from OrganizationLocationInsightType resource. + * + * @param {string} organizationLocationInsightTypeName + * A fully-qualified path representing organization_location_insight_type resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromOrganizationLocationInsightTypeName( + organizationLocationInsightTypeName: string + ) { + return this.pathTemplates.organizationLocationInsightTypePathTemplate.match( + organizationLocationInsightTypeName + ).insight_type; + } + + /** + * Return a fully-qualified organizationLocationInsightTypeInsight resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} insight_type + * @param {string} insight + * @returns {string} Resource name string. + */ + organizationLocationInsightTypeInsightPath( + organization: string, + location: string, + insightType: string, + insight: string + ) { + return this.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.render( + { + organization: organization, + location: location, + insight_type: insightType, + insight: insight, + } + ); + } + + /** + * Parse the organization from OrganizationLocationInsightTypeInsight resource. + * + * @param {string} organizationLocationInsightTypeInsightName + * A fully-qualified path representing organization_location_insight_type_insight resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationInsightTypeInsightName( + organizationLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.match( + organizationLocationInsightTypeInsightName + ).organization; + } + + /** + * Parse the location from OrganizationLocationInsightTypeInsight resource. + * + * @param {string} organizationLocationInsightTypeInsightName + * A fully-qualified path representing organization_location_insight_type_insight resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationInsightTypeInsightName( + organizationLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.match( + organizationLocationInsightTypeInsightName + ).location; + } + + /** + * Parse the insight_type from OrganizationLocationInsightTypeInsight resource. + * + * @param {string} organizationLocationInsightTypeInsightName + * A fully-qualified path representing organization_location_insight_type_insight resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromOrganizationLocationInsightTypeInsightName( + organizationLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.match( + organizationLocationInsightTypeInsightName + ).insight_type; + } + + /** + * Parse the insight from OrganizationLocationInsightTypeInsight resource. + * + * @param {string} organizationLocationInsightTypeInsightName + * A fully-qualified path representing organization_location_insight_type_insight resource. + * @returns {string} A string representing the insight. + */ + matchInsightFromOrganizationLocationInsightTypeInsightName( + organizationLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.match( + organizationLocationInsightTypeInsightName + ).insight; + } + + /** + * Return a fully-qualified organizationLocationRecommender resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} recommender + * @returns {string} Resource name string. + */ + organizationLocationRecommenderPath( + organization: string, + location: string, + recommender: string + ) { + return this.pathTemplates.organizationLocationRecommenderPathTemplate.render( + { + organization: organization, + location: location, + recommender: recommender, + } + ); + } + + /** + * Parse the organization from OrganizationLocationRecommender resource. + * + * @param {string} organizationLocationRecommenderName + * A fully-qualified path representing organization_location_recommender resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationRecommenderName( + organizationLocationRecommenderName: string + ) { + return this.pathTemplates.organizationLocationRecommenderPathTemplate.match( + organizationLocationRecommenderName + ).organization; + } + + /** + * Parse the location from OrganizationLocationRecommender resource. + * + * @param {string} organizationLocationRecommenderName + * A fully-qualified path representing organization_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationRecommenderName( + organizationLocationRecommenderName: string + ) { + return this.pathTemplates.organizationLocationRecommenderPathTemplate.match( + organizationLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from OrganizationLocationRecommender resource. + * + * @param {string} organizationLocationRecommenderName + * A fully-qualified path representing organization_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromOrganizationLocationRecommenderName( + organizationLocationRecommenderName: string + ) { + return this.pathTemplates.organizationLocationRecommenderPathTemplate.match( + organizationLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified organizationLocationRecommenderRecommendation resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + organizationLocationRecommenderRecommendationPath( + organization: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.render( + { + organization: organization, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); + } + + /** + * Parse the organization from OrganizationLocationRecommenderRecommendation resource. + * + * @param {string} organizationLocationRecommenderRecommendationName + * A fully-qualified path representing organization_location_recommender_recommendation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationRecommenderRecommendationName( + organizationLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.match( + organizationLocationRecommenderRecommendationName + ).organization; + } + + /** + * Parse the location from OrganizationLocationRecommenderRecommendation resource. + * + * @param {string} organizationLocationRecommenderRecommendationName + * A fully-qualified path representing organization_location_recommender_recommendation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationRecommenderRecommendationName( + organizationLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.match( + organizationLocationRecommenderRecommendationName + ).location; + } + + /** + * Parse the recommender from OrganizationLocationRecommenderRecommendation resource. + * + * @param {string} organizationLocationRecommenderRecommendationName + * A fully-qualified path representing organization_location_recommender_recommendation resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromOrganizationLocationRecommenderRecommendationName( + organizationLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.match( + organizationLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from OrganizationLocationRecommenderRecommendation resource. + * + * @param {string} organizationLocationRecommenderRecommendationName + * A fully-qualified path representing organization_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromOrganizationLocationRecommenderRecommendationName( + organizationLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.match( + organizationLocationRecommenderRecommendationName + ).recommendation; + } + + /** + * Return a fully-qualified projectLocationInsightType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} insight_type + * @returns {string} Resource name string. + */ + projectLocationInsightTypePath( + project: string, + location: string, + insightType: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.render({ + project: project, + location: location, + insight_type: insightType, + }); + } + + /** + * Parse the project from ProjectLocationInsightType resource. + * + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationInsightType resource. + * + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).location; + } + + /** + * Parse the insight_type from ProjectLocationInsightType resource. + * + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).insight_type; + } + + /** + * Return a fully-qualified projectLocationInsightTypeInsight resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} insight_type + * @param {string} insight + * @returns {string} Resource name string. + */ + projectLocationInsightTypeInsightPath( + project: string, + location: string, + insightType: string, + insight: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.render( + { + project: project, + location: location, + insight_type: insightType, + insight: insight, + } + ); + } + + /** + * Parse the project from ProjectLocationInsightTypeInsight resource. + * + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).project; + } + + /** + * Parse the location from ProjectLocationInsightTypeInsight resource. + * + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).location; + } + + /** + * Parse the insight_type from ProjectLocationInsightTypeInsight resource. + * + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).insight_type; + } + + /** + * Parse the insight from ProjectLocationInsightTypeInsight resource. + * + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the insight. + */ + matchInsightFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).insight; + } + + /** + * Return a fully-qualified projectLocationRecommender resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} recommender + * @returns {string} Resource name string. + */ + projectLocationRecommenderPath( + project: string, + location: string, + recommender: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.render({ + project: project, + location: location, + recommender: recommender, + }); + } + + /** + * Parse the project from ProjectLocationRecommender resource. + * + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).project; + } + + /** + * Parse the location from ProjectLocationRecommender resource. + * + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from ProjectLocationRecommender resource. + * + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified projectLocationRecommenderRecommendation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + projectLocationRecommenderRecommendationPath( + project: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.render( + { + project: project, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); + } + + /** + * Parse the project from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).project; + } + + /** + * Parse the location from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).location; + } + + /** + * Parse the recommender from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).recommendation; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.recommenderStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-recommender/src/v1/recommender_client_config.json b/packages/google-cloud-recommender/src/v1/recommender_client_config.json new file mode 100644 index 000000000000..a5a33f327783 --- /dev/null +++ b/packages/google-cloud-recommender/src/v1/recommender_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.recommender.v1.Recommender": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "ListInsights": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetInsight": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "MarkInsightAccepted": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRecommendations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetRecommendation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "MarkRecommendationClaimed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MarkRecommendationSucceeded": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MarkRecommendationFailed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-recommender/src/v1/recommender_proto_list.json b/packages/google-cloud-recommender/src/v1/recommender_proto_list.json new file mode 100644 index 000000000000..9492e3060335 --- /dev/null +++ b/packages/google-cloud-recommender/src/v1/recommender_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/recommender/v1/insight.proto", + "../../protos/google/cloud/recommender/v1/recommendation.proto", + "../../protos/google/cloud/recommender/v1/recommender_service.proto" +] diff --git a/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.js b/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..c33833cd73ca --- /dev/null +++ b/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const recommender = require('@google-cloud/recommender'); + +function main() { + const recommenderClient = new recommender.RecommenderClient(); +} + +main(); diff --git a/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..659c9f953154 --- /dev/null +++ b/packages/google-cloud-recommender/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** 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 {RecommenderClient} from '@google-cloud/recommender'; + +// check that the client class type name can be used +function doStuffWithRecommenderClient(client: RecommenderClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const recommenderClient = new RecommenderClient(); + doStuffWithRecommenderClient(recommenderClient); +} + +main(); diff --git a/packages/google-cloud-recommender/system-test/install.ts b/packages/google-cloud-recommender/system-test/install.ts new file mode 100644 index 000000000000..d2d61c0396fc --- /dev/null +++ b/packages/google-cloud-recommender/system-test/install.ts @@ -0,0 +1,51 @@ +// 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. +// +// ** 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-recommender/test/gapic_recommender_v1.ts b/packages/google-cloud-recommender/test/gapic_recommender_v1.ts new file mode 100644 index 000000000000..832227011386 --- /dev/null +++ b/packages/google-cloud-recommender/test/gapic_recommender_v1.ts @@ -0,0 +1,2952 @@ +// 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. +// +// ** 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 recommenderModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +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.RecommenderClient', () => { + it('has servicePath', () => { + const servicePath = recommenderModule.v1.RecommenderClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = recommenderModule.v1.RecommenderClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = recommenderModule.v1.RecommenderClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new recommenderModule.v1.RecommenderClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new recommenderModule.v1.RecommenderClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.recommenderStub, undefined); + await client.initialize(); + assert(client.recommenderStub); + }); + + it('has close method', () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new recommenderModule.v1.RecommenderClient({ + 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 recommenderModule.v1.RecommenderClient({ + 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('getInsight', () => { + it('invokes getInsight without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetInsightRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Insight() + ); + client.innerApiCalls.getInsight = stubSimpleCall(expectedResponse); + const [response] = await client.getInsight(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInsight as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getInsight without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetInsightRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Insight() + ); + client.innerApiCalls.getInsight = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInsight( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IInsight | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInsight as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getInsight with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetInsightRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInsight = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInsight(request), expectedError); + assert( + (client.innerApiCalls.getInsight as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('markInsightAccepted', () => { + it('invokes markInsightAccepted without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkInsightAcceptedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Insight() + ); + client.innerApiCalls.markInsightAccepted = + stubSimpleCall(expectedResponse); + const [response] = await client.markInsightAccepted(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markInsightAccepted as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes markInsightAccepted without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkInsightAcceptedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Insight() + ); + client.innerApiCalls.markInsightAccepted = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.markInsightAccepted( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IInsight | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markInsightAccepted as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes markInsightAccepted with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkInsightAcceptedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.markInsightAccepted = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.markInsightAccepted(request), expectedError); + assert( + (client.innerApiCalls.markInsightAccepted as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getRecommendation', () => { + it('invokes getRecommendation without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetRecommendationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.getRecommendation = stubSimpleCall(expectedResponse); + const [response] = await client.getRecommendation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRecommendation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getRecommendation without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetRecommendationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.getRecommendation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRecommendation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IRecommendation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRecommendation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getRecommendation with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.GetRecommendationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRecommendation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRecommendation(request), expectedError); + assert( + (client.innerApiCalls.getRecommendation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('markRecommendationClaimed', () => { + it('invokes markRecommendationClaimed without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationClaimedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationClaimed = + stubSimpleCall(expectedResponse); + const [response] = await client.markRecommendationClaimed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationClaimed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes markRecommendationClaimed without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationClaimedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationClaimed = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.markRecommendationClaimed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IRecommendation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationClaimed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes markRecommendationClaimed with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationClaimedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.markRecommendationClaimed = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.markRecommendationClaimed(request), + expectedError + ); + assert( + (client.innerApiCalls.markRecommendationClaimed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('markRecommendationSucceeded', () => { + it('invokes markRecommendationSucceeded without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationSucceededRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationSucceeded = + stubSimpleCall(expectedResponse); + const [response] = await client.markRecommendationSucceeded(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationSucceeded as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes markRecommendationSucceeded without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationSucceededRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationSucceeded = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.markRecommendationSucceeded( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IRecommendation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationSucceeded as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes markRecommendationSucceeded with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationSucceededRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.markRecommendationSucceeded = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.markRecommendationSucceeded(request), + expectedError + ); + assert( + (client.innerApiCalls.markRecommendationSucceeded as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('markRecommendationFailed', () => { + it('invokes markRecommendationFailed without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationFailedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationFailed = + stubSimpleCall(expectedResponse); + const [response] = await client.markRecommendationFailed(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationFailed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes markRecommendationFailed without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationFailedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ); + client.innerApiCalls.markRecommendationFailed = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.markRecommendationFailed( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IRecommendation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.markRecommendationFailed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes markRecommendationFailed with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.MarkRecommendationFailedRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.markRecommendationFailed = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.markRecommendationFailed(request), + expectedError + ); + assert( + (client.innerApiCalls.markRecommendationFailed as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listInsights', () => { + it('invokes listInsights without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + ]; + client.innerApiCalls.listInsights = stubSimpleCall(expectedResponse); + const [response] = await client.listInsights(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInsights as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInsights without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + ]; + client.innerApiCalls.listInsights = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInsights( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IInsight[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInsights as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listInsights with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInsights = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInsights(request), expectedError); + assert( + (client.innerApiCalls.listInsights as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInsightsStream without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + ]; + client.descriptors.page.listInsights.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInsightsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recommender.v1.Insight[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recommender.v1.Insight) => { + 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.listInsights.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInsights, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInsights.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInsightsStream with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInsights.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listInsightsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recommender.v1.Insight[] = []; + stream.on( + 'data', + (response: protos.google.cloud.recommender.v1.Insight) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInsights.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInsights, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInsights.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInsights without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + generateSampleMessage(new protos.google.cloud.recommender.v1.Insight()), + ]; + client.descriptors.page.listInsights.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recommender.v1.IInsight[] = []; + const iterable = client.listInsightsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInsights.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInsights.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInsights with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListInsightsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInsights.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInsightsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recommender.v1.IInsight[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInsights.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInsights.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listRecommendations', () => { + it('invokes listRecommendations without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + ]; + client.innerApiCalls.listRecommendations = + stubSimpleCall(expectedResponse); + const [response] = await client.listRecommendations(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRecommendations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRecommendations without error using callback', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + ]; + client.innerApiCalls.listRecommendations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRecommendations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.recommender.v1.IRecommendation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRecommendations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listRecommendations with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRecommendations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRecommendations(request), expectedError); + assert( + (client.innerApiCalls.listRecommendations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listRecommendationsStream without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + ]; + client.descriptors.page.listRecommendations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRecommendationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recommender.v1.Recommendation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.recommender.v1.Recommendation) => { + 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.listRecommendations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRecommendations, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listRecommendations.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listRecommendationsStream with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRecommendations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRecommendationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.recommender.v1.Recommendation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.recommender.v1.Recommendation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRecommendations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRecommendations, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listRecommendations.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRecommendations without error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + generateSampleMessage( + new protos.google.cloud.recommender.v1.Recommendation() + ), + ]; + client.descriptors.page.listRecommendations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.recommender.v1.IRecommendation[] = + []; + const iterable = client.listRecommendationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRecommendations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRecommendations.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRecommendations with error', async () => { + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.recommender.v1.ListRecommendationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listRecommendations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRecommendationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.recommender.v1.IRecommendation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRecommendations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listRecommendations.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('billingAccountLocationInsightType', () => { + const fakePath = '/rendered/path/billingAccountLocationInsightType'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationInsightTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationInsightTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationInsightTypePath', () => { + const result = client.billingAccountLocationInsightTypePath( + 'billingAccountValue', + 'locationValue', + 'insightTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationInsightTypeName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationInsightTypeName', () => { + const result = + client.matchLocationFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromBillingAccountLocationInsightTypeName', () => { + const result = + client.matchInsightTypeFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationInsightTypeInsight', () => { + const fakePath = + '/rendered/path/billingAccountLocationInsightTypeInsight'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + insight: 'insightValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationInsightTypeInsightPath', () => { + const result = client.billingAccountLocationInsightTypeInsightPath( + 'billingAccountValue', + 'locationValue', + 'insightTypeValue', + 'insightValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationInsightTypeInsightName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationInsightTypeInsightName', () => { + const result = + client.matchLocationFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromBillingAccountLocationInsightTypeInsightName', () => { + const result = + client.matchInsightTypeFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightFromBillingAccountLocationInsightTypeInsightName', () => { + const result = + client.matchInsightFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationRecommender', () => { + const fakePath = '/rendered/path/billingAccountLocationRecommender'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + recommender: 'recommenderValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationRecommenderPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationRecommenderPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationRecommenderPath', () => { + const result = client.billingAccountLocationRecommenderPath( + 'billingAccountValue', + 'locationValue', + 'recommenderValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationRecommenderName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationRecommenderName', () => { + const result = + client.matchLocationFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromBillingAccountLocationRecommenderName', () => { + const result = + client.matchRecommenderFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationRecommenderRecommendation', () => { + const fakePath = + '/rendered/path/billingAccountLocationRecommenderRecommendation'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationRecommenderRecommendationPath', () => { + const result = + client.billingAccountLocationRecommenderRecommendationPath( + 'billingAccountValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = + client.matchLocationFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommenderFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommendationFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + ( + client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationInsightType', () => { + const fakePath = '/rendered/path/folderLocationInsightType'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationInsightTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationInsightTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationInsightTypePath', () => { + const result = client.folderLocationInsightTypePath( + 'folderValue', + 'locationValue', + 'insightTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationInsightTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationInsightTypeName', () => { + const result = + client.matchFolderFromFolderLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationInsightTypeName', () => { + const result = + client.matchLocationFromFolderLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromFolderLocationInsightTypeName', () => { + const result = + client.matchInsightTypeFromFolderLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationInsightTypeInsight', () => { + const fakePath = '/rendered/path/folderLocationInsightTypeInsight'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + insight: 'insightValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationInsightTypeInsightPath', () => { + const result = client.folderLocationInsightTypeInsightPath( + 'folderValue', + 'locationValue', + 'insightTypeValue', + 'insightValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationInsightTypeInsightName', () => { + const result = + client.matchFolderFromFolderLocationInsightTypeInsightName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationInsightTypeInsightName', () => { + const result = + client.matchLocationFromFolderLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromFolderLocationInsightTypeInsightName', () => { + const result = + client.matchInsightTypeFromFolderLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightFromFolderLocationInsightTypeInsightName', () => { + const result = + client.matchInsightFromFolderLocationInsightTypeInsightName(fakePath); + assert.strictEqual(result, 'insightValue'); + assert( + ( + client.pathTemplates.folderLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationRecommender', () => { + const fakePath = '/rendered/path/folderLocationRecommender'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + recommender: 'recommenderValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationRecommenderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationRecommenderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationRecommenderPath', () => { + const result = client.folderLocationRecommenderPath( + 'folderValue', + 'locationValue', + 'recommenderValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationRecommenderPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationRecommenderName', () => { + const result = + client.matchFolderFromFolderLocationRecommenderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationRecommenderName', () => { + const result = + client.matchLocationFromFolderLocationRecommenderName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromFolderLocationRecommenderName', () => { + const result = + client.matchRecommenderFromFolderLocationRecommenderName(fakePath); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates.folderLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationRecommenderRecommendation', () => { + const fakePath = '/rendered/path/folderLocationRecommenderRecommendation'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationRecommenderRecommendationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationRecommenderRecommendationPath', () => { + const result = client.folderLocationRecommenderRecommendationPath( + 'folderValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .folderLocationRecommenderRecommendationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationRecommenderRecommendationName', () => { + const result = + client.matchFolderFromFolderLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates + .folderLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationRecommenderRecommendationName', () => { + const result = + client.matchLocationFromFolderLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .folderLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromFolderLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommenderFromFolderLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates + .folderLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromFolderLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommendationFromFolderLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + ( + client.pathTemplates + .folderLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationInsightType', () => { + const fakePath = '/rendered/path/organizationLocationInsightType'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationInsightTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationInsightTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationInsightTypePath', () => { + const result = client.organizationLocationInsightTypePath( + 'organizationValue', + 'locationValue', + 'insightTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationInsightTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationInsightTypeName', () => { + const result = + client.matchOrganizationFromOrganizationLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationInsightTypeName', () => { + const result = + client.matchLocationFromOrganizationLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromOrganizationLocationInsightTypeName', () => { + const result = + client.matchInsightTypeFromOrganizationLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.organizationLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationInsightTypeInsight', () => { + const fakePath = '/rendered/path/organizationLocationInsightTypeInsight'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + insight: 'insightValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationInsightTypeInsightPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationInsightTypeInsightPath', () => { + const result = client.organizationLocationInsightTypeInsightPath( + 'organizationValue', + 'locationValue', + 'insightTypeValue', + 'insightValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationInsightTypeInsightPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationInsightTypeInsightName', () => { + const result = + client.matchOrganizationFromOrganizationLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationInsightTypeInsightName', () => { + const result = + client.matchLocationFromOrganizationLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromOrganizationLocationInsightTypeInsightName', () => { + const result = + client.matchInsightTypeFromOrganizationLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates + .organizationLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightFromOrganizationLocationInsightTypeInsightName', () => { + const result = + client.matchInsightFromOrganizationLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightValue'); + assert( + ( + client.pathTemplates + .organizationLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationRecommender', () => { + const fakePath = '/rendered/path/organizationLocationRecommender'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + recommender: 'recommenderValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationRecommenderPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationRecommenderPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationRecommenderPath', () => { + const result = client.organizationLocationRecommenderPath( + 'organizationValue', + 'locationValue', + 'recommenderValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationRecommenderPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationRecommenderName', () => { + const result = + client.matchOrganizationFromOrganizationLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationRecommenderName', () => { + const result = + client.matchLocationFromOrganizationLocationRecommenderName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromOrganizationLocationRecommenderName', () => { + const result = + client.matchRecommenderFromOrganizationLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates.organizationLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationRecommenderRecommendation', () => { + const fakePath = + '/rendered/path/organizationLocationRecommenderRecommendation'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationRecommenderRecommendationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationRecommenderRecommendationPath', () => { + const result = client.organizationLocationRecommenderRecommendationPath( + 'organizationValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationRecommenderRecommendationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationRecommenderRecommendationName', () => { + const result = + client.matchOrganizationFromOrganizationLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationRecommenderRecommendationName', () => { + const result = + client.matchLocationFromOrganizationLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromOrganizationLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommenderFromOrganizationLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates + .organizationLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromOrganizationLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommendationFromOrganizationLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + ( + client.pathTemplates + .organizationLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationInsightType', () => { + const fakePath = '/rendered/path/projectLocationInsightType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationInsightTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationInsightTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationInsightTypePath', () => { + const result = client.projectLocationInsightTypePath( + 'projectValue', + 'locationValue', + 'insightTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationInsightTypePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationInsightTypeName', () => { + const result = + client.matchProjectFromProjectLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationInsightTypeName', () => { + const result = + client.matchLocationFromProjectLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromProjectLocationInsightTypeName', () => { + const result = + client.matchInsightTypeFromProjectLocationInsightTypeName(fakePath); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationInsightTypeInsight', () => { + const fakePath = '/rendered/path/projectLocationInsightTypeInsight'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + insight: 'insightValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationInsightTypeInsightPath', () => { + const result = client.projectLocationInsightTypeInsightPath( + 'projectValue', + 'locationValue', + 'insightTypeValue', + 'insightValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationInsightTypeInsightName', () => { + const result = + client.matchProjectFromProjectLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationInsightTypeInsightName', () => { + const result = + client.matchLocationFromProjectLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromProjectLocationInsightTypeInsightName', () => { + const result = + client.matchInsightTypeFromProjectLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightFromProjectLocationInsightTypeInsightName', () => { + const result = + client.matchInsightFromProjectLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightValue'); + assert( + ( + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationRecommender', () => { + const fakePath = '/rendered/path/projectLocationRecommender'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + recommender: 'recommenderValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationRecommenderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationRecommenderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationRecommenderPath', () => { + const result = client.projectLocationRecommenderPath( + 'projectValue', + 'locationValue', + 'recommenderValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationRecommenderPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationRecommenderName', () => { + const result = + client.matchProjectFromProjectLocationRecommenderName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationRecommenderName', () => { + const result = + client.matchLocationFromProjectLocationRecommenderName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromProjectLocationRecommenderName', () => { + const result = + client.matchRecommenderFromProjectLocationRecommenderName(fakePath); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationRecommenderRecommendation', () => { + const fakePath = + '/rendered/path/projectLocationRecommenderRecommendation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationRecommenderRecommendationPath', () => { + const result = client.projectLocationRecommenderRecommendationPath( + 'projectValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationRecommenderRecommendationName', () => { + const result = + client.matchProjectFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationRecommenderRecommendationName', () => { + const result = + client.matchLocationFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromProjectLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommenderFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + ( + client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromProjectLocationRecommenderRecommendationName', () => { + const result = + client.matchRecommendationFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + ( + client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-recommender/tsconfig.json b/packages/google-cloud-recommender/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-recommender/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/packages/google-cloud-recommender/webpack.config.js b/packages/google-cloud-recommender/webpack.config.js new file mode 100644 index 000000000000..919839c414cd --- /dev/null +++ b/packages/google-cloud-recommender/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: 'Recommender', + filename: './recommender.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/packages/google-cloud-resourcemanager/.OwlBot.yaml b/packages/google-cloud-resourcemanager/.OwlBot.yaml new file mode 100644 index 000000000000..df959322377f --- /dev/null +++ b/packages/google-cloud-resourcemanager/.OwlBot.yaml @@ -0,0 +1,22 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/resourcemanager/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-resourcemanager/$1 + +begin-after-commit-hash: 397c0bfd367a2427104f988d5329bc117caafd95 diff --git a/packages/google-cloud-resourcemanager/.eslintignore b/packages/google-cloud-resourcemanager/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-resourcemanager/.eslintrc.json b/packages/google-cloud-resourcemanager/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-resourcemanager/.gitattributes b/packages/google-cloud-resourcemanager/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-resourcemanager/.gitignore b/packages/google-cloud-resourcemanager/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.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/packages/google-cloud-resourcemanager/.jsdoc.js b/packages/google-cloud-resourcemanager/.jsdoc.js new file mode 100644 index 000000000000..ccd2dc416934 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/resource-manager', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-resourcemanager/.mocharc.js b/packages/google-cloud-resourcemanager/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-resourcemanager/.nycrc b/packages/google-cloud-resourcemanager/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-resourcemanager/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-resourcemanager/.prettierignore b/packages/google-cloud-resourcemanager/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-resourcemanager/.prettierrc.js b/packages/google-cloud-resourcemanager/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-resourcemanager/.readme-partials.yaml b/packages/google-cloud-resourcemanager/.readme-partials.yaml new file mode 100644 index 000000000000..7df610197744 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.readme-partials.yaml @@ -0,0 +1,13 @@ +introduction: |- + + > Node.js idiomatic client for [Cloud Resource Manager API][product-docs]. + + Google Cloud Platform provides container resources such as Organizations + and Projects, that allow you to group and hierarchically organize other + Cloud Platform resources. This hierarchical organization lets you easily + manage common aspects of your resources such as access control and + configuration settings. The [Cloud Resource Manager API](https://cloud.google.com/resource-manager/docs/) + enables you to programmatically manage these container resources. + + ### **_IMPORTANT NOTE_** + **Version 2.0.0 renames `@google-cloud/resource` to `@google-cloud/resource-manager` on npm.** \ No newline at end of file diff --git a/packages/google-cloud-resourcemanager/.repo-metadata.json b/packages/google-cloud-resourcemanager/.repo-metadata.json new file mode 100644 index 000000000000..b2b14e3dd2e7 --- /dev/null +++ b/packages/google-cloud-resourcemanager/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "resource", + "name_pretty": "Google Cloud Resource Manager API", + "product_documentation": "https://cloud.google.com/resource-manager", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/resource-manager/latest", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559757", + "release_level": "stable", + "language": "nodejs", + "default_version": "v3", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/resource-manager", + "api_id": "cloudresourcemanager.googleapis.com", + "requires_billing": true, + "api_shortname": "cloudresourcemanager", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-resourcemanager/CHANGELOG.md b/packages/google-cloud-resourcemanager/CHANGELOG.md new file mode 100644 index 000000000000..06f99593118e --- /dev/null +++ b/packages/google-cloud-resourcemanager/CHANGELOG.md @@ -0,0 +1,342 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/resource-manager?activeTab=versions + +## [4.1.1](https://github.com/googleapis/nodejs-resource-manager/compare/v4.1.0...v4.1.1) (2022-09-22) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#470](https://github.com/googleapis/nodejs-resource-manager/issues/470)) ([eaa8877](https://github.com/googleapis/nodejs-resource-manager/commit/eaa887732d228ec85fbcdf72f8f6bd98a22406d4)) +* Better support for fallback mode ([#465](https://github.com/googleapis/nodejs-resource-manager/issues/465)) ([fd689ca](https://github.com/googleapis/nodejs-resource-manager/commit/fd689ca2b95c78666c9703b40b380e155a7c87bc)) +* Change import long to require ([#466](https://github.com/googleapis/nodejs-resource-manager/issues/466)) ([de6e9b8](https://github.com/googleapis/nodejs-resource-manager/commit/de6e9b8ebc0c505722bd92cd7487fdabb177f062)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-resource-manager/issues/1553)) ([#469](https://github.com/googleapis/nodejs-resource-manager/issues/469)) ([189b652](https://github.com/googleapis/nodejs-resource-manager/commit/189b6522c57e3190f741cacb11fc76b8bf96aabb)) +* Preserve default values in x-goog-request-params header ([#471](https://github.com/googleapis/nodejs-resource-manager/issues/471)) ([c9b9564](https://github.com/googleapis/nodejs-resource-manager/commit/c9b95649df8d8a59e0d114100b537e54cfffefa2)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-resource-manager/issues/1546)) ([#468](https://github.com/googleapis/nodejs-resource-manager/issues/468)) ([07f7a4b](https://github.com/googleapis/nodejs-resource-manager/commit/07f7a4b3e8d28c3cf74debe162f23ba628e5f9fe)) +* use google-gax v3.3.0 ([189b652](https://github.com/googleapis/nodejs-resource-manager/commit/189b6522c57e3190f741cacb11fc76b8bf96aabb)) + +## [4.1.0](https://github.com/googleapis/nodejs-resource-manager/compare/v4.0.0...v4.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#458](https://github.com/googleapis/nodejs-resource-manager/issues/458)) ([5c42451](https://github.com/googleapis/nodejs-resource-manager/commit/5c42451843379918f25cf1692a19d263663cec37)) + +## [4.0.0](https://github.com/googleapis/nodejs-resource-manager/compare/v3.2.0...v4.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#452) + +### Build System + +* update library to use Node 12 ([#452](https://github.com/googleapis/nodejs-resource-manager/issues/452)) ([b1c7b72](https://github.com/googleapis/nodejs-resource-manager/commit/b1c7b728c44035f3774d19bed47ed03274926212)) + +## [3.2.0](https://github.com/googleapis/nodejs-resource-manager/compare/v3.1.0...v3.2.0) (2022-04-06) + + +### Features + +* AuditConfig for IAM v1 ([#439](https://github.com/googleapis/nodejs-resource-manager/issues/439)) ([58e5893](https://github.com/googleapis/nodejs-resource-manager/commit/58e5893b40f3e27a7037291ba8d5470e1b2d2715)) + +## [3.1.0](https://github.com/googleapis/nodejs-resource-manager/compare/v3.0.0...v3.1.0) (2022-03-23) + + +### Features + +* promote to stable ([#436](https://github.com/googleapis/nodejs-resource-manager/issues/436)) ([7aa1961](https://github.com/googleapis/nodejs-resource-manager/commit/7aa1961bbcdc61f0074486388b3c710610312a6b)), closes [#421](https://github.com/googleapis/nodejs-resource-manager/issues/421) + +## [3.0.0](https://www.github.com/googleapis/nodejs-resource-manager/compare/v2.0.1...v3.0.0) (2021-09-14) + + +### ⚠ BREAKING CHANGES + +* v3 introduces significant changes to API surface, see: https://cloud.google.com/resource-manager/reference/rest/v3/folders + +### Features + +* migrate to v3 API surface ([#387](https://www.github.com/googleapis/nodejs-resource-manager/issues/387)) ([88da339](https://www.github.com/googleapis/nodejs-resource-manager/commit/88da339803e7a8bb04f75124232ab0e09d4d971f)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-resource-manager/compare/v2.0.0...v2.0.1) (2021-09-09) + + +### Bug Fixes + +* **build:** switch primary branch to main ([#393](https://www.github.com/googleapis/nodejs-resource-manager/issues/393)) ([3e9c0a9](https://www.github.com/googleapis/nodejs-resource-manager/commit/3e9c0a94c065faacbc584353f10250a211d624ab)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-resource-manager/compare/v1.3.0...v2.0.0) (2021-06-01) + + +### ⚠ BREAKING CHANGES + +* rename package to @google-cloud/resource-manager (#376) + +### Features + +* rename package to @google-cloud/resource-manager ([#376](https://www.github.com/googleapis/nodejs-resource-manager/issues/376)) ([f9feeb2](https://www.github.com/googleapis/nodejs-resource-manager/commit/f9feeb22e0fbdfc0712dbcdc976d4f6f109fc44b)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-resource-manager/compare/v1.2.1...v1.3.0) (2021-05-25) + + +### Features + +* package rename in npm ([#370](https://www.github.com/googleapis/nodejs-resource-manager/issues/370)) ([04d21a2](https://www.github.com/googleapis/nodejs-resource-manager/commit/04d21a25a1eeb7c7a7070eadcaf64d5ca2d3b408)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-resource/compare/v1.2.0...v1.2.1) (2020-07-10) + + +### Bug Fixes + +* update node issue template ([#324](https://www.github.com/googleapis/nodejs-resource/issues/324)) ([1636ab1](https://www.github.com/googleapis/nodejs-resource/commit/1636ab1ab1885e8e28773d0804dc930eda3c7bd0)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.5...v1.2.0) (2020-05-20) + + +### Features + +* Expose getIamPolicy support for project ([#302](https://www.github.com/googleapis/nodejs-resource/issues/302)) ([85f136d](https://www.github.com/googleapis/nodejs-resource/commit/85f136dfe133e42976864082cfe444a3f0cea37c)) + + +### Bug Fixes + +* apache license URL ([#468](https://www.github.com/googleapis/nodejs-resource/issues/468)) ([#308](https://www.github.com/googleapis/nodejs-resource/issues/308)) ([3fdebd3](https://www.github.com/googleapis/nodejs-resource/commit/3fdebd3b5f57d11dc77b8a6755d25d9be3da4794)) +* **deps:** update dependency @google-cloud/common to v3 ([#301](https://www.github.com/googleapis/nodejs-resource/issues/301)) ([0ee3bf1](https://www.github.com/googleapis/nodejs-resource/commit/0ee3bf19810f38c4aa2a4e1b389022bc32bc70bc)) +* **deps:** update dependency @google-cloud/paginator to v3 ([#299](https://www.github.com/googleapis/nodejs-resource/issues/299)) ([3cffb9f](https://www.github.com/googleapis/nodejs-resource/commit/3cffb9ffbdeaabd77522f17af9b5f25eb11a9009)) +* **deps:** update dependency @google-cloud/promisify to v2 ([#298](https://www.github.com/googleapis/nodejs-resource/issues/298)) ([1e8965f](https://www.github.com/googleapis/nodejs-resource/commit/1e8965f204195d7d0014691dad6eb7d2efb632b9)) + +### [1.1.5](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.4...v1.1.5) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([6e6c60d](https://www.github.com/googleapis/nodejs-resource/commit/6e6c60d196bea624efd983be4b7fe3b41aa77c2f)) + +### [1.1.4](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.3...v1.1.4) (2019-11-14) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#258](https://www.github.com/googleapis/nodejs-resource/issues/258)) ([d81b8ae](https://www.github.com/googleapis/nodejs-resource/commit/d81b8aecd58bfcb167463b9c69acd54184efae70)) + +### [1.1.3](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.2...v1.1.3) (2019-07-26) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v2 ([#238](https://www.github.com/googleapis/nodejs-resource/issues/238)) ([42c35d2](https://www.github.com/googleapis/nodejs-resource/commit/42c35d2)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#234](https://www.github.com/googleapis/nodejs-resource/issues/234)) ([342c506](https://www.github.com/googleapis/nodejs-resource/commit/342c506)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-resource/compare/v1.1.0...v1.1.1) (2019-06-15) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#231](https://www.github.com/googleapis/nodejs-resource/issues/231)) ([4e08223](https://www.github.com/googleapis/nodejs-resource/commit/4e08223)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-resource/compare/v1.0.1...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint override ([#229](https://www.github.com/googleapis/nodejs-resource/issues/229)) ([f90f4b4](https://www.github.com/googleapis/nodejs-resource/commit/f90f4b4)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-resource/compare/v1.0.0...v1.0.1) (2019-05-24) + + +### Bug Fixes + +* **types:** use Metadata for api response type ([#222](https://www.github.com/googleapis/nodejs-resource/issues/222)) ([2032590](https://www.github.com/googleapis/nodejs-resource/commit/2032590)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-resource/compare/v0.9.1...v1.0.0) (2019-05-14) + + +### Bug Fixes + +* **deps:** remove teeny-request as dependency ([#199](https://www.github.com/googleapis/nodejs-resource/issues/199)) ([385b400](https://www.github.com/googleapis/nodejs-resource/commit/385b400)) +* **deps:** update dependency @google-cloud/common to ^0.32.0 ([4707eb9](https://www.github.com/googleapis/nodejs-resource/commit/4707eb9)), closes [#8203](https://www.github.com/googleapis/nodejs-resource/issues/8203) +* **deps:** update dependency @google-cloud/common to v1 ([#215](https://www.github.com/googleapis/nodejs-resource/issues/215)) ([ab7cb12](https://www.github.com/googleapis/nodejs-resource/commit/ab7cb12)) +* **deps:** update dependency @google-cloud/paginator to v1 ([#209](https://www.github.com/googleapis/nodejs-resource/issues/209)) ([14b6523](https://www.github.com/googleapis/nodejs-resource/commit/14b6523)) +* **deps:** update dependency @google-cloud/promisify to v1 ([#208](https://www.github.com/googleapis/nodejs-resource/issues/208)) ([3a71dcb](https://www.github.com/googleapis/nodejs-resource/commit/3a71dcb)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#204](https://www.github.com/googleapis/nodejs-resource/issues/204)) ([57b27fd](https://www.github.com/googleapis/nodejs-resource/commit/57b27fd)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#204) + +## v0.9.1 + +03-12-2019 12:22 PDT + +Greetings folks! This is a patch release that just bumps a few dependencies. Enjoy! + +### Dependencies +- fix(deps): update dependency @google-cloud/paginator to ^0.2.0 +- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#179](https://github.com/googleapis/nodejs-resource/pull/179)) +- fix(deps): update dependency @google-cloud/common to ^0.31.0 ([#171](https://github.com/googleapis/nodejs-resource/pull/171)) + +### Documentation +- docs: update links in contrib guide ([#180](https://github.com/googleapis/nodejs-resource/pull/180)) +- docs: update contributing path in README ([#174](https://github.com/googleapis/nodejs-resource/pull/174)) +- docs: move CONTRIBUTING.md to root ([#173](https://github.com/googleapis/nodejs-resource/pull/173)) +- docs: add lint/fix example to contributing guide ([#170](https://github.com/googleapis/nodejs-resource/pull/170)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#184](https://github.com/googleapis/nodejs-resource/pull/184)) +- build: use node10 to run samples-test, system-test etc ([#183](https://github.com/googleapis/nodejs-resource/pull/183)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#178](https://github.com/googleapis/nodejs-resource/pull/178)) +- fix(deps): update dependency yargs to v13 ([#177](https://github.com/googleapis/nodejs-resource/pull/177)) +- build: create docs test npm scripts ([#176](https://github.com/googleapis/nodejs-resource/pull/176)) +- build: test using @grpc/grpc-js in CI ([#175](https://github.com/googleapis/nodejs-resource/pull/175)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#168](https://github.com/googleapis/nodejs-resource/pull/168)) +- build: ignore googleapis.com in doc link check ([#166](https://github.com/googleapis/nodejs-resource/pull/166)) +- build: check broken links in generated docs ([#164](https://github.com/googleapis/nodejs-resource/pull/164)) +- refactor: modernize the sample tests ([#162](https://github.com/googleapis/nodejs-resource/pull/162)) +- chore(build): inject yoshi automation key ([#160](https://github.com/googleapis/nodejs-resource/pull/160)) +- chore: update nyc and eslint configs ([#159](https://github.com/googleapis/nodejs-resource/pull/159)) +- chore: fix publish.sh permission +x ([#157](https://github.com/googleapis/nodejs-resource/pull/157)) +- fix(build): fix Kokoro release script ([#156](https://github.com/googleapis/nodejs-resource/pull/156)) +- build: add Kokoro configs for autorelease ([#155](https://github.com/googleapis/nodejs-resource/pull/155)) + +## v0.9.0 + +12-06-2018 15:54 PST + +**This release has breaking changes**. Please update with care. + +### Breaking changes + +#### Dropped support for non-LTS versions of node.js +Node.js versions 4.x and 9.x are explicitly not supported. + +#### Support for es modules +The import syntax for this library has changed to support es modules. + +__old code__ +```js +const Resource = require('@google-cloud/resource-manager'); +const resource = Resource({...}); +``` + +__new code__ +```js +const {Resource} = require('@google-cloud/resource-manager'); +const resource = Resource({...}); +``` + +### Features +- feat: convert to typescript ([#64](https://github.com/googleapis/nodejs-resource/pull/64)) + +### Documentation +- docs: update readme badges ([#146](https://github.com/googleapis/nodejs-resource/pull/146)) +- docs(samples): updated samples code to use async await ([#139](https://github.com/googleapis/nodejs-resource/pull/139)) + +### Fixes +- fix: improve types and fix sample tests ([#141](https://github.com/googleapis/nodejs-resource/pull/141)) +- fix(typo): LifecylceState => LifecycleState interface ([#124](https://github.com/googleapis/nodejs-resource/pull/124)) +- fix: improve types, enable noImplicitThis ([#90](https://github.com/googleapis/nodejs-resource/pull/90)) +- fix: use small HTTP dependency ([#80](https://github.com/googleapis/nodejs-resource/pull/80)) +- fix: drop support for node.js 4.x and 9.x ([#50](https://github.com/googleapis/nodejs-resource/pull/50)) + +### Internal / Testing Changes +- test: disable lifecycle project system test ([#142](https://github.com/googleapis/nodejs-resource/pull/142)) +- chore: always nyc report before calling codecov ([#151](https://github.com/googleapis/nodejs-resource/pull/151)) +- chore: nyc ignore build/test by default ([#150](https://github.com/googleapis/nodejs-resource/pull/150)) +- chore: update license file ([#148](https://github.com/googleapis/nodejs-resource/pull/148)) +- fix(build): fix system key decryption ([#144](https://github.com/googleapis/nodejs-resource/pull/144)) +- chore(deps): update dependency typescript to ~3.2.0 ([#143](https://github.com/googleapis/nodejs-resource/pull/143)) +- chore: add a synth.metadata +- refactor(samples): convert sample tests from ava to mocha ([#135](https://github.com/googleapis/nodejs-resource/pull/135)) +- chore(deps): update dependency gts to ^0.9.0 ([#134](https://github.com/googleapis/nodejs-resource/pull/134)) +- chore: update eslintignore config ([#133](https://github.com/googleapis/nodejs-resource/pull/133)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#130](https://github.com/googleapis/nodejs-resource/pull/130)) +- refactor: drop dependency on extend ([#128](https://github.com/googleapis/nodejs-resource/pull/128)) +- chore: drop contributors from multiple places ([#129](https://github.com/googleapis/nodejs-resource/pull/129)) +- fix(deps): update dependency @google-cloud/common to ^0.26.0 ([#113](https://github.com/googleapis/nodejs-resource/pull/113)) +- chore: use latest npm on Windows ([#127](https://github.com/googleapis/nodejs-resource/pull/127)) +- chore: update CircleCI config ([#126](https://github.com/googleapis/nodejs-resource/pull/126)) +- chore: include build in eslintignore ([#122](https://github.com/googleapis/nodejs-resource/pull/122)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#118](https://github.com/googleapis/nodejs-resource/pull/118)) +- chore: update issue templates ([#117](https://github.com/googleapis/nodejs-resource/pull/117)) +- chore: remove old issue template ([#115](https://github.com/googleapis/nodejs-resource/pull/115)) +- build: run tests on node11 ([#114](https://github.com/googleapis/nodejs-resource/pull/114)) +- chores(build): do not collect sponge.xml from windows builds ([#112](https://github.com/googleapis/nodejs-resource/pull/112)) +- chores(build): run codecov on continuous builds ([#110](https://github.com/googleapis/nodejs-resource/pull/110)) +- chore: update new issue template ([#109](https://github.com/googleapis/nodejs-resource/pull/109)) +- chore(deps): update dependency sinon to v7 ([#105](https://github.com/googleapis/nodejs-resource/pull/105)) +- build: fix codecov uploading on Kokoro ([#106](https://github.com/googleapis/nodejs-resource/pull/106)) +- Update kokoro config ([#103](https://github.com/googleapis/nodejs-resource/pull/103)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#102](https://github.com/googleapis/nodejs-resource/pull/102)) +- chore(deps): update dependency typescript to ~3.1.0 ([#100](https://github.com/googleapis/nodejs-resource/pull/100)) +- Update CI config ([#99](https://github.com/googleapis/nodejs-resource/pull/99)) +- Don't publish sourcemaps ([#97](https://github.com/googleapis/nodejs-resource/pull/97)) +- Update the kokoro config ([#94](https://github.com/googleapis/nodejs-resource/pull/94)) +- test: remove appveyor config ([#93](https://github.com/googleapis/nodejs-resource/pull/93)) +- test: simplify and fix the system tests ([#92](https://github.com/googleapis/nodejs-resource/pull/92)) +- Update the CI config ([#89](https://github.com/googleapis/nodejs-resource/pull/89)) +- Enable prefer-const in the eslint config ([#88](https://github.com/googleapis/nodejs-resource/pull/88)) +- Enable no-var in eslint ([#86](https://github.com/googleapis/nodejs-resource/pull/86)) +- fix(deps): update dependency @google-cloud/common to ^0.25.0 ([#87](https://github.com/googleapis/nodejs-resource/pull/87)) +- Update CI config ([#83](https://github.com/googleapis/nodejs-resource/pull/83)) +- Fix code coverage ([#81](https://github.com/googleapis/nodejs-resource/pull/81)) +- fix(deps): update dependency @google-cloud/common to ^0.24.0 ([#71](https://github.com/googleapis/nodejs-resource/pull/71)) +- Update CI config ([#78](https://github.com/googleapis/nodejs-resource/pull/78)) +- Retry npm install in CI ([#79](https://github.com/googleapis/nodejs-resource/pull/79)) +- Re-generate library using /synth.py ([#77](https://github.com/googleapis/nodejs-resource/pull/77)) +- chore(deps): update dependency nyc to v13 ([#76](https://github.com/googleapis/nodejs-resource/pull/76)) +- Update the CI config ([#75](https://github.com/googleapis/nodejs-resource/pull/75)) +- chore: update CircleCI config +- chore: enable gts fix ([#73](https://github.com/googleapis/nodejs-resource/pull/73)) +- chore: convert to es6 ([#72](https://github.com/googleapis/nodejs-resource/pull/72)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#70](https://github.com/googleapis/nodejs-resource/pull/70)) +- fix(deps): update dependency @google-cloud/common to ^0.21.0 ([#66](https://github.com/googleapis/nodejs-resource/pull/66)) +- chore: split the common module ([#69](https://github.com/googleapis/nodejs-resource/pull/69)) +- chore: ignore package-lock.json ([#67](https://github.com/googleapis/nodejs-resource/pull/67)) +- chore: update renovate config ([#63](https://github.com/googleapis/nodejs-resource/pull/63)) +- chore: assert.deelEqual => assert.deepStrictEqual ([#60](https://github.com/googleapis/nodejs-resource/pull/60)) +- chore(deps): lock file maintenance ([#61](https://github.com/googleapis/nodejs-resource/pull/61)) +- chore: move mocha options to mocha.opts ([#58](https://github.com/googleapis/nodejs-resource/pull/58)) +- chore: require node 8 for samples ([#59](https://github.com/googleapis/nodejs-resource/pull/59)) +- chore(deps): lock file maintenance ([#57](https://github.com/googleapis/nodejs-resource/pull/57)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#55](https://github.com/googleapis/nodejs-resource/pull/55)) +- test: use strictEqual in tests ([#56](https://github.com/googleapis/nodejs-resource/pull/56)) +- fix(deps): update dependency yargs to v12 ([#46](https://github.com/googleapis/nodejs-resource/pull/46)) +- fix(deps): update dependency @google-cloud/common to ^0.20.0 ([#41](https://github.com/googleapis/nodejs-resource/pull/41)) +- chore(deps): update dependency sinon to v6 ([#44](https://github.com/googleapis/nodejs-resource/pull/44)) +- fix(deps): update dependency yargs to v11 ([#45](https://github.com/googleapis/nodejs-resource/pull/45)) +- chore(deps): update dependency proxyquire to v2 ([#43](https://github.com/googleapis/nodejs-resource/pull/43)) +- chore(deps): update dependency ava to v0.25.0 ([#39](https://github.com/googleapis/nodejs-resource/pull/39)) +- Configure Renovate ([#33](https://github.com/googleapis/nodejs-resource/pull/33)) +- chore(package): update eslint to version 5.0.0 ([#34](https://github.com/googleapis/nodejs-resource/pull/34)) +- refactor: drop repo-tool as an exec wrapper ([#37](https://github.com/googleapis/nodejs-resource/pull/37)) +- fix: update linking for samples ([#35](https://github.com/googleapis/nodejs-resource/pull/35)) +- chore: update sample lockfiles ([#36](https://github.com/googleapis/nodejs-resource/pull/36)) +- chore(package): update nyc to version 12.0.2 ([#32](https://github.com/googleapis/nodejs-resource/pull/32)) +- chore: lock files maintenance ([#30](https://github.com/googleapis/nodejs-resource/pull/30)) +- chore: timeout for system test ([#28](https://github.com/googleapis/nodejs-resource/pull/28)) +- chore: lock files maintenance ([#27](https://github.com/googleapis/nodejs-resource/pull/27)) +- chore: test on node10 ([#26](https://github.com/googleapis/nodejs-resource/pull/26)) +- chore: lock files maintenance ([#25](https://github.com/googleapis/nodejs-resource/pull/25)) +- chore: one more workaround for repo-tools EPERM ([#23](https://github.com/googleapis/nodejs-resource/pull/23)) +- chore: workaround for repo-tools EPERM ([#22](https://github.com/googleapis/nodejs-resource/pull/22)) +- Update @google-cloud/common to the latest version 🚀 ([#21](https://github.com/googleapis/nodejs-resource/pull/21)) +- Update google-auto-auth ([#20](https://github.com/googleapis/nodejs-resource/pull/20)) +- chore: setup nighty build in CircleCI ([#19](https://github.com/googleapis/nodejs-resource/pull/19)) +- Upgrade repo-tools and regenerate scaffolding. ([#16](https://github.com/googleapis/nodejs-resource/pull/16)) +- Update proxyquire to the latest version 🚀 ([#15](https://github.com/googleapis/nodejs-resource/pull/15)) +- chore: removing node7 job from CircleCI ([#14](https://github.com/googleapis/nodejs-resource/pull/14)) diff --git a/packages/google-cloud-resourcemanager/CODE_OF_CONDUCT.md b/packages/google-cloud-resourcemanager/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-resourcemanager/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-resourcemanager/CONTRIBUTING.md b/packages/google-cloud-resourcemanager/CONTRIBUTING.md new file mode 100644 index 000000000000..da2f730c973c --- /dev/null +++ b/packages/google-cloud-resourcemanager/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Resource Manager API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudresourcemanager.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-resourcemanager/LICENSE b/packages/google-cloud-resourcemanager/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-resourcemanager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-resourcemanager/README.md b/packages/google-cloud-resourcemanager/README.md new file mode 100644 index 000000000000..665c327a9be2 --- /dev/null +++ b/packages/google-cloud-resourcemanager/README.md @@ -0,0 +1,203 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Resource Manager API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/resource-manager.svg)](https://www.npmjs.org/package/@google-cloud/resource-manager) + + + + +Cloud Resource Manager Client Library for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google Cloud Resource Manager API Node.js Client API Reference][client-docs] +* [Google Cloud Resource Manager API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Resource Manager API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/resource-manager +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {ProjectsClient} = require('@google-cloud/resource-manager'); + +// Creates a client +const client = new ProjectsClient(); + +async function quickstart() { + // Lists current projects + const projects = client.searchProjectsAsync(); + console.log('Projects:'); + for await (const project of projects) { + console.info(project); + } +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Folders.create_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js,samples/README.md) | +| Folders.delete_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js,samples/README.md) | +| Folders.get_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js,samples/README.md) | +| Folders.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js,samples/README.md) | +| Folders.list_folders | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js,samples/README.md) | +| Folders.move_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js,samples/README.md) | +| Folders.search_folders | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js,samples/README.md) | +| Folders.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js,samples/README.md) | +| Folders.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js,samples/README.md) | +| Folders.undelete_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js,samples/README.md) | +| Folders.update_folder | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js,samples/README.md) | +| Organizations.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js,samples/README.md) | +| Organizations.get_organization | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js,samples/README.md) | +| Organizations.search_organizations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js,samples/README.md) | +| Organizations.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js,samples/README.md) | +| Organizations.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js,samples/README.md) | +| Projects.create_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js,samples/README.md) | +| Projects.delete_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js,samples/README.md) | +| Projects.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js,samples/README.md) | +| Projects.get_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js,samples/README.md) | +| Projects.list_projects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js,samples/README.md) | +| Projects.move_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js,samples/README.md) | +| Projects.search_projects | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js,samples/README.md) | +| Projects.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js,samples/README.md) | +| Projects.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js,samples/README.md) | +| Projects.undelete_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js,samples/README.md) | +| Projects.update_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js,samples/README.md) | +| Tag_bindings.create_tag_binding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js,samples/README.md) | +| Tag_bindings.delete_tag_binding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js,samples/README.md) | +| Tag_bindings.list_tag_bindings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js,samples/README.md) | +| Tag_keys.create_tag_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js,samples/README.md) | +| Tag_keys.delete_tag_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js,samples/README.md) | +| Tag_keys.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js,samples/README.md) | +| Tag_keys.get_tag_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js,samples/README.md) | +| Tag_keys.list_tag_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js,samples/README.md) | +| Tag_keys.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js,samples/README.md) | +| Tag_keys.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js,samples/README.md) | +| Tag_keys.update_tag_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js,samples/README.md) | +| Tag_values.create_tag_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js,samples/README.md) | +| Tag_values.delete_tag_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js,samples/README.md) | +| Tag_values.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js,samples/README.md) | +| Tag_values.get_tag_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js,samples/README.md) | +| Tag_values.list_tag_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js,samples/README.md) | +| Tag_values.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js,samples/README.md) | +| Tag_values.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js,samples/README.md) | +| Tag_values.update_tag_value | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/quickstart.js,samples/README.md) | +| Sample.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/test/sample.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/test/sample.test.js,samples/README.md) | + + + +The [Google Cloud Resource Manager API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/resource-manager@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/resource-manager/latest +[product-docs]: https://cloud.google.com/resource-manager +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudresourcemanager.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-resourcemanager/linkinator.config.json b/packages/google-cloud-resourcemanager/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-cloud-resourcemanager/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-resourcemanager/package.json b/packages/google-cloud-resourcemanager/package.json new file mode 100644 index 000000000000..ea65ed10c13d --- /dev/null +++ b/packages/google-cloud-resourcemanager/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/resource-manager", + "description": "Cloud Resource Manager Client Library for Node.js", + "version": "4.1.1", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": "googleapis/nodejs-resource-manager", + "main": "./build/src/index.js", + "types": "./build/src/index.d.ts", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google resource", + "resource" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + } +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/folders.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/folders.proto new file mode 100644 index 000000000000..af87809d751f --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/folders.proto @@ -0,0 +1,536 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "FoldersProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Manages Cloud Platform folder resources. +// Folders can be used to organize the resources under an +// organization and to control the policies applied to groups of resources. +service Folders { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Retrieves a folder identified by the supplied resource name. + // Valid folder resource names have the format `folders/{folder_id}` + // (for example, `folders/1234`). + // The caller must have `resourcemanager.folders.get` permission on the + // identified folder. + rpc GetFolder(GetFolderRequest) returns (Folder) { + option (google.api.http) = { + get: "/v3/{name=folders/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the folders that are direct descendants of supplied parent resource. + // `list()` provides a strongly consistent view of the folders underneath + // the specified parent resource. + // `list()` returns folders sorted based upon the (ascending) lexical ordering + // of their display_name. + // The caller must have `resourcemanager.folders.list` permission on the + // identified parent. + rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) { + option (google.api.http) = { + get: "/v3/folders" + }; + option (google.api.method_signature) = "parent"; + } + + // Search for folders that match specific filter criteria. + // `search()` provides an eventually consistent view of the folders a user has + // access to which meet the specified filter criteria. + // + // This will only return folders on which the caller has the + // permission `resourcemanager.folders.get`. + rpc SearchFolders(SearchFoldersRequest) returns (SearchFoldersResponse) { + option (google.api.http) = { + get: "/v3/folders:search" + }; + option (google.api.method_signature) = "query"; + } + + // Creates a folder in the resource hierarchy. + // Returns an `Operation` which can be used to track the progress of the + // folder creation workflow. + // Upon success, the `Operation.response` field will be populated with the + // created Folder. + // + // In order to succeed, the addition of this new folder must not violate + // the folder naming, height, or fanout constraints. + // + // + The folder's `display_name` must be distinct from all other folders that + // share its parent. + // + The addition of the folder must not cause the active folder hierarchy + // to exceed a height of 10. Note, the full active + deleted folder hierarchy + // is allowed to reach a height of 20; this provides additional headroom when + // moving folders that contain deleted folders. + // + The addition of the folder must not cause the total number of folders + // under its parent to exceed 300. + // + // If the operation fails due to a folder constraint violation, some errors + // may be returned by the `CreateFolder` request, with status code + // `FAILED_PRECONDITION` and an error description. Other folder constraint + // violations will be communicated in the `Operation`, with the specific + // `PreconditionFailure` returned in the details list in the `Operation.error` + // field. + // + // The caller must have `resourcemanager.folders.create` permission on the + // identified parent. + rpc CreateFolder(CreateFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/folders" + body: "folder" + }; + option (google.api.method_signature) = "folder"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "CreateFolderMetadata" + }; + } + + // Updates a folder, changing its `display_name`. + // Changes to the folder `display_name` will be rejected if they violate + // either the `display_name` formatting rules or the naming constraints + // described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. + // + // The folder's `display_name` must start and end with a letter or digit, + // may contain letters, digits, spaces, hyphens and underscores and can be + // between 3 and 30 characters. This is captured by the regular expression: + // `[\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]`. + // The caller must have `resourcemanager.folders.update` permission on the + // identified folder. + // + // If the update fails due to the unique name constraint then a + // `PreconditionFailure` explaining this violation will be returned + // in the Status.details field. + rpc UpdateFolder(UpdateFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{folder.name=folders/*}" + body: "folder" + }; + option (google.api.method_signature) = "folder,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "UpdateFolderMetadata" + }; + } + + // Moves a folder under a new resource parent. + // Returns an `Operation` which can be used to track the progress of the + // folder move workflow. + // Upon success, the `Operation.response` field will be populated with the + // moved folder. + // Upon failure, a `FolderOperationError` categorizing the failure cause will + // be returned - if the failure occurs synchronously then the + // `FolderOperationError` will be returned in the `Status.details` field. + // If it occurs asynchronously, then the FolderOperation will be returned + // in the `Operation.error` field. + // In addition, the `Operation.metadata` field will be populated with a + // `FolderOperation` message as an aid to stateless clients. + // Folder moves will be rejected if they violate either the naming, height, + // or fanout constraints described in the + // [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. + // The caller must have `resourcemanager.folders.move` permission on the + // folder's current and proposed new parent. + rpc MoveFolder(MoveFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=folders/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name,destination_parent"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "MoveFolderMetadata" + }; + } + + // Requests deletion of a folder. The folder is moved into the + // [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state + // immediately, and is deleted approximately 30 days later. This method may + // only be called on an empty folder, where a folder is empty if it doesn't + // contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. + // If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + // state the operation will result in a no-op success. + // The caller must have `resourcemanager.folders.delete` permission on the + // identified folder. + rpc DeleteFolder(DeleteFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=folders/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "DeleteFolderMetadata" + }; + } + + // Cancels the deletion request for a folder. This method may be called on a + // folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] + // state the result will be a no-op success. In order to succeed, the folder's + // parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, + // reintroducing the folder into the tree must not violate folder naming, + // height, and fanout constraints described in the + // [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. + // The caller must have `resourcemanager.folders.undelete` permission on the + // identified folder. + rpc UndeleteFolder(UndeleteFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=folders/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "UndeleteFolderMetadata" + }; + } + + // Gets the access control policy for a folder. The returned policy may be + // empty if no such policy or resource exists. The `resource` field should + // be the folder's resource name, for example: "folders/1234". + // The caller must have `resourcemanager.folders.getIamPolicy` permission + // on the identified folder. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on a folder, replacing any existing policy. + // The `resource` field should be the folder's resource name, for example: + // "folders/1234". + // The caller must have `resourcemanager.folders.setIamPolicy` permission + // on the identified folder. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that a caller has on the specified folder. + // The `resource` field should be the folder's resource name, + // for example: "folders/1234". + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A folder in an organization's resource hierarchy, used to +// organize that organization's resources. +message Folder { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" + style: DECLARATIVE_FRIENDLY + }; + + // Folder lifecycle states. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The folder has been marked for deletion by the user. + DELETE_REQUESTED = 2; + } + + // Output only. The resource name of the folder. + // Its format is `folders/{folder_id}`, for example: "folders/1234". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The folder's parent's resource name. + // Updates to the folder's parent must be performed using + // [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder]. + string parent = 2 [(google.api.field_behavior) = REQUIRED]; + + // The folder's display name. + // A folder's display name must be unique amongst its siblings. For example, + // no two folders with the same parent can share the same display name. + // The display name must start and end with a letter or digit, may contain + // letters, digits, spaces, hyphens and underscores and can be no longer + // than 30 characters. This is captured by the regular expression: + // `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. + string display_name = 3; + + // Output only. The lifecycle state of the folder. + // Updates to the state must be performed using + // [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and + // [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder]. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was last modified. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was requested to be deleted. + google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A checksum computed by the server based on the current value of the folder + // resource. This may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The GetFolder request message. +message GetFolderRequest { + // Required. The resource name of the folder to retrieve. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// The ListFolders request message. +message ListFoldersRequest { + // Required. The resource name of the organization or folder whose folders are + // being listed. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + // Access to this method is controlled by checking the + // `resourcemanager.folders.list` permission on the `parent`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. The maximum number of folders to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListFolders` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls whether folders in the + // [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + // state should be returned. Defaults to false. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListFolders response message. +message ListFoldersResponse { + // A possibly paginated list of folders that are direct descendants of + // the specified parent resource. + repeated Folder folders = 1; + + // A pagination token returned from a previous call to `ListFolders` + // that indicates from where listing should continue. + string next_page_token = 2; +} + +// The request message for searching folders. +message SearchFoldersRequest { + // Optional. The maximum number of folders to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `SearchFolders` + // that indicates from where search should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Search criteria used to select the folders to return. + // If no search criteria is specified then all accessible folders will be + // returned. + // + // Query expressions can be used to restrict results based upon displayName, + // state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + // can be used along with the suffix wildcard symbol `*`. + // + // The `displayName` field in a query expression should use escaped quotes + // for values that include whitespace to prevent unexpected behavior. + // + // ``` + // | Field | Description | + // |-------------------------|----------------------------------------| + // | displayName | Filters by displayName. | + // | parent | Filters by parent (for example: folders/123). | + // | state, lifecycleState | Filters by state. | + // ``` + // + // Some example queries are: + // + // * Query `displayName=Test*` returns Folder resources whose display name + // starts with "Test". + // * Query `state=ACTIVE` returns Folder resources with + // `state` set to `ACTIVE`. + // * Query `parent=folders/123` returns Folder resources that have + // `folders/123` as a parent resource. + // * Query `parent=folders/123 AND state=ACTIVE` returns active + // Folder resources that have `folders/123` as a parent resource. + // * Query `displayName=\\"Test String\\"` returns Folder resources with + // display names that include both "Test" and "String". + string query = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for searching folders. +message SearchFoldersResponse { + // A possibly paginated folder search results. + // the specified parent resource. + repeated Folder folders = 1; + + // A pagination token returned from a previous call to `SearchFolders` + // that indicates from where searching should continue. + string next_page_token = 2; +} + +// The CreateFolder request message. +message CreateFolderRequest { + // Required. The folder being created, only the display name and parent will be + // consulted. All other fields will be ignored. + Folder folder = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata pertaining to the Folder creation process. +message CreateFolderMetadata { + // The display name of the folder. + string display_name = 1; + + // The resource name of the folder or organization we are creating the folder + // under. + string parent = 2; +} + +// The request sent to the +// [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder] +// method. +// +// Only the `display_name` field can be changed. All other fields will be +// ignored. Use the +// [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder] method to +// change the `parent` field. +message UpdateFolderRequest { + // Required. The new definition of the Folder. It must include the `name` field, which + // cannot be changed. + Folder folder = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Fields to be updated. + // Only the `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UpdateFolder. +message UpdateFolderMetadata { + +} + +// The MoveFolder request message. +message MoveFolderRequest { + // Required. The resource name of the Folder to move. + // Must be of the form folders/{folder_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; + + // Required. The resource name of the folder or organization which should be the + // folder's new parent. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + string destination_parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; +} + +// Metadata pertaining to the folder move process. +message MoveFolderMetadata { + // The display name of the folder. + string display_name = 1; + + // The resource name of the folder's parent. + string source_parent = 2; + + // The resource name of the folder or organization to move the folder to. + string destination_parent = 3; +} + +// The DeleteFolder request message. +message DeleteFolderRequest { + // Required. The resource name of the folder to be deleted. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// A status object which is used as the `metadata` field for the `Operation` +// returned by `DeleteFolder`. +message DeleteFolderMetadata { + +} + +// The UndeleteFolder request message. +message UndeleteFolderRequest { + // Required. The resource name of the folder to undelete. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// A status object which is used as the `metadata` field for the `Operation` +// returned by `UndeleteFolder`. +message UndeleteFolderMetadata { + +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/organizations.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/organizations.proto new file mode 100644 index 000000000000..0e99a1552202 --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/organizations.proto @@ -0,0 +1,236 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "OrganizationsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Allows users to manage their organization resources. +service Organizations { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Fetches an organization resource identified by the specified resource name. + rpc GetOrganization(GetOrganizationRequest) returns (Organization) { + option (google.api.http) = { + get: "/v3/{name=organizations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Searches organization resources that are visible to the user and satisfy + // the specified filter. This method returns organizations in an unspecified + // order. New organizations do not necessarily appear at the end of the + // results, and may take a small amount of time to appear. + // + // Search will only return organizations on which the user has the permission + // `resourcemanager.organizations.get` + rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) { + option (google.api.http) = { + get: "/v3/organizations:search" + }; + option (google.api.method_signature) = "query"; + } + + // Gets the access control policy for an organization resource. The policy may + // be empty if no such policy or resource exists. The `resource` field should + // be the organization's resource name, for example: "organizations/123". + // + // Authorization requires the IAM permission + // `resourcemanager.organizations.getIamPolicy` on the specified organization. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on an organization resource. Replaces any + // existing policy. The `resource` field should be the organization's resource + // name, for example: "organizations/123". + // + // Authorization requires the IAM permission + // `resourcemanager.organizations.setIamPolicy` on the specified organization. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Returns the permissions that a caller has on the specified organization. + // The `resource` field should be the organization's resource name, + // for example: "organizations/123". + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// The root node in the resource hierarchy to which a particular entity's +// (a company, for example) resources belong. +message Organization { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" + style: DECLARATIVE_FRIENDLY + }; + + // Organization lifecycle states. + enum State { + // Unspecified state. This is only useful for distinguishing unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The organization has been marked for deletion by the user. + DELETE_REQUESTED = 2; + } + + // Output only. The resource name of the organization. This is the + // organization's relative path in the API. Its format is + // "organizations/[organization_id]". For example, "organizations/1234". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A human-readable string that refers to the organization in the + // Google Cloud Console. This string is set by the server and cannot be + // changed. The string will be set to the primary domain (for example, + // "google.com") of the Google Workspace customer that owns the organization. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The owner of this organization. The owner should be specified on + // creation. Once set, it cannot be changed. + // + // The lifetime of the organization and all of its descendants are bound to + // the owner. If the owner is deleted, the organization and all its + // descendants will be deleted. + oneof owner { + // Immutable. The G Suite / Workspace customer id used in the Directory API. + string directory_customer_id = 3 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Output only. The organization's current lifecycle state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was last modified. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was requested for deletion. + google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A checksum computed by the server based on the current value of the + // Organization resource. This may be sent on update and delete requests to + // ensure the client has an up-to-date value before proceeding. + string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request sent to the `GetOrganization` method. The `name` field is +// required. `organization_id` is no longer accepted. +message GetOrganizationRequest { + // Required. The resource name of the Organization to fetch. This is the organization's + // relative path in the API, formatted as "organizations/[organizationId]". + // For example, "organizations/1234". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// The request sent to the `SearchOrganizations` method. +message SearchOrganizationsRequest { + // Optional. The maximum number of organizations to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `SearchOrganizations` + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional query string used to filter the Organizations to return in + // the response. Query rules are case-insensitive. + // + // ``` + // | Field | Description | + // |------------------|--------------------------------------------| + // | directoryCustomerId, owner.directoryCustomerId | Filters by directory + // customer id. | + // | domain | Filters by domain. | + // ``` + // + // Organizations may be queried by `directoryCustomerId` or by + // `domain`, where the domain is a G Suite domain, for example: + // + // * Query `directorycustomerid:123456789` returns Organization + // resources with `owner.directory_customer_id` equal to `123456789`. + // * Query `domain:google.com` returns Organization resources corresponding + // to the domain `google.com`. + string query = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response returned from the `SearchOrganizations` method. +message SearchOrganizationsResponse { + // The list of Organizations that matched the search query, possibly + // paginated. + repeated Organization organizations = 1; + + // A pagination token to be used to retrieve the next page of results. If the + // result is too large to fit within the page size specified in the request, + // this field will be set with a token that can be used to fetch the next page + // of results. If this field is empty, it indicates that this response + // contains the last page of results. + string next_page_token = 2; +} + +// A status object which is used as the `metadata` field for the operation +// returned by DeleteOrganization. +message DeleteOrganizationMetadata { + +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UndeleteOrganization. +message UndeleteOrganizationMetadata { + +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/projects.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/projects.proto new file mode 100644 index 000000000000..3d2feb08d57b --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/projects.proto @@ -0,0 +1,640 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "ProjectsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Manages Google Cloud Projects. +service Projects { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Retrieves the project identified by the specified `name` (for example, + // `projects/415104041262`). + // + // The caller must have `resourcemanager.projects.get` permission + // for this project. + rpc GetProject(GetProjectRequest) returns (Project) { + option (google.api.http) = { + get: "/v3/{name=projects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists projects that are direct children of the specified folder or + // organization resource. `list()` provides a strongly consistent view of the + // projects underneath the specified parent resource. `list()` returns + // projects sorted based upon the (ascending) lexical ordering of their + // `display_name`. The caller must have `resourcemanager.projects.list` + // permission on the identified parent. + rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) { + option (google.api.http) = { + get: "/v3/projects" + }; + option (google.api.method_signature) = "parent"; + } + + // Search for projects that the caller has both `resourcemanager.projects.get` + // permission on, and also satisfy the specified query. + // + // This method returns projects in an unspecified order. + // + // This method is eventually consistent with project mutations; this means + // that a newly created project may not appear in the results or recent + // updates to an existing project may not be reflected in the results. To + // retrieve the latest state of a project, use the + // [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method. + rpc SearchProjects(SearchProjectsRequest) returns (SearchProjectsResponse) { + option (google.api.http) = { + get: "/v3/projects:search" + }; + option (google.api.method_signature) = "query"; + } + + // Request that a new project be created. The result is an `Operation` which + // can be used to track the creation process. This process usually takes a few + // seconds, but can sometimes take much longer. The tracking `Operation` is + // automatically deleted after a few hours, so there is no need to call + // `DeleteOperation`. + rpc CreateProject(CreateProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/projects" + body: "project" + }; + option (google.api.method_signature) = "project"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "CreateProjectMetadata" + }; + } + + // Updates the `display_name` and labels of the project identified by the + // specified `name` (for example, `projects/415104041262`). Deleting all + // labels requires an update mask for labels field. + // + // The caller must have `resourcemanager.projects.update` permission for this + // project. + rpc UpdateProject(UpdateProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{project.name=projects/*}" + body: "project" + }; + option (google.api.method_signature) = "project,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "UpdateProjectMetadata" + }; + } + + // Move a project to another place in your resource hierarchy, under a new + // resource parent. + // + // Returns an operation which can be used to track the process of the project + // move workflow. + // Upon success, the `Operation.response` field will be populated with the + // moved project. + // + // The caller must have `resourcemanager.projects.update` permission on the + // project and have `resourcemanager.projects.move` permission on the + // project's current and proposed new parent. + // + // + rpc MoveProject(MoveProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name, destination_parent"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "MoveProjectMetadata" + }; + } + + // Marks the project identified by the specified + // `name` (for example, `projects/415104041262`) for deletion. + // + // This method will only affect the project if it has a lifecycle state of + // [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. + // + // This method changes the Project's lifecycle state from + // [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] + // to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. + // The deletion starts at an unspecified time, + // at which point the Project is no longer accessible. + // + // Until the deletion completes, you can check the lifecycle state + // checked by retrieving the project with [GetProject] + // [google.cloud.resourcemanager.v3.Projects.GetProject], + // and the project remains visible to [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects]. + // However, you cannot update the project. + // + // After the deletion completes, the project is not retrievable by + // the [GetProject] + // [google.cloud.resourcemanager.v3.Projects.GetProject], + // [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects], and + // [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] + // methods. + // + // This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + // project will not cause an error, but also won't do anything. + // + // The caller must have `resourcemanager.projects.delete` permissions for this + // project. + rpc DeleteProject(DeleteProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=projects/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "DeleteProjectMetadata" + }; + } + + // Restores the project identified by the specified + // `name` (for example, `projects/415104041262`). + // You can only use this method for a project that has a lifecycle state of + // [DELETE_REQUESTED] + // [Projects.State.DELETE_REQUESTED]. + // After deletion starts, the project cannot be restored. + // + // The caller must have `resourcemanager.projects.undelete` permission for + // this project. + rpc UndeleteProject(UndeleteProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "UndeleteProjectMetadata" + }; + } + + // Returns the IAM access control policy for the specified project. + // Permission is denied if the policy or the resource do not exist. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the IAM access control policy for the specified project. + // + // CAUTION: This method will replace the existing policy, and cannot be used + // to append additional IAM settings. + // + // Note: Removing service accounts from policies or changing their roles can + // render services completely inoperable. It is important to understand how + // the service account is being used before removing or updating its roles. + // + // The following constraints apply when using `setIamPolicy()`: + // + // + Project does not support `allUsers` and `allAuthenticatedUsers` as + // `members` in a `Binding` of a `Policy`. + // + // + The owner role can be granted to a `user`, `serviceAccount`, or a group + // that is part of an organization. For example, + // group@myownpersonaldomain.com could be added as an owner to a project in + // the myownpersonaldomain.com organization, but not the examplepetstore.com + // organization. + // + // + Service accounts can be made owners of a project directly + // without any restrictions. However, to be added as an owner, a user must be + // invited using the Cloud Platform console and must accept the invitation. + // + // + A user cannot be granted the owner role using `setIamPolicy()`. The user + // must be granted the owner role using the Cloud Platform Console and must + // explicitly accept the invitation. + // + // + Invitations to grant the owner role cannot be sent using + // `setIamPolicy()`; + // they must be sent only using the Cloud Platform Console. + // + // + Membership changes that leave the project without any owners that have + // accepted the Terms of Service (ToS) will be rejected. + // + // + If the project is not part of an organization, there must be at least + // one owner who has accepted the Terms of Service (ToS) agreement in the + // policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + // from the policy will fail. This restriction also applies to legacy + // projects that no longer have owners who have accepted the ToS. Edits to + // IAM policies will be rejected until the lack of a ToS-accepting owner is + // rectified. + // + // + Calling this method requires enabling the App Engine Admin API. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource, policy"; + } + + // Returns permissions that a caller has on the specified project. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource, permissions"; + } +} + +// A project is a high-level Google Cloud entity. It is a +// container for ACLs, APIs, App Engine Apps, VMs, and other +// Google Cloud Platform resources. +message Project { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" + style: DECLARATIVE_FRIENDLY + }; + + // Project lifecycle states. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The project has been marked for deletion by the user + // (by invoking + // [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]) + // or by the system (Google Cloud Platform). + // This can generally be reversed by invoking [UndeleteProject] + // [google.cloud.resourcemanager.v3.Projects.UndeleteProject]. + DELETE_REQUESTED = 2; + } + + // Output only. The unique resource name of the project. It is an int64 generated number + // prefixed by "projects/". + // + // Example: `projects/415104041262` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A reference to a parent Resource. eg., `organizations/123` or + // `folders/876`. + string parent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The unique, user-assigned id of the project. + // It must be 6 to 30 lowercase ASCII letters, digits, or hyphens. + // It must start with a letter. + // Trailing hyphens are prohibited. + // + // Example: `tokyo-rain-123` + string project_id = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The project lifecycle state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A user-assigned display name of the project. + // When present it must be between 4 to 30 characters. + // Allowed characters are: lowercase and uppercase letters, numbers, + // hyphen, single-quote, double-quote, space, and exclamation point. + // + // Example: `My Project` + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A checksum computed by the server based on the current value of the Project + // resource. This may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels associated with this project. + // + // Label keys must be between 1 and 63 characters long and must conform + // to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + // + // Label values must be between 0 and 63 characters long and must conform + // to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + // + // No more than 256 labels can be associated with a given resource. + // + // Clients should store labels in a representation such as JSON that does not + // depend on specific characters being disallowed. + // + // Example: `"myBusinessDimension" : "businessValue"` + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request sent to the +// [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] +// method. +message GetProjectRequest { + // Required. The name of the project (for example, `projects/415104041262`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// The request sent to the +// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects] +// method. +message ListProjectsRequest { + // Required. The name of the parent resource to list projects under. + // + // For example, setting this field to 'folders/1234' would list all projects + // directly under that folder. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. A pagination token returned from a previous call to [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects] + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of projects to return in the response. + // The server can return fewer projects than requested. + // If unspecified, server picks an appropriate default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + // returned. Normally only `ACTIVE` projects are returned. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A page of the response received from the +// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects] +// method. +// +// A paginated response where more pages are available has +// `next_page_token` set. This token can be used in a subsequent request to +// retrieve the next request page. +// +// NOTE: A response may contain fewer elements than the request `page_size` and +// still have a `next_page_token`. +message ListProjectsResponse { + // The list of Projects under the parent. This list can be paginated. + repeated Project projects = 1; + + // Pagination token. + // + // If the result set is too large to fit in a single response, this token + // is returned. It encodes the position of the current result cursor. + // Feeding this value into a new list request with the `page_token` parameter + // gives the next page of the results. + // + // When `next_page_token` is not filled in, there is no next page and + // the list returned is the last page in the result set. + // + // Pagination tokens have a limited lifetime. + string next_page_token = 2; +} + +// The request sent to the +// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] +// method. +message SearchProjectsRequest { + // Optional. A query string for searching for projects that the caller has + // `resourcemanager.projects.get` permission to. If multiple fields are + // included in the query, the it will return results that match any of the + // fields. Some eligible fields are: + // + // ``` + // | Field | Description | + // |-------------------------|----------------------------------------------| + // | displayName, name | Filters by displayName. | + // | parent | Project's parent. (for example: folders/123, + // organizations/*) Prefer parent field over parent.type and parent.id. | + // | parent.type | Parent's type: `folder` or `organization`. | + // | parent.id | Parent's id number (for example: 123) | + // | id, projectId | Filters by projectId. | + // | state, lifecycleState | Filters by state. | + // | labels | Filters by label name or value. | + // | labels. (where *key* is the name of a label) | Filters by label + // name. | + // ``` + // + // Search expressions are case insensitive. + // + // Some examples queries: + // + // ``` + // | Query | Description | + // |------------------|-----------------------------------------------------| + // | name:how* | The project's name starts with "how". | + // | name:Howl | The project's name is `Howl` or `howl`. | + // | name:HOWL | Equivalent to above. | + // | NAME:howl | Equivalent to above. | + // | labels.color:* | The project has the label `color`. | + // | labels.color:red | The project's label `color` has the value `red`. | + // | labels.color:red labels.size:big | The project's label `color` has + // the value `red` and its label `size` has the value `big`. | + // ``` + // + // If no query is specified, the call will return projects for which the user + // has the `resourcemanager.projects.get` permission. + string query = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects] + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of projects to return in the response. + // The server can return fewer projects than requested. + // If unspecified, server picks an appropriate default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A page of the response received from the +// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] +// method. +// +// A paginated response where more pages are available has +// `next_page_token` set. This token can be used in a subsequent request to +// retrieve the next request page. +message SearchProjectsResponse { + // The list of Projects that matched the list filter query. This list can + // be paginated. + repeated Project projects = 1; + + // Pagination token. + // + // If the result set is too large to fit in a single response, this token + // is returned. It encodes the position of the current result cursor. + // Feeding this value into a new list request with the `page_token` parameter + // gives the next page of the results. + // + // When `next_page_token` is not filled in, there is no next page and + // the list returned is the last page in the result set. + // + // Pagination tokens have a limited lifetime. + string next_page_token = 2; +} + +// The request sent to the +// [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject] +// method. +message CreateProjectRequest { + // Required. The Project to create. + // + // Project ID is required. If the requested ID is unavailable, the request + // fails. + // + // If the `parent` field is set, the `resourcemanager.projects.create` + // permission is checked on the parent resource. If no parent is set and + // the authorization credentials belong to an Organziation, the parent + // will be set to that Organization. + Project project = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by CreateProject. It provides insight for when significant phases of +// Project creation have completed. +message CreateProjectMetadata { + // Creation time of the project creation workflow. + google.protobuf.Timestamp create_time = 1; + + // True if the project can be retrieved using `GetProject`. No other + // operations on the project are guaranteed to work until the project creation + // is complete. + bool gettable = 2; + + // True if the project creation process is complete. + bool ready = 3; +} + +// The request sent to the +// [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject] +// method. +// +// Only the `display_name` and `labels` fields can be change. Use the +// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] method to +// change the `parent` field. +message UpdateProjectRequest { + // Required. The new definition of the project. + Project project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An update mask to selectively update fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UpdateProject. +message UpdateProjectMetadata { + +} + +// The request sent to +// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] +// method. +message MoveProjectRequest { + // Required. The name of the project to move. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The new parent to move the Project under. + string destination_parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by MoveProject. +message MoveProjectMetadata { + +} + +// [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject] +// method. +message DeleteProjectRequest { + // Required. The name of the Project (for example, `projects/415104041262`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by `DeleteProject`. +message DeleteProjectMetadata { + +} + +// The request sent to the [UndeleteProject] +// [google.cloud.resourcemanager.v3.Projects.UndeleteProject] +// method. +message UndeleteProjectRequest { + // Required. The name of the project (for example, `projects/415104041262`). + // + // Required. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by `UndeleteProject`. +message UndeleteProjectMetadata { + +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_bindings.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_bindings.proto new file mode 100644 index 000000000000..6c8f260a4171 --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_bindings.proto @@ -0,0 +1,177 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagBindingsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Allow users to create and manage TagBindings between TagValues and +// different cloud resources throughout the GCP resource hierarchy. +service TagBindings { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the TagBindings for the given cloud resource, as specified with + // `parent`. + // + // NOTE: The `parent` field is expected to be a full resource name: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + rpc ListTagBindings(ListTagBindingsRequest) returns (ListTagBindingsResponse) { + option (google.api.http) = { + get: "/v3/tagBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a TagBinding between a TagValue and a cloud resource + // (currently project, folder, or organization). + rpc CreateTagBinding(CreateTagBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagBindings" + body: "tag_binding" + }; + option (google.api.method_signature) = "tag_binding"; + option (google.longrunning.operation_info) = { + response_type: "TagBinding" + metadata_type: "CreateTagBindingMetadata" + }; + } + + // Deletes a TagBinding. + rpc DeleteTagBinding(DeleteTagBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagBindings/**}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteTagBindingMetadata" + }; + } +} + +// A TagBinding represents a connection between a TagValue and a cloud +// resource (currently project, folder, or organization). Once a TagBinding is +// created, the TagValue is applied to all the descendants of the cloud +// resource. +message TagBinding { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagBinding" + pattern: "tagBindings/{tag_binding}" + }; + + // Output only. The name of the TagBinding. This is a String of the form: + // `tagBindings/{full-resource-name}/{tag-value-name}` (e.g. + // `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full resource name of the resource the TagValue is bound to. + // E.g. `//cloudresourcemanager.googleapis.com/projects/123` + string parent = 2; + + // The TagValue of the TagBinding. + // Must be of the form `tagValues/456`. + string tag_value = 3; +} + +// Runtime operation information for creating a TagValue. +message CreateTagBindingMetadata { + +} + +// The request message to create a TagBinding. +message CreateTagBindingRequest { + // Required. The TagBinding to be created. + TagBinding tag_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set to true to perform the validations necessary for creating the resource, + // but not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagBinding. +message DeleteTagBindingMetadata { + +} + +// The request message to delete a TagBinding. +message DeleteTagBindingRequest { + // Required. The name of the TagBinding. This is a String of the form: + // `tagBindings/{id}` (e.g. + // `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagBinding" + } + ]; +} + +// The request message to list all TagBindings for a parent. +message ListTagBindingsRequest { + // Required. The full resource name of a resource for which you want to list existing + // TagBindings. + // E.g. "//cloudresourcemanager.googleapis.com/projects/123" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. The maximum number of TagBindings to return in the response. The server + // allows a maximum of 300 TagBindings to return. If unspecified, the server + // will use 100 as the default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagBindings` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagBindings response. +message ListTagBindingsResponse { + // A possibly paginated list of TagBindings for the specified TagValue or + // resource. + repeated TagBinding tag_bindings = 1; + + // Pagination token. + // + // If the result set is too large to fit in a single response, this token + // is returned. It encodes the position of the current result cursor. + // Feeding this value into a new list request with the `page_token` parameter + // gives the next page of the results. + // + // When `next_page_token` is not filled in, there is no next page and + // the list returned is the last page in the result set. + // + // Pagination tokens have a limited lifetime. + string next_page_token = 2; +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_keys.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_keys.proto new file mode 100644 index 000000000000..5ecf0b405bfe --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_keys.proto @@ -0,0 +1,300 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagKeysProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Allow users to create and manage tag keys. +service TagKeys { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all TagKeys for a parent resource. + rpc ListTagKeys(ListTagKeysRequest) returns (ListTagKeysResponse) { + option (google.api.http) = { + get: "/v3/tagKeys" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + // key does not exist or the user does not have permission to view it. + rpc GetTagKey(GetTagKeyRequest) returns (TagKey) { + option (google.api.http) = { + get: "/v3/{name=tagKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new TagKey. If another request with the same parameters is + // sent while the original request is in process, the second request + // will receive an error. A maximum of 300 TagKeys can exist under a parent at + // any given time. + rpc CreateTagKey(CreateTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagKeys" + body: "tag_key" + }; + option (google.api.method_signature) = "tag_key"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "CreateTagKeyMetadata" + }; + } + + // Updates the attributes of the TagKey resource. + rpc UpdateTagKey(UpdateTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{tag_key.name=tagKeys/*}" + body: "tag_key" + }; + option (google.api.method_signature) = "tag_key,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "UpdateTagKeyMetadata" + }; + } + + // Deletes a TagKey. The TagKey cannot be deleted if it has any child + // TagValues. + rpc DeleteTagKey(DeleteTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagKeys/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "DeleteTagKeyMetadata" + }; + } + + // Gets the access control policy for a TagKey. The returned policy may be + // empty if no such policy or resource exists. The `resource` field should + // be the TagKey's resource name. For example, "tagKeys/1234". + // The caller must have + // `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + // the specified TagKey. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on a TagKey, replacing any existing + // policy. The `resource` field should be the TagKey's resource name. + // For example, "tagKeys/1234". + // The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + // on the identified tagValue. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that a caller has on the specified TagKey. + // The `resource` field should be the TagKey's resource name. + // For example, "tagKeys/1234". + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A TagKey, used to group a set of TagValues. +message TagKey { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + pattern: "tagKeys/{tag_key}" + style: DECLARATIVE_FRIENDLY + }; + + // Immutable. The resource name for a TagKey. Must be in the format + // `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for + // the TagKey. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The resource name of the new TagKey's parent. + // Must be of the form `organizations/{org_id}`. + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. The user friendly name for a TagKey. The short name should be + // unique for TagKeys within the same tag namespace. + // + // The short name must be 1-63 characters, beginning and ending with + // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + // dots (.), and alphanumerics between. + string short_name = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Namespaced name of the TagKey. + string namespaced_name = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. User-assigned description of the TagKey. Must not exceed 256 characters. + // + // Read-write. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Entity tag which users can pass to prevent race conditions. This field is + // always set in server responses. See UpdateTagKeyRequest for details. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for listing all TagKeys under a parent resource. +message ListTagKeysRequest { + // Required. The resource name of the new TagKey's parent. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. The maximum number of TagKeys to return in the response. The server allows + // a maximum of 300 TagKeys to return. If unspecified, the server will use 100 + // as the default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagKey` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagKeys response message. +message ListTagKeysResponse { + // List of TagKeys that live under the specified parent in the request. + repeated TagKey tag_keys = 1; + + // A pagination token returned from a previous call to `ListTagKeys` + // that indicates from where listing should continue. + string next_page_token = 2; +} + +// The request message for getting a TagKey. +message GetTagKeyRequest { + // Required. A resource name in the format `tagKeys/{id}`, such as + // `tagKeys/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + } + ]; +} + +// The request message for creating a TagKey. +message CreateTagKeyRequest { + // Required. The TagKey to be created. Only fields `short_name`, `description`, + // and `parent` are considered during the creation request. + TagKey tag_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set to true to perform validations necessary for creating the resource, but + // not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for creating a TagKey. +message CreateTagKeyMetadata { + +} + +// The request message for updating a TagKey. +message UpdateTagKeyRequest { + // Required. The new definition of the TagKey. Only the `description` and `etag` fields + // can be updated by this request. If the `etag` field is not empty, it + // must match the `etag` field of the existing tag key. Otherwise, + // `FAILED_PRECONDITION` will be returned. + TagKey tag_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to be updated. The mask may only contain `description` or + // `etag`. If omitted entirely, both `description` and `etag` are assumed to + // be significant. + google.protobuf.FieldMask update_mask = 2; + + // Set as true to perform validations necessary for updating the resource, but + // not actually perform the action. + bool validate_only = 3; +} + +// Runtime operation information for updating a TagKey. +message UpdateTagKeyMetadata { + +} + +// The request message for deleting a TagKey. +message DeleteTagKeyRequest { + // Required. The resource name of a TagKey to be deleted in the format `tagKeys/123`. + // The TagKey cannot be a parent of any existing TagValues or it will not be + // deleted successfully. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + } + ]; + + // Optional. Set as true to perform validations necessary for deletion, but not actually + // perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The etag known to the client for the expected state of the TagKey. This is + // to be used for optimistic concurrency. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagKey. +message DeleteTagKeyMetadata { + +} diff --git a/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_values.proto b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_values.proto new file mode 100644 index 000000000000..86ba70125578 --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/google/cloud/resourcemanager/v3/tag_values.proto @@ -0,0 +1,296 @@ +// 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 +// +// 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.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagValuesProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; +option ruby_package = "Google::Cloud::ResourceManager::V3"; + +// Allow users to create and manage tag values. +service TagValues { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all TagValues for a specific TagKey. + rpc ListTagValues(ListTagValuesRequest) returns (ListTagValuesResponse) { + option (google.api.http) = { + get: "/v3/tagValues" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves TagValue. If the TagValue or namespaced name does not exist, or + // if the user does not have permission to view it, this method will return + // `PERMISSION_DENIED`. + rpc GetTagValue(GetTagValueRequest) returns (TagValue) { + option (google.api.http) = { + get: "/v3/{name=tagValues/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a TagValue as a child of the specified TagKey. If a another + // request with the same parameters is sent while the original request is in + // process the second request will receive an error. A maximum of 300 + // TagValues can exist under a TagKey at any given time. + rpc CreateTagValue(CreateTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagValues" + body: "tag_value" + }; + option (google.api.method_signature) = "tag_value"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "CreateTagValueMetadata" + }; + } + + // Updates the attributes of the TagValue resource. + rpc UpdateTagValue(UpdateTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{tag_value.name=tagValues/*}" + body: "tag_value" + }; + option (google.api.method_signature) = "tag_value,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "UpdateTagValueMetadata" + }; + } + + // Deletes a TagValue. The TagValue cannot have any bindings when it is + // deleted. + rpc DeleteTagValue(DeleteTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagValues/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "DeleteTagValueMetadata" + }; + } + + // Gets the access control policy for a TagValue. The returned policy may be + // empty if no such policy or resource exists. The `resource` field should + // be the TagValue's resource name. For example: `tagValues/1234`. + // The caller must have the + // `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + // the identified TagValue to get the access control policy. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the access control policy on a TagValue, replacing any existing + // policy. The `resource` field should be the TagValue's resource name. + // For example: `tagValues/1234`. + // The caller must have `resourcemanager.tagValues.setIamPolicy` permission + // on the identified tagValue. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // Returns permissions that a caller has on the specified TagValue. + // The `resource` field should be the TagValue's resource name. For example: + // `tagValues/1234`. + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A TagValue is a child of a particular TagKey. This is used to group +// cloud resources for the purpose of controlling them using policies. +message TagValue { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + pattern: "tagValues/{tag_value}" + style: DECLARATIVE_FRIENDLY + }; + + // Immutable. Resource name for TagValue in the format `tagValues/456`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The resource name of the new TagValue's parent TagKey. + // Must be of the form `tagKeys/{tag_key_id}`. + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. User-assigned short name for TagValue. The short name should be + // unique for TagValues within the same parent TagKey. + // + // The short name must be 63 characters or less, beginning and ending with + // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), + // dots (.), and alphanumerics between. + string short_name = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Namespaced name of the TagValue. Must be in the format + // `{organization_id}/{tag_key_short_name}/{short_name}`. + string namespaced_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-assigned description of the TagValue. + // Must not exceed 256 characters. + // + // Read-write. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Entity tag which users can pass to prevent race conditions. This field is + // always set in server responses. See UpdateTagValueRequest for details. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for listing TagValues for the specified TagKey. +message ListTagValuesRequest { + // Required. Resource name for TagKey, parent of the TagValues to be listed, + // in the format `tagKeys/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. The maximum number of TagValues to return in the response. The server + // allows a maximum of 300 TagValues to return. If unspecified, the server + // will use 100 as the default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagValues` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagValues response. +message ListTagValuesResponse { + // A possibly paginated list of TagValues that are direct descendants of + // the specified parent TagKey. + repeated TagValue tag_values = 1; + + // A pagination token returned from a previous call to `ListTagValues` + // that indicates from where listing should continue. This is currently not + // used, but the server may at any point start supplying a valid token. + string next_page_token = 2; +} + +// The request message for getting a TagValue. +message GetTagValueRequest { + // Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + } + ]; +} + +// The request message for creating a TagValue. +message CreateTagValueRequest { + // Required. The TagValue to be created. Only fields `short_name`, `description`, + // and `parent` are considered during the creation request. + TagValue tag_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set as true to perform the validations necessary for creating the resource, + // but not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for creating a TagValue. +message CreateTagValueMetadata { + +} + +// The request message for updating a TagValue. +message UpdateTagValueRequest { + // Required. The new definition of the TagValue. Only fields `description` and `etag` + // fields can be updated by this request. If the `etag` field is nonempty, it + // must match the `etag` field of the existing ControlGroup. Otherwise, + // `FAILED_PRECONDITION` will be returned. + TagValue tag_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True to perform validations necessary for updating the resource, but not + // actually perform the action. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for updating a TagValue. +message UpdateTagValueMetadata { + +} + +// The request message for deleting a TagValue. +message DeleteTagValueRequest { + // Required. Resource name for TagValue to be deleted in the format tagValues/456. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + } + ]; + + // Optional. Set as true to perform the validations necessary for deletion, but not + // actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The etag known to the client for the expected state of the TagValue. This + // is to be used for optimistic concurrency. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagValue. +message DeleteTagValueMetadata { + +} diff --git a/packages/google-cloud-resourcemanager/protos/protos.d.ts b/packages/google-cloud-resourcemanager/protos/protos.d.ts new file mode 100644 index 000000000000..c5e1b4f02afe --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/protos.d.ts @@ -0,0 +1,14964 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace resourcemanager. */ + namespace resourcemanager { + + /** Namespace v3. */ + namespace v3 { + + /** Represents a Folders */ + class Folders extends $protobuf.rpc.Service { + + /** + * Constructs a new Folders 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 Folders 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): Folders; + + /** + * Calls GetFolder. + * @param request GetFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Folder + */ + public getFolder(request: google.cloud.resourcemanager.v3.IGetFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.GetFolderCallback): void; + + /** + * Calls GetFolder. + * @param request GetFolderRequest message or plain object + * @returns Promise + */ + public getFolder(request: google.cloud.resourcemanager.v3.IGetFolderRequest): Promise; + + /** + * Calls ListFolders. + * @param request ListFoldersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFoldersResponse + */ + public listFolders(request: google.cloud.resourcemanager.v3.IListFoldersRequest, callback: google.cloud.resourcemanager.v3.Folders.ListFoldersCallback): void; + + /** + * Calls ListFolders. + * @param request ListFoldersRequest message or plain object + * @returns Promise + */ + public listFolders(request: google.cloud.resourcemanager.v3.IListFoldersRequest): Promise; + + /** + * Calls SearchFolders. + * @param request SearchFoldersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchFoldersResponse + */ + public searchFolders(request: google.cloud.resourcemanager.v3.ISearchFoldersRequest, callback: google.cloud.resourcemanager.v3.Folders.SearchFoldersCallback): void; + + /** + * Calls SearchFolders. + * @param request SearchFoldersRequest message or plain object + * @returns Promise + */ + public searchFolders(request: google.cloud.resourcemanager.v3.ISearchFoldersRequest): Promise; + + /** + * Calls CreateFolder. + * @param request CreateFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createFolder(request: google.cloud.resourcemanager.v3.ICreateFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.CreateFolderCallback): void; + + /** + * Calls CreateFolder. + * @param request CreateFolderRequest message or plain object + * @returns Promise + */ + public createFolder(request: google.cloud.resourcemanager.v3.ICreateFolderRequest): Promise; + + /** + * Calls UpdateFolder. + * @param request UpdateFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateFolder(request: google.cloud.resourcemanager.v3.IUpdateFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.UpdateFolderCallback): void; + + /** + * Calls UpdateFolder. + * @param request UpdateFolderRequest message or plain object + * @returns Promise + */ + public updateFolder(request: google.cloud.resourcemanager.v3.IUpdateFolderRequest): Promise; + + /** + * Calls MoveFolder. + * @param request MoveFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveFolder(request: google.cloud.resourcemanager.v3.IMoveFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.MoveFolderCallback): void; + + /** + * Calls MoveFolder. + * @param request MoveFolderRequest message or plain object + * @returns Promise + */ + public moveFolder(request: google.cloud.resourcemanager.v3.IMoveFolderRequest): Promise; + + /** + * Calls DeleteFolder. + * @param request DeleteFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteFolder(request: google.cloud.resourcemanager.v3.IDeleteFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.DeleteFolderCallback): void; + + /** + * Calls DeleteFolder. + * @param request DeleteFolderRequest message or plain object + * @returns Promise + */ + public deleteFolder(request: google.cloud.resourcemanager.v3.IDeleteFolderRequest): Promise; + + /** + * Calls UndeleteFolder. + * @param request UndeleteFolderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteFolder(request: google.cloud.resourcemanager.v3.IUndeleteFolderRequest, callback: google.cloud.resourcemanager.v3.Folders.UndeleteFolderCallback): void; + + /** + * Calls UndeleteFolder. + * @param request UndeleteFolderRequest message or plain object + * @returns Promise + */ + public undeleteFolder(request: google.cloud.resourcemanager.v3.IUndeleteFolderRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Folders.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Folders.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.resourcemanager.v3.Folders.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace Folders { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|getFolder}. + * @param error Error, if any + * @param [response] Folder + */ + type GetFolderCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.Folder) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|listFolders}. + * @param error Error, if any + * @param [response] ListFoldersResponse + */ + type ListFoldersCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.ListFoldersResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|searchFolders}. + * @param error Error, if any + * @param [response] SearchFoldersResponse + */ + type SearchFoldersCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.SearchFoldersResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|createFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|updateFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|moveFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|deleteFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|undeleteFolder}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteFolderCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a Folder. */ + interface IFolder { + + /** Folder name */ + name?: (string|null); + + /** Folder parent */ + parent?: (string|null); + + /** Folder displayName */ + displayName?: (string|null); + + /** Folder state */ + state?: (google.cloud.resourcemanager.v3.Folder.State|keyof typeof google.cloud.resourcemanager.v3.Folder.State|null); + + /** Folder createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Folder updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Folder deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Folder etag */ + etag?: (string|null); + } + + /** Represents a Folder. */ + class Folder implements IFolder { + + /** + * Constructs a new Folder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IFolder); + + /** Folder name. */ + public name: string; + + /** Folder parent. */ + public parent: string; + + /** Folder displayName. */ + public displayName: string; + + /** Folder state. */ + public state: (google.cloud.resourcemanager.v3.Folder.State|keyof typeof google.cloud.resourcemanager.v3.Folder.State); + + /** Folder createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Folder updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Folder deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Folder etag. */ + public etag: string; + + /** + * Creates a new Folder instance using the specified properties. + * @param [properties] Properties to set + * @returns Folder instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IFolder): google.cloud.resourcemanager.v3.Folder; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.resourcemanager.v3.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Folder.verify|verify} messages. + * @param message Folder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IFolder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.Folder; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.Folder; + + /** + * Verifies a Folder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Folder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.Folder; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @param message Folder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.Folder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Folder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Folder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Folder { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DELETE_REQUESTED = 2 + } + } + + /** Properties of a GetFolderRequest. */ + interface IGetFolderRequest { + + /** GetFolderRequest name */ + name?: (string|null); + } + + /** Represents a GetFolderRequest. */ + class GetFolderRequest implements IGetFolderRequest { + + /** + * Constructs a new GetFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IGetFolderRequest); + + /** GetFolderRequest name. */ + public name: string; + + /** + * Creates a new GetFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IGetFolderRequest): google.cloud.resourcemanager.v3.GetFolderRequest; + + /** + * Encodes the specified GetFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetFolderRequest.verify|verify} messages. + * @param message GetFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IGetFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetFolderRequest.verify|verify} messages. + * @param message GetFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IGetFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.GetFolderRequest; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.GetFolderRequest; + + /** + * Verifies a GetFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.GetFolderRequest; + + /** + * Creates a plain object from a GetFolderRequest message. Also converts values to other types if specified. + * @param message GetFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.GetFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFoldersRequest. */ + interface IListFoldersRequest { + + /** ListFoldersRequest parent */ + parent?: (string|null); + + /** ListFoldersRequest pageSize */ + pageSize?: (number|null); + + /** ListFoldersRequest pageToken */ + pageToken?: (string|null); + + /** ListFoldersRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListFoldersRequest. */ + class ListFoldersRequest implements IListFoldersRequest { + + /** + * Constructs a new ListFoldersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListFoldersRequest); + + /** ListFoldersRequest parent. */ + public parent: string; + + /** ListFoldersRequest pageSize. */ + public pageSize: number; + + /** ListFoldersRequest pageToken. */ + public pageToken: string; + + /** ListFoldersRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListFoldersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFoldersRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListFoldersRequest): google.cloud.resourcemanager.v3.ListFoldersRequest; + + /** + * Encodes the specified ListFoldersRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersRequest.verify|verify} messages. + * @param message ListFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFoldersRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersRequest.verify|verify} messages. + * @param message ListFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListFoldersRequest; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListFoldersRequest; + + /** + * Verifies a ListFoldersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFoldersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListFoldersRequest; + + /** + * Creates a plain object from a ListFoldersRequest message. Also converts values to other types if specified. + * @param message ListFoldersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListFoldersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFoldersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFoldersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFoldersResponse. */ + interface IListFoldersResponse { + + /** ListFoldersResponse folders */ + folders?: (google.cloud.resourcemanager.v3.IFolder[]|null); + + /** ListFoldersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFoldersResponse. */ + class ListFoldersResponse implements IListFoldersResponse { + + /** + * Constructs a new ListFoldersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListFoldersResponse); + + /** ListFoldersResponse folders. */ + public folders: google.cloud.resourcemanager.v3.IFolder[]; + + /** ListFoldersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFoldersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFoldersResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListFoldersResponse): google.cloud.resourcemanager.v3.ListFoldersResponse; + + /** + * Encodes the specified ListFoldersResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersResponse.verify|verify} messages. + * @param message ListFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFoldersResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersResponse.verify|verify} messages. + * @param message ListFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListFoldersResponse; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListFoldersResponse; + + /** + * Verifies a ListFoldersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFoldersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListFoldersResponse; + + /** + * Creates a plain object from a ListFoldersResponse message. Also converts values to other types if specified. + * @param message ListFoldersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListFoldersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFoldersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFoldersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchFoldersRequest. */ + interface ISearchFoldersRequest { + + /** SearchFoldersRequest pageSize */ + pageSize?: (number|null); + + /** SearchFoldersRequest pageToken */ + pageToken?: (string|null); + + /** SearchFoldersRequest query */ + query?: (string|null); + } + + /** Represents a SearchFoldersRequest. */ + class SearchFoldersRequest implements ISearchFoldersRequest { + + /** + * Constructs a new SearchFoldersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchFoldersRequest); + + /** SearchFoldersRequest pageSize. */ + public pageSize: number; + + /** SearchFoldersRequest pageToken. */ + public pageToken: string; + + /** SearchFoldersRequest query. */ + public query: string; + + /** + * Creates a new SearchFoldersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchFoldersRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchFoldersRequest): google.cloud.resourcemanager.v3.SearchFoldersRequest; + + /** + * Encodes the specified SearchFoldersRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersRequest.verify|verify} messages. + * @param message SearchFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchFoldersRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersRequest.verify|verify} messages. + * @param message SearchFoldersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchFoldersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchFoldersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchFoldersRequest; + + /** + * Decodes a SearchFoldersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchFoldersRequest; + + /** + * Verifies a SearchFoldersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchFoldersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchFoldersRequest; + + /** + * Creates a plain object from a SearchFoldersRequest message. Also converts values to other types if specified. + * @param message SearchFoldersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchFoldersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchFoldersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchFoldersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchFoldersResponse. */ + interface ISearchFoldersResponse { + + /** SearchFoldersResponse folders */ + folders?: (google.cloud.resourcemanager.v3.IFolder[]|null); + + /** SearchFoldersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchFoldersResponse. */ + class SearchFoldersResponse implements ISearchFoldersResponse { + + /** + * Constructs a new SearchFoldersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchFoldersResponse); + + /** SearchFoldersResponse folders. */ + public folders: google.cloud.resourcemanager.v3.IFolder[]; + + /** SearchFoldersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchFoldersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchFoldersResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchFoldersResponse): google.cloud.resourcemanager.v3.SearchFoldersResponse; + + /** + * Encodes the specified SearchFoldersResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersResponse.verify|verify} messages. + * @param message SearchFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchFoldersResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersResponse.verify|verify} messages. + * @param message SearchFoldersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchFoldersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchFoldersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchFoldersResponse; + + /** + * Decodes a SearchFoldersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchFoldersResponse; + + /** + * Verifies a SearchFoldersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchFoldersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchFoldersResponse; + + /** + * Creates a plain object from a SearchFoldersResponse message. Also converts values to other types if specified. + * @param message SearchFoldersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchFoldersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchFoldersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchFoldersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFolderRequest. */ + interface ICreateFolderRequest { + + /** CreateFolderRequest folder */ + folder?: (google.cloud.resourcemanager.v3.IFolder|null); + } + + /** Represents a CreateFolderRequest. */ + class CreateFolderRequest implements ICreateFolderRequest { + + /** + * Constructs a new CreateFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateFolderRequest); + + /** CreateFolderRequest folder. */ + public folder?: (google.cloud.resourcemanager.v3.IFolder|null); + + /** + * Creates a new CreateFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateFolderRequest): google.cloud.resourcemanager.v3.CreateFolderRequest; + + /** + * Encodes the specified CreateFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderRequest.verify|verify} messages. + * @param message CreateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderRequest.verify|verify} messages. + * @param message CreateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateFolderRequest; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateFolderRequest; + + /** + * Verifies a CreateFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateFolderRequest; + + /** + * Creates a plain object from a CreateFolderRequest message. Also converts values to other types if specified. + * @param message CreateFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFolderMetadata. */ + interface ICreateFolderMetadata { + + /** CreateFolderMetadata displayName */ + displayName?: (string|null); + + /** CreateFolderMetadata parent */ + parent?: (string|null); + } + + /** Represents a CreateFolderMetadata. */ + class CreateFolderMetadata implements ICreateFolderMetadata { + + /** + * Constructs a new CreateFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateFolderMetadata); + + /** CreateFolderMetadata displayName. */ + public displayName: string; + + /** CreateFolderMetadata parent. */ + public parent: string; + + /** + * Creates a new CreateFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFolderMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateFolderMetadata): google.cloud.resourcemanager.v3.CreateFolderMetadata; + + /** + * Encodes the specified CreateFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderMetadata.verify|verify} messages. + * @param message CreateFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderMetadata.verify|verify} messages. + * @param message CreateFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateFolderMetadata; + + /** + * Decodes a CreateFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateFolderMetadata; + + /** + * Verifies a CreateFolderMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateFolderMetadata; + + /** + * Creates a plain object from a CreateFolderMetadata message. Also converts values to other types if specified. + * @param message CreateFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFolderRequest. */ + interface IUpdateFolderRequest { + + /** UpdateFolderRequest folder */ + folder?: (google.cloud.resourcemanager.v3.IFolder|null); + + /** UpdateFolderRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFolderRequest. */ + class UpdateFolderRequest implements IUpdateFolderRequest { + + /** + * Constructs a new UpdateFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateFolderRequest); + + /** UpdateFolderRequest folder. */ + public folder?: (google.cloud.resourcemanager.v3.IFolder|null); + + /** UpdateFolderRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateFolderRequest): google.cloud.resourcemanager.v3.UpdateFolderRequest; + + /** + * Encodes the specified UpdateFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderRequest.verify|verify} messages. + * @param message UpdateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderRequest.verify|verify} messages. + * @param message UpdateFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateFolderRequest; + + /** + * Decodes an UpdateFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateFolderRequest; + + /** + * Verifies an UpdateFolderRequest message. + * @param message Plain 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 UpdateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateFolderRequest; + + /** + * Creates a plain object from an UpdateFolderRequest message. Also converts values to other types if specified. + * @param message UpdateFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFolderMetadata. */ + interface IUpdateFolderMetadata { + } + + /** Represents an UpdateFolderMetadata. */ + class UpdateFolderMetadata implements IUpdateFolderMetadata { + + /** + * Constructs a new UpdateFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateFolderMetadata); + + /** + * Creates a new UpdateFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFolderMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateFolderMetadata): google.cloud.resourcemanager.v3.UpdateFolderMetadata; + + /** + * Encodes the specified UpdateFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderMetadata.verify|verify} messages. + * @param message UpdateFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderMetadata.verify|verify} messages. + * @param message UpdateFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateFolderMetadata; + + /** + * Decodes an UpdateFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateFolderMetadata; + + /** + * Verifies an UpdateFolderMetadata message. + * @param message Plain 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 UpdateFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateFolderMetadata; + + /** + * Creates a plain object from an UpdateFolderMetadata message. Also converts values to other types if specified. + * @param message UpdateFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveFolderRequest. */ + interface IMoveFolderRequest { + + /** MoveFolderRequest name */ + name?: (string|null); + + /** MoveFolderRequest destinationParent */ + destinationParent?: (string|null); + } + + /** Represents a MoveFolderRequest. */ + class MoveFolderRequest implements IMoveFolderRequest { + + /** + * Constructs a new MoveFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IMoveFolderRequest); + + /** MoveFolderRequest name. */ + public name: string; + + /** MoveFolderRequest destinationParent. */ + public destinationParent: string; + + /** + * Creates a new MoveFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IMoveFolderRequest): google.cloud.resourcemanager.v3.MoveFolderRequest; + + /** + * Encodes the specified MoveFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderRequest.verify|verify} messages. + * @param message MoveFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IMoveFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderRequest.verify|verify} messages. + * @param message MoveFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IMoveFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.MoveFolderRequest; + + /** + * Decodes a MoveFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.MoveFolderRequest; + + /** + * Verifies a MoveFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.MoveFolderRequest; + + /** + * Creates a plain object from a MoveFolderRequest message. Also converts values to other types if specified. + * @param message MoveFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.MoveFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveFolderMetadata. */ + interface IMoveFolderMetadata { + + /** MoveFolderMetadata displayName */ + displayName?: (string|null); + + /** MoveFolderMetadata sourceParent */ + sourceParent?: (string|null); + + /** MoveFolderMetadata destinationParent */ + destinationParent?: (string|null); + } + + /** Represents a MoveFolderMetadata. */ + class MoveFolderMetadata implements IMoveFolderMetadata { + + /** + * Constructs a new MoveFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IMoveFolderMetadata); + + /** MoveFolderMetadata displayName. */ + public displayName: string; + + /** MoveFolderMetadata sourceParent. */ + public sourceParent: string; + + /** MoveFolderMetadata destinationParent. */ + public destinationParent: string; + + /** + * Creates a new MoveFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveFolderMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IMoveFolderMetadata): google.cloud.resourcemanager.v3.MoveFolderMetadata; + + /** + * Encodes the specified MoveFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderMetadata.verify|verify} messages. + * @param message MoveFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IMoveFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderMetadata.verify|verify} messages. + * @param message MoveFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IMoveFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.MoveFolderMetadata; + + /** + * Decodes a MoveFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.MoveFolderMetadata; + + /** + * Verifies a MoveFolderMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.MoveFolderMetadata; + + /** + * Creates a plain object from a MoveFolderMetadata message. Also converts values to other types if specified. + * @param message MoveFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.MoveFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFolderRequest. */ + interface IDeleteFolderRequest { + + /** DeleteFolderRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFolderRequest. */ + class DeleteFolderRequest implements IDeleteFolderRequest { + + /** + * Constructs a new DeleteFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteFolderRequest); + + /** DeleteFolderRequest name. */ + public name: string; + + /** + * Creates a new DeleteFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteFolderRequest): google.cloud.resourcemanager.v3.DeleteFolderRequest; + + /** + * Encodes the specified DeleteFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderRequest.verify|verify} messages. + * @param message DeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderRequest.verify|verify} messages. + * @param message DeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteFolderRequest; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteFolderRequest; + + /** + * Verifies a DeleteFolderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteFolderRequest; + + /** + * Creates a plain object from a DeleteFolderRequest message. Also converts values to other types if specified. + * @param message DeleteFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFolderMetadata. */ + interface IDeleteFolderMetadata { + } + + /** Represents a DeleteFolderMetadata. */ + class DeleteFolderMetadata implements IDeleteFolderMetadata { + + /** + * Constructs a new DeleteFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteFolderMetadata); + + /** + * Creates a new DeleteFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFolderMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteFolderMetadata): google.cloud.resourcemanager.v3.DeleteFolderMetadata; + + /** + * Encodes the specified DeleteFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderMetadata.verify|verify} messages. + * @param message DeleteFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderMetadata.verify|verify} messages. + * @param message DeleteFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteFolderMetadata; + + /** + * Decodes a DeleteFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteFolderMetadata; + + /** + * Verifies a DeleteFolderMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteFolderMetadata; + + /** + * Creates a plain object from a DeleteFolderMetadata message. Also converts values to other types if specified. + * @param message DeleteFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteFolderRequest. */ + interface IUndeleteFolderRequest { + + /** UndeleteFolderRequest name */ + name?: (string|null); + } + + /** Represents an UndeleteFolderRequest. */ + class UndeleteFolderRequest implements IUndeleteFolderRequest { + + /** + * Constructs a new UndeleteFolderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUndeleteFolderRequest); + + /** UndeleteFolderRequest name. */ + public name: string; + + /** + * Creates a new UndeleteFolderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteFolderRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUndeleteFolderRequest): google.cloud.resourcemanager.v3.UndeleteFolderRequest; + + /** + * Encodes the specified UndeleteFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderRequest.verify|verify} messages. + * @param message UndeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUndeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderRequest.verify|verify} messages. + * @param message UndeleteFolderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUndeleteFolderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteFolderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UndeleteFolderRequest; + + /** + * Decodes an UndeleteFolderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UndeleteFolderRequest; + + /** + * Verifies an UndeleteFolderRequest message. + * @param message Plain 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 UndeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteFolderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UndeleteFolderRequest; + + /** + * Creates a plain object from an UndeleteFolderRequest message. Also converts values to other types if specified. + * @param message UndeleteFolderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UndeleteFolderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteFolderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteFolderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteFolderMetadata. */ + interface IUndeleteFolderMetadata { + } + + /** Represents an UndeleteFolderMetadata. */ + class UndeleteFolderMetadata implements IUndeleteFolderMetadata { + + /** + * Constructs a new UndeleteFolderMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUndeleteFolderMetadata); + + /** + * Creates a new UndeleteFolderMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteFolderMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUndeleteFolderMetadata): google.cloud.resourcemanager.v3.UndeleteFolderMetadata; + + /** + * Encodes the specified UndeleteFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderMetadata.verify|verify} messages. + * @param message UndeleteFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUndeleteFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderMetadata.verify|verify} messages. + * @param message UndeleteFolderMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUndeleteFolderMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteFolderMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UndeleteFolderMetadata; + + /** + * Decodes an UndeleteFolderMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UndeleteFolderMetadata; + + /** + * Verifies an UndeleteFolderMetadata message. + * @param message Plain 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 UndeleteFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteFolderMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UndeleteFolderMetadata; + + /** + * Creates a plain object from an UndeleteFolderMetadata message. Also converts values to other types if specified. + * @param message UndeleteFolderMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UndeleteFolderMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteFolderMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteFolderMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Organizations */ + class Organizations extends $protobuf.rpc.Service { + + /** + * Constructs a new Organizations 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 Organizations 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): Organizations; + + /** + * Calls GetOrganization. + * @param request GetOrganizationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Organization + */ + public getOrganization(request: google.cloud.resourcemanager.v3.IGetOrganizationRequest, callback: google.cloud.resourcemanager.v3.Organizations.GetOrganizationCallback): void; + + /** + * Calls GetOrganization. + * @param request GetOrganizationRequest message or plain object + * @returns Promise + */ + public getOrganization(request: google.cloud.resourcemanager.v3.IGetOrganizationRequest): Promise; + + /** + * Calls SearchOrganizations. + * @param request SearchOrganizationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchOrganizationsResponse + */ + public searchOrganizations(request: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, callback: google.cloud.resourcemanager.v3.Organizations.SearchOrganizationsCallback): void; + + /** + * Calls SearchOrganizations. + * @param request SearchOrganizationsRequest message or plain object + * @returns Promise + */ + public searchOrganizations(request: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Organizations.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Organizations.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.resourcemanager.v3.Organizations.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace Organizations { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|getOrganization}. + * @param error Error, if any + * @param [response] Organization + */ + type GetOrganizationCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.Organization) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|searchOrganizations}. + * @param error Error, if any + * @param [response] SearchOrganizationsResponse + */ + type SearchOrganizationsCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.SearchOrganizationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of an Organization. */ + interface IOrganization { + + /** Organization name */ + name?: (string|null); + + /** Organization displayName */ + displayName?: (string|null); + + /** Organization directoryCustomerId */ + directoryCustomerId?: (string|null); + + /** Organization state */ + state?: (google.cloud.resourcemanager.v3.Organization.State|keyof typeof google.cloud.resourcemanager.v3.Organization.State|null); + + /** Organization createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Organization updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Organization deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Organization etag */ + etag?: (string|null); + } + + /** Represents an Organization. */ + class Organization implements IOrganization { + + /** + * Constructs a new Organization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IOrganization); + + /** Organization name. */ + public name: string; + + /** Organization displayName. */ + public displayName: string; + + /** Organization directoryCustomerId. */ + public directoryCustomerId?: (string|null); + + /** Organization state. */ + public state: (google.cloud.resourcemanager.v3.Organization.State|keyof typeof google.cloud.resourcemanager.v3.Organization.State); + + /** Organization createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Organization updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Organization deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Organization etag. */ + public etag: string; + + /** Organization owner. */ + public owner?: "directoryCustomerId"; + + /** + * Creates a new Organization instance using the specified properties. + * @param [properties] Properties to set + * @returns Organization instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IOrganization): google.cloud.resourcemanager.v3.Organization; + + /** + * Encodes the specified Organization message. Does not implicitly {@link google.cloud.resourcemanager.v3.Organization.verify|verify} messages. + * @param message Organization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Organization message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Organization.verify|verify} messages. + * @param message Organization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IOrganization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Organization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Organization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.Organization; + + /** + * Decodes an Organization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Organization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.Organization; + + /** + * Verifies an Organization message. + * @param message Plain 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 Organization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Organization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.Organization; + + /** + * Creates a plain object from an Organization message. Also converts values to other types if specified. + * @param message Organization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.Organization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Organization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Organization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Organization { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DELETE_REQUESTED = 2 + } + } + + /** Properties of a GetOrganizationRequest. */ + interface IGetOrganizationRequest { + + /** GetOrganizationRequest name */ + name?: (string|null); + } + + /** Represents a GetOrganizationRequest. */ + class GetOrganizationRequest implements IGetOrganizationRequest { + + /** + * Constructs a new GetOrganizationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IGetOrganizationRequest); + + /** GetOrganizationRequest name. */ + public name: string; + + /** + * Creates a new GetOrganizationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOrganizationRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IGetOrganizationRequest): google.cloud.resourcemanager.v3.GetOrganizationRequest; + + /** + * Encodes the specified GetOrganizationRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetOrganizationRequest.verify|verify} messages. + * @param message GetOrganizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IGetOrganizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOrganizationRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetOrganizationRequest.verify|verify} messages. + * @param message GetOrganizationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IGetOrganizationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOrganizationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOrganizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.GetOrganizationRequest; + + /** + * Decodes a GetOrganizationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOrganizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.GetOrganizationRequest; + + /** + * Verifies a GetOrganizationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOrganizationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOrganizationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.GetOrganizationRequest; + + /** + * Creates a plain object from a GetOrganizationRequest message. Also converts values to other types if specified. + * @param message GetOrganizationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.GetOrganizationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOrganizationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOrganizationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchOrganizationsRequest. */ + interface ISearchOrganizationsRequest { + + /** SearchOrganizationsRequest pageSize */ + pageSize?: (number|null); + + /** SearchOrganizationsRequest pageToken */ + pageToken?: (string|null); + + /** SearchOrganizationsRequest query */ + query?: (string|null); + } + + /** Represents a SearchOrganizationsRequest. */ + class SearchOrganizationsRequest implements ISearchOrganizationsRequest { + + /** + * Constructs a new SearchOrganizationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest); + + /** SearchOrganizationsRequest pageSize. */ + public pageSize: number; + + /** SearchOrganizationsRequest pageToken. */ + public pageToken: string; + + /** SearchOrganizationsRequest query. */ + public query: string; + + /** + * Creates a new SearchOrganizationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchOrganizationsRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest): google.cloud.resourcemanager.v3.SearchOrganizationsRequest; + + /** + * Encodes the specified SearchOrganizationsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsRequest.verify|verify} messages. + * @param message SearchOrganizationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchOrganizationsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsRequest.verify|verify} messages. + * @param message SearchOrganizationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchOrganizationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchOrganizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchOrganizationsRequest; + + /** + * Decodes a SearchOrganizationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchOrganizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchOrganizationsRequest; + + /** + * Verifies a SearchOrganizationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchOrganizationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchOrganizationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchOrganizationsRequest; + + /** + * Creates a plain object from a SearchOrganizationsRequest message. Also converts values to other types if specified. + * @param message SearchOrganizationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchOrganizationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchOrganizationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchOrganizationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchOrganizationsResponse. */ + interface ISearchOrganizationsResponse { + + /** SearchOrganizationsResponse organizations */ + organizations?: (google.cloud.resourcemanager.v3.IOrganization[]|null); + + /** SearchOrganizationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchOrganizationsResponse. */ + class SearchOrganizationsResponse implements ISearchOrganizationsResponse { + + /** + * Constructs a new SearchOrganizationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchOrganizationsResponse); + + /** SearchOrganizationsResponse organizations. */ + public organizations: google.cloud.resourcemanager.v3.IOrganization[]; + + /** SearchOrganizationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchOrganizationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchOrganizationsResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchOrganizationsResponse): google.cloud.resourcemanager.v3.SearchOrganizationsResponse; + + /** + * Encodes the specified SearchOrganizationsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsResponse.verify|verify} messages. + * @param message SearchOrganizationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchOrganizationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchOrganizationsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsResponse.verify|verify} messages. + * @param message SearchOrganizationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchOrganizationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchOrganizationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchOrganizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchOrganizationsResponse; + + /** + * Decodes a SearchOrganizationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchOrganizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchOrganizationsResponse; + + /** + * Verifies a SearchOrganizationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchOrganizationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchOrganizationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchOrganizationsResponse; + + /** + * Creates a plain object from a SearchOrganizationsResponse message. Also converts values to other types if specified. + * @param message SearchOrganizationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchOrganizationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchOrganizationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchOrganizationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOrganizationMetadata. */ + interface IDeleteOrganizationMetadata { + } + + /** Represents a DeleteOrganizationMetadata. */ + class DeleteOrganizationMetadata implements IDeleteOrganizationMetadata { + + /** + * Constructs a new DeleteOrganizationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata); + + /** + * Creates a new DeleteOrganizationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOrganizationMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata): google.cloud.resourcemanager.v3.DeleteOrganizationMetadata; + + /** + * Encodes the specified DeleteOrganizationMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.verify|verify} messages. + * @param message DeleteOrganizationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOrganizationMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.verify|verify} messages. + * @param message DeleteOrganizationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOrganizationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteOrganizationMetadata; + + /** + * Decodes a DeleteOrganizationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteOrganizationMetadata; + + /** + * Verifies a DeleteOrganizationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOrganizationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOrganizationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteOrganizationMetadata; + + /** + * Creates a plain object from a DeleteOrganizationMetadata message. Also converts values to other types if specified. + * @param message DeleteOrganizationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteOrganizationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOrganizationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOrganizationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteOrganizationMetadata. */ + interface IUndeleteOrganizationMetadata { + } + + /** Represents an UndeleteOrganizationMetadata. */ + class UndeleteOrganizationMetadata implements IUndeleteOrganizationMetadata { + + /** + * Constructs a new UndeleteOrganizationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata); + + /** + * Creates a new UndeleteOrganizationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteOrganizationMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata): google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata; + + /** + * Encodes the specified UndeleteOrganizationMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.verify|verify} messages. + * @param message UndeleteOrganizationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteOrganizationMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.verify|verify} messages. + * @param message UndeleteOrganizationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteOrganizationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata; + + /** + * Decodes an UndeleteOrganizationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata; + + /** + * Verifies an UndeleteOrganizationMetadata message. + * @param message Plain 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 UndeleteOrganizationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteOrganizationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata; + + /** + * Creates a plain object from an UndeleteOrganizationMetadata message. Also converts values to other types if specified. + * @param message UndeleteOrganizationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteOrganizationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteOrganizationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Projects */ + class Projects extends $protobuf.rpc.Service { + + /** + * Constructs a new Projects 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 Projects 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): Projects; + + /** + * Calls GetProject. + * @param request GetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Project + */ + public getProject(request: google.cloud.resourcemanager.v3.IGetProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.GetProjectCallback): void; + + /** + * Calls GetProject. + * @param request GetProjectRequest message or plain object + * @returns Promise + */ + public getProject(request: google.cloud.resourcemanager.v3.IGetProjectRequest): Promise; + + /** + * Calls ListProjects. + * @param request ListProjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProjectsResponse + */ + public listProjects(request: google.cloud.resourcemanager.v3.IListProjectsRequest, callback: google.cloud.resourcemanager.v3.Projects.ListProjectsCallback): void; + + /** + * Calls ListProjects. + * @param request ListProjectsRequest message or plain object + * @returns Promise + */ + public listProjects(request: google.cloud.resourcemanager.v3.IListProjectsRequest): Promise; + + /** + * Calls SearchProjects. + * @param request SearchProjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchProjectsResponse + */ + public searchProjects(request: google.cloud.resourcemanager.v3.ISearchProjectsRequest, callback: google.cloud.resourcemanager.v3.Projects.SearchProjectsCallback): void; + + /** + * Calls SearchProjects. + * @param request SearchProjectsRequest message or plain object + * @returns Promise + */ + public searchProjects(request: google.cloud.resourcemanager.v3.ISearchProjectsRequest): Promise; + + /** + * Calls CreateProject. + * @param request CreateProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createProject(request: google.cloud.resourcemanager.v3.ICreateProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.CreateProjectCallback): void; + + /** + * Calls CreateProject. + * @param request CreateProjectRequest message or plain object + * @returns Promise + */ + public createProject(request: google.cloud.resourcemanager.v3.ICreateProjectRequest): Promise; + + /** + * Calls UpdateProject. + * @param request UpdateProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateProject(request: google.cloud.resourcemanager.v3.IUpdateProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.UpdateProjectCallback): void; + + /** + * Calls UpdateProject. + * @param request UpdateProjectRequest message or plain object + * @returns Promise + */ + public updateProject(request: google.cloud.resourcemanager.v3.IUpdateProjectRequest): Promise; + + /** + * Calls MoveProject. + * @param request MoveProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveProject(request: google.cloud.resourcemanager.v3.IMoveProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.MoveProjectCallback): void; + + /** + * Calls MoveProject. + * @param request MoveProjectRequest message or plain object + * @returns Promise + */ + public moveProject(request: google.cloud.resourcemanager.v3.IMoveProjectRequest): Promise; + + /** + * Calls DeleteProject. + * @param request DeleteProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProject(request: google.cloud.resourcemanager.v3.IDeleteProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.DeleteProjectCallback): void; + + /** + * Calls DeleteProject. + * @param request DeleteProjectRequest message or plain object + * @returns Promise + */ + public deleteProject(request: google.cloud.resourcemanager.v3.IDeleteProjectRequest): Promise; + + /** + * Calls UndeleteProject. + * @param request UndeleteProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeleteProject(request: google.cloud.resourcemanager.v3.IUndeleteProjectRequest, callback: google.cloud.resourcemanager.v3.Projects.UndeleteProjectCallback): void; + + /** + * Calls UndeleteProject. + * @param request UndeleteProjectRequest message or plain object + * @returns Promise + */ + public undeleteProject(request: google.cloud.resourcemanager.v3.IUndeleteProjectRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Projects.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.Projects.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.resourcemanager.v3.Projects.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace Projects { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|getProject}. + * @param error Error, if any + * @param [response] Project + */ + type GetProjectCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.Project) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|listProjects}. + * @param error Error, if any + * @param [response] ListProjectsResponse + */ + type ListProjectsCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.ListProjectsResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|searchProjects}. + * @param error Error, if any + * @param [response] SearchProjectsResponse + */ + type SearchProjectsCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.SearchProjectsResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|createProject}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|updateProject}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|moveProject}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|deleteProject}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|undeleteProject}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeleteProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a Project. */ + interface IProject { + + /** Project name */ + name?: (string|null); + + /** Project parent */ + parent?: (string|null); + + /** Project projectId */ + projectId?: (string|null); + + /** Project state */ + state?: (google.cloud.resourcemanager.v3.Project.State|keyof typeof google.cloud.resourcemanager.v3.Project.State|null); + + /** Project displayName */ + displayName?: (string|null); + + /** Project createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Project updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Project deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Project etag */ + etag?: (string|null); + + /** Project labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Project. */ + class Project implements IProject { + + /** + * Constructs a new Project. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IProject); + + /** Project name. */ + public name: string; + + /** Project parent. */ + public parent: string; + + /** Project projectId. */ + public projectId: string; + + /** Project state. */ + public state: (google.cloud.resourcemanager.v3.Project.State|keyof typeof google.cloud.resourcemanager.v3.Project.State); + + /** Project displayName. */ + public displayName: string; + + /** Project createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Project updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Project deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Project etag. */ + public etag: string; + + /** Project labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Project instance using the specified properties. + * @param [properties] Properties to set + * @returns Project instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IProject): google.cloud.resourcemanager.v3.Project; + + /** + * Encodes the specified Project message. Does not implicitly {@link google.cloud.resourcemanager.v3.Project.verify|verify} messages. + * @param message Project message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Project message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Project.verify|verify} messages. + * @param message Project message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Project message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Project + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.Project; + + /** + * Decodes a Project message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Project + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.Project; + + /** + * Verifies a Project message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Project message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Project + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.Project; + + /** + * Creates a plain object from a Project message. Also converts values to other types if specified. + * @param message Project + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.Project, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Project to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Project + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Project { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DELETE_REQUESTED = 2 + } + } + + /** Properties of a GetProjectRequest. */ + interface IGetProjectRequest { + + /** GetProjectRequest name */ + name?: (string|null); + } + + /** Represents a GetProjectRequest. */ + class GetProjectRequest implements IGetProjectRequest { + + /** + * Constructs a new GetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IGetProjectRequest); + + /** GetProjectRequest name. */ + public name: string; + + /** + * Creates a new GetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IGetProjectRequest): google.cloud.resourcemanager.v3.GetProjectRequest; + + /** + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetProjectRequest.verify|verify} messages. + * @param message GetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IGetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetProjectRequest.verify|verify} messages. + * @param message GetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IGetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.GetProjectRequest; + + /** + * Decodes a GetProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.GetProjectRequest; + + /** + * Verifies a GetProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.GetProjectRequest; + + /** + * Creates a plain object from a GetProjectRequest message. Also converts values to other types if specified. + * @param message GetProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.GetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProjectsRequest. */ + interface IListProjectsRequest { + + /** ListProjectsRequest parent */ + parent?: (string|null); + + /** ListProjectsRequest pageToken */ + pageToken?: (string|null); + + /** ListProjectsRequest pageSize */ + pageSize?: (number|null); + + /** ListProjectsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListProjectsRequest. */ + class ListProjectsRequest implements IListProjectsRequest { + + /** + * Constructs a new ListProjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListProjectsRequest); + + /** ListProjectsRequest parent. */ + public parent: string; + + /** ListProjectsRequest pageToken. */ + public pageToken: string; + + /** ListProjectsRequest pageSize. */ + public pageSize: number; + + /** ListProjectsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListProjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProjectsRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListProjectsRequest): google.cloud.resourcemanager.v3.ListProjectsRequest; + + /** + * Encodes the specified ListProjectsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsRequest.verify|verify} messages. + * @param message ListProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsRequest.verify|verify} messages. + * @param message ListProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListProjectsRequest; + + /** + * Decodes a ListProjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListProjectsRequest; + + /** + * Verifies a ListProjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListProjectsRequest; + + /** + * Creates a plain object from a ListProjectsRequest message. Also converts values to other types if specified. + * @param message ListProjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListProjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProjectsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProjectsResponse. */ + interface IListProjectsResponse { + + /** ListProjectsResponse projects */ + projects?: (google.cloud.resourcemanager.v3.IProject[]|null); + + /** ListProjectsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProjectsResponse. */ + class ListProjectsResponse implements IListProjectsResponse { + + /** + * Constructs a new ListProjectsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListProjectsResponse); + + /** ListProjectsResponse projects. */ + public projects: google.cloud.resourcemanager.v3.IProject[]; + + /** ListProjectsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProjectsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProjectsResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListProjectsResponse): google.cloud.resourcemanager.v3.ListProjectsResponse; + + /** + * Encodes the specified ListProjectsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsResponse.verify|verify} messages. + * @param message ListProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsResponse.verify|verify} messages. + * @param message ListProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProjectsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListProjectsResponse; + + /** + * Decodes a ListProjectsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListProjectsResponse; + + /** + * Verifies a ListProjectsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProjectsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListProjectsResponse; + + /** + * Creates a plain object from a ListProjectsResponse message. Also converts values to other types if specified. + * @param message ListProjectsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListProjectsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProjectsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProjectsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchProjectsRequest. */ + interface ISearchProjectsRequest { + + /** SearchProjectsRequest query */ + query?: (string|null); + + /** SearchProjectsRequest pageToken */ + pageToken?: (string|null); + + /** SearchProjectsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a SearchProjectsRequest. */ + class SearchProjectsRequest implements ISearchProjectsRequest { + + /** + * Constructs a new SearchProjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchProjectsRequest); + + /** SearchProjectsRequest query. */ + public query: string; + + /** SearchProjectsRequest pageToken. */ + public pageToken: string; + + /** SearchProjectsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new SearchProjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchProjectsRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchProjectsRequest): google.cloud.resourcemanager.v3.SearchProjectsRequest; + + /** + * Encodes the specified SearchProjectsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsRequest.verify|verify} messages. + * @param message SearchProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsRequest.verify|verify} messages. + * @param message SearchProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchProjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchProjectsRequest; + + /** + * Decodes a SearchProjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchProjectsRequest; + + /** + * Verifies a SearchProjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchProjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchProjectsRequest; + + /** + * Creates a plain object from a SearchProjectsRequest message. Also converts values to other types if specified. + * @param message SearchProjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchProjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchProjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchProjectsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchProjectsResponse. */ + interface ISearchProjectsResponse { + + /** SearchProjectsResponse projects */ + projects?: (google.cloud.resourcemanager.v3.IProject[]|null); + + /** SearchProjectsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchProjectsResponse. */ + class SearchProjectsResponse implements ISearchProjectsResponse { + + /** + * Constructs a new SearchProjectsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ISearchProjectsResponse); + + /** SearchProjectsResponse projects. */ + public projects: google.cloud.resourcemanager.v3.IProject[]; + + /** SearchProjectsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchProjectsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchProjectsResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ISearchProjectsResponse): google.cloud.resourcemanager.v3.SearchProjectsResponse; + + /** + * Encodes the specified SearchProjectsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsResponse.verify|verify} messages. + * @param message SearchProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ISearchProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsResponse.verify|verify} messages. + * @param message SearchProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ISearchProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchProjectsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.SearchProjectsResponse; + + /** + * Decodes a SearchProjectsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.SearchProjectsResponse; + + /** + * Verifies a SearchProjectsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchProjectsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.SearchProjectsResponse; + + /** + * Creates a plain object from a SearchProjectsResponse message. Also converts values to other types if specified. + * @param message SearchProjectsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.SearchProjectsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchProjectsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchProjectsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateProjectRequest. */ + interface ICreateProjectRequest { + + /** CreateProjectRequest project */ + project?: (google.cloud.resourcemanager.v3.IProject|null); + } + + /** Represents a CreateProjectRequest. */ + class CreateProjectRequest implements ICreateProjectRequest { + + /** + * Constructs a new CreateProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateProjectRequest); + + /** CreateProjectRequest project. */ + public project?: (google.cloud.resourcemanager.v3.IProject|null); + + /** + * Creates a new CreateProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateProjectRequest): google.cloud.resourcemanager.v3.CreateProjectRequest; + + /** + * Encodes the specified CreateProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectRequest.verify|verify} messages. + * @param message CreateProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectRequest.verify|verify} messages. + * @param message CreateProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateProjectRequest; + + /** + * Decodes a CreateProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateProjectRequest; + + /** + * Verifies a CreateProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateProjectRequest; + + /** + * Creates a plain object from a CreateProjectRequest message. Also converts values to other types if specified. + * @param message CreateProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateProjectMetadata. */ + interface ICreateProjectMetadata { + + /** CreateProjectMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateProjectMetadata gettable */ + gettable?: (boolean|null); + + /** CreateProjectMetadata ready */ + ready?: (boolean|null); + } + + /** Represents a CreateProjectMetadata. */ + class CreateProjectMetadata implements ICreateProjectMetadata { + + /** + * Constructs a new CreateProjectMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateProjectMetadata); + + /** CreateProjectMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateProjectMetadata gettable. */ + public gettable: boolean; + + /** CreateProjectMetadata ready. */ + public ready: boolean; + + /** + * Creates a new CreateProjectMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProjectMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateProjectMetadata): google.cloud.resourcemanager.v3.CreateProjectMetadata; + + /** + * Encodes the specified CreateProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectMetadata.verify|verify} messages. + * @param message CreateProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectMetadata.verify|verify} messages. + * @param message CreateProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProjectMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateProjectMetadata; + + /** + * Decodes a CreateProjectMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateProjectMetadata; + + /** + * Verifies a CreateProjectMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProjectMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateProjectMetadata; + + /** + * Creates a plain object from a CreateProjectMetadata message. Also converts values to other types if specified. + * @param message CreateProjectMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateProjectMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProjectMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProjectMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProjectRequest. */ + interface IUpdateProjectRequest { + + /** UpdateProjectRequest project */ + project?: (google.cloud.resourcemanager.v3.IProject|null); + + /** UpdateProjectRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProjectRequest. */ + class UpdateProjectRequest implements IUpdateProjectRequest { + + /** + * Constructs a new UpdateProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateProjectRequest); + + /** UpdateProjectRequest project. */ + public project?: (google.cloud.resourcemanager.v3.IProject|null); + + /** UpdateProjectRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateProjectRequest): google.cloud.resourcemanager.v3.UpdateProjectRequest; + + /** + * Encodes the specified UpdateProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectRequest.verify|verify} messages. + * @param message UpdateProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectRequest.verify|verify} messages. + * @param message UpdateProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateProjectRequest; + + /** + * Decodes an UpdateProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateProjectRequest; + + /** + * Verifies an UpdateProjectRequest message. + * @param message Plain 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 UpdateProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateProjectRequest; + + /** + * Creates a plain object from an UpdateProjectRequest message. Also converts values to other types if specified. + * @param message UpdateProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProjectMetadata. */ + interface IUpdateProjectMetadata { + } + + /** Represents an UpdateProjectMetadata. */ + class UpdateProjectMetadata implements IUpdateProjectMetadata { + + /** + * Constructs a new UpdateProjectMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateProjectMetadata); + + /** + * Creates a new UpdateProjectMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProjectMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateProjectMetadata): google.cloud.resourcemanager.v3.UpdateProjectMetadata; + + /** + * Encodes the specified UpdateProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectMetadata.verify|verify} messages. + * @param message UpdateProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectMetadata.verify|verify} messages. + * @param message UpdateProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProjectMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateProjectMetadata; + + /** + * Decodes an UpdateProjectMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateProjectMetadata; + + /** + * Verifies an UpdateProjectMetadata message. + * @param message Plain 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 UpdateProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProjectMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateProjectMetadata; + + /** + * Creates a plain object from an UpdateProjectMetadata message. Also converts values to other types if specified. + * @param message UpdateProjectMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateProjectMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProjectMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProjectMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveProjectRequest. */ + interface IMoveProjectRequest { + + /** MoveProjectRequest name */ + name?: (string|null); + + /** MoveProjectRequest destinationParent */ + destinationParent?: (string|null); + } + + /** Represents a MoveProjectRequest. */ + class MoveProjectRequest implements IMoveProjectRequest { + + /** + * Constructs a new MoveProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IMoveProjectRequest); + + /** MoveProjectRequest name. */ + public name: string; + + /** MoveProjectRequest destinationParent. */ + public destinationParent: string; + + /** + * Creates a new MoveProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IMoveProjectRequest): google.cloud.resourcemanager.v3.MoveProjectRequest; + + /** + * Encodes the specified MoveProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectRequest.verify|verify} messages. + * @param message MoveProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IMoveProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectRequest.verify|verify} messages. + * @param message MoveProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IMoveProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.MoveProjectRequest; + + /** + * Decodes a MoveProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.MoveProjectRequest; + + /** + * Verifies a MoveProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.MoveProjectRequest; + + /** + * Creates a plain object from a MoveProjectRequest message. Also converts values to other types if specified. + * @param message MoveProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.MoveProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveProjectMetadata. */ + interface IMoveProjectMetadata { + } + + /** Represents a MoveProjectMetadata. */ + class MoveProjectMetadata implements IMoveProjectMetadata { + + /** + * Constructs a new MoveProjectMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IMoveProjectMetadata); + + /** + * Creates a new MoveProjectMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveProjectMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IMoveProjectMetadata): google.cloud.resourcemanager.v3.MoveProjectMetadata; + + /** + * Encodes the specified MoveProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectMetadata.verify|verify} messages. + * @param message MoveProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IMoveProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectMetadata.verify|verify} messages. + * @param message MoveProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IMoveProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveProjectMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.MoveProjectMetadata; + + /** + * Decodes a MoveProjectMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.MoveProjectMetadata; + + /** + * Verifies a MoveProjectMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveProjectMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.MoveProjectMetadata; + + /** + * Creates a plain object from a MoveProjectMetadata message. Also converts values to other types if specified. + * @param message MoveProjectMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.MoveProjectMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveProjectMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveProjectMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProjectRequest. */ + interface IDeleteProjectRequest { + + /** DeleteProjectRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProjectRequest. */ + class DeleteProjectRequest implements IDeleteProjectRequest { + + /** + * Constructs a new DeleteProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteProjectRequest); + + /** DeleteProjectRequest name. */ + public name: string; + + /** + * Creates a new DeleteProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteProjectRequest): google.cloud.resourcemanager.v3.DeleteProjectRequest; + + /** + * Encodes the specified DeleteProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectRequest.verify|verify} messages. + * @param message DeleteProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectRequest.verify|verify} messages. + * @param message DeleteProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteProjectRequest; + + /** + * Decodes a DeleteProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteProjectRequest; + + /** + * Verifies a DeleteProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteProjectRequest; + + /** + * Creates a plain object from a DeleteProjectRequest message. Also converts values to other types if specified. + * @param message DeleteProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProjectMetadata. */ + interface IDeleteProjectMetadata { + } + + /** Represents a DeleteProjectMetadata. */ + class DeleteProjectMetadata implements IDeleteProjectMetadata { + + /** + * Constructs a new DeleteProjectMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteProjectMetadata); + + /** + * Creates a new DeleteProjectMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProjectMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteProjectMetadata): google.cloud.resourcemanager.v3.DeleteProjectMetadata; + + /** + * Encodes the specified DeleteProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectMetadata.verify|verify} messages. + * @param message DeleteProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectMetadata.verify|verify} messages. + * @param message DeleteProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProjectMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteProjectMetadata; + + /** + * Decodes a DeleteProjectMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteProjectMetadata; + + /** + * Verifies a DeleteProjectMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProjectMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteProjectMetadata; + + /** + * Creates a plain object from a DeleteProjectMetadata message. Also converts values to other types if specified. + * @param message DeleteProjectMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteProjectMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProjectMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProjectMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteProjectRequest. */ + interface IUndeleteProjectRequest { + + /** UndeleteProjectRequest name */ + name?: (string|null); + } + + /** Represents an UndeleteProjectRequest. */ + class UndeleteProjectRequest implements IUndeleteProjectRequest { + + /** + * Constructs a new UndeleteProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUndeleteProjectRequest); + + /** UndeleteProjectRequest name. */ + public name: string; + + /** + * Creates a new UndeleteProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteProjectRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUndeleteProjectRequest): google.cloud.resourcemanager.v3.UndeleteProjectRequest; + + /** + * Encodes the specified UndeleteProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectRequest.verify|verify} messages. + * @param message UndeleteProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUndeleteProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectRequest.verify|verify} messages. + * @param message UndeleteProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUndeleteProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UndeleteProjectRequest; + + /** + * Decodes an UndeleteProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UndeleteProjectRequest; + + /** + * Verifies an UndeleteProjectRequest message. + * @param message Plain 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 UndeleteProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UndeleteProjectRequest; + + /** + * Creates a plain object from an UndeleteProjectRequest message. Also converts values to other types if specified. + * @param message UndeleteProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UndeleteProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteProjectMetadata. */ + interface IUndeleteProjectMetadata { + } + + /** Represents an UndeleteProjectMetadata. */ + class UndeleteProjectMetadata implements IUndeleteProjectMetadata { + + /** + * Constructs a new UndeleteProjectMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUndeleteProjectMetadata); + + /** + * Creates a new UndeleteProjectMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteProjectMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUndeleteProjectMetadata): google.cloud.resourcemanager.v3.UndeleteProjectMetadata; + + /** + * Encodes the specified UndeleteProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectMetadata.verify|verify} messages. + * @param message UndeleteProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUndeleteProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectMetadata.verify|verify} messages. + * @param message UndeleteProjectMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUndeleteProjectMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteProjectMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UndeleteProjectMetadata; + + /** + * Decodes an UndeleteProjectMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UndeleteProjectMetadata; + + /** + * Verifies an UndeleteProjectMetadata message. + * @param message Plain 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 UndeleteProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteProjectMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UndeleteProjectMetadata; + + /** + * Creates a plain object from an UndeleteProjectMetadata message. Also converts values to other types if specified. + * @param message UndeleteProjectMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UndeleteProjectMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteProjectMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteProjectMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TagBindings */ + class TagBindings extends $protobuf.rpc.Service { + + /** + * Constructs a new TagBindings 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 TagBindings 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): TagBindings; + + /** + * Calls ListTagBindings. + * @param request ListTagBindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTagBindingsResponse + */ + public listTagBindings(request: google.cloud.resourcemanager.v3.IListTagBindingsRequest, callback: google.cloud.resourcemanager.v3.TagBindings.ListTagBindingsCallback): void; + + /** + * Calls ListTagBindings. + * @param request ListTagBindingsRequest message or plain object + * @returns Promise + */ + public listTagBindings(request: google.cloud.resourcemanager.v3.IListTagBindingsRequest): Promise; + + /** + * Calls CreateTagBinding. + * @param request CreateTagBindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTagBinding(request: google.cloud.resourcemanager.v3.ICreateTagBindingRequest, callback: google.cloud.resourcemanager.v3.TagBindings.CreateTagBindingCallback): void; + + /** + * Calls CreateTagBinding. + * @param request CreateTagBindingRequest message or plain object + * @returns Promise + */ + public createTagBinding(request: google.cloud.resourcemanager.v3.ICreateTagBindingRequest): Promise; + + /** + * Calls DeleteTagBinding. + * @param request DeleteTagBindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTagBinding(request: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, callback: google.cloud.resourcemanager.v3.TagBindings.DeleteTagBindingCallback): void; + + /** + * Calls DeleteTagBinding. + * @param request DeleteTagBindingRequest message or plain object + * @returns Promise + */ + public deleteTagBinding(request: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest): Promise; + } + + namespace TagBindings { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|listTagBindings}. + * @param error Error, if any + * @param [response] ListTagBindingsResponse + */ + type ListTagBindingsCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.ListTagBindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|createTagBinding}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTagBindingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|deleteTagBinding}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTagBindingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a TagBinding. */ + interface ITagBinding { + + /** TagBinding name */ + name?: (string|null); + + /** TagBinding parent */ + parent?: (string|null); + + /** TagBinding tagValue */ + tagValue?: (string|null); + } + + /** Represents a TagBinding. */ + class TagBinding implements ITagBinding { + + /** + * Constructs a new TagBinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ITagBinding); + + /** TagBinding name. */ + public name: string; + + /** TagBinding parent. */ + public parent: string; + + /** TagBinding tagValue. */ + public tagValue: string; + + /** + * Creates a new TagBinding instance using the specified properties. + * @param [properties] Properties to set + * @returns TagBinding instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ITagBinding): google.cloud.resourcemanager.v3.TagBinding; + + /** + * Encodes the specified TagBinding message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagBinding.verify|verify} messages. + * @param message TagBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ITagBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagBinding message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagBinding.verify|verify} messages. + * @param message TagBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ITagBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagBinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.TagBinding; + + /** + * Decodes a TagBinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.TagBinding; + + /** + * Verifies a TagBinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagBinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagBinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.TagBinding; + + /** + * Creates a plain object from a TagBinding message. Also converts values to other types if specified. + * @param message TagBinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.TagBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagBinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagBinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagBindingMetadata. */ + interface ICreateTagBindingMetadata { + } + + /** Represents a CreateTagBindingMetadata. */ + class CreateTagBindingMetadata implements ICreateTagBindingMetadata { + + /** + * Constructs a new CreateTagBindingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagBindingMetadata); + + /** + * Creates a new CreateTagBindingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagBindingMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagBindingMetadata): google.cloud.resourcemanager.v3.CreateTagBindingMetadata; + + /** + * Encodes the specified CreateTagBindingMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingMetadata.verify|verify} messages. + * @param message CreateTagBindingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagBindingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagBindingMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingMetadata.verify|verify} messages. + * @param message CreateTagBindingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagBindingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagBindingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagBindingMetadata; + + /** + * Decodes a CreateTagBindingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagBindingMetadata; + + /** + * Verifies a CreateTagBindingMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagBindingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagBindingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagBindingMetadata; + + /** + * Creates a plain object from a CreateTagBindingMetadata message. Also converts values to other types if specified. + * @param message CreateTagBindingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagBindingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagBindingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagBindingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagBindingRequest. */ + interface ICreateTagBindingRequest { + + /** CreateTagBindingRequest tagBinding */ + tagBinding?: (google.cloud.resourcemanager.v3.ITagBinding|null); + + /** CreateTagBindingRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTagBindingRequest. */ + class CreateTagBindingRequest implements ICreateTagBindingRequest { + + /** + * Constructs a new CreateTagBindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagBindingRequest); + + /** CreateTagBindingRequest tagBinding. */ + public tagBinding?: (google.cloud.resourcemanager.v3.ITagBinding|null); + + /** CreateTagBindingRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTagBindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagBindingRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagBindingRequest): google.cloud.resourcemanager.v3.CreateTagBindingRequest; + + /** + * Encodes the specified CreateTagBindingRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingRequest.verify|verify} messages. + * @param message CreateTagBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagBindingRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingRequest.verify|verify} messages. + * @param message CreateTagBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagBindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagBindingRequest; + + /** + * Decodes a CreateTagBindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagBindingRequest; + + /** + * Verifies a CreateTagBindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagBindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagBindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagBindingRequest; + + /** + * Creates a plain object from a CreateTagBindingRequest message. Also converts values to other types if specified. + * @param message CreateTagBindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagBindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagBindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagBindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagBindingMetadata. */ + interface IDeleteTagBindingMetadata { + } + + /** Represents a DeleteTagBindingMetadata. */ + class DeleteTagBindingMetadata implements IDeleteTagBindingMetadata { + + /** + * Constructs a new DeleteTagBindingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata); + + /** + * Creates a new DeleteTagBindingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagBindingMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata): google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; + + /** + * Encodes the specified DeleteTagBindingMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.verify|verify} messages. + * @param message DeleteTagBindingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagBindingMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.verify|verify} messages. + * @param message DeleteTagBindingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagBindingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; + + /** + * Decodes a DeleteTagBindingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; + + /** + * Verifies a DeleteTagBindingMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagBindingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagBindingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; + + /** + * Creates a plain object from a DeleteTagBindingMetadata message. Also converts values to other types if specified. + * @param message DeleteTagBindingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagBindingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagBindingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagBindingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagBindingRequest. */ + interface IDeleteTagBindingRequest { + + /** DeleteTagBindingRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTagBindingRequest. */ + class DeleteTagBindingRequest implements IDeleteTagBindingRequest { + + /** + * Constructs a new DeleteTagBindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest); + + /** DeleteTagBindingRequest name. */ + public name: string; + + /** + * Creates a new DeleteTagBindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagBindingRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest): google.cloud.resourcemanager.v3.DeleteTagBindingRequest; + + /** + * Encodes the specified DeleteTagBindingRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingRequest.verify|verify} messages. + * @param message DeleteTagBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagBindingRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingRequest.verify|verify} messages. + * @param message DeleteTagBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagBindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagBindingRequest; + + /** + * Decodes a DeleteTagBindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagBindingRequest; + + /** + * Verifies a DeleteTagBindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagBindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagBindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagBindingRequest; + + /** + * Creates a plain object from a DeleteTagBindingRequest message. Also converts values to other types if specified. + * @param message DeleteTagBindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagBindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagBindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagBindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagBindingsRequest. */ + interface IListTagBindingsRequest { + + /** ListTagBindingsRequest parent */ + parent?: (string|null); + + /** ListTagBindingsRequest pageSize */ + pageSize?: (number|null); + + /** ListTagBindingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTagBindingsRequest. */ + class ListTagBindingsRequest implements IListTagBindingsRequest { + + /** + * Constructs a new ListTagBindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagBindingsRequest); + + /** ListTagBindingsRequest parent. */ + public parent: string; + + /** ListTagBindingsRequest pageSize. */ + public pageSize: number; + + /** ListTagBindingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTagBindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagBindingsRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagBindingsRequest): google.cloud.resourcemanager.v3.ListTagBindingsRequest; + + /** + * Encodes the specified ListTagBindingsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsRequest.verify|verify} messages. + * @param message ListTagBindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagBindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagBindingsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsRequest.verify|verify} messages. + * @param message ListTagBindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagBindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagBindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagBindingsRequest; + + /** + * Decodes a ListTagBindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagBindingsRequest; + + /** + * Verifies a ListTagBindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagBindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagBindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagBindingsRequest; + + /** + * Creates a plain object from a ListTagBindingsRequest message. Also converts values to other types if specified. + * @param message ListTagBindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagBindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagBindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagBindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagBindingsResponse. */ + interface IListTagBindingsResponse { + + /** ListTagBindingsResponse tagBindings */ + tagBindings?: (google.cloud.resourcemanager.v3.ITagBinding[]|null); + + /** ListTagBindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTagBindingsResponse. */ + class ListTagBindingsResponse implements IListTagBindingsResponse { + + /** + * Constructs a new ListTagBindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagBindingsResponse); + + /** ListTagBindingsResponse tagBindings. */ + public tagBindings: google.cloud.resourcemanager.v3.ITagBinding[]; + + /** ListTagBindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTagBindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagBindingsResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagBindingsResponse): google.cloud.resourcemanager.v3.ListTagBindingsResponse; + + /** + * Encodes the specified ListTagBindingsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsResponse.verify|verify} messages. + * @param message ListTagBindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagBindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagBindingsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsResponse.verify|verify} messages. + * @param message ListTagBindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagBindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagBindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagBindingsResponse; + + /** + * Decodes a ListTagBindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagBindingsResponse; + + /** + * Verifies a ListTagBindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagBindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagBindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagBindingsResponse; + + /** + * Creates a plain object from a ListTagBindingsResponse message. Also converts values to other types if specified. + * @param message ListTagBindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagBindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagBindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagBindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TagKeys */ + class TagKeys extends $protobuf.rpc.Service { + + /** + * Constructs a new TagKeys 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 TagKeys 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): TagKeys; + + /** + * Calls ListTagKeys. + * @param request ListTagKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTagKeysResponse + */ + public listTagKeys(request: google.cloud.resourcemanager.v3.IListTagKeysRequest, callback: google.cloud.resourcemanager.v3.TagKeys.ListTagKeysCallback): void; + + /** + * Calls ListTagKeys. + * @param request ListTagKeysRequest message or plain object + * @returns Promise + */ + public listTagKeys(request: google.cloud.resourcemanager.v3.IListTagKeysRequest): Promise; + + /** + * Calls GetTagKey. + * @param request GetTagKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TagKey + */ + public getTagKey(request: google.cloud.resourcemanager.v3.IGetTagKeyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.GetTagKeyCallback): void; + + /** + * Calls GetTagKey. + * @param request GetTagKeyRequest message or plain object + * @returns Promise + */ + public getTagKey(request: google.cloud.resourcemanager.v3.IGetTagKeyRequest): Promise; + + /** + * Calls CreateTagKey. + * @param request CreateTagKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTagKey(request: google.cloud.resourcemanager.v3.ICreateTagKeyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.CreateTagKeyCallback): void; + + /** + * Calls CreateTagKey. + * @param request CreateTagKeyRequest message or plain object + * @returns Promise + */ + public createTagKey(request: google.cloud.resourcemanager.v3.ICreateTagKeyRequest): Promise; + + /** + * Calls UpdateTagKey. + * @param request UpdateTagKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTagKey(request: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.UpdateTagKeyCallback): void; + + /** + * Calls UpdateTagKey. + * @param request UpdateTagKeyRequest message or plain object + * @returns Promise + */ + public updateTagKey(request: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest): Promise; + + /** + * Calls DeleteTagKey. + * @param request DeleteTagKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTagKey(request: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.DeleteTagKeyCallback): void; + + /** + * Calls DeleteTagKey. + * @param request DeleteTagKeyRequest message or plain object + * @returns Promise + */ + public deleteTagKey(request: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.TagKeys.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.resourcemanager.v3.TagKeys.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace TagKeys { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|listTagKeys}. + * @param error Error, if any + * @param [response] ListTagKeysResponse + */ + type ListTagKeysCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.ListTagKeysResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|getTagKey}. + * @param error Error, if any + * @param [response] TagKey + */ + type GetTagKeyCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.TagKey) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|createTagKey}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTagKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|updateTagKey}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTagKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|deleteTagKey}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTagKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a TagKey. */ + interface ITagKey { + + /** TagKey name */ + name?: (string|null); + + /** TagKey parent */ + parent?: (string|null); + + /** TagKey shortName */ + shortName?: (string|null); + + /** TagKey namespacedName */ + namespacedName?: (string|null); + + /** TagKey description */ + description?: (string|null); + + /** TagKey createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TagKey updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TagKey etag */ + etag?: (string|null); + } + + /** Represents a TagKey. */ + class TagKey implements ITagKey { + + /** + * Constructs a new TagKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ITagKey); + + /** TagKey name. */ + public name: string; + + /** TagKey parent. */ + public parent: string; + + /** TagKey shortName. */ + public shortName: string; + + /** TagKey namespacedName. */ + public namespacedName: string; + + /** TagKey description. */ + public description: string; + + /** TagKey createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TagKey updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TagKey etag. */ + public etag: string; + + /** + * Creates a new TagKey instance using the specified properties. + * @param [properties] Properties to set + * @returns TagKey instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ITagKey): google.cloud.resourcemanager.v3.TagKey; + + /** + * Encodes the specified TagKey message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagKey.verify|verify} messages. + * @param message TagKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ITagKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagKey message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagKey.verify|verify} messages. + * @param message TagKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ITagKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.TagKey; + + /** + * Decodes a TagKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.TagKey; + + /** + * Verifies a TagKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.TagKey; + + /** + * Creates a plain object from a TagKey message. Also converts values to other types if specified. + * @param message TagKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.TagKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagKeysRequest. */ + interface IListTagKeysRequest { + + /** ListTagKeysRequest parent */ + parent?: (string|null); + + /** ListTagKeysRequest pageSize */ + pageSize?: (number|null); + + /** ListTagKeysRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTagKeysRequest. */ + class ListTagKeysRequest implements IListTagKeysRequest { + + /** + * Constructs a new ListTagKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagKeysRequest); + + /** ListTagKeysRequest parent. */ + public parent: string; + + /** ListTagKeysRequest pageSize. */ + public pageSize: number; + + /** ListTagKeysRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTagKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagKeysRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagKeysRequest): google.cloud.resourcemanager.v3.ListTagKeysRequest; + + /** + * Encodes the specified ListTagKeysRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysRequest.verify|verify} messages. + * @param message ListTagKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagKeysRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysRequest.verify|verify} messages. + * @param message ListTagKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagKeysRequest; + + /** + * Decodes a ListTagKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagKeysRequest; + + /** + * Verifies a ListTagKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagKeysRequest; + + /** + * Creates a plain object from a ListTagKeysRequest message. Also converts values to other types if specified. + * @param message ListTagKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagKeysResponse. */ + interface IListTagKeysResponse { + + /** ListTagKeysResponse tagKeys */ + tagKeys?: (google.cloud.resourcemanager.v3.ITagKey[]|null); + + /** ListTagKeysResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTagKeysResponse. */ + class ListTagKeysResponse implements IListTagKeysResponse { + + /** + * Constructs a new ListTagKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagKeysResponse); + + /** ListTagKeysResponse tagKeys. */ + public tagKeys: google.cloud.resourcemanager.v3.ITagKey[]; + + /** ListTagKeysResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTagKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagKeysResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagKeysResponse): google.cloud.resourcemanager.v3.ListTagKeysResponse; + + /** + * Encodes the specified ListTagKeysResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysResponse.verify|verify} messages. + * @param message ListTagKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagKeysResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysResponse.verify|verify} messages. + * @param message ListTagKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagKeysResponse; + + /** + * Decodes a ListTagKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagKeysResponse; + + /** + * Verifies a ListTagKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagKeysResponse; + + /** + * Creates a plain object from a ListTagKeysResponse message. Also converts values to other types if specified. + * @param message ListTagKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagKeysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTagKeyRequest. */ + interface IGetTagKeyRequest { + + /** GetTagKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetTagKeyRequest. */ + class GetTagKeyRequest implements IGetTagKeyRequest { + + /** + * Constructs a new GetTagKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IGetTagKeyRequest); + + /** GetTagKeyRequest name. */ + public name: string; + + /** + * Creates a new GetTagKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTagKeyRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IGetTagKeyRequest): google.cloud.resourcemanager.v3.GetTagKeyRequest; + + /** + * Encodes the specified GetTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagKeyRequest.verify|verify} messages. + * @param message GetTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IGetTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagKeyRequest.verify|verify} messages. + * @param message GetTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IGetTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTagKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.GetTagKeyRequest; + + /** + * Decodes a GetTagKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.GetTagKeyRequest; + + /** + * Verifies a GetTagKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTagKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.GetTagKeyRequest; + + /** + * Creates a plain object from a GetTagKeyRequest message. Also converts values to other types if specified. + * @param message GetTagKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.GetTagKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTagKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTagKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagKeyRequest. */ + interface ICreateTagKeyRequest { + + /** CreateTagKeyRequest tagKey */ + tagKey?: (google.cloud.resourcemanager.v3.ITagKey|null); + + /** CreateTagKeyRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTagKeyRequest. */ + class CreateTagKeyRequest implements ICreateTagKeyRequest { + + /** + * Constructs a new CreateTagKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagKeyRequest); + + /** CreateTagKeyRequest tagKey. */ + public tagKey?: (google.cloud.resourcemanager.v3.ITagKey|null); + + /** CreateTagKeyRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTagKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagKeyRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagKeyRequest): google.cloud.resourcemanager.v3.CreateTagKeyRequest; + + /** + * Encodes the specified CreateTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyRequest.verify|verify} messages. + * @param message CreateTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyRequest.verify|verify} messages. + * @param message CreateTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagKeyRequest; + + /** + * Decodes a CreateTagKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagKeyRequest; + + /** + * Verifies a CreateTagKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagKeyRequest; + + /** + * Creates a plain object from a CreateTagKeyRequest message. Also converts values to other types if specified. + * @param message CreateTagKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagKeyMetadata. */ + interface ICreateTagKeyMetadata { + } + + /** Represents a CreateTagKeyMetadata. */ + class CreateTagKeyMetadata implements ICreateTagKeyMetadata { + + /** + * Constructs a new CreateTagKeyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagKeyMetadata); + + /** + * Creates a new CreateTagKeyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagKeyMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagKeyMetadata): google.cloud.resourcemanager.v3.CreateTagKeyMetadata; + + /** + * Encodes the specified CreateTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyMetadata.verify|verify} messages. + * @param message CreateTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyMetadata.verify|verify} messages. + * @param message CreateTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagKeyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagKeyMetadata; + + /** + * Decodes a CreateTagKeyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagKeyMetadata; + + /** + * Verifies a CreateTagKeyMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagKeyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagKeyMetadata; + + /** + * Creates a plain object from a CreateTagKeyMetadata message. Also converts values to other types if specified. + * @param message CreateTagKeyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagKeyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagKeyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagKeyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTagKeyRequest. */ + interface IUpdateTagKeyRequest { + + /** UpdateTagKeyRequest tagKey */ + tagKey?: (google.cloud.resourcemanager.v3.ITagKey|null); + + /** UpdateTagKeyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTagKeyRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateTagKeyRequest. */ + class UpdateTagKeyRequest implements IUpdateTagKeyRequest { + + /** + * Constructs a new UpdateTagKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest); + + /** UpdateTagKeyRequest tagKey. */ + public tagKey?: (google.cloud.resourcemanager.v3.ITagKey|null); + + /** UpdateTagKeyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTagKeyRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateTagKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTagKeyRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest): google.cloud.resourcemanager.v3.UpdateTagKeyRequest; + + /** + * Encodes the specified UpdateTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyRequest.verify|verify} messages. + * @param message UpdateTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyRequest.verify|verify} messages. + * @param message UpdateTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTagKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateTagKeyRequest; + + /** + * Decodes an UpdateTagKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateTagKeyRequest; + + /** + * Verifies an UpdateTagKeyRequest message. + * @param message Plain 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 UpdateTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTagKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateTagKeyRequest; + + /** + * Creates a plain object from an UpdateTagKeyRequest message. Also converts values to other types if specified. + * @param message UpdateTagKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateTagKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTagKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTagKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTagKeyMetadata. */ + interface IUpdateTagKeyMetadata { + } + + /** Represents an UpdateTagKeyMetadata. */ + class UpdateTagKeyMetadata implements IUpdateTagKeyMetadata { + + /** + * Constructs a new UpdateTagKeyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata); + + /** + * Creates a new UpdateTagKeyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTagKeyMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata): google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; + + /** + * Encodes the specified UpdateTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.verify|verify} messages. + * @param message UpdateTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.verify|verify} messages. + * @param message UpdateTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTagKeyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; + + /** + * Decodes an UpdateTagKeyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; + + /** + * Verifies an UpdateTagKeyMetadata message. + * @param message Plain 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 UpdateTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTagKeyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; + + /** + * Creates a plain object from an UpdateTagKeyMetadata message. Also converts values to other types if specified. + * @param message UpdateTagKeyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateTagKeyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTagKeyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTagKeyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagKeyRequest. */ + interface IDeleteTagKeyRequest { + + /** DeleteTagKeyRequest name */ + name?: (string|null); + + /** DeleteTagKeyRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteTagKeyRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteTagKeyRequest. */ + class DeleteTagKeyRequest implements IDeleteTagKeyRequest { + + /** + * Constructs a new DeleteTagKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest); + + /** DeleteTagKeyRequest name. */ + public name: string; + + /** DeleteTagKeyRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteTagKeyRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteTagKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagKeyRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest): google.cloud.resourcemanager.v3.DeleteTagKeyRequest; + + /** + * Encodes the specified DeleteTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyRequest.verify|verify} messages. + * @param message DeleteTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyRequest.verify|verify} messages. + * @param message DeleteTagKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagKeyRequest; + + /** + * Decodes a DeleteTagKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagKeyRequest; + + /** + * Verifies a DeleteTagKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagKeyRequest; + + /** + * Creates a plain object from a DeleteTagKeyRequest message. Also converts values to other types if specified. + * @param message DeleteTagKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagKeyMetadata. */ + interface IDeleteTagKeyMetadata { + } + + /** Represents a DeleteTagKeyMetadata. */ + class DeleteTagKeyMetadata implements IDeleteTagKeyMetadata { + + /** + * Constructs a new DeleteTagKeyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata); + + /** + * Creates a new DeleteTagKeyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagKeyMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata): google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; + + /** + * Encodes the specified DeleteTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.verify|verify} messages. + * @param message DeleteTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.verify|verify} messages. + * @param message DeleteTagKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagKeyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; + + /** + * Decodes a DeleteTagKeyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; + + /** + * Verifies a DeleteTagKeyMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagKeyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; + + /** + * Creates a plain object from a DeleteTagKeyMetadata message. Also converts values to other types if specified. + * @param message DeleteTagKeyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagKeyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagKeyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagKeyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TagValues */ + class TagValues extends $protobuf.rpc.Service { + + /** + * Constructs a new TagValues 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 TagValues 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): TagValues; + + /** + * Calls ListTagValues. + * @param request ListTagValuesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTagValuesResponse + */ + public listTagValues(request: google.cloud.resourcemanager.v3.IListTagValuesRequest, callback: google.cloud.resourcemanager.v3.TagValues.ListTagValuesCallback): void; + + /** + * Calls ListTagValues. + * @param request ListTagValuesRequest message or plain object + * @returns Promise + */ + public listTagValues(request: google.cloud.resourcemanager.v3.IListTagValuesRequest): Promise; + + /** + * Calls GetTagValue. + * @param request GetTagValueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TagValue + */ + public getTagValue(request: google.cloud.resourcemanager.v3.IGetTagValueRequest, callback: google.cloud.resourcemanager.v3.TagValues.GetTagValueCallback): void; + + /** + * Calls GetTagValue. + * @param request GetTagValueRequest message or plain object + * @returns Promise + */ + public getTagValue(request: google.cloud.resourcemanager.v3.IGetTagValueRequest): Promise; + + /** + * Calls CreateTagValue. + * @param request CreateTagValueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTagValue(request: google.cloud.resourcemanager.v3.ICreateTagValueRequest, callback: google.cloud.resourcemanager.v3.TagValues.CreateTagValueCallback): void; + + /** + * Calls CreateTagValue. + * @param request CreateTagValueRequest message or plain object + * @returns Promise + */ + public createTagValue(request: google.cloud.resourcemanager.v3.ICreateTagValueRequest): Promise; + + /** + * Calls UpdateTagValue. + * @param request UpdateTagValueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTagValue(request: google.cloud.resourcemanager.v3.IUpdateTagValueRequest, callback: google.cloud.resourcemanager.v3.TagValues.UpdateTagValueCallback): void; + + /** + * Calls UpdateTagValue. + * @param request UpdateTagValueRequest message or plain object + * @returns Promise + */ + public updateTagValue(request: google.cloud.resourcemanager.v3.IUpdateTagValueRequest): Promise; + + /** + * Calls DeleteTagValue. + * @param request DeleteTagValueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTagValue(request: google.cloud.resourcemanager.v3.IDeleteTagValueRequest, callback: google.cloud.resourcemanager.v3.TagValues.DeleteTagValueCallback): void; + + /** + * Calls DeleteTagValue. + * @param request DeleteTagValueRequest message or plain object + * @returns Promise + */ + public deleteTagValue(request: google.cloud.resourcemanager.v3.IDeleteTagValueRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.TagValues.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.resourcemanager.v3.TagValues.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.resourcemanager.v3.TagValues.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace TagValues { + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|listTagValues}. + * @param error Error, if any + * @param [response] ListTagValuesResponse + */ + type ListTagValuesCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.ListTagValuesResponse) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|getTagValue}. + * @param error Error, if any + * @param [response] TagValue + */ + type GetTagValueCallback = (error: (Error|null), response?: google.cloud.resourcemanager.v3.TagValue) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|createTagValue}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTagValueCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|updateTagValue}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTagValueCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|deleteTagValue}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTagValueCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a TagValue. */ + interface ITagValue { + + /** TagValue name */ + name?: (string|null); + + /** TagValue parent */ + parent?: (string|null); + + /** TagValue shortName */ + shortName?: (string|null); + + /** TagValue namespacedName */ + namespacedName?: (string|null); + + /** TagValue description */ + description?: (string|null); + + /** TagValue createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TagValue updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TagValue etag */ + etag?: (string|null); + } + + /** Represents a TagValue. */ + class TagValue implements ITagValue { + + /** + * Constructs a new TagValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ITagValue); + + /** TagValue name. */ + public name: string; + + /** TagValue parent. */ + public parent: string; + + /** TagValue shortName. */ + public shortName: string; + + /** TagValue namespacedName. */ + public namespacedName: string; + + /** TagValue description. */ + public description: string; + + /** TagValue createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TagValue updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TagValue etag. */ + public etag: string; + + /** + * Creates a new TagValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TagValue instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ITagValue): google.cloud.resourcemanager.v3.TagValue; + + /** + * Encodes the specified TagValue message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagValue.verify|verify} messages. + * @param message TagValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ITagValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagValue message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagValue.verify|verify} messages. + * @param message TagValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ITagValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.TagValue; + + /** + * Decodes a TagValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.TagValue; + + /** + * Verifies a TagValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.TagValue; + + /** + * Creates a plain object from a TagValue message. Also converts values to other types if specified. + * @param message TagValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.TagValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagValuesRequest. */ + interface IListTagValuesRequest { + + /** ListTagValuesRequest parent */ + parent?: (string|null); + + /** ListTagValuesRequest pageSize */ + pageSize?: (number|null); + + /** ListTagValuesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTagValuesRequest. */ + class ListTagValuesRequest implements IListTagValuesRequest { + + /** + * Constructs a new ListTagValuesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagValuesRequest); + + /** ListTagValuesRequest parent. */ + public parent: string; + + /** ListTagValuesRequest pageSize. */ + public pageSize: number; + + /** ListTagValuesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTagValuesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagValuesRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagValuesRequest): google.cloud.resourcemanager.v3.ListTagValuesRequest; + + /** + * Encodes the specified ListTagValuesRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesRequest.verify|verify} messages. + * @param message ListTagValuesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagValuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagValuesRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesRequest.verify|verify} messages. + * @param message ListTagValuesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagValuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagValuesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagValuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagValuesRequest; + + /** + * Decodes a ListTagValuesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagValuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagValuesRequest; + + /** + * Verifies a ListTagValuesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagValuesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagValuesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagValuesRequest; + + /** + * Creates a plain object from a ListTagValuesRequest message. Also converts values to other types if specified. + * @param message ListTagValuesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagValuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagValuesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagValuesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTagValuesResponse. */ + interface IListTagValuesResponse { + + /** ListTagValuesResponse tagValues */ + tagValues?: (google.cloud.resourcemanager.v3.ITagValue[]|null); + + /** ListTagValuesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTagValuesResponse. */ + class ListTagValuesResponse implements IListTagValuesResponse { + + /** + * Constructs a new ListTagValuesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IListTagValuesResponse); + + /** ListTagValuesResponse tagValues. */ + public tagValues: google.cloud.resourcemanager.v3.ITagValue[]; + + /** ListTagValuesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTagValuesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTagValuesResponse instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IListTagValuesResponse): google.cloud.resourcemanager.v3.ListTagValuesResponse; + + /** + * Encodes the specified ListTagValuesResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesResponse.verify|verify} messages. + * @param message ListTagValuesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IListTagValuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTagValuesResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesResponse.verify|verify} messages. + * @param message ListTagValuesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IListTagValuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTagValuesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTagValuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.ListTagValuesResponse; + + /** + * Decodes a ListTagValuesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTagValuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.ListTagValuesResponse; + + /** + * Verifies a ListTagValuesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTagValuesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTagValuesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.ListTagValuesResponse; + + /** + * Creates a plain object from a ListTagValuesResponse message. Also converts values to other types if specified. + * @param message ListTagValuesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.ListTagValuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTagValuesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTagValuesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTagValueRequest. */ + interface IGetTagValueRequest { + + /** GetTagValueRequest name */ + name?: (string|null); + } + + /** Represents a GetTagValueRequest. */ + class GetTagValueRequest implements IGetTagValueRequest { + + /** + * Constructs a new GetTagValueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IGetTagValueRequest); + + /** GetTagValueRequest name. */ + public name: string; + + /** + * Creates a new GetTagValueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTagValueRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IGetTagValueRequest): google.cloud.resourcemanager.v3.GetTagValueRequest; + + /** + * Encodes the specified GetTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagValueRequest.verify|verify} messages. + * @param message GetTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IGetTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagValueRequest.verify|verify} messages. + * @param message GetTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IGetTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTagValueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.GetTagValueRequest; + + /** + * Decodes a GetTagValueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.GetTagValueRequest; + + /** + * Verifies a GetTagValueRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTagValueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.GetTagValueRequest; + + /** + * Creates a plain object from a GetTagValueRequest message. Also converts values to other types if specified. + * @param message GetTagValueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.GetTagValueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTagValueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTagValueRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagValueRequest. */ + interface ICreateTagValueRequest { + + /** CreateTagValueRequest tagValue */ + tagValue?: (google.cloud.resourcemanager.v3.ITagValue|null); + + /** CreateTagValueRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateTagValueRequest. */ + class CreateTagValueRequest implements ICreateTagValueRequest { + + /** + * Constructs a new CreateTagValueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagValueRequest); + + /** CreateTagValueRequest tagValue. */ + public tagValue?: (google.cloud.resourcemanager.v3.ITagValue|null); + + /** CreateTagValueRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateTagValueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagValueRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagValueRequest): google.cloud.resourcemanager.v3.CreateTagValueRequest; + + /** + * Encodes the specified CreateTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueRequest.verify|verify} messages. + * @param message CreateTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueRequest.verify|verify} messages. + * @param message CreateTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagValueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagValueRequest; + + /** + * Decodes a CreateTagValueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagValueRequest; + + /** + * Verifies a CreateTagValueRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagValueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagValueRequest; + + /** + * Creates a plain object from a CreateTagValueRequest message. Also converts values to other types if specified. + * @param message CreateTagValueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagValueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagValueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagValueRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTagValueMetadata. */ + interface ICreateTagValueMetadata { + } + + /** Represents a CreateTagValueMetadata. */ + class CreateTagValueMetadata implements ICreateTagValueMetadata { + + /** + * Constructs a new CreateTagValueMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.ICreateTagValueMetadata); + + /** + * Creates a new CreateTagValueMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTagValueMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.ICreateTagValueMetadata): google.cloud.resourcemanager.v3.CreateTagValueMetadata; + + /** + * Encodes the specified CreateTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueMetadata.verify|verify} messages. + * @param message CreateTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.ICreateTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueMetadata.verify|verify} messages. + * @param message CreateTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.ICreateTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTagValueMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.CreateTagValueMetadata; + + /** + * Decodes a CreateTagValueMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.CreateTagValueMetadata; + + /** + * Verifies a CreateTagValueMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTagValueMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.CreateTagValueMetadata; + + /** + * Creates a plain object from a CreateTagValueMetadata message. Also converts values to other types if specified. + * @param message CreateTagValueMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.CreateTagValueMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTagValueMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTagValueMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTagValueRequest. */ + interface IUpdateTagValueRequest { + + /** UpdateTagValueRequest tagValue */ + tagValue?: (google.cloud.resourcemanager.v3.ITagValue|null); + + /** UpdateTagValueRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTagValueRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateTagValueRequest. */ + class UpdateTagValueRequest implements IUpdateTagValueRequest { + + /** + * Constructs a new UpdateTagValueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateTagValueRequest); + + /** UpdateTagValueRequest tagValue. */ + public tagValue?: (google.cloud.resourcemanager.v3.ITagValue|null); + + /** UpdateTagValueRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTagValueRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateTagValueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTagValueRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateTagValueRequest): google.cloud.resourcemanager.v3.UpdateTagValueRequest; + + /** + * Encodes the specified UpdateTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueRequest.verify|verify} messages. + * @param message UpdateTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueRequest.verify|verify} messages. + * @param message UpdateTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTagValueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateTagValueRequest; + + /** + * Decodes an UpdateTagValueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateTagValueRequest; + + /** + * Verifies an UpdateTagValueRequest message. + * @param message Plain 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 UpdateTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTagValueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateTagValueRequest; + + /** + * Creates a plain object from an UpdateTagValueRequest message. Also converts values to other types if specified. + * @param message UpdateTagValueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateTagValueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTagValueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTagValueRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTagValueMetadata. */ + interface IUpdateTagValueMetadata { + } + + /** Represents an UpdateTagValueMetadata. */ + class UpdateTagValueMetadata implements IUpdateTagValueMetadata { + + /** + * Constructs a new UpdateTagValueMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IUpdateTagValueMetadata); + + /** + * Creates a new UpdateTagValueMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTagValueMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IUpdateTagValueMetadata): google.cloud.resourcemanager.v3.UpdateTagValueMetadata; + + /** + * Encodes the specified UpdateTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueMetadata.verify|verify} messages. + * @param message UpdateTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IUpdateTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueMetadata.verify|verify} messages. + * @param message UpdateTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IUpdateTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTagValueMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.UpdateTagValueMetadata; + + /** + * Decodes an UpdateTagValueMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.UpdateTagValueMetadata; + + /** + * Verifies an UpdateTagValueMetadata message. + * @param message Plain 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 UpdateTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTagValueMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.UpdateTagValueMetadata; + + /** + * Creates a plain object from an UpdateTagValueMetadata message. Also converts values to other types if specified. + * @param message UpdateTagValueMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.UpdateTagValueMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTagValueMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTagValueMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagValueRequest. */ + interface IDeleteTagValueRequest { + + /** DeleteTagValueRequest name */ + name?: (string|null); + + /** DeleteTagValueRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteTagValueRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteTagValueRequest. */ + class DeleteTagValueRequest implements IDeleteTagValueRequest { + + /** + * Constructs a new DeleteTagValueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagValueRequest); + + /** DeleteTagValueRequest name. */ + public name: string; + + /** DeleteTagValueRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteTagValueRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteTagValueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagValueRequest instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagValueRequest): google.cloud.resourcemanager.v3.DeleteTagValueRequest; + + /** + * Encodes the specified DeleteTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueRequest.verify|verify} messages. + * @param message DeleteTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueRequest.verify|verify} messages. + * @param message DeleteTagValueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagValueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagValueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagValueRequest; + + /** + * Decodes a DeleteTagValueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagValueRequest; + + /** + * Verifies a DeleteTagValueRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagValueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagValueRequest; + + /** + * Creates a plain object from a DeleteTagValueRequest message. Also converts values to other types if specified. + * @param message DeleteTagValueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagValueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagValueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagValueRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTagValueMetadata. */ + interface IDeleteTagValueMetadata { + } + + /** Represents a DeleteTagValueMetadata. */ + class DeleteTagValueMetadata implements IDeleteTagValueMetadata { + + /** + * Constructs a new DeleteTagValueMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.resourcemanager.v3.IDeleteTagValueMetadata); + + /** + * Creates a new DeleteTagValueMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTagValueMetadata instance + */ + public static create(properties?: google.cloud.resourcemanager.v3.IDeleteTagValueMetadata): google.cloud.resourcemanager.v3.DeleteTagValueMetadata; + + /** + * Encodes the specified DeleteTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueMetadata.verify|verify} messages. + * @param message DeleteTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.resourcemanager.v3.IDeleteTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueMetadata.verify|verify} messages. + * @param message DeleteTagValueMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.resourcemanager.v3.IDeleteTagValueMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTagValueMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.resourcemanager.v3.DeleteTagValueMetadata; + + /** + * Decodes a DeleteTagValueMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.resourcemanager.v3.DeleteTagValueMetadata; + + /** + * Verifies a DeleteTagValueMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTagValueMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.resourcemanager.v3.DeleteTagValueMetadata; + + /** + * Creates a plain object from a DeleteTagValueMetadata message. Also converts values to other types if specified. + * @param message DeleteTagValueMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.resourcemanager.v3.DeleteTagValueMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTagValueMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTagValueMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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 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; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-resourcemanager/protos/protos.js b/packages/google-cloud-resourcemanager/protos/protos.js new file mode 100644 index 000000000000..a402b1eff3c0 --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/protos.js @@ -0,0 +1,35174 @@ +// Copyright 2022 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_resource_manager_protos || ($protobuf.roots._google_cloud_resource_manager_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.resourcemanager = (function() { + + /** + * Namespace resourcemanager. + * @memberof google.cloud + * @namespace + */ + var resourcemanager = {}; + + resourcemanager.v3 = (function() { + + /** + * Namespace v3. + * @memberof google.cloud.resourcemanager + * @namespace + */ + var v3 = {}; + + v3.Folders = (function() { + + /** + * Constructs a new Folders service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a Folders + * @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 Folders(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Folders.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Folders; + + /** + * Creates new Folders service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.Folders + * @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 {Folders} RPC service. Useful where requests and/or responses are streamed. + */ + Folders.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|getFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef GetFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.Folder} [response] Folder + */ + + /** + * Calls GetFolder. + * @function getFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest} request GetFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.GetFolderCallback} callback Node-style callback called with the error, if any, and Folder + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.getFolder = function getFolder(request, callback) { + return this.rpcCall(getFolder, $root.google.cloud.resourcemanager.v3.GetFolderRequest, $root.google.cloud.resourcemanager.v3.Folder, request, callback); + }, "name", { value: "GetFolder" }); + + /** + * Calls GetFolder. + * @function getFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest} request GetFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|listFolders}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef ListFoldersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.ListFoldersResponse} [response] ListFoldersResponse + */ + + /** + * Calls ListFolders. + * @function listFolders + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest} request ListFoldersRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.ListFoldersCallback} callback Node-style callback called with the error, if any, and ListFoldersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.listFolders = function listFolders(request, callback) { + return this.rpcCall(listFolders, $root.google.cloud.resourcemanager.v3.ListFoldersRequest, $root.google.cloud.resourcemanager.v3.ListFoldersResponse, request, callback); + }, "name", { value: "ListFolders" }); + + /** + * Calls ListFolders. + * @function listFolders + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest} request ListFoldersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|searchFolders}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef SearchFoldersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.SearchFoldersResponse} [response] SearchFoldersResponse + */ + + /** + * Calls SearchFolders. + * @function searchFolders + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest} request SearchFoldersRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.SearchFoldersCallback} callback Node-style callback called with the error, if any, and SearchFoldersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.searchFolders = function searchFolders(request, callback) { + return this.rpcCall(searchFolders, $root.google.cloud.resourcemanager.v3.SearchFoldersRequest, $root.google.cloud.resourcemanager.v3.SearchFoldersResponse, request, callback); + }, "name", { value: "SearchFolders" }); + + /** + * Calls SearchFolders. + * @function searchFolders + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest} request SearchFoldersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|createFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef CreateFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateFolder. + * @function createFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest} request CreateFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.CreateFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.createFolder = function createFolder(request, callback) { + return this.rpcCall(createFolder, $root.google.cloud.resourcemanager.v3.CreateFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateFolder" }); + + /** + * Calls CreateFolder. + * @function createFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest} request CreateFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|updateFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef UpdateFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateFolder. + * @function updateFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest} request UpdateFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.UpdateFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.updateFolder = function updateFolder(request, callback) { + return this.rpcCall(updateFolder, $root.google.cloud.resourcemanager.v3.UpdateFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateFolder" }); + + /** + * Calls UpdateFolder. + * @function updateFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest} request UpdateFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|moveFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef MoveFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MoveFolder. + * @function moveFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest} request MoveFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.MoveFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.moveFolder = function moveFolder(request, callback) { + return this.rpcCall(moveFolder, $root.google.cloud.resourcemanager.v3.MoveFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MoveFolder" }); + + /** + * Calls MoveFolder. + * @function moveFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest} request MoveFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|deleteFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef DeleteFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteFolder. + * @function deleteFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest} request DeleteFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.DeleteFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.deleteFolder = function deleteFolder(request, callback) { + return this.rpcCall(deleteFolder, $root.google.cloud.resourcemanager.v3.DeleteFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteFolder" }); + + /** + * Calls DeleteFolder. + * @function deleteFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest} request DeleteFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|undeleteFolder}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef UndeleteFolderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteFolder. + * @function undeleteFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest} request UndeleteFolderRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.UndeleteFolderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.undeleteFolder = function undeleteFolder(request, callback) { + return this.rpcCall(undeleteFolder, $root.google.cloud.resourcemanager.v3.UndeleteFolderRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteFolder" }); + + /** + * Calls UndeleteFolder. + * @function undeleteFolder + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest} request UndeleteFolderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|getIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|setIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Folders|testIamPermissions}. + * @memberof google.cloud.resourcemanager.v3.Folders + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Folders.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Folders.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Folders + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Folders; + })(); + + v3.Folder = (function() { + + /** + * Properties of a Folder. + * @memberof google.cloud.resourcemanager.v3 + * @interface IFolder + * @property {string|null} [name] Folder name + * @property {string|null} [parent] Folder parent + * @property {string|null} [displayName] Folder displayName + * @property {google.cloud.resourcemanager.v3.Folder.State|null} [state] Folder state + * @property {google.protobuf.ITimestamp|null} [createTime] Folder createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Folder updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Folder deleteTime + * @property {string|null} [etag] Folder etag + */ + + /** + * Constructs a new Folder. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a Folder. + * @implements IFolder + * @constructor + * @param {google.cloud.resourcemanager.v3.IFolder=} [properties] Properties to set + */ + function Folder(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]]; + } + + /** + * Folder name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.name = ""; + + /** + * Folder parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.parent = ""; + + /** + * Folder displayName. + * @member {string} displayName + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.displayName = ""; + + /** + * Folder state. + * @member {google.cloud.resourcemanager.v3.Folder.State} state + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.state = 0; + + /** + * Folder createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.createTime = null; + + /** + * Folder updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.updateTime = null; + + /** + * Folder deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.deleteTime = null; + + /** + * Folder etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + */ + Folder.prototype.etag = ""; + + /** + * Creates a new Folder instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {google.cloud.resourcemanager.v3.IFolder=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.Folder} Folder instance + */ + Folder.create = function create(properties) { + return new Folder(properties); + }; + + /** + * Encodes the specified Folder message. Does not implicitly {@link google.cloud.resourcemanager.v3.Folder.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {google.cloud.resourcemanager.v3.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Folder message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Folder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {google.cloud.resourcemanager.v3.IFolder} message Folder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Folder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Folder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.Folder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Folder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.Folder} Folder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Folder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Folder message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Folder.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Folder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.Folder} Folder + */ + Folder.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.Folder) + return object; + var message = new $root.google.cloud.resourcemanager.v3.Folder(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "DELETE_REQUESTED": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Folder.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Folder.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Folder.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Folder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {google.cloud.resourcemanager.v3.Folder} message Folder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Folder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.resourcemanager.v3.Folder.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Folder to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.Folder + * @instance + * @returns {Object.} JSON object + */ + Folder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Folder + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.Folder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Folder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.Folder"; + }; + + /** + * State enum. + * @name google.cloud.resourcemanager.v3.Folder.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value + */ + Folder.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DELETE_REQUESTED"] = 2; + return values; + })(); + + return Folder; + })(); + + v3.GetFolderRequest = (function() { + + /** + * Properties of a GetFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IGetFolderRequest + * @property {string|null} [name] GetFolderRequest name + */ + + /** + * Constructs a new GetFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a GetFolderRequest. + * @implements IGetFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest=} [properties] Properties to set + */ + function GetFolderRequest(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]]; + } + + /** + * GetFolderRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @instance + */ + GetFolderRequest.prototype.name = ""; + + /** + * Creates a new GetFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.GetFolderRequest} GetFolderRequest instance + */ + GetFolderRequest.create = function create(properties) { + return new GetFolderRequest(properties); + }; + + /** + * Encodes the specified GetFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest} message GetFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderRequest.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 GetFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetFolderRequest} message GetFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.GetFolderRequest} GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.GetFolderRequest(); + 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 GetFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.GetFolderRequest} GetFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFolderRequest.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 GetFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.GetFolderRequest} GetFolderRequest + */ + GetFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.GetFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.GetFolderRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.GetFolderRequest} message GetFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFolderRequest.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 GetFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @instance + * @returns {Object.} JSON object + */ + GetFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.GetFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.GetFolderRequest"; + }; + + return GetFolderRequest; + })(); + + v3.ListFoldersRequest = (function() { + + /** + * Properties of a ListFoldersRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListFoldersRequest + * @property {string|null} [parent] ListFoldersRequest parent + * @property {number|null} [pageSize] ListFoldersRequest pageSize + * @property {string|null} [pageToken] ListFoldersRequest pageToken + * @property {boolean|null} [showDeleted] ListFoldersRequest showDeleted + */ + + /** + * Constructs a new ListFoldersRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListFoldersRequest. + * @implements IListFoldersRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest=} [properties] Properties to set + */ + function ListFoldersRequest(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]]; + } + + /** + * ListFoldersRequest parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.parent = ""; + + /** + * ListFoldersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.pageSize = 0; + + /** + * ListFoldersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.pageToken = ""; + + /** + * ListFoldersRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @instance + */ + ListFoldersRequest.prototype.showDeleted = false; + + /** + * Creates a new ListFoldersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListFoldersRequest} ListFoldersRequest instance + */ + ListFoldersRequest.create = function create(properties) { + return new ListFoldersRequest(properties); + }; + + /** + * Encodes the specified ListFoldersRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest} message ListFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListFoldersRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersRequest} message ListFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListFoldersRequest} ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListFoldersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFoldersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListFoldersRequest} ListFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFoldersRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFoldersRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListFoldersRequest} ListFoldersRequest + */ + ListFoldersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListFoldersRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListFoldersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListFoldersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.ListFoldersRequest} message ListFoldersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFoldersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListFoldersRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @instance + * @returns {Object.} JSON object + */ + ListFoldersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFoldersRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListFoldersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFoldersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListFoldersRequest"; + }; + + return ListFoldersRequest; + })(); + + v3.ListFoldersResponse = (function() { + + /** + * Properties of a ListFoldersResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListFoldersResponse + * @property {Array.|null} [folders] ListFoldersResponse folders + * @property {string|null} [nextPageToken] ListFoldersResponse nextPageToken + */ + + /** + * Constructs a new ListFoldersResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListFoldersResponse. + * @implements IListFoldersResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.IListFoldersResponse=} [properties] Properties to set + */ + function ListFoldersResponse(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFoldersResponse folders. + * @member {Array.} folders + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @instance + */ + ListFoldersResponse.prototype.folders = $util.emptyArray; + + /** + * ListFoldersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @instance + */ + ListFoldersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFoldersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListFoldersResponse} ListFoldersResponse instance + */ + ListFoldersResponse.create = function create(properties) { + return new ListFoldersResponse(properties); + }; + + /** + * Encodes the specified ListFoldersResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersResponse} message ListFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.resourcemanager.v3.Folder.encode(message.folders[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 ListFoldersResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListFoldersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListFoldersResponse} message ListFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListFoldersResponse} ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListFoldersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.resourcemanager.v3.Folder.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFoldersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListFoldersResponse} ListFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFoldersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFoldersResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFoldersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListFoldersResponse} ListFoldersResponse + */ + ListFoldersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListFoldersResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListFoldersResponse(); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.resourcemanager.v3.ListFoldersResponse.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.ListFoldersResponse.folders: object expected"); + message.folders[i] = $root.google.cloud.resourcemanager.v3.Folder.fromObject(object.folders[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFoldersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.ListFoldersResponse} message ListFoldersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFoldersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.resourcemanager.v3.Folder.toObject(message.folders[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFoldersResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @instance + * @returns {Object.} JSON object + */ + ListFoldersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFoldersResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListFoldersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFoldersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListFoldersResponse"; + }; + + return ListFoldersResponse; + })(); + + v3.SearchFoldersRequest = (function() { + + /** + * Properties of a SearchFoldersRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchFoldersRequest + * @property {number|null} [pageSize] SearchFoldersRequest pageSize + * @property {string|null} [pageToken] SearchFoldersRequest pageToken + * @property {string|null} [query] SearchFoldersRequest query + */ + + /** + * Constructs a new SearchFoldersRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchFoldersRequest. + * @implements ISearchFoldersRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest=} [properties] Properties to set + */ + function SearchFoldersRequest(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]]; + } + + /** + * SearchFoldersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @instance + */ + SearchFoldersRequest.prototype.pageSize = 0; + + /** + * SearchFoldersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @instance + */ + SearchFoldersRequest.prototype.pageToken = ""; + + /** + * SearchFoldersRequest query. + * @member {string} query + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @instance + */ + SearchFoldersRequest.prototype.query = ""; + + /** + * Creates a new SearchFoldersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchFoldersRequest} SearchFoldersRequest instance + */ + SearchFoldersRequest.create = function create(properties) { + return new SearchFoldersRequest(properties); + }; + + /** + * Encodes the specified SearchFoldersRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest} message SearchFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchFoldersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + return writer; + }; + + /** + * Encodes the specified SearchFoldersRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersRequest} message SearchFoldersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchFoldersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchFoldersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchFoldersRequest} SearchFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchFoldersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchFoldersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchFoldersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchFoldersRequest} SearchFoldersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchFoldersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchFoldersRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchFoldersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + return null; + }; + + /** + * Creates a SearchFoldersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchFoldersRequest} SearchFoldersRequest + */ + SearchFoldersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchFoldersRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchFoldersRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.query != null) + message.query = String(object.query); + return message; + }; + + /** + * Creates a plain object from a SearchFoldersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {google.cloud.resourcemanager.v3.SearchFoldersRequest} message SearchFoldersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchFoldersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.query = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + return object; + }; + + /** + * Converts this SearchFoldersRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @instance + * @returns {Object.} JSON object + */ + SearchFoldersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchFoldersRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchFoldersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchFoldersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchFoldersRequest"; + }; + + return SearchFoldersRequest; + })(); + + v3.SearchFoldersResponse = (function() { + + /** + * Properties of a SearchFoldersResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchFoldersResponse + * @property {Array.|null} [folders] SearchFoldersResponse folders + * @property {string|null} [nextPageToken] SearchFoldersResponse nextPageToken + */ + + /** + * Constructs a new SearchFoldersResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchFoldersResponse. + * @implements ISearchFoldersResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchFoldersResponse=} [properties] Properties to set + */ + function SearchFoldersResponse(properties) { + this.folders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchFoldersResponse folders. + * @member {Array.} folders + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @instance + */ + SearchFoldersResponse.prototype.folders = $util.emptyArray; + + /** + * SearchFoldersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @instance + */ + SearchFoldersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchFoldersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchFoldersResponse} SearchFoldersResponse instance + */ + SearchFoldersResponse.create = function create(properties) { + return new SearchFoldersResponse(properties); + }; + + /** + * Encodes the specified SearchFoldersResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersResponse} message SearchFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchFoldersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + $root.google.cloud.resourcemanager.v3.Folder.encode(message.folders[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 SearchFoldersResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchFoldersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchFoldersResponse} message SearchFoldersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchFoldersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchFoldersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchFoldersResponse} SearchFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchFoldersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchFoldersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push($root.google.cloud.resourcemanager.v3.Folder.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchFoldersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchFoldersResponse} SearchFoldersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchFoldersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchFoldersResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchFoldersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.Folder.verify(message.folders[i]); + if (error) + return "folders." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchFoldersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchFoldersResponse} SearchFoldersResponse + */ + SearchFoldersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchFoldersResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchFoldersResponse(); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.resourcemanager.v3.SearchFoldersResponse.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) { + if (typeof object.folders[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.SearchFoldersResponse.folders: object expected"); + message.folders[i] = $root.google.cloud.resourcemanager.v3.Folder.fromObject(object.folders[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchFoldersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {google.cloud.resourcemanager.v3.SearchFoldersResponse} message SearchFoldersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchFoldersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = $root.google.cloud.resourcemanager.v3.Folder.toObject(message.folders[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchFoldersResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @instance + * @returns {Object.} JSON object + */ + SearchFoldersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchFoldersResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchFoldersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchFoldersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchFoldersResponse"; + }; + + return SearchFoldersResponse; + })(); + + v3.CreateFolderRequest = (function() { + + /** + * Properties of a CreateFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateFolderRequest + * @property {google.cloud.resourcemanager.v3.IFolder|null} [folder] CreateFolderRequest folder + */ + + /** + * Constructs a new CreateFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateFolderRequest. + * @implements ICreateFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest=} [properties] Properties to set + */ + function CreateFolderRequest(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]]; + } + + /** + * CreateFolderRequest folder. + * @member {google.cloud.resourcemanager.v3.IFolder|null|undefined} folder + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @instance + */ + CreateFolderRequest.prototype.folder = null; + + /** + * Creates a new CreateFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateFolderRequest} CreateFolderRequest instance + */ + CreateFolderRequest.create = function create(properties) { + return new CreateFolderRequest(properties); + }; + + /** + * Encodes the specified CreateFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest} message CreateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) + $root.google.cloud.resourcemanager.v3.Folder.encode(message.folder, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderRequest} message CreateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateFolderRequest} CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.folder = $root.google.cloud.resourcemanager.v3.Folder.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateFolderRequest} CreateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFolderRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folder != null && message.hasOwnProperty("folder")) { + var error = $root.google.cloud.resourcemanager.v3.Folder.verify(message.folder); + if (error) + return "folder." + error; + } + return null; + }; + + /** + * Creates a CreateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateFolderRequest} CreateFolderRequest + */ + CreateFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateFolderRequest(); + if (object.folder != null) { + if (typeof object.folder !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateFolderRequest.folder: object expected"); + message.folder = $root.google.cloud.resourcemanager.v3.Folder.fromObject(object.folder); + } + return message; + }; + + /** + * Creates a plain object from a CreateFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.CreateFolderRequest} message CreateFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.folder = null; + if (message.folder != null && message.hasOwnProperty("folder")) + object.folder = $root.google.cloud.resourcemanager.v3.Folder.toObject(message.folder, options); + return object; + }; + + /** + * Converts this CreateFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateFolderRequest"; + }; + + return CreateFolderRequest; + })(); + + v3.CreateFolderMetadata = (function() { + + /** + * Properties of a CreateFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateFolderMetadata + * @property {string|null} [displayName] CreateFolderMetadata displayName + * @property {string|null} [parent] CreateFolderMetadata parent + */ + + /** + * Constructs a new CreateFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateFolderMetadata. + * @implements ICreateFolderMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateFolderMetadata=} [properties] Properties to set + */ + function CreateFolderMetadata(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]]; + } + + /** + * CreateFolderMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @instance + */ + CreateFolderMetadata.prototype.displayName = ""; + + /** + * CreateFolderMetadata parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @instance + */ + CreateFolderMetadata.prototype.parent = ""; + + /** + * Creates a new CreateFolderMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateFolderMetadata} CreateFolderMetadata instance + */ + CreateFolderMetadata.create = function create(properties) { + return new CreateFolderMetadata(properties); + }; + + /** + * Encodes the specified CreateFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderMetadata} message CreateFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateFolderMetadata} message CreateFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateFolderMetadata} CreateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateFolderMetadata} CreateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFolderMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a CreateFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateFolderMetadata} CreateFolderMetadata + */ + CreateFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateFolderMetadata) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateFolderMetadata(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a CreateFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.CreateFolderMetadata} message CreateFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFolderMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.parent = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateFolderMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFolderMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateFolderMetadata"; + }; + + return CreateFolderMetadata; + })(); + + v3.UpdateFolderRequest = (function() { + + /** + * Properties of an UpdateFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateFolderRequest + * @property {google.cloud.resourcemanager.v3.IFolder|null} [folder] UpdateFolderRequest folder + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFolderRequest updateMask + */ + + /** + * Constructs a new UpdateFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateFolderRequest. + * @implements IUpdateFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest=} [properties] Properties to set + */ + function UpdateFolderRequest(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]]; + } + + /** + * UpdateFolderRequest folder. + * @member {google.cloud.resourcemanager.v3.IFolder|null|undefined} folder + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @instance + */ + UpdateFolderRequest.prototype.folder = null; + + /** + * UpdateFolderRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @instance + */ + UpdateFolderRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateFolderRequest} UpdateFolderRequest instance + */ + UpdateFolderRequest.create = function create(properties) { + return new UpdateFolderRequest(properties); + }; + + /** + * Encodes the specified UpdateFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest} message UpdateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) + $root.google.cloud.resourcemanager.v3.Folder.encode(message.folder, 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 UpdateFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderRequest} message UpdateFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateFolderRequest} UpdateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.folder = $root.google.cloud.resourcemanager.v3.Folder.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 UpdateFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateFolderRequest} UpdateFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFolderRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.folder != null && message.hasOwnProperty("folder")) { + var error = $root.google.cloud.resourcemanager.v3.Folder.verify(message.folder); + if (error) + return "folder." + 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 UpdateFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateFolderRequest} UpdateFolderRequest + */ + UpdateFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UpdateFolderRequest(); + if (object.folder != null) { + if (typeof object.folder !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateFolderRequest.folder: object expected"); + message.folder = $root.google.cloud.resourcemanager.v3.Folder.fromObject(object.folder); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateFolderRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.UpdateFolderRequest} message UpdateFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.folder = null; + object.updateMask = null; + } + if (message.folder != null && message.hasOwnProperty("folder")) + object.folder = $root.google.cloud.resourcemanager.v3.Folder.toObject(message.folder, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateFolderRequest"; + }; + + return UpdateFolderRequest; + })(); + + v3.UpdateFolderMetadata = (function() { + + /** + * Properties of an UpdateFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateFolderMetadata + */ + + /** + * Constructs a new UpdateFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateFolderMetadata. + * @implements IUpdateFolderMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateFolderMetadata=} [properties] Properties to set + */ + function UpdateFolderMetadata(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 UpdateFolderMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateFolderMetadata} UpdateFolderMetadata instance + */ + UpdateFolderMetadata.create = function create(properties) { + return new UpdateFolderMetadata(properties); + }; + + /** + * Encodes the specified UpdateFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderMetadata} message UpdateFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateFolderMetadata} message UpdateFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateFolderMetadata} UpdateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateFolderMetadata} UpdateFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFolderMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateFolderMetadata} UpdateFolderMetadata + */ + UpdateFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateFolderMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UpdateFolderMetadata(); + }; + + /** + * Creates a plain object from an UpdateFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UpdateFolderMetadata} message UpdateFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFolderMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateFolderMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFolderMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateFolderMetadata"; + }; + + return UpdateFolderMetadata; + })(); + + v3.MoveFolderRequest = (function() { + + /** + * Properties of a MoveFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IMoveFolderRequest + * @property {string|null} [name] MoveFolderRequest name + * @property {string|null} [destinationParent] MoveFolderRequest destinationParent + */ + + /** + * Constructs a new MoveFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a MoveFolderRequest. + * @implements IMoveFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest=} [properties] Properties to set + */ + function MoveFolderRequest(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]]; + } + + /** + * MoveFolderRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @instance + */ + MoveFolderRequest.prototype.name = ""; + + /** + * MoveFolderRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @instance + */ + MoveFolderRequest.prototype.destinationParent = ""; + + /** + * Creates a new MoveFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.MoveFolderRequest} MoveFolderRequest instance + */ + MoveFolderRequest.create = function create(properties) { + return new MoveFolderRequest(properties); + }; + + /** + * Encodes the specified MoveFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest} message MoveFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFolderRequest.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.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + return writer; + }; + + /** + * Encodes the specified MoveFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderRequest} message MoveFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.MoveFolderRequest} MoveFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.MoveFolderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.destinationParent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.MoveFolderRequest} MoveFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveFolderRequest.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.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + return null; + }; + + /** + * Creates a MoveFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.MoveFolderRequest} MoveFolderRequest + */ + MoveFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.MoveFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.MoveFolderRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + return message; + }; + + /** + * Creates a plain object from a MoveFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.MoveFolderRequest} message MoveFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveFolderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.destinationParent = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + return object; + }; + + /** + * Converts this MoveFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @instance + * @returns {Object.} JSON object + */ + MoveFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.MoveFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.MoveFolderRequest"; + }; + + return MoveFolderRequest; + })(); + + v3.MoveFolderMetadata = (function() { + + /** + * Properties of a MoveFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IMoveFolderMetadata + * @property {string|null} [displayName] MoveFolderMetadata displayName + * @property {string|null} [sourceParent] MoveFolderMetadata sourceParent + * @property {string|null} [destinationParent] MoveFolderMetadata destinationParent + */ + + /** + * Constructs a new MoveFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a MoveFolderMetadata. + * @implements IMoveFolderMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IMoveFolderMetadata=} [properties] Properties to set + */ + function MoveFolderMetadata(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]]; + } + + /** + * MoveFolderMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @instance + */ + MoveFolderMetadata.prototype.displayName = ""; + + /** + * MoveFolderMetadata sourceParent. + * @member {string} sourceParent + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @instance + */ + MoveFolderMetadata.prototype.sourceParent = ""; + + /** + * MoveFolderMetadata destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @instance + */ + MoveFolderMetadata.prototype.destinationParent = ""; + + /** + * Creates a new MoveFolderMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.MoveFolderMetadata} MoveFolderMetadata instance + */ + MoveFolderMetadata.create = function create(properties) { + return new MoveFolderMetadata(properties); + }; + + /** + * Encodes the specified MoveFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderMetadata} message MoveFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.sourceParent != null && Object.hasOwnProperty.call(message, "sourceParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceParent); + if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationParent); + return writer; + }; + + /** + * Encodes the specified MoveFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveFolderMetadata} message MoveFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.MoveFolderMetadata} MoveFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFolderMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.MoveFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.sourceParent = reader.string(); + break; + } + case 3: { + message.destinationParent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.MoveFolderMetadata} MoveFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveFolderMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.sourceParent != null && message.hasOwnProperty("sourceParent")) + if (!$util.isString(message.sourceParent)) + return "sourceParent: string expected"; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + return null; + }; + + /** + * Creates a MoveFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.MoveFolderMetadata} MoveFolderMetadata + */ + MoveFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.MoveFolderMetadata) + return object; + var message = new $root.google.cloud.resourcemanager.v3.MoveFolderMetadata(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.sourceParent != null) + message.sourceParent = String(object.sourceParent); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + return message; + }; + + /** + * Creates a plain object from a MoveFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.MoveFolderMetadata} message MoveFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveFolderMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.sourceParent = ""; + object.destinationParent = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.sourceParent != null && message.hasOwnProperty("sourceParent")) + object.sourceParent = message.sourceParent; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + return object; + }; + + /** + * Converts this MoveFolderMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + MoveFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveFolderMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.MoveFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.MoveFolderMetadata"; + }; + + return MoveFolderMetadata; + })(); + + v3.DeleteFolderRequest = (function() { + + /** + * Properties of a DeleteFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteFolderRequest + * @property {string|null} [name] DeleteFolderRequest name + */ + + /** + * Constructs a new DeleteFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteFolderRequest. + * @implements IDeleteFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest=} [properties] Properties to set + */ + function DeleteFolderRequest(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]]; + } + + /** + * DeleteFolderRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @instance + */ + DeleteFolderRequest.prototype.name = ""; + + /** + * Creates a new DeleteFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteFolderRequest} DeleteFolderRequest instance + */ + DeleteFolderRequest.create = function create(properties) { + return new DeleteFolderRequest(properties); + }; + + /** + * Encodes the specified DeleteFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest} message DeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRequest.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 DeleteFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderRequest} message DeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteFolderRequest} DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteFolderRequest(); + 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 DeleteFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteFolderRequest} DeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFolderRequest.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 DeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteFolderRequest} DeleteFolderRequest + */ + DeleteFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.DeleteFolderRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.DeleteFolderRequest} message DeleteFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFolderRequest.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 DeleteFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteFolderRequest"; + }; + + return DeleteFolderRequest; + })(); + + v3.DeleteFolderMetadata = (function() { + + /** + * Properties of a DeleteFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteFolderMetadata + */ + + /** + * Constructs a new DeleteFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteFolderMetadata. + * @implements IDeleteFolderMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteFolderMetadata=} [properties] Properties to set + */ + function DeleteFolderMetadata(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 DeleteFolderMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteFolderMetadata} DeleteFolderMetadata instance + */ + DeleteFolderMetadata.create = function create(properties) { + return new DeleteFolderMetadata(properties); + }; + + /** + * Encodes the specified DeleteFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderMetadata} message DeleteFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteFolderMetadata} message DeleteFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteFolderMetadata} DeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteFolderMetadata} DeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFolderMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteFolderMetadata} DeleteFolderMetadata + */ + DeleteFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteFolderMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteFolderMetadata(); + }; + + /** + * Creates a plain object from a DeleteFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteFolderMetadata} message DeleteFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFolderMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteFolderMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFolderMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteFolderMetadata"; + }; + + return DeleteFolderMetadata; + })(); + + v3.UndeleteFolderRequest = (function() { + + /** + * Properties of an UndeleteFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUndeleteFolderRequest + * @property {string|null} [name] UndeleteFolderRequest name + */ + + /** + * Constructs a new UndeleteFolderRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UndeleteFolderRequest. + * @implements IUndeleteFolderRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest=} [properties] Properties to set + */ + function UndeleteFolderRequest(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]]; + } + + /** + * UndeleteFolderRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @instance + */ + UndeleteFolderRequest.prototype.name = ""; + + /** + * Creates a new UndeleteFolderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderRequest} UndeleteFolderRequest instance + */ + UndeleteFolderRequest.create = function create(properties) { + return new UndeleteFolderRequest(properties); + }; + + /** + * Encodes the specified UndeleteFolderRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest} message UndeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteFolderRequest.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 UndeleteFolderRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderRequest} message UndeleteFolderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteFolderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteFolderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderRequest} UndeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteFolderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UndeleteFolderRequest(); + 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 an UndeleteFolderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderRequest} UndeleteFolderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteFolderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteFolderRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteFolderRequest.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 an UndeleteFolderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderRequest} UndeleteFolderRequest + */ + UndeleteFolderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UndeleteFolderRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UndeleteFolderRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeleteFolderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {google.cloud.resourcemanager.v3.UndeleteFolderRequest} message UndeleteFolderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteFolderRequest.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 UndeleteFolderRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteFolderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteFolderRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteFolderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UndeleteFolderRequest"; + }; + + return UndeleteFolderRequest; + })(); + + v3.UndeleteFolderMetadata = (function() { + + /** + * Properties of an UndeleteFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUndeleteFolderMetadata + */ + + /** + * Constructs a new UndeleteFolderMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UndeleteFolderMetadata. + * @implements IUndeleteFolderMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderMetadata=} [properties] Properties to set + */ + function UndeleteFolderMetadata(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 UndeleteFolderMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderMetadata} UndeleteFolderMetadata instance + */ + UndeleteFolderMetadata.create = function create(properties) { + return new UndeleteFolderMetadata(properties); + }; + + /** + * Encodes the specified UndeleteFolderMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderMetadata} message UndeleteFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteFolderMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeleteFolderMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteFolderMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteFolderMetadata} message UndeleteFolderMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteFolderMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteFolderMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderMetadata} UndeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteFolderMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UndeleteFolderMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteFolderMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderMetadata} UndeleteFolderMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteFolderMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteFolderMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteFolderMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeleteFolderMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UndeleteFolderMetadata} UndeleteFolderMetadata + */ + UndeleteFolderMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UndeleteFolderMetadata(); + }; + + /** + * Creates a plain object from an UndeleteFolderMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UndeleteFolderMetadata} message UndeleteFolderMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteFolderMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeleteFolderMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeleteFolderMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteFolderMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UndeleteFolderMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteFolderMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UndeleteFolderMetadata"; + }; + + return UndeleteFolderMetadata; + })(); + + v3.Organizations = (function() { + + /** + * Constructs a new Organizations service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an Organizations + * @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 Organizations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Organizations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Organizations; + + /** + * Creates new Organizations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.Organizations + * @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 {Organizations} RPC service. Useful where requests and/or responses are streamed. + */ + Organizations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|getOrganization}. + * @memberof google.cloud.resourcemanager.v3.Organizations + * @typedef GetOrganizationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.Organization} [response] Organization + */ + + /** + * Calls GetOrganization. + * @function getOrganization + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest} request GetOrganizationRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Organizations.GetOrganizationCallback} callback Node-style callback called with the error, if any, and Organization + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Organizations.prototype.getOrganization = function getOrganization(request, callback) { + return this.rpcCall(getOrganization, $root.google.cloud.resourcemanager.v3.GetOrganizationRequest, $root.google.cloud.resourcemanager.v3.Organization, request, callback); + }, "name", { value: "GetOrganization" }); + + /** + * Calls GetOrganization. + * @function getOrganization + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest} request GetOrganizationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|searchOrganizations}. + * @memberof google.cloud.resourcemanager.v3.Organizations + * @typedef SearchOrganizationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} [response] SearchOrganizationsResponse + */ + + /** + * Calls SearchOrganizations. + * @function searchOrganizations + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest} request SearchOrganizationsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Organizations.SearchOrganizationsCallback} callback Node-style callback called with the error, if any, and SearchOrganizationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Organizations.prototype.searchOrganizations = function searchOrganizations(request, callback) { + return this.rpcCall(searchOrganizations, $root.google.cloud.resourcemanager.v3.SearchOrganizationsRequest, $root.google.cloud.resourcemanager.v3.SearchOrganizationsResponse, request, callback); + }, "name", { value: "SearchOrganizations" }); + + /** + * Calls SearchOrganizations. + * @function searchOrganizations + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest} request SearchOrganizationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|getIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Organizations + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Organizations.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Organizations.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|setIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Organizations + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Organizations.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Organizations.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Organizations|testIamPermissions}. + * @memberof google.cloud.resourcemanager.v3.Organizations + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Organizations.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Organizations.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Organizations + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Organizations; + })(); + + v3.Organization = (function() { + + /** + * Properties of an Organization. + * @memberof google.cloud.resourcemanager.v3 + * @interface IOrganization + * @property {string|null} [name] Organization name + * @property {string|null} [displayName] Organization displayName + * @property {string|null} [directoryCustomerId] Organization directoryCustomerId + * @property {google.cloud.resourcemanager.v3.Organization.State|null} [state] Organization state + * @property {google.protobuf.ITimestamp|null} [createTime] Organization createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Organization updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Organization deleteTime + * @property {string|null} [etag] Organization etag + */ + + /** + * Constructs a new Organization. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an Organization. + * @implements IOrganization + * @constructor + * @param {google.cloud.resourcemanager.v3.IOrganization=} [properties] Properties to set + */ + function Organization(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]]; + } + + /** + * Organization name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.name = ""; + + /** + * Organization displayName. + * @member {string} displayName + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.displayName = ""; + + /** + * Organization directoryCustomerId. + * @member {string|null|undefined} directoryCustomerId + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.directoryCustomerId = null; + + /** + * Organization state. + * @member {google.cloud.resourcemanager.v3.Organization.State} state + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.state = 0; + + /** + * Organization createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.createTime = null; + + /** + * Organization updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.updateTime = null; + + /** + * Organization deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.deleteTime = null; + + /** + * Organization etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Organization.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Organization owner. + * @member {"directoryCustomerId"|undefined} owner + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + */ + Object.defineProperty(Organization.prototype, "owner", { + get: $util.oneOfGetter($oneOfFields = ["directoryCustomerId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Organization instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {google.cloud.resourcemanager.v3.IOrganization=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.Organization} Organization instance + */ + Organization.create = function create(properties) { + return new Organization(properties); + }; + + /** + * Encodes the specified Organization message. Does not implicitly {@link google.cloud.resourcemanager.v3.Organization.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {google.cloud.resourcemanager.v3.IOrganization} message Organization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Organization.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.directoryCustomerId != null && Object.hasOwnProperty.call(message, "directoryCustomerId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.directoryCustomerId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Organization message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Organization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {google.cloud.resourcemanager.v3.IOrganization} message Organization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Organization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Organization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.Organization} Organization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Organization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.Organization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.directoryCustomerId = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Organization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.Organization} Organization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Organization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Organization message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Organization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.directoryCustomerId != null && message.hasOwnProperty("directoryCustomerId")) { + properties.owner = 1; + if (!$util.isString(message.directoryCustomerId)) + return "directoryCustomerId: string expected"; + } + 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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Organization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.Organization} Organization + */ + Organization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.Organization) + return object; + var message = new $root.google.cloud.resourcemanager.v3.Organization(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.directoryCustomerId != null) + message.directoryCustomerId = String(object.directoryCustomerId); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "DELETE_REQUESTED": + case 2: + message.state = 2; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Organization.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Organization.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Organization.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Organization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {google.cloud.resourcemanager.v3.Organization} message Organization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Organization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.directoryCustomerId != null && message.hasOwnProperty("directoryCustomerId")) { + object.directoryCustomerId = message.directoryCustomerId; + if (options.oneofs) + object.owner = "directoryCustomerId"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.resourcemanager.v3.Organization.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Organization to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.Organization + * @instance + * @returns {Object.} JSON object + */ + Organization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Organization + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.Organization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Organization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.Organization"; + }; + + /** + * State enum. + * @name google.cloud.resourcemanager.v3.Organization.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value + */ + Organization.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DELETE_REQUESTED"] = 2; + return values; + })(); + + return Organization; + })(); + + v3.GetOrganizationRequest = (function() { + + /** + * Properties of a GetOrganizationRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IGetOrganizationRequest + * @property {string|null} [name] GetOrganizationRequest name + */ + + /** + * Constructs a new GetOrganizationRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a GetOrganizationRequest. + * @implements IGetOrganizationRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest=} [properties] Properties to set + */ + function GetOrganizationRequest(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]]; + } + + /** + * GetOrganizationRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @instance + */ + GetOrganizationRequest.prototype.name = ""; + + /** + * Creates a new GetOrganizationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.GetOrganizationRequest} GetOrganizationRequest instance + */ + GetOrganizationRequest.create = function create(properties) { + return new GetOrganizationRequest(properties); + }; + + /** + * Encodes the specified GetOrganizationRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetOrganizationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest} message GetOrganizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationRequest.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 GetOrganizationRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetOrganizationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetOrganizationRequest} message GetOrganizationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOrganizationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOrganizationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.GetOrganizationRequest} GetOrganizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.GetOrganizationRequest(); + 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 GetOrganizationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.GetOrganizationRequest} GetOrganizationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOrganizationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOrganizationRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOrganizationRequest.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 GetOrganizationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.GetOrganizationRequest} GetOrganizationRequest + */ + GetOrganizationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.GetOrganizationRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.GetOrganizationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOrganizationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {google.cloud.resourcemanager.v3.GetOrganizationRequest} message GetOrganizationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOrganizationRequest.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 GetOrganizationRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOrganizationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOrganizationRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.GetOrganizationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOrganizationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.GetOrganizationRequest"; + }; + + return GetOrganizationRequest; + })(); + + v3.SearchOrganizationsRequest = (function() { + + /** + * Properties of a SearchOrganizationsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchOrganizationsRequest + * @property {number|null} [pageSize] SearchOrganizationsRequest pageSize + * @property {string|null} [pageToken] SearchOrganizationsRequest pageToken + * @property {string|null} [query] SearchOrganizationsRequest query + */ + + /** + * Constructs a new SearchOrganizationsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchOrganizationsRequest. + * @implements ISearchOrganizationsRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest=} [properties] Properties to set + */ + function SearchOrganizationsRequest(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]]; + } + + /** + * SearchOrganizationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @instance + */ + SearchOrganizationsRequest.prototype.pageSize = 0; + + /** + * SearchOrganizationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @instance + */ + SearchOrganizationsRequest.prototype.pageToken = ""; + + /** + * SearchOrganizationsRequest query. + * @member {string} query + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @instance + */ + SearchOrganizationsRequest.prototype.query = ""; + + /** + * Creates a new SearchOrganizationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsRequest} SearchOrganizationsRequest instance + */ + SearchOrganizationsRequest.create = function create(properties) { + return new SearchOrganizationsRequest(properties); + }; + + /** + * Encodes the specified SearchOrganizationsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest} message SearchOrganizationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchOrganizationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + return writer; + }; + + /** + * Encodes the specified SearchOrganizationsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsRequest} message SearchOrganizationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchOrganizationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchOrganizationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsRequest} SearchOrganizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchOrganizationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchOrganizationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchOrganizationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsRequest} SearchOrganizationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchOrganizationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchOrganizationsRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchOrganizationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + return null; + }; + + /** + * Creates a SearchOrganizationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsRequest} SearchOrganizationsRequest + */ + SearchOrganizationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchOrganizationsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.query != null) + message.query = String(object.query); + return message; + }; + + /** + * Creates a plain object from a SearchOrganizationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {google.cloud.resourcemanager.v3.SearchOrganizationsRequest} message SearchOrganizationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchOrganizationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.query = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + return object; + }; + + /** + * Converts this SearchOrganizationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchOrganizationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchOrganizationsRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchOrganizationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchOrganizationsRequest"; + }; + + return SearchOrganizationsRequest; + })(); + + v3.SearchOrganizationsResponse = (function() { + + /** + * Properties of a SearchOrganizationsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchOrganizationsResponse + * @property {Array.|null} [organizations] SearchOrganizationsResponse organizations + * @property {string|null} [nextPageToken] SearchOrganizationsResponse nextPageToken + */ + + /** + * Constructs a new SearchOrganizationsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchOrganizationsResponse. + * @implements ISearchOrganizationsResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsResponse=} [properties] Properties to set + */ + function SearchOrganizationsResponse(properties) { + this.organizations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchOrganizationsResponse organizations. + * @member {Array.} organizations + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @instance + */ + SearchOrganizationsResponse.prototype.organizations = $util.emptyArray; + + /** + * SearchOrganizationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @instance + */ + SearchOrganizationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchOrganizationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} SearchOrganizationsResponse instance + */ + SearchOrganizationsResponse.create = function create(properties) { + return new SearchOrganizationsResponse(properties); + }; + + /** + * Encodes the specified SearchOrganizationsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsResponse} message SearchOrganizationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchOrganizationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizations != null && message.organizations.length) + for (var i = 0; i < message.organizations.length; ++i) + $root.google.cloud.resourcemanager.v3.Organization.encode(message.organizations[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 SearchOrganizationsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchOrganizationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchOrganizationsResponse} message SearchOrganizationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchOrganizationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchOrganizationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} SearchOrganizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchOrganizationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchOrganizationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.organizations && message.organizations.length)) + message.organizations = []; + message.organizations.push($root.google.cloud.resourcemanager.v3.Organization.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchOrganizationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} SearchOrganizationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchOrganizationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchOrganizationsResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchOrganizationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizations != null && message.hasOwnProperty("organizations")) { + if (!Array.isArray(message.organizations)) + return "organizations: array expected"; + for (var i = 0; i < message.organizations.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.Organization.verify(message.organizations[i]); + if (error) + return "organizations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchOrganizationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} SearchOrganizationsResponse + */ + SearchOrganizationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchOrganizationsResponse(); + if (object.organizations) { + if (!Array.isArray(object.organizations)) + throw TypeError(".google.cloud.resourcemanager.v3.SearchOrganizationsResponse.organizations: array expected"); + message.organizations = []; + for (var i = 0; i < object.organizations.length; ++i) { + if (typeof object.organizations[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.SearchOrganizationsResponse.organizations: object expected"); + message.organizations[i] = $root.google.cloud.resourcemanager.v3.Organization.fromObject(object.organizations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchOrganizationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {google.cloud.resourcemanager.v3.SearchOrganizationsResponse} message SearchOrganizationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchOrganizationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.organizations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.organizations && message.organizations.length) { + object.organizations = []; + for (var j = 0; j < message.organizations.length; ++j) + object.organizations[j] = $root.google.cloud.resourcemanager.v3.Organization.toObject(message.organizations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchOrganizationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchOrganizationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchOrganizationsResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchOrganizationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchOrganizationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchOrganizationsResponse"; + }; + + return SearchOrganizationsResponse; + })(); + + v3.DeleteOrganizationMetadata = (function() { + + /** + * Properties of a DeleteOrganizationMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteOrganizationMetadata + */ + + /** + * Constructs a new DeleteOrganizationMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteOrganizationMetadata. + * @implements IDeleteOrganizationMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata=} [properties] Properties to set + */ + function DeleteOrganizationMetadata(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 DeleteOrganizationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} DeleteOrganizationMetadata instance + */ + DeleteOrganizationMetadata.create = function create(properties) { + return new DeleteOrganizationMetadata(properties); + }; + + /** + * Encodes the specified DeleteOrganizationMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata} message DeleteOrganizationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOrganizationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteOrganizationMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteOrganizationMetadata} message DeleteOrganizationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOrganizationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOrganizationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} DeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOrganizationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOrganizationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} DeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOrganizationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOrganizationMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOrganizationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteOrganizationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} DeleteOrganizationMetadata + */ + DeleteOrganizationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata(); + }; + + /** + * Creates a plain object from a DeleteOrganizationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} message DeleteOrganizationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOrganizationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteOrganizationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteOrganizationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOrganizationMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOrganizationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteOrganizationMetadata"; + }; + + return DeleteOrganizationMetadata; + })(); + + v3.UndeleteOrganizationMetadata = (function() { + + /** + * Properties of an UndeleteOrganizationMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUndeleteOrganizationMetadata + */ + + /** + * Constructs a new UndeleteOrganizationMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UndeleteOrganizationMetadata. + * @implements IUndeleteOrganizationMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata=} [properties] Properties to set + */ + function UndeleteOrganizationMetadata(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 UndeleteOrganizationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} UndeleteOrganizationMetadata instance + */ + UndeleteOrganizationMetadata.create = function create(properties) { + return new UndeleteOrganizationMetadata(properties); + }; + + /** + * Encodes the specified UndeleteOrganizationMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata} message UndeleteOrganizationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteOrganizationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeleteOrganizationMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteOrganizationMetadata} message UndeleteOrganizationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteOrganizationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteOrganizationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} UndeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteOrganizationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteOrganizationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} UndeleteOrganizationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteOrganizationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteOrganizationMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteOrganizationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeleteOrganizationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} UndeleteOrganizationMetadata + */ + UndeleteOrganizationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata(); + }; + + /** + * Creates a plain object from an UndeleteOrganizationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} message UndeleteOrganizationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteOrganizationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeleteOrganizationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeleteOrganizationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteOrganizationMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteOrganizationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata"; + }; + + return UndeleteOrganizationMetadata; + })(); + + v3.Projects = (function() { + + /** + * Constructs a new Projects service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a Projects + * @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 Projects(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Projects.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Projects; + + /** + * Creates new Projects service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.Projects + * @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 {Projects} RPC service. Useful where requests and/or responses are streamed. + */ + Projects.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|getProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef GetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.Project} [response] Project + */ + + /** + * Calls GetProject. + * @function getProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest} request GetProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.GetProjectCallback} callback Node-style callback called with the error, if any, and Project + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.getProject = function getProject(request, callback) { + return this.rpcCall(getProject, $root.google.cloud.resourcemanager.v3.GetProjectRequest, $root.google.cloud.resourcemanager.v3.Project, request, callback); + }, "name", { value: "GetProject" }); + + /** + * Calls GetProject. + * @function getProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest} request GetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|listProjects}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef ListProjectsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.ListProjectsResponse} [response] ListProjectsResponse + */ + + /** + * Calls ListProjects. + * @function listProjects + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest} request ListProjectsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.ListProjectsCallback} callback Node-style callback called with the error, if any, and ListProjectsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.listProjects = function listProjects(request, callback) { + return this.rpcCall(listProjects, $root.google.cloud.resourcemanager.v3.ListProjectsRequest, $root.google.cloud.resourcemanager.v3.ListProjectsResponse, request, callback); + }, "name", { value: "ListProjects" }); + + /** + * Calls ListProjects. + * @function listProjects + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest} request ListProjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|searchProjects}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef SearchProjectsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.SearchProjectsResponse} [response] SearchProjectsResponse + */ + + /** + * Calls SearchProjects. + * @function searchProjects + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest} request SearchProjectsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.SearchProjectsCallback} callback Node-style callback called with the error, if any, and SearchProjectsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.searchProjects = function searchProjects(request, callback) { + return this.rpcCall(searchProjects, $root.google.cloud.resourcemanager.v3.SearchProjectsRequest, $root.google.cloud.resourcemanager.v3.SearchProjectsResponse, request, callback); + }, "name", { value: "SearchProjects" }); + + /** + * Calls SearchProjects. + * @function searchProjects + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest} request SearchProjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|createProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef CreateProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateProject. + * @function createProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest} request CreateProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.CreateProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.createProject = function createProject(request, callback) { + return this.rpcCall(createProject, $root.google.cloud.resourcemanager.v3.CreateProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateProject" }); + + /** + * Calls CreateProject. + * @function createProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest} request CreateProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|updateProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef UpdateProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateProject. + * @function updateProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest} request UpdateProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.UpdateProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.updateProject = function updateProject(request, callback) { + return this.rpcCall(updateProject, $root.google.cloud.resourcemanager.v3.UpdateProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateProject" }); + + /** + * Calls UpdateProject. + * @function updateProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest} request UpdateProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|moveProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef MoveProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls MoveProject. + * @function moveProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest} request MoveProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.MoveProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.moveProject = function moveProject(request, callback) { + return this.rpcCall(moveProject, $root.google.cloud.resourcemanager.v3.MoveProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "MoveProject" }); + + /** + * Calls MoveProject. + * @function moveProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest} request MoveProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|deleteProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef DeleteProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProject. + * @function deleteProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest} request DeleteProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.DeleteProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.deleteProject = function deleteProject(request, callback) { + return this.rpcCall(deleteProject, $root.google.cloud.resourcemanager.v3.DeleteProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProject" }); + + /** + * Calls DeleteProject. + * @function deleteProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest} request DeleteProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|undeleteProject}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef UndeleteProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeleteProject. + * @function undeleteProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest} request UndeleteProjectRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.UndeleteProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.undeleteProject = function undeleteProject(request, callback) { + return this.rpcCall(undeleteProject, $root.google.cloud.resourcemanager.v3.UndeleteProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeleteProject" }); + + /** + * Calls UndeleteProject. + * @function undeleteProject + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest} request UndeleteProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|getIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|setIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.Projects|testIamPermissions}. + * @memberof google.cloud.resourcemanager.v3.Projects + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.Projects.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.Projects + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Projects; + })(); + + v3.Project = (function() { + + /** + * Properties of a Project. + * @memberof google.cloud.resourcemanager.v3 + * @interface IProject + * @property {string|null} [name] Project name + * @property {string|null} [parent] Project parent + * @property {string|null} [projectId] Project projectId + * @property {google.cloud.resourcemanager.v3.Project.State|null} [state] Project state + * @property {string|null} [displayName] Project displayName + * @property {google.protobuf.ITimestamp|null} [createTime] Project createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Project updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Project deleteTime + * @property {string|null} [etag] Project etag + * @property {Object.|null} [labels] Project labels + */ + + /** + * Constructs a new Project. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a Project. + * @implements IProject + * @constructor + * @param {google.cloud.resourcemanager.v3.IProject=} [properties] Properties to set + */ + function Project(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]]; + } + + /** + * Project name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.name = ""; + + /** + * Project parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.parent = ""; + + /** + * Project projectId. + * @member {string} projectId + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.projectId = ""; + + /** + * Project state. + * @member {google.cloud.resourcemanager.v3.Project.State} state + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.state = 0; + + /** + * Project displayName. + * @member {string} displayName + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.displayName = ""; + + /** + * Project createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.createTime = null; + + /** + * Project updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.updateTime = null; + + /** + * Project deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.deleteTime = null; + + /** + * Project etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.etag = ""; + + /** + * Project labels. + * @member {Object.} labels + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + */ + Project.prototype.labels = $util.emptyObject; + + /** + * Creates a new Project instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {google.cloud.resourcemanager.v3.IProject=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.Project} Project instance + */ + Project.create = function create(properties) { + return new Project(properties); + }; + + /** + * Encodes the specified Project message. Does not implicitly {@link google.cloud.resourcemanager.v3.Project.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {google.cloud.resourcemanager.v3.IProject} message Project message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Project.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + 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 10, wireType 2 =*/82).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 Project message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.Project.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {google.cloud.resourcemanager.v3.IProject} message Project message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Project.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Project message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.Project} Project + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Project.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.Project(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + 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 Project message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.Project} Project + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Project.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Project message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Project.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + 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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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 Project message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.Project} Project + */ + Project.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.Project) + return object; + var message = new $root.google.cloud.resourcemanager.v3.Project(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "DELETE_REQUESTED": + case 2: + message.state = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Project.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Project.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Project.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.Project.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 Project message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {google.cloud.resourcemanager.v3.Project} message Project + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Project.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.projectId = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.resourcemanager.v3.Project.State[message.state] : message.state; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + 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 Project to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.Project + * @instance + * @returns {Object.} JSON object + */ + Project.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Project + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.Project + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Project.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.Project"; + }; + + /** + * State enum. + * @name google.cloud.resourcemanager.v3.Project.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value + */ + Project.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DELETE_REQUESTED"] = 2; + return values; + })(); + + return Project; + })(); + + v3.GetProjectRequest = (function() { + + /** + * Properties of a GetProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IGetProjectRequest + * @property {string|null} [name] GetProjectRequest name + */ + + /** + * Constructs a new GetProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a GetProjectRequest. + * @implements IGetProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest=} [properties] Properties to set + */ + function GetProjectRequest(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]]; + } + + /** + * GetProjectRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @instance + */ + GetProjectRequest.prototype.name = ""; + + /** + * Creates a new GetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.GetProjectRequest} GetProjectRequest instance + */ + GetProjectRequest.create = function create(properties) { + return new GetProjectRequest(properties); + }; + + /** + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest} message GetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProjectRequest.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 GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetProjectRequest} message GetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.GetProjectRequest} GetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.GetProjectRequest(); + 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 GetProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.GetProjectRequest} GetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProjectRequest.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 GetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.GetProjectRequest} GetProjectRequest + */ + GetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.GetProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.GetProjectRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.GetProjectRequest} message GetProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProjectRequest.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 GetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + GetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.GetProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.GetProjectRequest"; + }; + + return GetProjectRequest; + })(); + + v3.ListProjectsRequest = (function() { + + /** + * Properties of a ListProjectsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListProjectsRequest + * @property {string|null} [parent] ListProjectsRequest parent + * @property {string|null} [pageToken] ListProjectsRequest pageToken + * @property {number|null} [pageSize] ListProjectsRequest pageSize + * @property {boolean|null} [showDeleted] ListProjectsRequest showDeleted + */ + + /** + * Constructs a new ListProjectsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListProjectsRequest. + * @implements IListProjectsRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest=} [properties] Properties to set + */ + function ListProjectsRequest(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]]; + } + + /** + * ListProjectsRequest parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @instance + */ + ListProjectsRequest.prototype.parent = ""; + + /** + * ListProjectsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @instance + */ + ListProjectsRequest.prototype.pageToken = ""; + + /** + * ListProjectsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @instance + */ + ListProjectsRequest.prototype.pageSize = 0; + + /** + * ListProjectsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @instance + */ + ListProjectsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListProjectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListProjectsRequest} ListProjectsRequest instance + */ + ListProjectsRequest.create = function create(properties) { + return new ListProjectsRequest(properties); + }; + + /** + * Encodes the specified ListProjectsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest} message ListProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProjectsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsRequest} message ListProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListProjectsRequest} ListProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProjectsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListProjectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListProjectsRequest} ListProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProjectsRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProjectsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListProjectsRequest} ListProjectsRequest + */ + ListProjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListProjectsRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListProjectsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListProjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ListProjectsRequest} message ListProjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProjectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListProjectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProjectsRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListProjectsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProjectsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListProjectsRequest"; + }; + + return ListProjectsRequest; + })(); + + v3.ListProjectsResponse = (function() { + + /** + * Properties of a ListProjectsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListProjectsResponse + * @property {Array.|null} [projects] ListProjectsResponse projects + * @property {string|null} [nextPageToken] ListProjectsResponse nextPageToken + */ + + /** + * Constructs a new ListProjectsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListProjectsResponse. + * @implements IListProjectsResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.IListProjectsResponse=} [properties] Properties to set + */ + function ListProjectsResponse(properties) { + this.projects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProjectsResponse projects. + * @member {Array.} projects + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @instance + */ + ListProjectsResponse.prototype.projects = $util.emptyArray; + + /** + * ListProjectsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @instance + */ + ListProjectsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProjectsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListProjectsResponse} ListProjectsResponse instance + */ + ListProjectsResponse.create = function create(properties) { + return new ListProjectsResponse(properties); + }; + + /** + * Encodes the specified ListProjectsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsResponse} message ListProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProjectsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projects != null && message.projects.length) + for (var i = 0; i < message.projects.length; ++i) + $root.google.cloud.resourcemanager.v3.Project.encode(message.projects[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 ListProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListProjectsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListProjectsResponse} message ListProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProjectsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProjectsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListProjectsResponse} ListProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProjectsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListProjectsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.projects && message.projects.length)) + message.projects = []; + message.projects.push($root.google.cloud.resourcemanager.v3.Project.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProjectsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListProjectsResponse} ListProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProjectsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProjectsResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProjectsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projects != null && message.hasOwnProperty("projects")) { + if (!Array.isArray(message.projects)) + return "projects: array expected"; + for (var i = 0; i < message.projects.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.Project.verify(message.projects[i]); + if (error) + return "projects." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListProjectsResponse} ListProjectsResponse + */ + ListProjectsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListProjectsResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListProjectsResponse(); + if (object.projects) { + if (!Array.isArray(object.projects)) + throw TypeError(".google.cloud.resourcemanager.v3.ListProjectsResponse.projects: array expected"); + message.projects = []; + for (var i = 0; i < object.projects.length; ++i) { + if (typeof object.projects[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.ListProjectsResponse.projects: object expected"); + message.projects[i] = $root.google.cloud.resourcemanager.v3.Project.fromObject(object.projects[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProjectsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ListProjectsResponse} message ListProjectsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProjectsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projects = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.projects && message.projects.length) { + object.projects = []; + for (var j = 0; j < message.projects.length; ++j) + object.projects[j] = $root.google.cloud.resourcemanager.v3.Project.toObject(message.projects[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProjectsResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProjectsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProjectsResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListProjectsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProjectsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListProjectsResponse"; + }; + + return ListProjectsResponse; + })(); + + v3.SearchProjectsRequest = (function() { + + /** + * Properties of a SearchProjectsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchProjectsRequest + * @property {string|null} [query] SearchProjectsRequest query + * @property {string|null} [pageToken] SearchProjectsRequest pageToken + * @property {number|null} [pageSize] SearchProjectsRequest pageSize + */ + + /** + * Constructs a new SearchProjectsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchProjectsRequest. + * @implements ISearchProjectsRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest=} [properties] Properties to set + */ + function SearchProjectsRequest(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]]; + } + + /** + * SearchProjectsRequest query. + * @member {string} query + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @instance + */ + SearchProjectsRequest.prototype.query = ""; + + /** + * SearchProjectsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @instance + */ + SearchProjectsRequest.prototype.pageToken = ""; + + /** + * SearchProjectsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @instance + */ + SearchProjectsRequest.prototype.pageSize = 0; + + /** + * Creates a new SearchProjectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchProjectsRequest} SearchProjectsRequest instance + */ + SearchProjectsRequest.create = function create(properties) { + return new SearchProjectsRequest(properties); + }; + + /** + * Encodes the specified SearchProjectsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest} message SearchProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchProjectsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified SearchProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsRequest} message SearchProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchProjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchProjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchProjectsRequest} SearchProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchProjectsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchProjectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchProjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchProjectsRequest} SearchProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchProjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchProjectsRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchProjectsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a SearchProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchProjectsRequest} SearchProjectsRequest + */ + SearchProjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchProjectsRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchProjectsRequest(); + if (object.query != null) + message.query = String(object.query); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a SearchProjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {google.cloud.resourcemanager.v3.SearchProjectsRequest} message SearchProjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchProjectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this SearchProjectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchProjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchProjectsRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchProjectsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchProjectsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchProjectsRequest"; + }; + + return SearchProjectsRequest; + })(); + + v3.SearchProjectsResponse = (function() { + + /** + * Properties of a SearchProjectsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface ISearchProjectsResponse + * @property {Array.|null} [projects] SearchProjectsResponse projects + * @property {string|null} [nextPageToken] SearchProjectsResponse nextPageToken + */ + + /** + * Constructs a new SearchProjectsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a SearchProjectsResponse. + * @implements ISearchProjectsResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.ISearchProjectsResponse=} [properties] Properties to set + */ + function SearchProjectsResponse(properties) { + this.projects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchProjectsResponse projects. + * @member {Array.} projects + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @instance + */ + SearchProjectsResponse.prototype.projects = $util.emptyArray; + + /** + * SearchProjectsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @instance + */ + SearchProjectsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchProjectsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.SearchProjectsResponse} SearchProjectsResponse instance + */ + SearchProjectsResponse.create = function create(properties) { + return new SearchProjectsResponse(properties); + }; + + /** + * Encodes the specified SearchProjectsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsResponse} message SearchProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchProjectsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projects != null && message.projects.length) + for (var i = 0; i < message.projects.length; ++i) + $root.google.cloud.resourcemanager.v3.Project.encode(message.projects[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 SearchProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.SearchProjectsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ISearchProjectsResponse} message SearchProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchProjectsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchProjectsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.SearchProjectsResponse} SearchProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchProjectsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.SearchProjectsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.projects && message.projects.length)) + message.projects = []; + message.projects.push($root.google.cloud.resourcemanager.v3.Project.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchProjectsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.SearchProjectsResponse} SearchProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchProjectsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchProjectsResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchProjectsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projects != null && message.hasOwnProperty("projects")) { + if (!Array.isArray(message.projects)) + return "projects: array expected"; + for (var i = 0; i < message.projects.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.Project.verify(message.projects[i]); + if (error) + return "projects." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.SearchProjectsResponse} SearchProjectsResponse + */ + SearchProjectsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.SearchProjectsResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.SearchProjectsResponse(); + if (object.projects) { + if (!Array.isArray(object.projects)) + throw TypeError(".google.cloud.resourcemanager.v3.SearchProjectsResponse.projects: array expected"); + message.projects = []; + for (var i = 0; i < object.projects.length; ++i) { + if (typeof object.projects[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.SearchProjectsResponse.projects: object expected"); + message.projects[i] = $root.google.cloud.resourcemanager.v3.Project.fromObject(object.projects[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchProjectsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {google.cloud.resourcemanager.v3.SearchProjectsResponse} message SearchProjectsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchProjectsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.projects = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.projects && message.projects.length) { + object.projects = []; + for (var j = 0; j < message.projects.length; ++j) + object.projects[j] = $root.google.cloud.resourcemanager.v3.Project.toObject(message.projects[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchProjectsResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchProjectsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchProjectsResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.SearchProjectsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchProjectsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.SearchProjectsResponse"; + }; + + return SearchProjectsResponse; + })(); + + v3.CreateProjectRequest = (function() { + + /** + * Properties of a CreateProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateProjectRequest + * @property {google.cloud.resourcemanager.v3.IProject|null} [project] CreateProjectRequest project + */ + + /** + * Constructs a new CreateProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateProjectRequest. + * @implements ICreateProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest=} [properties] Properties to set + */ + function CreateProjectRequest(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]]; + } + + /** + * CreateProjectRequest project. + * @member {google.cloud.resourcemanager.v3.IProject|null|undefined} project + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @instance + */ + CreateProjectRequest.prototype.project = null; + + /** + * Creates a new CreateProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateProjectRequest} CreateProjectRequest instance + */ + CreateProjectRequest.create = function create(properties) { + return new CreateProjectRequest(properties); + }; + + /** + * Encodes the specified CreateProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest} message CreateProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + $root.google.cloud.resourcemanager.v3.Project.encode(message.project, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectRequest} message CreateProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateProjectRequest} CreateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = $root.google.cloud.resourcemanager.v3.Project.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateProjectRequest} CreateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) { + var error = $root.google.cloud.resourcemanager.v3.Project.verify(message.project); + if (error) + return "project." + error; + } + return null; + }; + + /** + * Creates a CreateProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateProjectRequest} CreateProjectRequest + */ + CreateProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateProjectRequest(); + if (object.project != null) { + if (typeof object.project !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateProjectRequest.project: object expected"); + message.project = $root.google.cloud.resourcemanager.v3.Project.fromObject(object.project); + } + return message; + }; + + /** + * Creates a plain object from a CreateProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.CreateProjectRequest} message CreateProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = null; + if (message.project != null && message.hasOwnProperty("project")) + object.project = $root.google.cloud.resourcemanager.v3.Project.toObject(message.project, options); + return object; + }; + + /** + * Converts this CreateProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateProjectRequest"; + }; + + return CreateProjectRequest; + })(); + + v3.CreateProjectMetadata = (function() { + + /** + * Properties of a CreateProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateProjectMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateProjectMetadata createTime + * @property {boolean|null} [gettable] CreateProjectMetadata gettable + * @property {boolean|null} [ready] CreateProjectMetadata ready + */ + + /** + * Constructs a new CreateProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateProjectMetadata. + * @implements ICreateProjectMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateProjectMetadata=} [properties] Properties to set + */ + function CreateProjectMetadata(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]]; + } + + /** + * CreateProjectMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @instance + */ + CreateProjectMetadata.prototype.createTime = null; + + /** + * CreateProjectMetadata gettable. + * @member {boolean} gettable + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @instance + */ + CreateProjectMetadata.prototype.gettable = false; + + /** + * CreateProjectMetadata ready. + * @member {boolean} ready + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @instance + */ + CreateProjectMetadata.prototype.ready = false; + + /** + * Creates a new CreateProjectMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateProjectMetadata} CreateProjectMetadata instance + */ + CreateProjectMetadata.create = function create(properties) { + return new CreateProjectMetadata(properties); + }; + + /** + * Encodes the specified CreateProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectMetadata} message CreateProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProjectMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gettable != null && Object.hasOwnProperty.call(message, "gettable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.gettable); + if (message.ready != null && Object.hasOwnProperty.call(message, "ready")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ready); + return writer; + }; + + /** + * Encodes the specified CreateProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateProjectMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateProjectMetadata} message CreateProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProjectMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProjectMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateProjectMetadata} CreateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProjectMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateProjectMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gettable = reader.bool(); + break; + } + case 3: { + message.ready = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProjectMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateProjectMetadata} CreateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProjectMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProjectMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProjectMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.gettable != null && message.hasOwnProperty("gettable")) + if (typeof message.gettable !== "boolean") + return "gettable: boolean expected"; + if (message.ready != null && message.hasOwnProperty("ready")) + if (typeof message.ready !== "boolean") + return "ready: boolean expected"; + return null; + }; + + /** + * Creates a CreateProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateProjectMetadata} CreateProjectMetadata + */ + CreateProjectMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateProjectMetadata) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateProjectMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateProjectMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.gettable != null) + message.gettable = Boolean(object.gettable); + if (object.ready != null) + message.ready = Boolean(object.ready); + return message; + }; + + /** + * Creates a plain object from a CreateProjectMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.CreateProjectMetadata} message CreateProjectMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProjectMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.gettable = false; + object.ready = false; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.gettable != null && message.hasOwnProperty("gettable")) + object.gettable = message.gettable; + if (message.ready != null && message.hasOwnProperty("ready")) + object.ready = message.ready; + return object; + }; + + /** + * Converts this CreateProjectMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateProjectMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProjectMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateProjectMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProjectMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateProjectMetadata"; + }; + + return CreateProjectMetadata; + })(); + + v3.UpdateProjectRequest = (function() { + + /** + * Properties of an UpdateProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateProjectRequest + * @property {google.cloud.resourcemanager.v3.IProject|null} [project] UpdateProjectRequest project + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProjectRequest updateMask + */ + + /** + * Constructs a new UpdateProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateProjectRequest. + * @implements IUpdateProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest=} [properties] Properties to set + */ + function UpdateProjectRequest(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]]; + } + + /** + * UpdateProjectRequest project. + * @member {google.cloud.resourcemanager.v3.IProject|null|undefined} project + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @instance + */ + UpdateProjectRequest.prototype.project = null; + + /** + * UpdateProjectRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @instance + */ + UpdateProjectRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateProjectRequest} UpdateProjectRequest instance + */ + UpdateProjectRequest.create = function create(properties) { + return new UpdateProjectRequest(properties); + }; + + /** + * Encodes the specified UpdateProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest} message UpdateProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + $root.google.cloud.resourcemanager.v3.Project.encode(message.project, 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 UpdateProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectRequest} message UpdateProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateProjectRequest} UpdateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = $root.google.cloud.resourcemanager.v3.Project.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 UpdateProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateProjectRequest} UpdateProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) { + var error = $root.google.cloud.resourcemanager.v3.Project.verify(message.project); + if (error) + return "project." + 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 UpdateProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateProjectRequest} UpdateProjectRequest + */ + UpdateProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UpdateProjectRequest(); + if (object.project != null) { + if (typeof object.project !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateProjectRequest.project: object expected"); + message.project = $root.google.cloud.resourcemanager.v3.Project.fromObject(object.project); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateProjectRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.UpdateProjectRequest} message UpdateProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = null; + object.updateMask = null; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = $root.google.cloud.resourcemanager.v3.Project.toObject(message.project, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateProjectRequest"; + }; + + return UpdateProjectRequest; + })(); + + v3.UpdateProjectMetadata = (function() { + + /** + * Properties of an UpdateProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateProjectMetadata + */ + + /** + * Constructs a new UpdateProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateProjectMetadata. + * @implements IUpdateProjectMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateProjectMetadata=} [properties] Properties to set + */ + function UpdateProjectMetadata(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 UpdateProjectMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateProjectMetadata} UpdateProjectMetadata instance + */ + UpdateProjectMetadata.create = function create(properties) { + return new UpdateProjectMetadata(properties); + }; + + /** + * Encodes the specified UpdateProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectMetadata} message UpdateProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateProjectMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateProjectMetadata} message UpdateProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProjectMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProjectMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateProjectMetadata} UpdateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateProjectMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProjectMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateProjectMetadata} UpdateProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProjectMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProjectMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProjectMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateProjectMetadata} UpdateProjectMetadata + */ + UpdateProjectMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateProjectMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UpdateProjectMetadata(); + }; + + /** + * Creates a plain object from an UpdateProjectMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UpdateProjectMetadata} message UpdateProjectMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProjectMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateProjectMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateProjectMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProjectMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateProjectMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProjectMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateProjectMetadata"; + }; + + return UpdateProjectMetadata; + })(); + + v3.MoveProjectRequest = (function() { + + /** + * Properties of a MoveProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IMoveProjectRequest + * @property {string|null} [name] MoveProjectRequest name + * @property {string|null} [destinationParent] MoveProjectRequest destinationParent + */ + + /** + * Constructs a new MoveProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a MoveProjectRequest. + * @implements IMoveProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest=} [properties] Properties to set + */ + function MoveProjectRequest(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]]; + } + + /** + * MoveProjectRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @instance + */ + MoveProjectRequest.prototype.name = ""; + + /** + * MoveProjectRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @instance + */ + MoveProjectRequest.prototype.destinationParent = ""; + + /** + * Creates a new MoveProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.MoveProjectRequest} MoveProjectRequest instance + */ + MoveProjectRequest.create = function create(properties) { + return new MoveProjectRequest(properties); + }; + + /** + * Encodes the specified MoveProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest} message MoveProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveProjectRequest.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.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + return writer; + }; + + /** + * Encodes the specified MoveProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectRequest} message MoveProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.MoveProjectRequest} MoveProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.MoveProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.destinationParent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.MoveProjectRequest} MoveProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveProjectRequest.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.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + return null; + }; + + /** + * Creates a MoveProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.MoveProjectRequest} MoveProjectRequest + */ + MoveProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.MoveProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.MoveProjectRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + return message; + }; + + /** + * Creates a plain object from a MoveProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.MoveProjectRequest} message MoveProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.destinationParent = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + return object; + }; + + /** + * Converts this MoveProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @instance + * @returns {Object.} JSON object + */ + MoveProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.MoveProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.MoveProjectRequest"; + }; + + return MoveProjectRequest; + })(); + + v3.MoveProjectMetadata = (function() { + + /** + * Properties of a MoveProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IMoveProjectMetadata + */ + + /** + * Constructs a new MoveProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a MoveProjectMetadata. + * @implements IMoveProjectMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IMoveProjectMetadata=} [properties] Properties to set + */ + function MoveProjectMetadata(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 MoveProjectMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.MoveProjectMetadata} MoveProjectMetadata instance + */ + MoveProjectMetadata.create = function create(properties) { + return new MoveProjectMetadata(properties); + }; + + /** + * Encodes the specified MoveProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectMetadata} message MoveProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveProjectMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified MoveProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.MoveProjectMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IMoveProjectMetadata} message MoveProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveProjectMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveProjectMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.MoveProjectMetadata} MoveProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveProjectMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.MoveProjectMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveProjectMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.MoveProjectMetadata} MoveProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveProjectMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveProjectMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveProjectMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a MoveProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.MoveProjectMetadata} MoveProjectMetadata + */ + MoveProjectMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.MoveProjectMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.MoveProjectMetadata(); + }; + + /** + * Creates a plain object from a MoveProjectMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.MoveProjectMetadata} message MoveProjectMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveProjectMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this MoveProjectMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @instance + * @returns {Object.} JSON object + */ + MoveProjectMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveProjectMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.MoveProjectMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveProjectMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.MoveProjectMetadata"; + }; + + return MoveProjectMetadata; + })(); + + v3.DeleteProjectRequest = (function() { + + /** + * Properties of a DeleteProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteProjectRequest + * @property {string|null} [name] DeleteProjectRequest name + */ + + /** + * Constructs a new DeleteProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteProjectRequest. + * @implements IDeleteProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest=} [properties] Properties to set + */ + function DeleteProjectRequest(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]]; + } + + /** + * DeleteProjectRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @instance + */ + DeleteProjectRequest.prototype.name = ""; + + /** + * Creates a new DeleteProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteProjectRequest} DeleteProjectRequest instance + */ + DeleteProjectRequest.create = function create(properties) { + return new DeleteProjectRequest(properties); + }; + + /** + * Encodes the specified DeleteProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest} message DeleteProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProjectRequest.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 DeleteProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectRequest} message DeleteProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteProjectRequest} DeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteProjectRequest(); + 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 DeleteProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteProjectRequest} DeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProjectRequest.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 DeleteProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteProjectRequest} DeleteProjectRequest + */ + DeleteProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.DeleteProjectRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.DeleteProjectRequest} message DeleteProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProjectRequest.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 DeleteProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteProjectRequest"; + }; + + return DeleteProjectRequest; + })(); + + v3.DeleteProjectMetadata = (function() { + + /** + * Properties of a DeleteProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteProjectMetadata + */ + + /** + * Constructs a new DeleteProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteProjectMetadata. + * @implements IDeleteProjectMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteProjectMetadata=} [properties] Properties to set + */ + function DeleteProjectMetadata(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 DeleteProjectMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteProjectMetadata} DeleteProjectMetadata instance + */ + DeleteProjectMetadata.create = function create(properties) { + return new DeleteProjectMetadata(properties); + }; + + /** + * Encodes the specified DeleteProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectMetadata} message DeleteProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProjectMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteProjectMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteProjectMetadata} message DeleteProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProjectMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProjectMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteProjectMetadata} DeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProjectMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteProjectMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProjectMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteProjectMetadata} DeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProjectMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProjectMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProjectMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteProjectMetadata} DeleteProjectMetadata + */ + DeleteProjectMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteProjectMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteProjectMetadata(); + }; + + /** + * Creates a plain object from a DeleteProjectMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteProjectMetadata} message DeleteProjectMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProjectMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteProjectMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteProjectMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProjectMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteProjectMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProjectMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteProjectMetadata"; + }; + + return DeleteProjectMetadata; + })(); + + v3.UndeleteProjectRequest = (function() { + + /** + * Properties of an UndeleteProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUndeleteProjectRequest + * @property {string|null} [name] UndeleteProjectRequest name + */ + + /** + * Constructs a new UndeleteProjectRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UndeleteProjectRequest. + * @implements IUndeleteProjectRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest=} [properties] Properties to set + */ + function UndeleteProjectRequest(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]]; + } + + /** + * UndeleteProjectRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @instance + */ + UndeleteProjectRequest.prototype.name = ""; + + /** + * Creates a new UndeleteProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectRequest} UndeleteProjectRequest instance + */ + UndeleteProjectRequest.create = function create(properties) { + return new UndeleteProjectRequest(properties); + }; + + /** + * Encodes the specified UndeleteProjectRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest} message UndeleteProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteProjectRequest.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 UndeleteProjectRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectRequest} message UndeleteProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectRequest} UndeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UndeleteProjectRequest(); + 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 an UndeleteProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectRequest} UndeleteProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteProjectRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteProjectRequest.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 an UndeleteProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectRequest} UndeleteProjectRequest + */ + UndeleteProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UndeleteProjectRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UndeleteProjectRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeleteProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {google.cloud.resourcemanager.v3.UndeleteProjectRequest} message UndeleteProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteProjectRequest.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 UndeleteProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteProjectRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UndeleteProjectRequest"; + }; + + return UndeleteProjectRequest; + })(); + + v3.UndeleteProjectMetadata = (function() { + + /** + * Properties of an UndeleteProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUndeleteProjectMetadata + */ + + /** + * Constructs a new UndeleteProjectMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UndeleteProjectMetadata. + * @implements IUndeleteProjectMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectMetadata=} [properties] Properties to set + */ + function UndeleteProjectMetadata(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 UndeleteProjectMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectMetadata} UndeleteProjectMetadata instance + */ + UndeleteProjectMetadata.create = function create(properties) { + return new UndeleteProjectMetadata(properties); + }; + + /** + * Encodes the specified UndeleteProjectMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectMetadata} message UndeleteProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteProjectMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeleteProjectMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UndeleteProjectMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUndeleteProjectMetadata} message UndeleteProjectMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteProjectMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeleteProjectMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectMetadata} UndeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteProjectMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UndeleteProjectMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteProjectMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectMetadata} UndeleteProjectMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteProjectMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteProjectMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteProjectMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeleteProjectMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UndeleteProjectMetadata} UndeleteProjectMetadata + */ + UndeleteProjectMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UndeleteProjectMetadata(); + }; + + /** + * Creates a plain object from an UndeleteProjectMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UndeleteProjectMetadata} message UndeleteProjectMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteProjectMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeleteProjectMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeleteProjectMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteProjectMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UndeleteProjectMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteProjectMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UndeleteProjectMetadata"; + }; + + return UndeleteProjectMetadata; + })(); + + v3.TagBindings = (function() { + + /** + * Constructs a new TagBindings service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagBindings + * @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 TagBindings(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TagBindings.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TagBindings; + + /** + * Creates new TagBindings service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @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 {TagBindings} RPC service. Useful where requests and/or responses are streamed. + */ + TagBindings.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|listTagBindings}. + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @typedef ListTagBindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.ListTagBindingsResponse} [response] ListTagBindingsResponse + */ + + /** + * Calls ListTagBindings. + * @function listTagBindings + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest} request ListTagBindingsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagBindings.ListTagBindingsCallback} callback Node-style callback called with the error, if any, and ListTagBindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagBindings.prototype.listTagBindings = function listTagBindings(request, callback) { + return this.rpcCall(listTagBindings, $root.google.cloud.resourcemanager.v3.ListTagBindingsRequest, $root.google.cloud.resourcemanager.v3.ListTagBindingsResponse, request, callback); + }, "name", { value: "ListTagBindings" }); + + /** + * Calls ListTagBindings. + * @function listTagBindings + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest} request ListTagBindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|createTagBinding}. + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @typedef CreateTagBindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTagBinding. + * @function createTagBinding + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest} request CreateTagBindingRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagBindings.CreateTagBindingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagBindings.prototype.createTagBinding = function createTagBinding(request, callback) { + return this.rpcCall(createTagBinding, $root.google.cloud.resourcemanager.v3.CreateTagBindingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTagBinding" }); + + /** + * Calls CreateTagBinding. + * @function createTagBinding + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest} request CreateTagBindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagBindings|deleteTagBinding}. + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @typedef DeleteTagBindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTagBinding. + * @function deleteTagBinding + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest} request DeleteTagBindingRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagBindings.DeleteTagBindingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagBindings.prototype.deleteTagBinding = function deleteTagBinding(request, callback) { + return this.rpcCall(deleteTagBinding, $root.google.cloud.resourcemanager.v3.DeleteTagBindingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTagBinding" }); + + /** + * Calls DeleteTagBinding. + * @function deleteTagBinding + * @memberof google.cloud.resourcemanager.v3.TagBindings + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest} request DeleteTagBindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TagBindings; + })(); + + v3.TagBinding = (function() { + + /** + * Properties of a TagBinding. + * @memberof google.cloud.resourcemanager.v3 + * @interface ITagBinding + * @property {string|null} [name] TagBinding name + * @property {string|null} [parent] TagBinding parent + * @property {string|null} [tagValue] TagBinding tagValue + */ + + /** + * Constructs a new TagBinding. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagBinding. + * @implements ITagBinding + * @constructor + * @param {google.cloud.resourcemanager.v3.ITagBinding=} [properties] Properties to set + */ + function TagBinding(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]]; + } + + /** + * TagBinding name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @instance + */ + TagBinding.prototype.name = ""; + + /** + * TagBinding parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @instance + */ + TagBinding.prototype.parent = ""; + + /** + * TagBinding tagValue. + * @member {string} tagValue + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @instance + */ + TagBinding.prototype.tagValue = ""; + + /** + * Creates a new TagBinding instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {google.cloud.resourcemanager.v3.ITagBinding=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.TagBinding} TagBinding instance + */ + TagBinding.create = function create(properties) { + return new TagBinding(properties); + }; + + /** + * Encodes the specified TagBinding message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {google.cloud.resourcemanager.v3.ITagBinding} message TagBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagBinding.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValue); + return writer; + }; + + /** + * Encodes the specified TagBinding message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {google.cloud.resourcemanager.v3.ITagBinding} message TagBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.TagBinding} TagBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagBinding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.TagBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.tagValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.TagBinding} TagBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagBinding message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagBinding.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tagValue != null && message.hasOwnProperty("tagValue")) + if (!$util.isString(message.tagValue)) + return "tagValue: string expected"; + return null; + }; + + /** + * Creates a TagBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.TagBinding} TagBinding + */ + TagBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.TagBinding) + return object; + var message = new $root.google.cloud.resourcemanager.v3.TagBinding(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tagValue != null) + message.tagValue = String(object.tagValue); + return message; + }; + + /** + * Creates a plain object from a TagBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {google.cloud.resourcemanager.v3.TagBinding} message TagBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.tagValue = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tagValue != null && message.hasOwnProperty("tagValue")) + object.tagValue = message.tagValue; + return object; + }; + + /** + * Converts this TagBinding to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @instance + * @returns {Object.} JSON object + */ + TagBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagBinding + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.TagBinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagBinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.TagBinding"; + }; + + return TagBinding; + })(); + + v3.CreateTagBindingMetadata = (function() { + + /** + * Properties of a CreateTagBindingMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagBindingMetadata + */ + + /** + * Constructs a new CreateTagBindingMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagBindingMetadata. + * @implements ICreateTagBindingMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingMetadata=} [properties] Properties to set + */ + function CreateTagBindingMetadata(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 CreateTagBindingMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingMetadata} CreateTagBindingMetadata instance + */ + CreateTagBindingMetadata.create = function create(properties) { + return new CreateTagBindingMetadata(properties); + }; + + /** + * Encodes the specified CreateTagBindingMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingMetadata} message CreateTagBindingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagBindingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateTagBindingMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingMetadata} message CreateTagBindingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagBindingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagBindingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingMetadata} CreateTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagBindingMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagBindingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagBindingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingMetadata} CreateTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagBindingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagBindingMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagBindingMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateTagBindingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingMetadata} CreateTagBindingMetadata + */ + CreateTagBindingMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.CreateTagBindingMetadata(); + }; + + /** + * Creates a plain object from a CreateTagBindingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagBindingMetadata} message CreateTagBindingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagBindingMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateTagBindingMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTagBindingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagBindingMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagBindingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagBindingMetadata"; + }; + + return CreateTagBindingMetadata; + })(); + + v3.CreateTagBindingRequest = (function() { + + /** + * Properties of a CreateTagBindingRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagBindingRequest + * @property {google.cloud.resourcemanager.v3.ITagBinding|null} [tagBinding] CreateTagBindingRequest tagBinding + * @property {boolean|null} [validateOnly] CreateTagBindingRequest validateOnly + */ + + /** + * Constructs a new CreateTagBindingRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagBindingRequest. + * @implements ICreateTagBindingRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest=} [properties] Properties to set + */ + function CreateTagBindingRequest(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]]; + } + + /** + * CreateTagBindingRequest tagBinding. + * @member {google.cloud.resourcemanager.v3.ITagBinding|null|undefined} tagBinding + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @instance + */ + CreateTagBindingRequest.prototype.tagBinding = null; + + /** + * CreateTagBindingRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @instance + */ + CreateTagBindingRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTagBindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingRequest} CreateTagBindingRequest instance + */ + CreateTagBindingRequest.create = function create(properties) { + return new CreateTagBindingRequest(properties); + }; + + /** + * Encodes the specified CreateTagBindingRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest} message CreateTagBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagBindingRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagBinding != null && Object.hasOwnProperty.call(message, "tagBinding")) + $root.google.cloud.resourcemanager.v3.TagBinding.encode(message.tagBinding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTagBindingRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagBindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagBindingRequest} message CreateTagBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagBindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagBindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingRequest} CreateTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagBindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagBindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagBinding = $root.google.cloud.resourcemanager.v3.TagBinding.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagBindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingRequest} CreateTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagBindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagBindingRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagBindingRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagBinding != null && message.hasOwnProperty("tagBinding")) { + var error = $root.google.cloud.resourcemanager.v3.TagBinding.verify(message.tagBinding); + if (error) + return "tagBinding." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTagBindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagBindingRequest} CreateTagBindingRequest + */ + CreateTagBindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagBindingRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateTagBindingRequest(); + if (object.tagBinding != null) { + if (typeof object.tagBinding !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateTagBindingRequest.tagBinding: object expected"); + message.tagBinding = $root.google.cloud.resourcemanager.v3.TagBinding.fromObject(object.tagBinding); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTagBindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagBindingRequest} message CreateTagBindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagBindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagBinding = null; + object.validateOnly = false; + } + if (message.tagBinding != null && message.hasOwnProperty("tagBinding")) + object.tagBinding = $root.google.cloud.resourcemanager.v3.TagBinding.toObject(message.tagBinding, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTagBindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTagBindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagBindingRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagBindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagBindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagBindingRequest"; + }; + + return CreateTagBindingRequest; + })(); + + v3.DeleteTagBindingMetadata = (function() { + + /** + * Properties of a DeleteTagBindingMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagBindingMetadata + */ + + /** + * Constructs a new DeleteTagBindingMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagBindingMetadata. + * @implements IDeleteTagBindingMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata=} [properties] Properties to set + */ + function DeleteTagBindingMetadata(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 DeleteTagBindingMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} DeleteTagBindingMetadata instance + */ + DeleteTagBindingMetadata.create = function create(properties) { + return new DeleteTagBindingMetadata(properties); + }; + + /** + * Encodes the specified DeleteTagBindingMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata} message DeleteTagBindingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagBindingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteTagBindingMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata} message DeleteTagBindingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagBindingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagBindingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} DeleteTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagBindingMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTagBindingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} DeleteTagBindingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagBindingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagBindingMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagBindingMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteTagBindingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} DeleteTagBindingMetadata + */ + DeleteTagBindingMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata(); + }; + + /** + * Creates a plain object from a DeleteTagBindingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} message DeleteTagBindingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagBindingMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteTagBindingMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteTagBindingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagBindingMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagBindingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagBindingMetadata"; + }; + + return DeleteTagBindingMetadata; + })(); + + v3.DeleteTagBindingRequest = (function() { + + /** + * Properties of a DeleteTagBindingRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagBindingRequest + * @property {string|null} [name] DeleteTagBindingRequest name + */ + + /** + * Constructs a new DeleteTagBindingRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagBindingRequest. + * @implements IDeleteTagBindingRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest=} [properties] Properties to set + */ + function DeleteTagBindingRequest(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]]; + } + + /** + * DeleteTagBindingRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @instance + */ + DeleteTagBindingRequest.prototype.name = ""; + + /** + * Creates a new DeleteTagBindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingRequest} DeleteTagBindingRequest instance + */ + DeleteTagBindingRequest.create = function create(properties) { + return new DeleteTagBindingRequest(properties); + }; + + /** + * Encodes the specified DeleteTagBindingRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest} message DeleteTagBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagBindingRequest.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 DeleteTagBindingRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagBindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagBindingRequest} message DeleteTagBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagBindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagBindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingRequest} DeleteTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagBindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagBindingRequest(); + 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 DeleteTagBindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingRequest} DeleteTagBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagBindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagBindingRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagBindingRequest.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 DeleteTagBindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagBindingRequest} DeleteTagBindingRequest + */ + DeleteTagBindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.DeleteTagBindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTagBindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagBindingRequest} message DeleteTagBindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagBindingRequest.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 DeleteTagBindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTagBindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagBindingRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagBindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagBindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagBindingRequest"; + }; + + return DeleteTagBindingRequest; + })(); + + v3.ListTagBindingsRequest = (function() { + + /** + * Properties of a ListTagBindingsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagBindingsRequest + * @property {string|null} [parent] ListTagBindingsRequest parent + * @property {number|null} [pageSize] ListTagBindingsRequest pageSize + * @property {string|null} [pageToken] ListTagBindingsRequest pageToken + */ + + /** + * Constructs a new ListTagBindingsRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagBindingsRequest. + * @implements IListTagBindingsRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest=} [properties] Properties to set + */ + function ListTagBindingsRequest(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]]; + } + + /** + * ListTagBindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @instance + */ + ListTagBindingsRequest.prototype.parent = ""; + + /** + * ListTagBindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @instance + */ + ListTagBindingsRequest.prototype.pageSize = 0; + + /** + * ListTagBindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @instance + */ + ListTagBindingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTagBindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsRequest} ListTagBindingsRequest instance + */ + ListTagBindingsRequest.create = function create(properties) { + return new ListTagBindingsRequest(properties); + }; + + /** + * Encodes the specified ListTagBindingsRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest} message ListTagBindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagBindingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTagBindingsRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsRequest} message ListTagBindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagBindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagBindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsRequest} ListTagBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagBindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagBindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagBindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsRequest} ListTagBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagBindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagBindingsRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagBindingsRequest.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.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 ListTagBindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsRequest} ListTagBindingsRequest + */ + ListTagBindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagBindingsRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagBindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListTagBindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {google.cloud.resourcemanager.v3.ListTagBindingsRequest} message ListTagBindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagBindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListTagBindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTagBindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagBindingsRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagBindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagBindingsRequest"; + }; + + return ListTagBindingsRequest; + })(); + + v3.ListTagBindingsResponse = (function() { + + /** + * Properties of a ListTagBindingsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagBindingsResponse + * @property {Array.|null} [tagBindings] ListTagBindingsResponse tagBindings + * @property {string|null} [nextPageToken] ListTagBindingsResponse nextPageToken + */ + + /** + * Constructs a new ListTagBindingsResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagBindingsResponse. + * @implements IListTagBindingsResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagBindingsResponse=} [properties] Properties to set + */ + function ListTagBindingsResponse(properties) { + this.tagBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTagBindingsResponse tagBindings. + * @member {Array.} tagBindings + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @instance + */ + ListTagBindingsResponse.prototype.tagBindings = $util.emptyArray; + + /** + * ListTagBindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @instance + */ + ListTagBindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTagBindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsResponse} ListTagBindingsResponse instance + */ + ListTagBindingsResponse.create = function create(properties) { + return new ListTagBindingsResponse(properties); + }; + + /** + * Encodes the specified ListTagBindingsResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsResponse} message ListTagBindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagBindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagBindings != null && message.tagBindings.length) + for (var i = 0; i < message.tagBindings.length; ++i) + $root.google.cloud.resourcemanager.v3.TagBinding.encode(message.tagBindings[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 ListTagBindingsResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagBindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagBindingsResponse} message ListTagBindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagBindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagBindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsResponse} ListTagBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagBindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagBindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tagBindings && message.tagBindings.length)) + message.tagBindings = []; + message.tagBindings.push($root.google.cloud.resourcemanager.v3.TagBinding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagBindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsResponse} ListTagBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagBindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagBindingsResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagBindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagBindings != null && message.hasOwnProperty("tagBindings")) { + if (!Array.isArray(message.tagBindings)) + return "tagBindings: array expected"; + for (var i = 0; i < message.tagBindings.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.TagBinding.verify(message.tagBindings[i]); + if (error) + return "tagBindings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTagBindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagBindingsResponse} ListTagBindingsResponse + */ + ListTagBindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagBindingsResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagBindingsResponse(); + if (object.tagBindings) { + if (!Array.isArray(object.tagBindings)) + throw TypeError(".google.cloud.resourcemanager.v3.ListTagBindingsResponse.tagBindings: array expected"); + message.tagBindings = []; + for (var i = 0; i < object.tagBindings.length; ++i) { + if (typeof object.tagBindings[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.ListTagBindingsResponse.tagBindings: object expected"); + message.tagBindings[i] = $root.google.cloud.resourcemanager.v3.TagBinding.fromObject(object.tagBindings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTagBindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {google.cloud.resourcemanager.v3.ListTagBindingsResponse} message ListTagBindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagBindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tagBindings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tagBindings && message.tagBindings.length) { + object.tagBindings = []; + for (var j = 0; j < message.tagBindings.length; ++j) + object.tagBindings[j] = $root.google.cloud.resourcemanager.v3.TagBinding.toObject(message.tagBindings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTagBindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTagBindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagBindingsResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagBindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagBindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagBindingsResponse"; + }; + + return ListTagBindingsResponse; + })(); + + v3.TagKeys = (function() { + + /** + * Constructs a new TagKeys service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagKeys + * @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 TagKeys(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TagKeys.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TagKeys; + + /** + * Creates new TagKeys service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @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 {TagKeys} RPC service. Useful where requests and/or responses are streamed. + */ + TagKeys.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|listTagKeys}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef ListTagKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.ListTagKeysResponse} [response] ListTagKeysResponse + */ + + /** + * Calls ListTagKeys. + * @function listTagKeys + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest} request ListTagKeysRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.ListTagKeysCallback} callback Node-style callback called with the error, if any, and ListTagKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.listTagKeys = function listTagKeys(request, callback) { + return this.rpcCall(listTagKeys, $root.google.cloud.resourcemanager.v3.ListTagKeysRequest, $root.google.cloud.resourcemanager.v3.ListTagKeysResponse, request, callback); + }, "name", { value: "ListTagKeys" }); + + /** + * Calls ListTagKeys. + * @function listTagKeys + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest} request ListTagKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|getTagKey}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef GetTagKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.TagKey} [response] TagKey + */ + + /** + * Calls GetTagKey. + * @function getTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest} request GetTagKeyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.GetTagKeyCallback} callback Node-style callback called with the error, if any, and TagKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.getTagKey = function getTagKey(request, callback) { + return this.rpcCall(getTagKey, $root.google.cloud.resourcemanager.v3.GetTagKeyRequest, $root.google.cloud.resourcemanager.v3.TagKey, request, callback); + }, "name", { value: "GetTagKey" }); + + /** + * Calls GetTagKey. + * @function getTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest} request GetTagKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|createTagKey}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef CreateTagKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTagKey. + * @function createTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest} request CreateTagKeyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.CreateTagKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.createTagKey = function createTagKey(request, callback) { + return this.rpcCall(createTagKey, $root.google.cloud.resourcemanager.v3.CreateTagKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTagKey" }); + + /** + * Calls CreateTagKey. + * @function createTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest} request CreateTagKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|updateTagKey}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef UpdateTagKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTagKey. + * @function updateTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest} request UpdateTagKeyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.UpdateTagKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.updateTagKey = function updateTagKey(request, callback) { + return this.rpcCall(updateTagKey, $root.google.cloud.resourcemanager.v3.UpdateTagKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTagKey" }); + + /** + * Calls UpdateTagKey. + * @function updateTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest} request UpdateTagKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|deleteTagKey}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef DeleteTagKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTagKey. + * @function deleteTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest} request DeleteTagKeyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.DeleteTagKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.deleteTagKey = function deleteTagKey(request, callback) { + return this.rpcCall(deleteTagKey, $root.google.cloud.resourcemanager.v3.DeleteTagKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTagKey" }); + + /** + * Calls DeleteTagKey. + * @function deleteTagKey + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest} request DeleteTagKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|getIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|setIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagKeys|testIamPermissions}. + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagKeys.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagKeys.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.TagKeys + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TagKeys; + })(); + + v3.TagKey = (function() { + + /** + * Properties of a TagKey. + * @memberof google.cloud.resourcemanager.v3 + * @interface ITagKey + * @property {string|null} [name] TagKey name + * @property {string|null} [parent] TagKey parent + * @property {string|null} [shortName] TagKey shortName + * @property {string|null} [namespacedName] TagKey namespacedName + * @property {string|null} [description] TagKey description + * @property {google.protobuf.ITimestamp|null} [createTime] TagKey createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TagKey updateTime + * @property {string|null} [etag] TagKey etag + */ + + /** + * Constructs a new TagKey. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagKey. + * @implements ITagKey + * @constructor + * @param {google.cloud.resourcemanager.v3.ITagKey=} [properties] Properties to set + */ + function TagKey(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]]; + } + + /** + * TagKey name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.name = ""; + + /** + * TagKey parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.parent = ""; + + /** + * TagKey shortName. + * @member {string} shortName + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.shortName = ""; + + /** + * TagKey namespacedName. + * @member {string} namespacedName + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.namespacedName = ""; + + /** + * TagKey description. + * @member {string} description + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.description = ""; + + /** + * TagKey createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.createTime = null; + + /** + * TagKey updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.updateTime = null; + + /** + * TagKey etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + */ + TagKey.prototype.etag = ""; + + /** + * Creates a new TagKey instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {google.cloud.resourcemanager.v3.ITagKey=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.TagKey} TagKey instance + */ + TagKey.create = function create(properties) { + return new TagKey(properties); + }; + + /** + * Encodes the specified TagKey message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {google.cloud.resourcemanager.v3.ITagKey} message TagKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagKey.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.namespacedName != null && Object.hasOwnProperty.call(message, "namespacedName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespacedName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + return writer; + }; + + /** + * Encodes the specified TagKey message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {google.cloud.resourcemanager.v3.ITagKey} message TagKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.TagKey} TagKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.TagKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.namespacedName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.TagKey} TagKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagKey message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagKey.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.namespacedName != null && message.hasOwnProperty("namespacedName")) + if (!$util.isString(message.namespacedName)) + return "namespacedName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a TagKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.TagKey} TagKey + */ + TagKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.TagKey) + return object; + var message = new $root.google.cloud.resourcemanager.v3.TagKey(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.namespacedName != null) + message.namespacedName = String(object.namespacedName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.TagKey.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.TagKey.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a TagKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {google.cloud.resourcemanager.v3.TagKey} message TagKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.shortName = ""; + object.namespacedName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.namespacedName != null && message.hasOwnProperty("namespacedName")) + object.namespacedName = message.namespacedName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this TagKey to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.TagKey + * @instance + * @returns {Object.} JSON object + */ + TagKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagKey + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.TagKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.TagKey"; + }; + + return TagKey; + })(); + + v3.ListTagKeysRequest = (function() { + + /** + * Properties of a ListTagKeysRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagKeysRequest + * @property {string|null} [parent] ListTagKeysRequest parent + * @property {number|null} [pageSize] ListTagKeysRequest pageSize + * @property {string|null} [pageToken] ListTagKeysRequest pageToken + */ + + /** + * Constructs a new ListTagKeysRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagKeysRequest. + * @implements IListTagKeysRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest=} [properties] Properties to set + */ + function ListTagKeysRequest(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]]; + } + + /** + * ListTagKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @instance + */ + ListTagKeysRequest.prototype.parent = ""; + + /** + * ListTagKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @instance + */ + ListTagKeysRequest.prototype.pageSize = 0; + + /** + * ListTagKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @instance + */ + ListTagKeysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTagKeysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagKeysRequest} ListTagKeysRequest instance + */ + ListTagKeysRequest.create = function create(properties) { + return new ListTagKeysRequest(properties); + }; + + /** + * Encodes the specified ListTagKeysRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest} message ListTagKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagKeysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTagKeysRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysRequest} message ListTagKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagKeysRequest} ListTagKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagKeysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagKeysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagKeysRequest} ListTagKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagKeysRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagKeysRequest.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.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 ListTagKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagKeysRequest} ListTagKeysRequest + */ + ListTagKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagKeysRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagKeysRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListTagKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {google.cloud.resourcemanager.v3.ListTagKeysRequest} message ListTagKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListTagKeysRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @instance + * @returns {Object.} JSON object + */ + ListTagKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagKeysRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagKeysRequest"; + }; + + return ListTagKeysRequest; + })(); + + v3.ListTagKeysResponse = (function() { + + /** + * Properties of a ListTagKeysResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagKeysResponse + * @property {Array.|null} [tagKeys] ListTagKeysResponse tagKeys + * @property {string|null} [nextPageToken] ListTagKeysResponse nextPageToken + */ + + /** + * Constructs a new ListTagKeysResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagKeysResponse. + * @implements IListTagKeysResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagKeysResponse=} [properties] Properties to set + */ + function ListTagKeysResponse(properties) { + this.tagKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTagKeysResponse tagKeys. + * @member {Array.} tagKeys + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @instance + */ + ListTagKeysResponse.prototype.tagKeys = $util.emptyArray; + + /** + * ListTagKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @instance + */ + ListTagKeysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTagKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagKeysResponse} ListTagKeysResponse instance + */ + ListTagKeysResponse.create = function create(properties) { + return new ListTagKeysResponse(properties); + }; + + /** + * Encodes the specified ListTagKeysResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysResponse} message ListTagKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagKeys != null && message.tagKeys.length) + for (var i = 0; i < message.tagKeys.length; ++i) + $root.google.cloud.resourcemanager.v3.TagKey.encode(message.tagKeys[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 ListTagKeysResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagKeysResponse} message ListTagKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagKeysResponse} ListTagKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagKeysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tagKeys && message.tagKeys.length)) + message.tagKeys = []; + message.tagKeys.push($root.google.cloud.resourcemanager.v3.TagKey.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagKeysResponse} ListTagKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagKeysResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagKeys != null && message.hasOwnProperty("tagKeys")) { + if (!Array.isArray(message.tagKeys)) + return "tagKeys: array expected"; + for (var i = 0; i < message.tagKeys.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.TagKey.verify(message.tagKeys[i]); + if (error) + return "tagKeys." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTagKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagKeysResponse} ListTagKeysResponse + */ + ListTagKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagKeysResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagKeysResponse(); + if (object.tagKeys) { + if (!Array.isArray(object.tagKeys)) + throw TypeError(".google.cloud.resourcemanager.v3.ListTagKeysResponse.tagKeys: array expected"); + message.tagKeys = []; + for (var i = 0; i < object.tagKeys.length; ++i) { + if (typeof object.tagKeys[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.ListTagKeysResponse.tagKeys: object expected"); + message.tagKeys[i] = $root.google.cloud.resourcemanager.v3.TagKey.fromObject(object.tagKeys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTagKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {google.cloud.resourcemanager.v3.ListTagKeysResponse} message ListTagKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tagKeys = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tagKeys && message.tagKeys.length) { + object.tagKeys = []; + for (var j = 0; j < message.tagKeys.length; ++j) + object.tagKeys[j] = $root.google.cloud.resourcemanager.v3.TagKey.toObject(message.tagKeys[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTagKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListTagKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagKeysResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagKeysResponse"; + }; + + return ListTagKeysResponse; + })(); + + v3.GetTagKeyRequest = (function() { + + /** + * Properties of a GetTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IGetTagKeyRequest + * @property {string|null} [name] GetTagKeyRequest name + */ + + /** + * Constructs a new GetTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a GetTagKeyRequest. + * @implements IGetTagKeyRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest=} [properties] Properties to set + */ + function GetTagKeyRequest(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]]; + } + + /** + * GetTagKeyRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @instance + */ + GetTagKeyRequest.prototype.name = ""; + + /** + * Creates a new GetTagKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.GetTagKeyRequest} GetTagKeyRequest instance + */ + GetTagKeyRequest.create = function create(properties) { + return new GetTagKeyRequest(properties); + }; + + /** + * Encodes the specified GetTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest} message GetTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTagKeyRequest.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 GetTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagKeyRequest} message GetTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTagKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTagKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.GetTagKeyRequest} GetTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTagKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.GetTagKeyRequest(); + 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 GetTagKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.GetTagKeyRequest} GetTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTagKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTagKeyRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTagKeyRequest.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 GetTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.GetTagKeyRequest} GetTagKeyRequest + */ + GetTagKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.GetTagKeyRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.GetTagKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTagKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.GetTagKeyRequest} message GetTagKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTagKeyRequest.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 GetTagKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTagKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTagKeyRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.GetTagKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTagKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.GetTagKeyRequest"; + }; + + return GetTagKeyRequest; + })(); + + v3.CreateTagKeyRequest = (function() { + + /** + * Properties of a CreateTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagKeyRequest + * @property {google.cloud.resourcemanager.v3.ITagKey|null} [tagKey] CreateTagKeyRequest tagKey + * @property {boolean|null} [validateOnly] CreateTagKeyRequest validateOnly + */ + + /** + * Constructs a new CreateTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagKeyRequest. + * @implements ICreateTagKeyRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest=} [properties] Properties to set + */ + function CreateTagKeyRequest(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]]; + } + + /** + * CreateTagKeyRequest tagKey. + * @member {google.cloud.resourcemanager.v3.ITagKey|null|undefined} tagKey + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @instance + */ + CreateTagKeyRequest.prototype.tagKey = null; + + /** + * CreateTagKeyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @instance + */ + CreateTagKeyRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTagKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyRequest} CreateTagKeyRequest instance + */ + CreateTagKeyRequest.create = function create(properties) { + return new CreateTagKeyRequest(properties); + }; + + /** + * Encodes the specified CreateTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest} message CreateTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + $root.google.cloud.resourcemanager.v3.TagKey.encode(message.tagKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyRequest} message CreateTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyRequest} CreateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyRequest} CreateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagKeyRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagKey != null && message.hasOwnProperty("tagKey")) { + var error = $root.google.cloud.resourcemanager.v3.TagKey.verify(message.tagKey); + if (error) + return "tagKey." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyRequest} CreateTagKeyRequest + */ + CreateTagKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagKeyRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateTagKeyRequest(); + if (object.tagKey != null) { + if (typeof object.tagKey !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateTagKeyRequest.tagKey: object expected"); + message.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.fromObject(object.tagKey); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTagKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagKeyRequest} message CreateTagKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagKey = null; + object.validateOnly = false; + } + if (message.tagKey != null && message.hasOwnProperty("tagKey")) + object.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.toObject(message.tagKey, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTagKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTagKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagKeyRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagKeyRequest"; + }; + + return CreateTagKeyRequest; + })(); + + v3.CreateTagKeyMetadata = (function() { + + /** + * Properties of a CreateTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagKeyMetadata + */ + + /** + * Constructs a new CreateTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagKeyMetadata. + * @implements ICreateTagKeyMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyMetadata=} [properties] Properties to set + */ + function CreateTagKeyMetadata(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 CreateTagKeyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyMetadata} CreateTagKeyMetadata instance + */ + CreateTagKeyMetadata.create = function create(properties) { + return new CreateTagKeyMetadata(properties); + }; + + /** + * Encodes the specified CreateTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyMetadata} message CreateTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagKeyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagKeyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagKeyMetadata} message CreateTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagKeyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagKeyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyMetadata} CreateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagKeyMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagKeyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagKeyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyMetadata} CreateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagKeyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagKeyMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagKeyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagKeyMetadata} CreateTagKeyMetadata + */ + CreateTagKeyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.CreateTagKeyMetadata(); + }; + + /** + * Creates a plain object from a CreateTagKeyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagKeyMetadata} message CreateTagKeyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagKeyMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateTagKeyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTagKeyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagKeyMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagKeyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagKeyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagKeyMetadata"; + }; + + return CreateTagKeyMetadata; + })(); + + v3.UpdateTagKeyRequest = (function() { + + /** + * Properties of an UpdateTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateTagKeyRequest + * @property {google.cloud.resourcemanager.v3.ITagKey|null} [tagKey] UpdateTagKeyRequest tagKey + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTagKeyRequest updateMask + * @property {boolean|null} [validateOnly] UpdateTagKeyRequest validateOnly + */ + + /** + * Constructs a new UpdateTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateTagKeyRequest. + * @implements IUpdateTagKeyRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest=} [properties] Properties to set + */ + function UpdateTagKeyRequest(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]]; + } + + /** + * UpdateTagKeyRequest tagKey. + * @member {google.cloud.resourcemanager.v3.ITagKey|null|undefined} tagKey + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @instance + */ + UpdateTagKeyRequest.prototype.tagKey = null; + + /** + * UpdateTagKeyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @instance + */ + UpdateTagKeyRequest.prototype.updateMask = null; + + /** + * UpdateTagKeyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @instance + */ + UpdateTagKeyRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateTagKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyRequest} UpdateTagKeyRequest instance + */ + UpdateTagKeyRequest.create = function create(properties) { + return new UpdateTagKeyRequest(properties); + }; + + /** + * Encodes the specified UpdateTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest} message UpdateTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + $root.google.cloud.resourcemanager.v3.TagKey.encode(message.tagKey, 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(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyRequest} message UpdateTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTagKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyRequest} UpdateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateTagKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTagKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyRequest} UpdateTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTagKeyRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTagKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagKey != null && message.hasOwnProperty("tagKey")) { + var error = $root.google.cloud.resourcemanager.v3.TagKey.verify(message.tagKey); + if (error) + return "tagKey." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyRequest} UpdateTagKeyRequest + */ + UpdateTagKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UpdateTagKeyRequest(); + if (object.tagKey != null) { + if (typeof object.tagKey !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateTagKeyRequest.tagKey: object expected"); + message.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.fromObject(object.tagKey); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateTagKeyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateTagKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.UpdateTagKeyRequest} message UpdateTagKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTagKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagKey = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.tagKey != null && message.hasOwnProperty("tagKey")) + object.tagKey = $root.google.cloud.resourcemanager.v3.TagKey.toObject(message.tagKey, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateTagKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTagKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTagKeyRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTagKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateTagKeyRequest"; + }; + + return UpdateTagKeyRequest; + })(); + + v3.UpdateTagKeyMetadata = (function() { + + /** + * Properties of an UpdateTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateTagKeyMetadata + */ + + /** + * Constructs a new UpdateTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateTagKeyMetadata. + * @implements IUpdateTagKeyMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata=} [properties] Properties to set + */ + function UpdateTagKeyMetadata(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 UpdateTagKeyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} UpdateTagKeyMetadata instance + */ + UpdateTagKeyMetadata.create = function create(properties) { + return new UpdateTagKeyMetadata(properties); + }; + + /** + * Encodes the specified UpdateTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata} message UpdateTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagKeyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata} message UpdateTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagKeyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTagKeyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} UpdateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagKeyMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTagKeyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} UpdateTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagKeyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTagKeyMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTagKeyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} UpdateTagKeyMetadata + */ + UpdateTagKeyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata(); + }; + + /** + * Creates a plain object from an UpdateTagKeyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} message UpdateTagKeyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTagKeyMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateTagKeyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateTagKeyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTagKeyMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTagKeyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateTagKeyMetadata"; + }; + + return UpdateTagKeyMetadata; + })(); + + v3.DeleteTagKeyRequest = (function() { + + /** + * Properties of a DeleteTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagKeyRequest + * @property {string|null} [name] DeleteTagKeyRequest name + * @property {boolean|null} [validateOnly] DeleteTagKeyRequest validateOnly + * @property {string|null} [etag] DeleteTagKeyRequest etag + */ + + /** + * Constructs a new DeleteTagKeyRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagKeyRequest. + * @implements IDeleteTagKeyRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest=} [properties] Properties to set + */ + function DeleteTagKeyRequest(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]]; + } + + /** + * DeleteTagKeyRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @instance + */ + DeleteTagKeyRequest.prototype.name = ""; + + /** + * DeleteTagKeyRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @instance + */ + DeleteTagKeyRequest.prototype.validateOnly = false; + + /** + * DeleteTagKeyRequest etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @instance + */ + DeleteTagKeyRequest.prototype.etag = ""; + + /** + * Creates a new DeleteTagKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyRequest} DeleteTagKeyRequest instance + */ + DeleteTagKeyRequest.create = function create(properties) { + return new DeleteTagKeyRequest(properties); + }; + + /** + * Encodes the specified DeleteTagKeyRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest} message DeleteTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagKeyRequest.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteTagKeyRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyRequest} message DeleteTagKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyRequest} DeleteTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTagKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyRequest} DeleteTagKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagKeyRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagKeyRequest.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.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteTagKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyRequest} DeleteTagKeyRequest + */ + DeleteTagKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.DeleteTagKeyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteTagKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagKeyRequest} message DeleteTagKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteTagKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTagKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagKeyRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagKeyRequest"; + }; + + return DeleteTagKeyRequest; + })(); + + v3.DeleteTagKeyMetadata = (function() { + + /** + * Properties of a DeleteTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagKeyMetadata + */ + + /** + * Constructs a new DeleteTagKeyMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagKeyMetadata. + * @implements IDeleteTagKeyMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata=} [properties] Properties to set + */ + function DeleteTagKeyMetadata(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 DeleteTagKeyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} DeleteTagKeyMetadata instance + */ + DeleteTagKeyMetadata.create = function create(properties) { + return new DeleteTagKeyMetadata(properties); + }; + + /** + * Encodes the specified DeleteTagKeyMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata} message DeleteTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagKeyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteTagKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata} message DeleteTagKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagKeyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagKeyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} DeleteTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagKeyMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTagKeyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} DeleteTagKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagKeyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagKeyMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagKeyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteTagKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} DeleteTagKeyMetadata + */ + DeleteTagKeyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata(); + }; + + /** + * Creates a plain object from a DeleteTagKeyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} message DeleteTagKeyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagKeyMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteTagKeyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteTagKeyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagKeyMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagKeyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagKeyMetadata"; + }; + + return DeleteTagKeyMetadata; + })(); + + v3.TagValues = (function() { + + /** + * Constructs a new TagValues service. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagValues + * @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 TagValues(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TagValues.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TagValues; + + /** + * Creates new TagValues service using the specified rpc implementation. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagValues + * @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 {TagValues} RPC service. Useful where requests and/or responses are streamed. + */ + TagValues.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|listTagValues}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef ListTagValuesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.ListTagValuesResponse} [response] ListTagValuesResponse + */ + + /** + * Calls ListTagValues. + * @function listTagValues + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest} request ListTagValuesRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.ListTagValuesCallback} callback Node-style callback called with the error, if any, and ListTagValuesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.listTagValues = function listTagValues(request, callback) { + return this.rpcCall(listTagValues, $root.google.cloud.resourcemanager.v3.ListTagValuesRequest, $root.google.cloud.resourcemanager.v3.ListTagValuesResponse, request, callback); + }, "name", { value: "ListTagValues" }); + + /** + * Calls ListTagValues. + * @function listTagValues + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest} request ListTagValuesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|getTagValue}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef GetTagValueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.resourcemanager.v3.TagValue} [response] TagValue + */ + + /** + * Calls GetTagValue. + * @function getTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest} request GetTagValueRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.GetTagValueCallback} callback Node-style callback called with the error, if any, and TagValue + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.getTagValue = function getTagValue(request, callback) { + return this.rpcCall(getTagValue, $root.google.cloud.resourcemanager.v3.GetTagValueRequest, $root.google.cloud.resourcemanager.v3.TagValue, request, callback); + }, "name", { value: "GetTagValue" }); + + /** + * Calls GetTagValue. + * @function getTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest} request GetTagValueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|createTagValue}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef CreateTagValueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTagValue. + * @function createTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest} request CreateTagValueRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.CreateTagValueCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.createTagValue = function createTagValue(request, callback) { + return this.rpcCall(createTagValue, $root.google.cloud.resourcemanager.v3.CreateTagValueRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTagValue" }); + + /** + * Calls CreateTagValue. + * @function createTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest} request CreateTagValueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|updateTagValue}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef UpdateTagValueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTagValue. + * @function updateTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest} request UpdateTagValueRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.UpdateTagValueCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.updateTagValue = function updateTagValue(request, callback) { + return this.rpcCall(updateTagValue, $root.google.cloud.resourcemanager.v3.UpdateTagValueRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTagValue" }); + + /** + * Calls UpdateTagValue. + * @function updateTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest} request UpdateTagValueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|deleteTagValue}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef DeleteTagValueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTagValue. + * @function deleteTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest} request DeleteTagValueRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.DeleteTagValueCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.deleteTagValue = function deleteTagValue(request, callback) { + return this.rpcCall(deleteTagValue, $root.google.cloud.resourcemanager.v3.DeleteTagValueRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTagValue" }); + + /** + * Calls DeleteTagValue. + * @function deleteTagValue + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest} request DeleteTagValueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|getIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|setIamPolicy}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.resourcemanager.v3.TagValues|testIamPermissions}. + * @memberof google.cloud.resourcemanager.v3.TagValues + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.resourcemanager.v3.TagValues.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TagValues.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.resourcemanager.v3.TagValues + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TagValues; + })(); + + v3.TagValue = (function() { + + /** + * Properties of a TagValue. + * @memberof google.cloud.resourcemanager.v3 + * @interface ITagValue + * @property {string|null} [name] TagValue name + * @property {string|null} [parent] TagValue parent + * @property {string|null} [shortName] TagValue shortName + * @property {string|null} [namespacedName] TagValue namespacedName + * @property {string|null} [description] TagValue description + * @property {google.protobuf.ITimestamp|null} [createTime] TagValue createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TagValue updateTime + * @property {string|null} [etag] TagValue etag + */ + + /** + * Constructs a new TagValue. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a TagValue. + * @implements ITagValue + * @constructor + * @param {google.cloud.resourcemanager.v3.ITagValue=} [properties] Properties to set + */ + function TagValue(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]]; + } + + /** + * TagValue name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.name = ""; + + /** + * TagValue parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.parent = ""; + + /** + * TagValue shortName. + * @member {string} shortName + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.shortName = ""; + + /** + * TagValue namespacedName. + * @member {string} namespacedName + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.namespacedName = ""; + + /** + * TagValue description. + * @member {string} description + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.description = ""; + + /** + * TagValue createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.createTime = null; + + /** + * TagValue updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.updateTime = null; + + /** + * TagValue etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + */ + TagValue.prototype.etag = ""; + + /** + * Creates a new TagValue instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {google.cloud.resourcemanager.v3.ITagValue=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.TagValue} TagValue instance + */ + TagValue.create = function create(properties) { + return new TagValue(properties); + }; + + /** + * Encodes the specified TagValue message. Does not implicitly {@link google.cloud.resourcemanager.v3.TagValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {google.cloud.resourcemanager.v3.ITagValue} message TagValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValue.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.namespacedName != null && Object.hasOwnProperty.call(message, "namespacedName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespacedName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.etag); + return writer; + }; + + /** + * Encodes the specified TagValue message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.TagValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {google.cloud.resourcemanager.v3.ITagValue} message TagValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.TagValue} TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.TagValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.namespacedName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.TagValue} TagValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagValue message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagValue.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.namespacedName != null && message.hasOwnProperty("namespacedName")) + if (!$util.isString(message.namespacedName)) + return "namespacedName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a TagValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.TagValue} TagValue + */ + TagValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.TagValue) + return object; + var message = new $root.google.cloud.resourcemanager.v3.TagValue(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.namespacedName != null) + message.namespacedName = String(object.namespacedName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.TagValue.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.TagValue.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a TagValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {google.cloud.resourcemanager.v3.TagValue} message TagValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.shortName = ""; + object.namespacedName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.namespacedName != null && message.hasOwnProperty("namespacedName")) + object.namespacedName = message.namespacedName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this TagValue to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.TagValue + * @instance + * @returns {Object.} JSON object + */ + TagValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagValue + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.TagValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.TagValue"; + }; + + return TagValue; + })(); + + v3.ListTagValuesRequest = (function() { + + /** + * Properties of a ListTagValuesRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagValuesRequest + * @property {string|null} [parent] ListTagValuesRequest parent + * @property {number|null} [pageSize] ListTagValuesRequest pageSize + * @property {string|null} [pageToken] ListTagValuesRequest pageToken + */ + + /** + * Constructs a new ListTagValuesRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagValuesRequest. + * @implements IListTagValuesRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest=} [properties] Properties to set + */ + function ListTagValuesRequest(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]]; + } + + /** + * ListTagValuesRequest parent. + * @member {string} parent + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @instance + */ + ListTagValuesRequest.prototype.parent = ""; + + /** + * ListTagValuesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @instance + */ + ListTagValuesRequest.prototype.pageSize = 0; + + /** + * ListTagValuesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @instance + */ + ListTagValuesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTagValuesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagValuesRequest} ListTagValuesRequest instance + */ + ListTagValuesRequest.create = function create(properties) { + return new ListTagValuesRequest(properties); + }; + + /** + * Encodes the specified ListTagValuesRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest} message ListTagValuesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagValuesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTagValuesRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesRequest} message ListTagValuesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagValuesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagValuesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagValuesRequest} ListTagValuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagValuesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagValuesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagValuesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagValuesRequest} ListTagValuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagValuesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagValuesRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagValuesRequest.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.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 ListTagValuesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagValuesRequest} ListTagValuesRequest + */ + ListTagValuesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagValuesRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagValuesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListTagValuesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {google.cloud.resourcemanager.v3.ListTagValuesRequest} message ListTagValuesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagValuesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListTagValuesRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTagValuesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagValuesRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagValuesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagValuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagValuesRequest"; + }; + + return ListTagValuesRequest; + })(); + + v3.ListTagValuesResponse = (function() { + + /** + * Properties of a ListTagValuesResponse. + * @memberof google.cloud.resourcemanager.v3 + * @interface IListTagValuesResponse + * @property {Array.|null} [tagValues] ListTagValuesResponse tagValues + * @property {string|null} [nextPageToken] ListTagValuesResponse nextPageToken + */ + + /** + * Constructs a new ListTagValuesResponse. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a ListTagValuesResponse. + * @implements IListTagValuesResponse + * @constructor + * @param {google.cloud.resourcemanager.v3.IListTagValuesResponse=} [properties] Properties to set + */ + function ListTagValuesResponse(properties) { + this.tagValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTagValuesResponse tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @instance + */ + ListTagValuesResponse.prototype.tagValues = $util.emptyArray; + + /** + * ListTagValuesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @instance + */ + ListTagValuesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTagValuesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesResponse=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.ListTagValuesResponse} ListTagValuesResponse instance + */ + ListTagValuesResponse.create = function create(properties) { + return new ListTagValuesResponse(properties); + }; + + /** + * Encodes the specified ListTagValuesResponse message. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesResponse} message ListTagValuesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagValuesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + $root.google.cloud.resourcemanager.v3.TagValue.encode(message.tagValues[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 ListTagValuesResponse message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.ListTagValuesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {google.cloud.resourcemanager.v3.IListTagValuesResponse} message ListTagValuesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTagValuesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTagValuesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.ListTagValuesResponse} ListTagValuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagValuesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.ListTagValuesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push($root.google.cloud.resourcemanager.v3.TagValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTagValuesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.ListTagValuesResponse} ListTagValuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTagValuesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTagValuesResponse message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTagValuesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) { + var error = $root.google.cloud.resourcemanager.v3.TagValue.verify(message.tagValues[i]); + if (error) + return "tagValues." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTagValuesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.ListTagValuesResponse} ListTagValuesResponse + */ + ListTagValuesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.ListTagValuesResponse) + return object; + var message = new $root.google.cloud.resourcemanager.v3.ListTagValuesResponse(); + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.resourcemanager.v3.ListTagValuesResponse.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) { + if (typeof object.tagValues[i] !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.ListTagValuesResponse.tagValues: object expected"); + message.tagValues[i] = $root.google.cloud.resourcemanager.v3.TagValue.fromObject(object.tagValues[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTagValuesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {google.cloud.resourcemanager.v3.ListTagValuesResponse} message ListTagValuesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTagValuesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tagValues = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = $root.google.cloud.resourcemanager.v3.TagValue.toObject(message.tagValues[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTagValuesResponse to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTagValuesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTagValuesResponse + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.ListTagValuesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTagValuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.ListTagValuesResponse"; + }; + + return ListTagValuesResponse; + })(); + + v3.GetTagValueRequest = (function() { + + /** + * Properties of a GetTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IGetTagValueRequest + * @property {string|null} [name] GetTagValueRequest name + */ + + /** + * Constructs a new GetTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a GetTagValueRequest. + * @implements IGetTagValueRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest=} [properties] Properties to set + */ + function GetTagValueRequest(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]]; + } + + /** + * GetTagValueRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @instance + */ + GetTagValueRequest.prototype.name = ""; + + /** + * Creates a new GetTagValueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.GetTagValueRequest} GetTagValueRequest instance + */ + GetTagValueRequest.create = function create(properties) { + return new GetTagValueRequest(properties); + }; + + /** + * Encodes the specified GetTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagValueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest} message GetTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTagValueRequest.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 GetTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.GetTagValueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IGetTagValueRequest} message GetTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTagValueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTagValueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.GetTagValueRequest} GetTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTagValueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.GetTagValueRequest(); + 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 GetTagValueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.GetTagValueRequest} GetTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTagValueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTagValueRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTagValueRequest.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 GetTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.GetTagValueRequest} GetTagValueRequest + */ + GetTagValueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.GetTagValueRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.GetTagValueRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTagValueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.GetTagValueRequest} message GetTagValueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTagValueRequest.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 GetTagValueRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @instance + * @returns {Object.} JSON object + */ + GetTagValueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTagValueRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.GetTagValueRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTagValueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.GetTagValueRequest"; + }; + + return GetTagValueRequest; + })(); + + v3.CreateTagValueRequest = (function() { + + /** + * Properties of a CreateTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagValueRequest + * @property {google.cloud.resourcemanager.v3.ITagValue|null} [tagValue] CreateTagValueRequest tagValue + * @property {boolean|null} [validateOnly] CreateTagValueRequest validateOnly + */ + + /** + * Constructs a new CreateTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagValueRequest. + * @implements ICreateTagValueRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest=} [properties] Properties to set + */ + function CreateTagValueRequest(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]]; + } + + /** + * CreateTagValueRequest tagValue. + * @member {google.cloud.resourcemanager.v3.ITagValue|null|undefined} tagValue + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @instance + */ + CreateTagValueRequest.prototype.tagValue = null; + + /** + * CreateTagValueRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @instance + */ + CreateTagValueRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateTagValueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagValueRequest} CreateTagValueRequest instance + */ + CreateTagValueRequest.create = function create(properties) { + return new CreateTagValueRequest(properties); + }; + + /** + * Encodes the specified CreateTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest} message CreateTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagValueRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + $root.google.cloud.resourcemanager.v3.TagValue.encode(message.tagValue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueRequest} message CreateTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagValueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagValueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagValueRequest} CreateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagValueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagValueRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagValueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagValueRequest} CreateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagValueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagValueRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagValueRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagValue != null && message.hasOwnProperty("tagValue")) { + var error = $root.google.cloud.resourcemanager.v3.TagValue.verify(message.tagValue); + if (error) + return "tagValue." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagValueRequest} CreateTagValueRequest + */ + CreateTagValueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagValueRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.CreateTagValueRequest(); + if (object.tagValue != null) { + if (typeof object.tagValue !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.CreateTagValueRequest.tagValue: object expected"); + message.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.fromObject(object.tagValue); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateTagValueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagValueRequest} message CreateTagValueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagValueRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagValue = null; + object.validateOnly = false; + } + if (message.tagValue != null && message.hasOwnProperty("tagValue")) + object.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.toObject(message.tagValue, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateTagValueRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTagValueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagValueRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagValueRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagValueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagValueRequest"; + }; + + return CreateTagValueRequest; + })(); + + v3.CreateTagValueMetadata = (function() { + + /** + * Properties of a CreateTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface ICreateTagValueMetadata + */ + + /** + * Constructs a new CreateTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a CreateTagValueMetadata. + * @implements ICreateTagValueMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.ICreateTagValueMetadata=} [properties] Properties to set + */ + function CreateTagValueMetadata(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 CreateTagValueMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.CreateTagValueMetadata} CreateTagValueMetadata instance + */ + CreateTagValueMetadata.create = function create(properties) { + return new CreateTagValueMetadata(properties); + }; + + /** + * Encodes the specified CreateTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueMetadata} message CreateTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagValueMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.CreateTagValueMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.ICreateTagValueMetadata} message CreateTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTagValueMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTagValueMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.CreateTagValueMetadata} CreateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagValueMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.CreateTagValueMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTagValueMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.CreateTagValueMetadata} CreateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTagValueMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTagValueMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTagValueMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.CreateTagValueMetadata} CreateTagValueMetadata + */ + CreateTagValueMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.CreateTagValueMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.CreateTagValueMetadata(); + }; + + /** + * Creates a plain object from a CreateTagValueMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.CreateTagValueMetadata} message CreateTagValueMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTagValueMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateTagValueMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTagValueMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTagValueMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.CreateTagValueMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTagValueMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.CreateTagValueMetadata"; + }; + + return CreateTagValueMetadata; + })(); + + v3.UpdateTagValueRequest = (function() { + + /** + * Properties of an UpdateTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateTagValueRequest + * @property {google.cloud.resourcemanager.v3.ITagValue|null} [tagValue] UpdateTagValueRequest tagValue + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTagValueRequest updateMask + * @property {boolean|null} [validateOnly] UpdateTagValueRequest validateOnly + */ + + /** + * Constructs a new UpdateTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateTagValueRequest. + * @implements IUpdateTagValueRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest=} [properties] Properties to set + */ + function UpdateTagValueRequest(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]]; + } + + /** + * UpdateTagValueRequest tagValue. + * @member {google.cloud.resourcemanager.v3.ITagValue|null|undefined} tagValue + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @instance + */ + UpdateTagValueRequest.prototype.tagValue = null; + + /** + * UpdateTagValueRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @instance + */ + UpdateTagValueRequest.prototype.updateMask = null; + + /** + * UpdateTagValueRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @instance + */ + UpdateTagValueRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateTagValueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueRequest} UpdateTagValueRequest instance + */ + UpdateTagValueRequest.create = function create(properties) { + return new UpdateTagValueRequest(properties); + }; + + /** + * Encodes the specified UpdateTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest} message UpdateTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagValueRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + $root.google.cloud.resourcemanager.v3.TagValue.encode(message.tagValue, 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(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueRequest} message UpdateTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagValueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTagValueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueRequest} UpdateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagValueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateTagValueRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTagValueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueRequest} UpdateTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagValueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTagValueRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTagValueRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagValue != null && message.hasOwnProperty("tagValue")) { + var error = $root.google.cloud.resourcemanager.v3.TagValue.verify(message.tagValue); + if (error) + return "tagValue." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueRequest} UpdateTagValueRequest + */ + UpdateTagValueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateTagValueRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.UpdateTagValueRequest(); + if (object.tagValue != null) { + if (typeof object.tagValue !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateTagValueRequest.tagValue: object expected"); + message.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.fromObject(object.tagValue); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.resourcemanager.v3.UpdateTagValueRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateTagValueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.UpdateTagValueRequest} message UpdateTagValueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTagValueRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagValue = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.tagValue != null && message.hasOwnProperty("tagValue")) + object.tagValue = $root.google.cloud.resourcemanager.v3.TagValue.toObject(message.tagValue, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateTagValueRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTagValueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTagValueRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTagValueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateTagValueRequest"; + }; + + return UpdateTagValueRequest; + })(); + + v3.UpdateTagValueMetadata = (function() { + + /** + * Properties of an UpdateTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IUpdateTagValueMetadata + */ + + /** + * Constructs a new UpdateTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents an UpdateTagValueMetadata. + * @implements IUpdateTagValueMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueMetadata=} [properties] Properties to set + */ + function UpdateTagValueMetadata(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 UpdateTagValueMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueMetadata} UpdateTagValueMetadata instance + */ + UpdateTagValueMetadata.create = function create(properties) { + return new UpdateTagValueMetadata(properties); + }; + + /** + * Encodes the specified UpdateTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueMetadata} message UpdateTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagValueMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.UpdateTagValueMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IUpdateTagValueMetadata} message UpdateTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTagValueMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTagValueMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueMetadata} UpdateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagValueMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.UpdateTagValueMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTagValueMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueMetadata} UpdateTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTagValueMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTagValueMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTagValueMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpdateTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.UpdateTagValueMetadata} UpdateTagValueMetadata + */ + UpdateTagValueMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.UpdateTagValueMetadata(); + }; + + /** + * Creates a plain object from an UpdateTagValueMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.UpdateTagValueMetadata} message UpdateTagValueMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTagValueMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateTagValueMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateTagValueMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTagValueMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.UpdateTagValueMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTagValueMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.UpdateTagValueMetadata"; + }; + + return UpdateTagValueMetadata; + })(); + + v3.DeleteTagValueRequest = (function() { + + /** + * Properties of a DeleteTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagValueRequest + * @property {string|null} [name] DeleteTagValueRequest name + * @property {boolean|null} [validateOnly] DeleteTagValueRequest validateOnly + * @property {string|null} [etag] DeleteTagValueRequest etag + */ + + /** + * Constructs a new DeleteTagValueRequest. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagValueRequest. + * @implements IDeleteTagValueRequest + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest=} [properties] Properties to set + */ + function DeleteTagValueRequest(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]]; + } + + /** + * DeleteTagValueRequest name. + * @member {string} name + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @instance + */ + DeleteTagValueRequest.prototype.name = ""; + + /** + * DeleteTagValueRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @instance + */ + DeleteTagValueRequest.prototype.validateOnly = false; + + /** + * DeleteTagValueRequest etag. + * @member {string} etag + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @instance + */ + DeleteTagValueRequest.prototype.etag = ""; + + /** + * Creates a new DeleteTagValueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueRequest} DeleteTagValueRequest instance + */ + DeleteTagValueRequest.create = function create(properties) { + return new DeleteTagValueRequest(properties); + }; + + /** + * Encodes the specified DeleteTagValueRequest message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest} message DeleteTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagValueRequest.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteTagValueRequest message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueRequest} message DeleteTagValueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagValueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagValueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueRequest} DeleteTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagValueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagValueRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTagValueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueRequest} DeleteTagValueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagValueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagValueRequest message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagValueRequest.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.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteTagValueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueRequest} DeleteTagValueRequest + */ + DeleteTagValueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagValueRequest) + return object; + var message = new $root.google.cloud.resourcemanager.v3.DeleteTagValueRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteTagValueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagValueRequest} message DeleteTagValueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagValueRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteTagValueRequest to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTagValueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagValueRequest + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagValueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagValueRequest"; + }; + + return DeleteTagValueRequest; + })(); + + v3.DeleteTagValueMetadata = (function() { + + /** + * Properties of a DeleteTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @interface IDeleteTagValueMetadata + */ + + /** + * Constructs a new DeleteTagValueMetadata. + * @memberof google.cloud.resourcemanager.v3 + * @classdesc Represents a DeleteTagValueMetadata. + * @implements IDeleteTagValueMetadata + * @constructor + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueMetadata=} [properties] Properties to set + */ + function DeleteTagValueMetadata(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 DeleteTagValueMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueMetadata=} [properties] Properties to set + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueMetadata} DeleteTagValueMetadata instance + */ + DeleteTagValueMetadata.create = function create(properties) { + return new DeleteTagValueMetadata(properties); + }; + + /** + * Encodes the specified DeleteTagValueMetadata message. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueMetadata} message DeleteTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagValueMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteTagValueMetadata message, length delimited. Does not implicitly {@link google.cloud.resourcemanager.v3.DeleteTagValueMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.IDeleteTagValueMetadata} message DeleteTagValueMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTagValueMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTagValueMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueMetadata} DeleteTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagValueMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.resourcemanager.v3.DeleteTagValueMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTagValueMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueMetadata} DeleteTagValueMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTagValueMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTagValueMetadata message. + * @function verify + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTagValueMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteTagValueMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.resourcemanager.v3.DeleteTagValueMetadata} DeleteTagValueMetadata + */ + DeleteTagValueMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + return object; + return new $root.google.cloud.resourcemanager.v3.DeleteTagValueMetadata(); + }; + + /** + * Creates a plain object from a DeleteTagValueMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {google.cloud.resourcemanager.v3.DeleteTagValueMetadata} message DeleteTagValueMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTagValueMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteTagValueMetadata to JSON. + * @function toJSON + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteTagValueMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTagValueMetadata + * @function getTypeUrl + * @memberof google.cloud.resourcemanager.v3.DeleteTagValueMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTagValueMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.resourcemanager.v3.DeleteTagValueMetadata"; + }; + + return DeleteTagValueMetadata; + })(); + + return v3; + })(); + + return resourcemanager; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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.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; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(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]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + 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 a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(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]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(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]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(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]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-resourcemanager/protos/protos.json b/packages/google-cloud-resourcemanager/protos/protos.json new file mode 100644 index 000000000000..7c8da45f9aea --- /dev/null +++ b/packages/google-cloud-resourcemanager/protos/protos.json @@ -0,0 +1,4047 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "resourcemanager": { + "nested": { + "v3": { + "options": { + "csharp_namespace": "Google.Cloud.ResourceManager.V3", + "go_package": "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager", + "java_multiple_files": true, + "java_outer_classname": "TagValuesProto", + "java_package": "com.google.cloud.resourcemanager.v3", + "php_namespace": "Google\\Cloud\\ResourceManager\\V3", + "ruby_package": "Google::Cloud::ResourceManager::V3" + }, + "nested": { + "Folders": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetFolder": { + "requestType": "GetFolderRequest", + "responseType": "Folder", + "options": { + "(google.api.http).get": "/v3/{name=folders/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=folders/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFolders": { + "requestType": "ListFoldersRequest", + "responseType": "ListFoldersResponse", + "options": { + "(google.api.http).get": "/v3/folders", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/folders" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchFolders": { + "requestType": "SearchFoldersRequest", + "responseType": "SearchFoldersResponse", + "options": { + "(google.api.http).get": "/v3/folders:search", + "(google.api.method_signature)": "query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/folders:search" + } + }, + { + "(google.api.method_signature)": "query" + } + ] + }, + "CreateFolder": { + "requestType": "CreateFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/folders", + "(google.api.http).body": "folder", + "(google.api.method_signature)": "folder", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "CreateFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/folders", + "body": "folder" + } + }, + { + "(google.api.method_signature)": "folder" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "CreateFolderMetadata" + } + } + ] + }, + "UpdateFolder": { + "requestType": "UpdateFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3/{folder.name=folders/*}", + "(google.api.http).body": "folder", + "(google.api.method_signature)": "folder,update_mask", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "UpdateFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{folder.name=folders/*}", + "body": "folder" + } + }, + { + "(google.api.method_signature)": "folder,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "UpdateFolderMetadata" + } + } + ] + }, + "MoveFolder": { + "requestType": "MoveFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=folders/*}:move", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,destination_parent", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "MoveFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=folders/*}:move", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,destination_parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "MoveFolderMetadata" + } + } + ] + }, + "DeleteFolder": { + "requestType": "DeleteFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=folders/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "DeleteFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=folders/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "DeleteFolderMetadata" + } + } + ] + }, + "UndeleteFolder": { + "requestType": "UndeleteFolderRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=folders/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Folder", + "(google.longrunning.operation_info).metadata_type": "UndeleteFolderMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=folders/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Folder", + "metadata_type": "UndeleteFolderMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=folders/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=folders/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=folders/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=folders/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v3/{resource=folders/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=folders/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + } + } + }, + "Folder": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/Folder", + "(google.api.resource).pattern": "folders/{folder}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2 + } + } + } + }, + "GetFolderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Folder" + } + } + } + }, + "ListFoldersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showDeleted": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListFoldersResponse": { + "fields": { + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchFoldersRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchFoldersResponse": { + "fields": { + "folders": { + "rule": "repeated", + "type": "Folder", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateFolderRequest": { + "fields": { + "folder": { + "type": "Folder", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateFolderMetadata": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + } + } + }, + "UpdateFolderRequest": { + "fields": { + "folder": { + "type": "Folder", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateFolderMetadata": { + "fields": {} + }, + "MoveFolderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Folder" + } + }, + "destinationParent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + } + } + }, + "MoveFolderMetadata": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "sourceParent": { + "type": "string", + "id": 2 + }, + "destinationParent": { + "type": "string", + "id": 3 + } + } + }, + "DeleteFolderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Folder" + } + } + } + }, + "DeleteFolderMetadata": { + "fields": {} + }, + "UndeleteFolderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Folder" + } + } + } + }, + "UndeleteFolderMetadata": { + "fields": {} + }, + "Organizations": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetOrganization": { + "requestType": "GetOrganizationRequest", + "responseType": "Organization", + "options": { + "(google.api.http).get": "/v3/{name=organizations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=organizations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchOrganizations": { + "requestType": "SearchOrganizationsRequest", + "responseType": "SearchOrganizationsResponse", + "options": { + "(google.api.http).get": "/v3/organizations:search", + "(google.api.method_signature)": "query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/organizations:search" + } + }, + { + "(google.api.method_signature)": "query" + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=organizations/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=organizations/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=organizations/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=organizations/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v3/{resource=organizations/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=organizations/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + } + } + }, + "Organization": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/Organization", + "(google.api.resource).pattern": "organizations/{organization}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "owner": { + "oneof": [ + "directoryCustomerId" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "directoryCustomerId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2 + } + } + } + }, + "GetOrganizationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Organization" + } + } + } + }, + "SearchOrganizationsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchOrganizationsResponse": { + "fields": { + "organizations": { + "rule": "repeated", + "type": "Organization", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteOrganizationMetadata": { + "fields": {} + }, + "UndeleteOrganizationMetadata": { + "fields": {} + }, + "Projects": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetProject": { + "requestType": "GetProjectRequest", + "responseType": "Project", + "options": { + "(google.api.http).get": "/v3/{name=projects/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=projects/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListProjects": { + "requestType": "ListProjectsRequest", + "responseType": "ListProjectsResponse", + "options": { + "(google.api.http).get": "/v3/projects", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/projects" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchProjects": { + "requestType": "SearchProjectsRequest", + "responseType": "SearchProjectsResponse", + "options": { + "(google.api.http).get": "/v3/projects:search", + "(google.api.method_signature)": "query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/projects:search" + } + }, + { + "(google.api.method_signature)": "query" + } + ] + }, + "CreateProject": { + "requestType": "CreateProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/projects", + "(google.api.http).body": "project", + "(google.api.method_signature)": "project", + "(google.longrunning.operation_info).response_type": "Project", + "(google.longrunning.operation_info).metadata_type": "CreateProjectMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/projects", + "body": "project" + } + }, + { + "(google.api.method_signature)": "project" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Project", + "metadata_type": "CreateProjectMetadata" + } + } + ] + }, + "UpdateProject": { + "requestType": "UpdateProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3/{project.name=projects/*}", + "(google.api.http).body": "project", + "(google.api.method_signature)": "project,update_mask", + "(google.longrunning.operation_info).response_type": "Project", + "(google.longrunning.operation_info).metadata_type": "UpdateProjectMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{project.name=projects/*}", + "body": "project" + } + }, + { + "(google.api.method_signature)": "project,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Project", + "metadata_type": "UpdateProjectMetadata" + } + } + ] + }, + "MoveProject": { + "requestType": "MoveProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*}:move", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name, destination_parent", + "(google.longrunning.operation_info).response_type": "Project", + "(google.longrunning.operation_info).metadata_type": "MoveProjectMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}:move", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name, destination_parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Project", + "metadata_type": "MoveProjectMetadata" + } + } + ] + }, + "DeleteProject": { + "requestType": "DeleteProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Project", + "(google.longrunning.operation_info).metadata_type": "DeleteProjectMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=projects/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Project", + "metadata_type": "DeleteProjectMetadata" + } + } + ] + }, + "UndeleteProject": { + "requestType": "UndeleteProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{name=projects/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Project", + "(google.longrunning.operation_info).metadata_type": "UndeleteProjectMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{name=projects/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Project", + "metadata_type": "UndeleteProjectMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=projects/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=projects/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=projects/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource, policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=projects/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource, policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v3/{resource=projects/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource, permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=projects/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource, permissions" + } + ] + } + } + }, + "Project": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/Project", + "(google.api.resource).pattern": "projects/{project}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2 + } + } + } + }, + "GetProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + } + } + }, + "ListProjectsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showDeleted": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListProjectsResponse": { + "fields": { + "projects": { + "rule": "repeated", + "type": "Project", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchProjectsRequest": { + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchProjectsResponse": { + "fields": { + "projects": { + "rule": "repeated", + "type": "Project", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateProjectRequest": { + "fields": { + "project": { + "type": "Project", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateProjectMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "gettable": { + "type": "bool", + "id": 2 + }, + "ready": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateProjectRequest": { + "fields": { + "project": { + "type": "Project", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateProjectMetadata": { + "fields": {} + }, + "MoveProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "destinationParent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + } + } + }, + "MoveProjectMetadata": { + "fields": {} + }, + "DeleteProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + } + } + }, + "DeleteProjectMetadata": { + "fields": {} + }, + "UndeleteProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + } + } + }, + "UndeleteProjectMetadata": { + "fields": {} + }, + "TagBindings": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListTagBindings": { + "requestType": "ListTagBindingsRequest", + "responseType": "ListTagBindingsResponse", + "options": { + "(google.api.http).get": "/v3/tagBindings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/tagBindings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateTagBinding": { + "requestType": "CreateTagBindingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/tagBindings", + "(google.api.http).body": "tag_binding", + "(google.api.method_signature)": "tag_binding", + "(google.longrunning.operation_info).response_type": "TagBinding", + "(google.longrunning.operation_info).metadata_type": "CreateTagBindingMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/tagBindings", + "body": "tag_binding" + } + }, + { + "(google.api.method_signature)": "tag_binding" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagBinding", + "metadata_type": "CreateTagBindingMetadata" + } + } + ] + }, + "DeleteTagBinding": { + "requestType": "DeleteTagBindingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=tagBindings/**}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteTagBindingMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=tagBindings/**}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteTagBindingMetadata" + } + } + ] + } + } + }, + "TagBinding": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/TagBinding", + "(google.api.resource).pattern": "tagBindings/{tag_binding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parent": { + "type": "string", + "id": 2 + }, + "tagValue": { + "type": "string", + "id": 3 + } + } + }, + "CreateTagBindingMetadata": { + "fields": {} + }, + "CreateTagBindingRequest": { + "fields": { + "tagBinding": { + "type": "TagBinding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTagBindingMetadata": { + "fields": {} + }, + "DeleteTagBindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/TagBinding" + } + } + } + }, + "ListTagBindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTagBindingsResponse": { + "fields": { + "tagBindings": { + "rule": "repeated", + "type": "TagBinding", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TagKeys": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListTagKeys": { + "requestType": "ListTagKeysRequest", + "responseType": "ListTagKeysResponse", + "options": { + "(google.api.http).get": "/v3/tagKeys", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/tagKeys" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTagKey": { + "requestType": "GetTagKeyRequest", + "responseType": "TagKey", + "options": { + "(google.api.http).get": "/v3/{name=tagKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=tagKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTagKey": { + "requestType": "CreateTagKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/tagKeys", + "(google.api.http).body": "tag_key", + "(google.api.method_signature)": "tag_key", + "(google.longrunning.operation_info).response_type": "TagKey", + "(google.longrunning.operation_info).metadata_type": "CreateTagKeyMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/tagKeys", + "body": "tag_key" + } + }, + { + "(google.api.method_signature)": "tag_key" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagKey", + "metadata_type": "CreateTagKeyMetadata" + } + } + ] + }, + "UpdateTagKey": { + "requestType": "UpdateTagKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3/{tag_key.name=tagKeys/*}", + "(google.api.http).body": "tag_key", + "(google.api.method_signature)": "tag_key,update_mask", + "(google.longrunning.operation_info).response_type": "TagKey", + "(google.longrunning.operation_info).metadata_type": "UpdateTagKeyMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{tag_key.name=tagKeys/*}", + "body": "tag_key" + } + }, + { + "(google.api.method_signature)": "tag_key,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagKey", + "metadata_type": "UpdateTagKeyMetadata" + } + } + ] + }, + "DeleteTagKey": { + "requestType": "DeleteTagKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=tagKeys/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "TagKey", + "(google.longrunning.operation_info).metadata_type": "DeleteTagKeyMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=tagKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagKey", + "metadata_type": "DeleteTagKeyMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=tagKeys/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagKeys/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=tagKeys/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagKeys/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v3/{resource=tagKeys/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagKeys/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + } + } + }, + "TagKey": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/TagKey", + "(google.api.resource).pattern": "tagKeys/{tag_key}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "shortName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "namespacedName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTagKeysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTagKeysResponse": { + "fields": { + "tagKeys": { + "rule": "repeated", + "type": "TagKey", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTagKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/TagKey" + } + } + } + }, + "CreateTagKeyRequest": { + "fields": { + "tagKey": { + "type": "TagKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateTagKeyMetadata": { + "fields": {} + }, + "UpdateTagKeyRequest": { + "fields": { + "tagKey": { + "type": "TagKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateTagKeyMetadata": { + "fields": {} + }, + "DeleteTagKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/TagKey" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTagKeyMetadata": { + "fields": {} + }, + "TagValues": { + "options": { + "(google.api.default_host)": "cloudresourcemanager.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListTagValues": { + "requestType": "ListTagValuesRequest", + "responseType": "ListTagValuesResponse", + "options": { + "(google.api.http).get": "/v3/tagValues", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/tagValues" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTagValue": { + "requestType": "GetTagValueRequest", + "responseType": "TagValue", + "options": { + "(google.api.http).get": "/v3/{name=tagValues/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{name=tagValues/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTagValue": { + "requestType": "CreateTagValueRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/tagValues", + "(google.api.http).body": "tag_value", + "(google.api.method_signature)": "tag_value", + "(google.longrunning.operation_info).response_type": "TagValue", + "(google.longrunning.operation_info).metadata_type": "CreateTagValueMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/tagValues", + "body": "tag_value" + } + }, + { + "(google.api.method_signature)": "tag_value" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagValue", + "metadata_type": "CreateTagValueMetadata" + } + } + ] + }, + "UpdateTagValue": { + "requestType": "UpdateTagValueRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v3/{tag_value.name=tagValues/*}", + "(google.api.http).body": "tag_value", + "(google.api.method_signature)": "tag_value,update_mask", + "(google.longrunning.operation_info).response_type": "TagValue", + "(google.longrunning.operation_info).metadata_type": "UpdateTagValueMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3/{tag_value.name=tagValues/*}", + "body": "tag_value" + } + }, + { + "(google.api.method_signature)": "tag_value,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagValue", + "metadata_type": "UpdateTagValueMetadata" + } + } + ] + }, + "DeleteTagValue": { + "requestType": "DeleteTagValueRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v3/{name=tagValues/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "TagValue", + "(google.longrunning.operation_info).metadata_type": "DeleteTagValueMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3/{name=tagValues/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TagValue", + "metadata_type": "DeleteTagValueMetadata" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=tagValues/*}:getIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagValues/*}:getIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v3/{resource=tagValues/*}:setIamPolicy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagValues/*}:setIamPolicy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,policy" + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v3/{resource=tagValues/*}:testIamPermissions", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource,permissions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{resource=tagValues/*}:testIamPermissions", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource,permissions" + } + ] + } + } + }, + "TagValue": { + "options": { + "(google.api.resource).type": "cloudresourcemanager.googleapis.com/TagValue", + "(google.api.resource).pattern": "tagValues/{tag_value}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "shortName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "namespacedName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTagValuesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTagValuesResponse": { + "fields": { + "tagValues": { + "rule": "repeated", + "type": "TagValue", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTagValueRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/TagValue" + } + } + } + }, + "CreateTagValueRequest": { + "fields": { + "tagValue": { + "type": "TagValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateTagValueMetadata": { + "fields": {} + }, + "UpdateTagValueRequest": { + "fields": { + "tagValue": { + "type": "TagValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateTagValueMetadata": { + "fields": {} + }, + "DeleteTagValueRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/TagValue" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTagValueMetadata": { + "fields": {} + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-resourcemanager/samples/.eslintrc.yml b/packages/google-cloud-resourcemanager/samples/.eslintrc.yml new file mode 100644 index 000000000000..0aa37ac630e2 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/.eslintrc.yml @@ -0,0 +1,4 @@ +--- +rules: + no-console: off + node/no-missing-require: off diff --git a/packages/google-cloud-resourcemanager/samples/README.md b/packages/google-cloud-resourcemanager/samples/README.md new file mode 100644 index 000000000000..5caf0e4b025f --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/README.md @@ -0,0 +1,896 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Resource Manager API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Folders.create_folder](#folders.create_folder) + * [Folders.delete_folder](#folders.delete_folder) + * [Folders.get_folder](#folders.get_folder) + * [Folders.get_iam_policy](#folders.get_iam_policy) + * [Folders.list_folders](#folders.list_folders) + * [Folders.move_folder](#folders.move_folder) + * [Folders.search_folders](#folders.search_folders) + * [Folders.set_iam_policy](#folders.set_iam_policy) + * [Folders.test_iam_permissions](#folders.test_iam_permissions) + * [Folders.undelete_folder](#folders.undelete_folder) + * [Folders.update_folder](#folders.update_folder) + * [Organizations.get_iam_policy](#organizations.get_iam_policy) + * [Organizations.get_organization](#organizations.get_organization) + * [Organizations.search_organizations](#organizations.search_organizations) + * [Organizations.set_iam_policy](#organizations.set_iam_policy) + * [Organizations.test_iam_permissions](#organizations.test_iam_permissions) + * [Projects.create_project](#projects.create_project) + * [Projects.delete_project](#projects.delete_project) + * [Projects.get_iam_policy](#projects.get_iam_policy) + * [Projects.get_project](#projects.get_project) + * [Projects.list_projects](#projects.list_projects) + * [Projects.move_project](#projects.move_project) + * [Projects.search_projects](#projects.search_projects) + * [Projects.set_iam_policy](#projects.set_iam_policy) + * [Projects.test_iam_permissions](#projects.test_iam_permissions) + * [Projects.undelete_project](#projects.undelete_project) + * [Projects.update_project](#projects.update_project) + * [Tag_bindings.create_tag_binding](#tag_bindings.create_tag_binding) + * [Tag_bindings.delete_tag_binding](#tag_bindings.delete_tag_binding) + * [Tag_bindings.list_tag_bindings](#tag_bindings.list_tag_bindings) + * [Tag_keys.create_tag_key](#tag_keys.create_tag_key) + * [Tag_keys.delete_tag_key](#tag_keys.delete_tag_key) + * [Tag_keys.get_iam_policy](#tag_keys.get_iam_policy) + * [Tag_keys.get_tag_key](#tag_keys.get_tag_key) + * [Tag_keys.list_tag_keys](#tag_keys.list_tag_keys) + * [Tag_keys.set_iam_policy](#tag_keys.set_iam_policy) + * [Tag_keys.test_iam_permissions](#tag_keys.test_iam_permissions) + * [Tag_keys.update_tag_key](#tag_keys.update_tag_key) + * [Tag_values.create_tag_value](#tag_values.create_tag_value) + * [Tag_values.delete_tag_value](#tag_values.delete_tag_value) + * [Tag_values.get_iam_policy](#tag_values.get_iam_policy) + * [Tag_values.get_tag_value](#tag_values.get_tag_value) + * [Tag_values.list_tag_values](#tag_values.list_tag_values) + * [Tag_values.set_iam_policy](#tag_values.set_iam_policy) + * [Tag_values.test_iam_permissions](#tag_values.test_iam_permissions) + * [Tag_values.update_tag_value](#tag_values.update_tag_value) + * [Quickstart](#quickstart) + * [Sample.test](#sample.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Folders.create_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js` + + +----- + + + + +### Folders.delete_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js` + + +----- + + + + +### Folders.get_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js` + + +----- + + + + +### Folders.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js` + + +----- + + + + +### Folders.list_folders + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js` + + +----- + + + + +### Folders.move_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js` + + +----- + + + + +### Folders.search_folders + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js` + + +----- + + + + +### Folders.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js` + + +----- + + + + +### Folders.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js` + + +----- + + + + +### Folders.undelete_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js` + + +----- + + + + +### Folders.update_folder + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js` + + +----- + + + + +### Organizations.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js` + + +----- + + + + +### Organizations.get_organization + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js` + + +----- + + + + +### Organizations.search_organizations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js` + + +----- + + + + +### Organizations.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js` + + +----- + + + + +### Organizations.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js` + + +----- + + + + +### Projects.create_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js` + + +----- + + + + +### Projects.delete_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js` + + +----- + + + + +### Projects.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js` + + +----- + + + + +### Projects.get_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js` + + +----- + + + + +### Projects.list_projects + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js` + + +----- + + + + +### Projects.move_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js` + + +----- + + + + +### Projects.search_projects + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js` + + +----- + + + + +### Projects.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js` + + +----- + + + + +### Projects.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js` + + +----- + + + + +### Projects.undelete_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js` + + +----- + + + + +### Projects.update_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js` + + +----- + + + + +### Tag_bindings.create_tag_binding + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js` + + +----- + + + + +### Tag_bindings.delete_tag_binding + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js` + + +----- + + + + +### Tag_bindings.list_tag_bindings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js` + + +----- + + + + +### Tag_keys.create_tag_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js` + + +----- + + + + +### Tag_keys.delete_tag_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js` + + +----- + + + + +### Tag_keys.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js` + + +----- + + + + +### Tag_keys.get_tag_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js` + + +----- + + + + +### Tag_keys.list_tag_keys + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js` + + +----- + + + + +### Tag_keys.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js` + + +----- + + + + +### Tag_keys.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js` + + +----- + + + + +### Tag_keys.update_tag_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js` + + +----- + + + + +### Tag_values.create_tag_value + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js` + + +----- + + + + +### Tag_values.delete_tag_value + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js` + + +----- + + + + +### Tag_values.get_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js` + + +----- + + + + +### Tag_values.get_tag_value + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js` + + +----- + + + + +### Tag_values.list_tag_values + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js` + + +----- + + + + +### Tag_values.set_iam_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js` + + +----- + + + + +### Tag_values.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js` + + +----- + + + + +### Tag_values.update_tag_value + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/quickstart.js` + + +----- + + + + +### Sample.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-resourcemanager/samples/test/sample.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-resourcemanager/samples/test/sample.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-resourcemanager/samples/test/sample.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/resource-manager diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js new file mode 100644 index 000000000000..f23ee8ff2a8b --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.create_folder.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(folder) { + // [START cloudresourcemanager_v3_generated_Folders_CreateFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The folder being created, only the display name and parent will be + * consulted. All other fields will be ignored. + */ + // const folder = {} + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callCreateFolder() { + // Construct request + const request = { + folder, + }; + + // Run request + const [operation] = await resourcemanagerClient.createFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateFolder(); + // [END cloudresourcemanager_v3_generated_Folders_CreateFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js new file mode 100644 index 000000000000..4e6445b634d5 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.delete_folder.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Folders_DeleteFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callDeleteFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.deleteFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteFolder(); + // [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js new file mode 100644 index 000000000000..9e3d772c164e --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_folder.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Folders_GetFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callGetFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await resourcemanagerClient.getFolder(request); + console.log(response); + } + + callGetFolder(); + // [END cloudresourcemanager_v3_generated_Folders_GetFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js new file mode 100644 index 000000000000..bb810bda3108 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START cloudresourcemanager_v3_generated_Folders_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await resourcemanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js new file mode 100644 index 000000000000..1cadc21dcb7e --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.list_folders.js @@ -0,0 +1,83 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START cloudresourcemanager_v3_generated_Folders_ListFolders_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the organization or folder whose folders are + * being listed. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + /** + * Optional. Controls whether folders in the + * DELETE_REQUESTED google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED + * state should be returned. Defaults to false. + */ + // const showDeleted = true + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callListFolders() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await resourcemanagerClient.listFoldersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFolders(); + // [END cloudresourcemanager_v3_generated_Folders_ListFolders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js new file mode 100644 index 000000000000..5aff715ed41c --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.move_folder.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(name, destinationParent) { + // [START cloudresourcemanager_v3_generated_Folders_MoveFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + */ + // const name = 'abc123' + /** + * Required. The resource name of the folder or organization which should be the + * folder's new parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + */ + // const destinationParent = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callMoveFolder() { + // Construct request + const request = { + name, + destinationParent, + }; + + // Run request + const [operation] = await resourcemanagerClient.moveFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callMoveFolder(); + // [END cloudresourcemanager_v3_generated_Folders_MoveFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js new file mode 100644 index 000000000000..54d592a22223 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.search_folders.js @@ -0,0 +1,97 @@ +// Copyright 2022 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'; + +function main() { + // [START cloudresourcemanager_v3_generated_Folders_SearchFolders_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `SearchFolders` + * that indicates from where search should continue. + */ + // const pageToken = 'abc123' + /** + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * Some example queries are: + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + */ + // const query = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callSearchFolders() { + // Construct request + const request = { + }; + + // Run request + const iterable = await resourcemanagerClient.searchFoldersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchFolders(); + // [END cloudresourcemanager_v3_generated_Folders_SearchFolders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js new file mode 100644 index 000000000000..f4b3f44abdac --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START cloudresourcemanager_v3_generated_Folders_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await resourcemanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js new file mode 100644 index 000000000000..46bed62cd297 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START cloudresourcemanager_v3_generated_Folders_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await resourcemanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js new file mode 100644 index 000000000000..3ac7afc454f9 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.undelete_folder.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Folders_UndeleteFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callUndeleteFolder() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.undeleteFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteFolder(); + // [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js new file mode 100644 index 000000000000..d06dc967701d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/folders.update_folder.js @@ -0,0 +1,69 @@ +// Copyright 2022 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'; + +function main(folder, updateMask) { + // [START cloudresourcemanager_v3_generated_Folders_UpdateFolder_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new definition of the Folder. It must include the `name` field, which + * cannot be changed. + */ + // const folder = {} + /** + * Required. Fields to be updated. + * Only the `display_name` can be updated. + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {FoldersClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new FoldersClient(); + + async function callUpdateFolder() { + // Construct request + const request = { + folder, + updateMask, + }; + + // Run request + const [operation] = await resourcemanagerClient.updateFolder(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateFolder(); + // [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js new file mode 100644 index 000000000000..cf063b3758f5 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Resourcemanager library + const {OrganizationsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new OrganizationsClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await resourcemanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js new file mode 100644 index 000000000000..8279281dbddd --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.get_organization.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Organizations_GetOrganization_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Organization to fetch. This is the organization's + * relative path in the API, formatted as "organizations/[organizationId]". + * For example, "organizations/1234". + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {OrganizationsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new OrganizationsClient(); + + async function callGetOrganization() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await resourcemanagerClient.getOrganization(request); + console.log(response); + } + + callGetOrganization(); + // [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js new file mode 100644 index 000000000000..8029c3a5fcdb --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.search_organizations.js @@ -0,0 +1,86 @@ +// Copyright 2022 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'; + +function main() { + // [START cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The maximum number of organizations to return in the response. + * If unspecified, server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + */ + // const pageToken = 'abc123' + /** + * Optional. An optional query string used to filter the Organizations to return in + * the response. Query rules are case-insensitive. + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + */ + // const query = 'abc123' + + // Imports the Resourcemanager library + const {OrganizationsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new OrganizationsClient(); + + async function callSearchOrganizations() { + // Construct request + const request = { + }; + + // Run request + const iterable = await resourcemanagerClient.searchOrganizationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchOrganizations(); + // [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js new file mode 100644 index 000000000000..18202baab258 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {OrganizationsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new OrganizationsClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await resourcemanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js new file mode 100644 index 000000000000..f5ba3e7e3508 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/organizations.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Resourcemanager library + const {OrganizationsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new OrganizationsClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await resourcemanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js new file mode 100644 index 000000000000..16ce1f9ebeb3 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.create_project.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(project) { + // [START cloudresourcemanager_v3_generated_Projects_CreateProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Project to create. + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organziation, the parent + * will be set to that Organization. + */ + // const project = 'my-project' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callCreateProject() { + // Construct request + const request = { + project, + }; + + // Run request + const [operation] = await resourcemanagerClient.createProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateProject(); + // [END cloudresourcemanager_v3_generated_Projects_CreateProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js new file mode 100644 index 000000000000..de85020b1765 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.delete_project.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Projects_DeleteProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Project (for example, `projects/415104041262`). + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callDeleteProject() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.deleteProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProject(); + // [END cloudresourcemanager_v3_generated_Projects_DeleteProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js new file mode 100644 index 000000000000..712ca9a4a015 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START cloudresourcemanager_v3_generated_Projects_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await resourcemanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js new file mode 100644 index 000000000000..f3bce7612eb7 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.get_project.js @@ -0,0 +1,61 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Projects_GetProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project (for example, `projects/415104041262`). + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callGetProject() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await resourcemanagerClient.getProject(request); + console.log(response); + } + + callGetProject(); + // [END cloudresourcemanager_v3_generated_Projects_GetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js new file mode 100644 index 000000000000..e7c1b6ef53c5 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.list_projects.js @@ -0,0 +1,82 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START cloudresourcemanager_v3_generated_Projects_ListProjects_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the parent resource to list projects under. + * For example, setting this field to 'folders/1234' would list all projects + * directly under that folder. + */ + // const parent = 'abc123' + /** + * Optional. A pagination token returned from a previous call to ListProjects + * google.cloud.resourcemanager.v3.Projects.ListProjects + * that indicates from where listing should continue. + */ + // const pageToken = 'abc123' + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + * returned. Normally only `ACTIVE` projects are returned. + */ + // const showDeleted = true + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callListProjects() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await resourcemanagerClient.listProjectsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProjects(); + // [END cloudresourcemanager_v3_generated_Projects_ListProjects_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js new file mode 100644 index 000000000000..d179abbfff1a --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.move_project.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(name, destinationParent) { + // [START cloudresourcemanager_v3_generated_Projects_MoveProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project to move. + */ + // const name = 'abc123' + /** + * Required. The new parent to move the Project under. + */ + // const destinationParent = 'abc123' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callMoveProject() { + // Construct request + const request = { + name, + destinationParent, + }; + + // Run request + const [operation] = await resourcemanagerClient.moveProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callMoveProject(); + // [END cloudresourcemanager_v3_generated_Projects_MoveProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js new file mode 100644 index 000000000000..48299b54b10d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.search_projects.js @@ -0,0 +1,107 @@ +// Copyright 2022 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'; + +function main() { + // [START cloudresourcemanager_v3_generated_Projects_SearchProjects_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, the it will return results that match any of the + * fields. Some eligible fields are: + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------------| + * | displayName, name | Filters by displayName. | + * | parent | Project's parent. (for example: folders/123, + * organizations/*) Prefer parent field over parent.type and parent.id. | + * | parent.type | Parent's type: `folder` or `organization`. | + * | parent.id | Parent's id number (for example: 123) | + * | id, projectId | Filters by projectId. | + * | state, lifecycleState | Filters by state. | + * | labels | Filters by label name or value. | + * | labels. (where *key* is the name of a label) | Filters by label + * name. | + * ``` + * Search expressions are case insensitive. + * Some examples queries: + * ``` + * | Query | Description | + * |------------------|-----------------------------------------------------| + * | name:how* | The project's name starts with "how". | + * | name:Howl | The project's name is `Howl` or `howl`. | + * | name:HOWL | Equivalent to above. | + * | NAME:howl | Equivalent to above. | + * | labels.color:* | The project has the label `color`. | + * | labels.color:red | The project's label `color` has the value `red`. | + * | labels.color:red labels.size:big | The project's label `color` has + * the value `red` and its label `size` has the value `big`. | + * ``` + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + */ + // const query = 'abc123' + /** + * Optional. A pagination token returned from a previous call to ListProjects + * google.cloud.resourcemanager.v3.Projects.ListProjects + * that indicates from where listing should continue. + */ + // const pageToken = 'abc123' + /** + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + */ + // const pageSize = 1234 + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callSearchProjects() { + // Construct request + const request = { + }; + + // Run request + const iterable = await resourcemanagerClient.searchProjectsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchProjects(); + // [END cloudresourcemanager_v3_generated_Projects_SearchProjects_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js new file mode 100644 index 000000000000..2cd24ff7e871 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START cloudresourcemanager_v3_generated_Projects_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await resourcemanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js new file mode 100644 index 000000000000..39f6a66c3de6 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START cloudresourcemanager_v3_generated_Projects_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await resourcemanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js new file mode 100644 index 000000000000..2df217634e6d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.undelete_project.js @@ -0,0 +1,63 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_Projects_UndeleteProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project (for example, `projects/415104041262`). + * Required. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callUndeleteProject() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.undeleteProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeleteProject(); + // [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js new file mode 100644 index 000000000000..ecac004711ad --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/projects.update_project.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(project) { + // [START cloudresourcemanager_v3_generated_Projects_UpdateProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new definition of the project. + */ + // const project = 'my-project' + /** + * Optional. An update mask to selectively update fields. + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {ProjectsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new ProjectsClient(); + + async function callUpdateProject() { + // Construct request + const request = { + project, + }; + + // Run request + const [operation] = await resourcemanagerClient.updateProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateProject(); + // [END cloudresourcemanager_v3_generated_Projects_UpdateProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/snippet_metadata.google.cloud.resourcemanager.v3.json b/packages/google-cloud-resourcemanager/samples/generated/v3/snippet_metadata.google.cloud.resourcemanager.v3.json new file mode 100644 index 000000000000..2367b6daf85d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/snippet_metadata.google.cloud.resourcemanager.v3.json @@ -0,0 +1,2067 @@ +{ + "clientLibrary": { + "name": "nodejs-resourcemanager", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.resourcemanager.v3", + "version": "v3" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_GetFolder_async", + "title": "Folders getFolder Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have `resourcemanager.folders.get` permission on the identified folder.", + "canonical": true, + "file": "folders.get_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.GetFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.Folder", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "GetFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.GetFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_ListFolders_async", + "title": "Folders listFolders Sample", + "origin": "API_DEFINITION", + "description": " Lists the folders that are direct descendants of supplied parent resource. `list()` provides a strongly consistent view of the folders underneath the specified parent resource. `list()` returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent.", + "canonical": true, + "file": "folders.list_folders.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFolders", + "fullName": "google.cloud.resourcemanager.v3.Folders.ListFolders", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.ListFoldersResponse", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "ListFolders", + "fullName": "google.cloud.resourcemanager.v3.Folders.ListFolders", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_SearchFolders_async", + "title": "Folders searchFolders Sample", + "origin": "API_DEFINITION", + "description": " Search for folders that match specific filter criteria. `search()` provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission `resourcemanager.folders.get`.", + "canonical": true, + "file": "folders.search_folders.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchFolders", + "fullName": "google.cloud.resourcemanager.v3.Folders.SearchFolders", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.SearchFoldersResponse", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "SearchFolders", + "fullName": "google.cloud.resourcemanager.v3.Folders.SearchFolders", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_CreateFolder_async", + "title": "Folders createFolder Sample", + "origin": "API_DEFINITION", + "description": " Creates a folder in the resource hierarchy. Returns an `Operation` which can be used to track the progress of the folder creation workflow. Upon success, the `Operation.response` field will be populated with the created Folder. In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints. + The folder's `display_name` must be distinct from all other folders that share its parent. + The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of the folder must not cause the total number of folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the `CreateFolder` request, with status code `FAILED_PRECONDITION` and an error description. Other folder constraint violations will be communicated in the `Operation`, with the specific `PreconditionFailure` returned in the details list in the `Operation.error` field. The caller must have `resourcemanager.folders.create` permission on the identified parent.", + "canonical": true, + "file": "folders.create_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.CreateFolder", + "async": true, + "parameters": [ + { + "name": "folder", + "type": ".google.cloud.resourcemanager.v3.Folder" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "CreateFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.CreateFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_UpdateFolder_async", + "title": "Folders updateFolder Sample", + "origin": "API_DEFINITION", + "description": " Updates a folder, changing its `display_name`. Changes to the folder `display_name` will be rejected if they violate either the `display_name` formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The folder's `display_name` must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: `[\\p{L}\\p{N}][\\p{L}\\p{N}_- ]{1,28}[\\p{L}\\p{N}]`. The caller must have `resourcemanager.folders.update` permission on the identified folder. If the update fails due to the unique name constraint then a `PreconditionFailure` explaining this violation will be returned in the Status.details field.", + "canonical": true, + "file": "folders.update_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.UpdateFolder", + "async": true, + "parameters": [ + { + "name": "folder", + "type": ".google.cloud.resourcemanager.v3.Folder" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "UpdateFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.UpdateFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_MoveFolder_async", + "title": "Folders moveFolder Sample", + "origin": "API_DEFINITION", + "description": " Moves a folder under a new resource parent. Returns an `Operation` which can be used to track the progress of the folder move workflow. Upon success, the `Operation.response` field will be populated with the moved folder. Upon failure, a `FolderOperationError` categorizing the failure cause will be returned - if the failure occurs synchronously then the `FolderOperationError` will be returned in the `Status.details` field. If it occurs asynchronously, then the FolderOperation will be returned in the `Operation.error` field. In addition, the `Operation.metadata` field will be populated with a `FolderOperation` message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent.", + "canonical": true, + "file": "folders.move_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.MoveFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "MoveFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.MoveFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_DeleteFolder_async", + "title": "Folders deleteFolder Sample", + "origin": "API_DEFINITION", + "description": " Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have `resourcemanager.folders.delete` permission on the identified folder.", + "canonical": true, + "file": "folders.delete_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.DeleteFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "DeleteFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.DeleteFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_UndeleteFolder_async", + "title": "Folders undeleteFolder Sample", + "origin": "API_DEFINITION", + "description": " Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have `resourcemanager.folders.undelete` permission on the identified folder.", + "canonical": true, + "file": "folders.undelete_folder.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.UndeleteFolder", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "UndeleteFolder", + "fullName": "google.cloud.resourcemanager.v3.Folders.UndeleteFolder", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_GetIamPolicy_async", + "title": "Folders getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the folder's resource name, for example: \"folders/1234\". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder.", + "canonical": true, + "file": "folders.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Folders.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Folders.GetIamPolicy", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_SetIamPolicy_async", + "title": "Folders setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on a folder, replacing any existing policy. The `resource` field should be the folder's resource name, for example: \"folders/1234\". The caller must have `resourcemanager.folders.setIamPolicy` permission on the identified folder.", + "canonical": true, + "file": "folders.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Folders.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Folders.SetIamPolicy", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Folders_TestIamPermissions_async", + "title": "Folders testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified folder. The `resource` field should be the folder's resource name, for example: \"folders/1234\". There are no permissions required for making this API call.", + "canonical": true, + "file": "folders.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Folders.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "FoldersClient", + "fullName": "google.cloud.resourcemanager.v3.FoldersClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Folders.TestIamPermissions", + "service": { + "shortName": "Folders", + "fullName": "google.cloud.resourcemanager.v3.Folders" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Organizations_GetOrganization_async", + "title": "Folders getOrganization Sample", + "origin": "API_DEFINITION", + "description": " Fetches an organization resource identified by the specified resource name.", + "canonical": true, + "file": "organizations.get_organization.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOrganization", + "fullName": "google.cloud.resourcemanager.v3.Organizations.GetOrganization", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.Organization", + "client": { + "shortName": "OrganizationsClient", + "fullName": "google.cloud.resourcemanager.v3.OrganizationsClient" + }, + "method": { + "shortName": "GetOrganization", + "fullName": "google.cloud.resourcemanager.v3.Organizations.GetOrganization", + "service": { + "shortName": "Organizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_async", + "title": "Folders searchOrganizations Sample", + "origin": "API_DEFINITION", + "description": " Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", + "canonical": true, + "file": "organizations.search_organizations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchOrganizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations.SearchOrganizations", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.SearchOrganizationsResponse", + "client": { + "shortName": "OrganizationsClient", + "fullName": "google.cloud.resourcemanager.v3.OrganizationsClient" + }, + "method": { + "shortName": "SearchOrganizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations.SearchOrganizations", + "service": { + "shortName": "Organizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_async", + "title": "Folders getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for an organization resource. The policy may be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, for example: \"organizations/123\". Authorization requires the IAM permission `resourcemanager.organizations.getIamPolicy` on the specified organization.", + "canonical": true, + "file": "organizations.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Organizations.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "OrganizationsClient", + "fullName": "google.cloud.resourcemanager.v3.OrganizationsClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Organizations.GetIamPolicy", + "service": { + "shortName": "Organizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_async", + "title": "Folders setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on an organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, for example: \"organizations/123\". Authorization requires the IAM permission `resourcemanager.organizations.setIamPolicy` on the specified organization.", + "canonical": true, + "file": "organizations.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Organizations.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "OrganizationsClient", + "fullName": "google.cloud.resourcemanager.v3.OrganizationsClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Organizations.SetIamPolicy", + "service": { + "shortName": "Organizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_async", + "title": "Folders testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns the permissions that a caller has on the specified organization. The `resource` field should be the organization's resource name, for example: \"organizations/123\". There are no permissions required for making this API call.", + "canonical": true, + "file": "organizations.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Organizations.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "OrganizationsClient", + "fullName": "google.cloud.resourcemanager.v3.OrganizationsClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Organizations.TestIamPermissions", + "service": { + "shortName": "Organizations", + "fullName": "google.cloud.resourcemanager.v3.Organizations" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_GetProject_async", + "title": "Folders getProject Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the project identified by the specified `name` (for example, `projects/415104041262`). The caller must have `resourcemanager.projects.get` permission for this project.", + "canonical": true, + "file": "projects.get_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.GetProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.Project", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "GetProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.GetProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_ListProjects_async", + "title": "Folders listProjects Sample", + "origin": "API_DEFINITION", + "description": " Lists projects that are direct children of the specified folder or organization resource. `list()` provides a strongly consistent view of the projects underneath the specified parent resource. `list()` returns projects sorted based upon the (ascending) lexical ordering of their `display_name`. The caller must have `resourcemanager.projects.list` permission on the identified parent.", + "canonical": true, + "file": "projects.list_projects.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProjects", + "fullName": "google.cloud.resourcemanager.v3.Projects.ListProjects", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.ListProjectsResponse", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "ListProjects", + "fullName": "google.cloud.resourcemanager.v3.Projects.ListProjects", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_SearchProjects_async", + "title": "Folders searchProjects Sample", + "origin": "API_DEFINITION", + "description": " Search for projects that the caller has both `resourcemanager.projects.get` permission on, and also satisfy the specified query. This method returns projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method.", + "canonical": true, + "file": "projects.search_projects.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchProjects", + "fullName": "google.cloud.resourcemanager.v3.Projects.SearchProjects", + "async": true, + "parameters": [ + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.SearchProjectsResponse", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "SearchProjects", + "fullName": "google.cloud.resourcemanager.v3.Projects.SearchProjects", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_CreateProject_async", + "title": "Folders createProject Sample", + "origin": "API_DEFINITION", + "description": " Request that a new project be created. The result is an `Operation` which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much longer. The tracking `Operation` is automatically deleted after a few hours, so there is no need to call `DeleteOperation`.", + "canonical": true, + "file": "projects.create_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.CreateProject", + "async": true, + "parameters": [ + { + "name": "project", + "type": ".google.cloud.resourcemanager.v3.Project" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "CreateProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.CreateProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_UpdateProject_async", + "title": "Folders updateProject Sample", + "origin": "API_DEFINITION", + "description": " Updates the `display_name` and labels of the project identified by the specified `name` (for example, `projects/415104041262`). Deleting all labels requires an update mask for labels field. The caller must have `resourcemanager.projects.update` permission for this project.", + "canonical": true, + "file": "projects.update_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.UpdateProject", + "async": true, + "parameters": [ + { + "name": "project", + "type": ".google.cloud.resourcemanager.v3.Project" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "UpdateProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.UpdateProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_MoveProject_async", + "title": "Folders moveProject Sample", + "origin": "API_DEFINITION", + "description": " Move a project to another place in your resource hierarchy, under a new resource parent. Returns an operation which can be used to track the process of the project move workflow. Upon success, the `Operation.response` field will be populated with the moved project. The caller must have `resourcemanager.projects.update` permission on the project and have `resourcemanager.projects.move` permission on the project's current and proposed new parent.", + "canonical": true, + "file": "projects.move_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.MoveProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "MoveProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.MoveProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_DeleteProject_async", + "title": "Folders deleteProject Sample", + "origin": "API_DEFINITION", + "description": " Marks the project identified by the specified `name` (for example, `projects/415104041262`) for deletion. This method will only affect the project if it has a lifecycle state of [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE]. This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the Project is no longer accessible. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloud.resourcemanager.v3.Projects.GetProject], and the project remains visible to [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloud.resourcemanager.v3.Projects.GetProject], [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects], and [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] methods. This method behaves idempotently, such that deleting a `DELETE_REQUESTED` project will not cause an error, but also won't do anything. The caller must have `resourcemanager.projects.delete` permissions for this project.", + "canonical": true, + "file": "projects.delete_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.DeleteProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "DeleteProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.DeleteProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_UndeleteProject_async", + "title": "Folders undeleteProject Sample", + "origin": "API_DEFINITION", + "description": " Restores the project identified by the specified `name` (for example, `projects/415104041262`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [Projects.State.DELETE_REQUESTED]. After deletion starts, the project cannot be restored. The caller must have `resourcemanager.projects.undelete` permission for this project.", + "canonical": true, + "file": "projects.undelete_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeleteProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.UndeleteProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "UndeleteProject", + "fullName": "google.cloud.resourcemanager.v3.Projects.UndeleteProject", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_GetIamPolicy_async", + "title": "Folders getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Returns the IAM access control policy for the specified project. Permission is denied if the policy or the resource do not exist.", + "canonical": true, + "file": "projects.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Projects.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Projects.GetIamPolicy", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_SetIamPolicy_async", + "title": "Folders setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM access control policy for the specified project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited using the Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; they must be sent only using the Cloud Platform Console. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. + Calling this method requires enabling the App Engine Admin API.", + "canonical": true, + "file": "projects.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Projects.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.Projects.SetIamPolicy", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_Projects_TestIamPermissions_async", + "title": "Folders testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified project.", + "canonical": true, + "file": "projects.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Projects.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "ProjectsClient", + "fullName": "google.cloud.resourcemanager.v3.ProjectsClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.Projects.TestIamPermissions", + "service": { + "shortName": "Projects", + "fullName": "google.cloud.resourcemanager.v3.Projects" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_async", + "title": "Folders listTagBindings Sample", + "origin": "API_DEFINITION", + "description": " Lists the TagBindings for the given cloud resource, as specified with `parent`. NOTE: The `parent` field is expected to be a full resource name: https://cloud.google.com/apis/design/resource_names#full_resource_name", + "canonical": true, + "file": "tag_bindings.list_tag_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTagBindings", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.ListTagBindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.ListTagBindingsResponse", + "client": { + "shortName": "TagBindingsClient", + "fullName": "google.cloud.resourcemanager.v3.TagBindingsClient" + }, + "method": { + "shortName": "ListTagBindings", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.ListTagBindings", + "service": { + "shortName": "TagBindings", + "fullName": "google.cloud.resourcemanager.v3.TagBindings" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_async", + "title": "Folders createTagBinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or organization).", + "canonical": true, + "file": "tag_bindings.create_tag_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTagBinding", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.CreateTagBinding", + "async": true, + "parameters": [ + { + "name": "tag_binding", + "type": ".google.cloud.resourcemanager.v3.TagBinding" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagBindingsClient", + "fullName": "google.cloud.resourcemanager.v3.TagBindingsClient" + }, + "method": { + "shortName": "CreateTagBinding", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.CreateTagBinding", + "service": { + "shortName": "TagBindings", + "fullName": "google.cloud.resourcemanager.v3.TagBindings" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_async", + "title": "Folders deleteTagBinding Sample", + "origin": "API_DEFINITION", + "description": " Deletes a TagBinding.", + "canonical": true, + "file": "tag_bindings.delete_tag_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTagBinding", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.DeleteTagBinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagBindingsClient", + "fullName": "google.cloud.resourcemanager.v3.TagBindingsClient" + }, + "method": { + "shortName": "DeleteTagBinding", + "fullName": "google.cloud.resourcemanager.v3.TagBindings.DeleteTagBinding", + "service": { + "shortName": "TagBindings", + "fullName": "google.cloud.resourcemanager.v3.TagBindings" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_async", + "title": "Folders listTagKeys Sample", + "origin": "API_DEFINITION", + "description": " Lists all TagKeys for a parent resource.", + "canonical": true, + "file": "tag_keys.list_tag_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.ListTagKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.ListTagKeysResponse", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "ListTagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.ListTagKeys", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_GetTagKey_async", + "title": "Folders getTagKey Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the key does not exist or the user does not have permission to view it.", + "canonical": true, + "file": "tag_keys.get_tag_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.GetTagKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.TagKey", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "GetTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.GetTagKey", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_async", + "title": "Folders createTagKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 300 TagKeys can exist under a parent at any given time.", + "canonical": true, + "file": "tag_keys.create_tag_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.CreateTagKey", + "async": true, + "parameters": [ + { + "name": "tag_key", + "type": ".google.cloud.resourcemanager.v3.TagKey" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "CreateTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.CreateTagKey", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_async", + "title": "Folders updateTagKey Sample", + "origin": "API_DEFINITION", + "description": " Updates the attributes of the TagKey resource.", + "canonical": true, + "file": "tag_keys.update_tag_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.UpdateTagKey", + "async": true, + "parameters": [ + { + "name": "tag_key", + "type": ".google.cloud.resourcemanager.v3.TagKey" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "UpdateTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.UpdateTagKey", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_async", + "title": "Folders deleteTagKey Sample", + "origin": "API_DEFINITION", + "description": " Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.", + "canonical": true, + "file": "tag_keys.delete_tag_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.DeleteTagKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "DeleteTagKey", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.DeleteTagKey", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_async", + "title": "Folders getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagKey's resource name. For example, \"tagKeys/1234\". The caller must have `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on the specified TagKey.", + "canonical": true, + "file": "tag_keys.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.GetIamPolicy", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_async", + "title": "Folders setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on a TagKey, replacing any existing policy. The `resource` field should be the TagKey's resource name. For example, \"tagKeys/1234\". The caller must have `resourcemanager.tagKeys.setIamPolicy` permission on the identified tagValue.", + "canonical": true, + "file": "tag_keys.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.SetIamPolicy", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_async", + "title": "Folders testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified TagKey. The `resource` field should be the TagKey's resource name. For example, \"tagKeys/1234\". There are no permissions required for making this API call.", + "canonical": true, + "file": "tag_keys.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "TagKeysClient", + "fullName": "google.cloud.resourcemanager.v3.TagKeysClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.TagKeys.TestIamPermissions", + "service": { + "shortName": "TagKeys", + "fullName": "google.cloud.resourcemanager.v3.TagKeys" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_ListTagValues_async", + "title": "Folders listTagValues Sample", + "origin": "API_DEFINITION", + "description": " Lists all TagValues for a specific TagKey.", + "canonical": true, + "file": "tag_values.list_tag_values.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues.ListTagValues", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.ListTagValuesResponse", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "ListTagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues.ListTagValues", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_GetTagValue_async", + "title": "Folders getTagValue Sample", + "origin": "API_DEFINITION", + "description": " Retrieves TagValue. If the TagValue or namespaced name does not exist, or if the user does not have permission to view it, this method will return `PERMISSION_DENIED`.", + "canonical": true, + "file": "tag_values.get_tag_value.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.GetTagValue", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.resourcemanager.v3.TagValue", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "GetTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.GetTagValue", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_CreateTagValue_async", + "title": "Folders createTagValue Sample", + "origin": "API_DEFINITION", + "description": " Creates a TagValue as a child of the specified TagKey. If a another request with the same parameters is sent while the original request is in process the second request will receive an error. A maximum of 300 TagValues can exist under a TagKey at any given time.", + "canonical": true, + "file": "tag_values.create_tag_value.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.CreateTagValue", + "async": true, + "parameters": [ + { + "name": "tag_value", + "type": ".google.cloud.resourcemanager.v3.TagValue" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "CreateTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.CreateTagValue", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_async", + "title": "Folders updateTagValue Sample", + "origin": "API_DEFINITION", + "description": " Updates the attributes of the TagValue resource.", + "canonical": true, + "file": "tag_values.update_tag_value.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.UpdateTagValue", + "async": true, + "parameters": [ + { + "name": "tag_value", + "type": ".google.cloud.resourcemanager.v3.TagValue" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "UpdateTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.UpdateTagValue", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_async", + "title": "Folders deleteTagValue Sample", + "origin": "API_DEFINITION", + "description": " Deletes a TagValue. The TagValue cannot have any bindings when it is deleted.", + "canonical": true, + "file": "tag_values.delete_tag_value.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.DeleteTagValue", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "DeleteTagValue", + "fullName": "google.cloud.resourcemanager.v3.TagValues.DeleteTagValue", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_async", + "title": "Folders getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the access control policy for a TagValue. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have the `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on the identified TagValue to get the access control policy.", + "canonical": true, + "file": "tag_values.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagValues.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagValues.GetIamPolicy", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_async", + "title": "Folders setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the access control policy on a TagValue, replacing any existing policy. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. The caller must have `resourcemanager.tagValues.setIamPolicy` permission on the identified tagValue.", + "canonical": true, + "file": "tag_values.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagValues.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.resourcemanager.v3.TagValues.SetIamPolicy", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + }, + { + "regionTag": "cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_async", + "title": "Folders testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified TagValue. The `resource` field should be the TagValue's resource name. For example: `tagValues/1234`. There are no permissions required for making this API call.", + "canonical": true, + "file": "tag_values.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.TagValues.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "TagValuesClient", + "fullName": "google.cloud.resourcemanager.v3.TagValuesClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.resourcemanager.v3.TagValues.TestIamPermissions", + "service": { + "shortName": "TagValues", + "fullName": "google.cloud.resourcemanager.v3.TagValues" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js new file mode 100644 index 000000000000..95cd2b8310a8 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.create_tag_binding.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(tagBinding) { + // [START cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The TagBinding to be created. + */ + // const tagBinding = {} + /** + * Optional. Set to true to perform the validations necessary for creating the resource, + * but not actually perform the action. + */ + // const validateOnly = true + + // Imports the Resourcemanager library + const {TagBindingsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagBindingsClient(); + + async function callCreateTagBinding() { + // Construct request + const request = { + tagBinding, + }; + + // Run request + const [operation] = await resourcemanagerClient.createTagBinding(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTagBinding(); + // [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js new file mode 100644 index 000000000000..0d3391b7ae99 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.delete_tag_binding.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {TagBindingsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagBindingsClient(); + + async function callDeleteTagBinding() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.deleteTagBinding(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTagBinding(); + // [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js new file mode 100644 index 000000000000..b85455ce370a --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_bindings.list_tag_bindings.js @@ -0,0 +1,76 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of a resource for which you want to list existing + * TagBindings. + * E.g. "//cloudresourcemanager.googleapis.com/projects/123" + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of TagBindings to return in the response. The server + * allows a maximum of 300 TagBindings to return. If unspecified, the server + * will use 100 as the default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `ListTagBindings` + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + + // Imports the Resourcemanager library + const {TagBindingsClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagBindingsClient(); + + async function callListTagBindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await resourcemanagerClient.listTagBindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTagBindings(); + // [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js new file mode 100644 index 000000000000..f9a46190139b --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.create_tag_key.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(tagKey) { + // [START cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The TagKey to be created. Only fields `short_name`, `description`, + * and `parent` are considered during the creation request. + */ + // const tagKey = {} + /** + * Optional. Set to true to perform validations necessary for creating the resource, but + * not actually perform the action. + */ + // const validateOnly = true + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callCreateTagKey() { + // Construct request + const request = { + tagKey, + }; + + // Run request + const [operation] = await resourcemanagerClient.createTagKey(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTagKey(); + // [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js new file mode 100644 index 000000000000..0bd4280054fa --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.delete_tag_key.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of a TagKey to be deleted in the format `tagKeys/123`. + * The TagKey cannot be a parent of any existing TagValues or it will not be + * deleted successfully. + */ + // const name = 'abc123' + /** + * Optional. Set as true to perform validations necessary for deletion, but not actually + * perform the action. + */ + // const validateOnly = true + /** + * Optional. The etag known to the client for the expected state of the TagKey. This is + * to be used for optimistic concurrency. + */ + // const etag = 'abc123' + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callDeleteTagKey() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.deleteTagKey(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTagKey(); + // [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js new file mode 100644 index 000000000000..0d8b9d312218 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await resourcemanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js new file mode 100644 index 000000000000..4c685057cf69 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.get_tag_key.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_TagKeys_GetTagKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callGetTagKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await resourcemanagerClient.getTagKey(request); + console.log(response); + } + + callGetTagKey(); + // [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js new file mode 100644 index 000000000000..c064499d644b --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.list_tag_keys.js @@ -0,0 +1,75 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the new TagKey's parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of TagKeys to return in the response. The server allows + * a maximum of 300 TagKeys to return. If unspecified, the server will use 100 + * as the default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callListTagKeys() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await resourcemanagerClient.listTagKeysAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTagKeys(); + // [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js new file mode 100644 index 000000000000..3de3d5a861ab --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await resourcemanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js new file mode 100644 index 000000000000..bb1133fd3b89 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await resourcemanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js new file mode 100644 index 000000000000..7770ced21342 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_keys.update_tag_key.js @@ -0,0 +1,76 @@ +// Copyright 2022 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'; + +function main(tagKey) { + // [START cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new definition of the TagKey. Only the `description` and `etag` fields + * can be updated by this request. If the `etag` field is not empty, it + * must match the `etag` field of the existing tag key. Otherwise, + * `FAILED_PRECONDITION` will be returned. + */ + // const tagKey = {} + /** + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + */ + // const updateMask = {} + /** + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + */ + // const validateOnly = true + + // Imports the Resourcemanager library + const {TagKeysClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagKeysClient(); + + async function callUpdateTagKey() { + // Construct request + const request = { + tagKey, + }; + + // Run request + const [operation] = await resourcemanagerClient.updateTagKey(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTagKey(); + // [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js new file mode 100644 index 000000000000..52e6fc1f6f76 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.create_tag_value.js @@ -0,0 +1,68 @@ +// Copyright 2022 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'; + +function main(tagValue) { + // [START cloudresourcemanager_v3_generated_TagValues_CreateTagValue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The TagValue to be created. Only fields `short_name`, `description`, + * and `parent` are considered during the creation request. + */ + // const tagValue = {} + /** + * Optional. Set as true to perform the validations necessary for creating the resource, + * but not actually perform the action. + */ + // const validateOnly = true + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callCreateTagValue() { + // Construct request + const request = { + tagValue, + }; + + // Run request + const [operation] = await resourcemanagerClient.createTagValue(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTagValue(); + // [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js new file mode 100644 index 000000000000..cc127be44e2d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.delete_tag_value.js @@ -0,0 +1,72 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name for TagValue to be deleted in the format tagValues/456. + */ + // const name = 'abc123' + /** + * Optional. Set as true to perform the validations necessary for deletion, but not + * actually perform the action. + */ + // const validateOnly = true + /** + * Optional. The etag known to the client for the expected state of the TagValue. This + * is to be used for optimistic concurrency. + */ + // const etag = 'abc123' + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callDeleteTagValue() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await resourcemanagerClient.deleteTagValue(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTagValue(); + // [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js new file mode 100644 index 000000000000..056798c3fb23 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2022 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'; + +function main(resource) { + // [START cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await resourcemanagerClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js new file mode 100644 index 000000000000..019ab5d143be --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.get_tag_value.js @@ -0,0 +1,61 @@ +// Copyright 2022 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'; + +function main(name) { + // [START cloudresourcemanager_v3_generated_TagValues_GetTagValue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + */ + // const name = 'abc123' + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callGetTagValue() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await resourcemanagerClient.getTagValue(request); + console.log(response); + } + + callGetTagValue(); + // [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js new file mode 100644 index 000000000000..ed8add2b22a7 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.list_tag_values.js @@ -0,0 +1,75 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START cloudresourcemanager_v3_generated_TagValues_ListTagValues_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name for TagKey, parent of the TagValues to be listed, + * in the format `tagKeys/123`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of TagValues to return in the response. The server + * allows a maximum of 300 TagValues to return. If unspecified, the server + * will use 100 as the default. + */ + // const pageSize = 1234 + /** + * Optional. A pagination token returned from a previous call to `ListTagValues` + * that indicates where this listing should continue from. + */ + // const pageToken = 'abc123' + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callListTagValues() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await resourcemanagerClient.listTagValuesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTagValues(); + // [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js new file mode 100644 index 000000000000..95cfa9c0301a --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2022 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'; + +function main(resource, policy) { + // [START cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await resourcemanagerClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js new file mode 100644 index 000000000000..7e9e24b5b163 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2022 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'; + +function main(resource, permissions) { + // [START cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = 'abc123' + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await resourcemanagerClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js new file mode 100644 index 000000000000..d4cfc202e550 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/generated/v3/tag_values.update_tag_value.js @@ -0,0 +1,74 @@ +// Copyright 2022 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'; + +function main(tagValue) { + // [START cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new definition of the TagValue. Only fields `description` and `etag` + * fields can be updated by this request. If the `etag` field is nonempty, it + * must match the `etag` field of the existing ControlGroup. Otherwise, + * `FAILED_PRECONDITION` will be returned. + */ + // const tagValue = {} + /** + * Optional. Fields to be updated. + */ + // const updateMask = {} + /** + * Optional. True to perform validations necessary for updating the resource, but not + * actually perform the action. + */ + // const validateOnly = true + + // Imports the Resourcemanager library + const {TagValuesClient} = require('@google-cloud/resource-manager').v3; + + // Instantiates a client + const resourcemanagerClient = new TagValuesClient(); + + async function callUpdateTagValue() { + // Construct request + const request = { + tagValue, + }; + + // Run request + const [operation] = await resourcemanagerClient.updateTagValue(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTagValue(); + // [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-resourcemanager/samples/package.json b/packages/google-cloud-resourcemanager/samples/package.json new file mode 100644 index 000000000000..95c79761fe4d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-docs-samples-resource-manager", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "repository": "googleapis/nodejs-resource-manager", + "files": [ + "*.js" + ], + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "mocha --timeout=600000" + }, + "dependencies": { + "@google-cloud/resource-manager": "^4.1.1" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-resourcemanager/samples/quickstart.js b/packages/google-cloud-resourcemanager/samples/quickstart.js new file mode 100644 index 000000000000..446f9abf5e1d --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/quickstart.js @@ -0,0 +1,41 @@ +// Copyright 2017 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. + +'use strict'; + +async function main() { + // [START cloudresourcemanager_quickstart] + // Imports the Google Cloud client library + const {ProjectsClient} = require('@google-cloud/resource-manager'); + + // Creates a client + const client = new ProjectsClient(); + + async function quickstart() { + // Lists current projects + const projects = client.searchProjectsAsync(); + console.log('Projects:'); + for await (const project of projects) { + console.info(project); + } + } + quickstart(); + // [END cloudresourcemanager_quickstart] +} + +main().catch(console.error); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-resourcemanager/samples/test/sample.test.js b/packages/google-cloud-resourcemanager/samples/test/sample.test.js new file mode 100644 index 000000000000..a46f12261fc7 --- /dev/null +++ b/packages/google-cloud-resourcemanager/samples/test/sample.test.js @@ -0,0 +1,28 @@ +// Copyright 2017 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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const {execSync} = require('child_process'); + +const exec = cmd => execSync(cmd, {encoding: 'utf-8'}); + +describe('resource samples', () => { + it('should list projects', () => { + const stdout = exec('node quickstart'); + assert.match(stdout, /Projects:/); + }); +}); diff --git a/packages/google-cloud-resourcemanager/src/index.ts b/packages/google-cloud-resourcemanager/src/index.ts new file mode 100644 index 000000000000..874e092a84e6 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/index.ts @@ -0,0 +1,53 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v3 from './v3'; + +const FoldersClient = v3.FoldersClient; +type FoldersClient = v3.FoldersClient; +const OrganizationsClient = v3.OrganizationsClient; +type OrganizationsClient = v3.OrganizationsClient; +const ProjectsClient = v3.ProjectsClient; +type ProjectsClient = v3.ProjectsClient; +const TagBindingsClient = v3.TagBindingsClient; +type TagBindingsClient = v3.TagBindingsClient; +const TagKeysClient = v3.TagKeysClient; +type TagKeysClient = v3.TagKeysClient; +const TagValuesClient = v3.TagValuesClient; +type TagValuesClient = v3.TagValuesClient; + +export { + v3, + FoldersClient, + OrganizationsClient, + ProjectsClient, + TagBindingsClient, + TagKeysClient, + TagValuesClient, +}; +export default { + v3, + FoldersClient, + OrganizationsClient, + ProjectsClient, + TagBindingsClient, + TagKeysClient, + TagValuesClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-resourcemanager/src/v3/folders_client.ts b/packages/google-cloud-resourcemanager/src/v3/folders_client.ts new file mode 100644 index 000000000000..ba65d5700617 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/folders_client.ts @@ -0,0 +1,2246 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v3/folders_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './folders_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages Cloud Platform folder resources. + * Folders can be used to organize the resources under an + * organization and to control the policies applied to groups of resources. + * @class + * @memberof v3 + */ +export class FoldersClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + foldersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FoldersClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 FoldersClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FoldersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + listFolders: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'folders' + ), + searchFolders: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'folders' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=operations/**}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createFolderResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Folder' + ) as gax.protobuf.Type; + const createFolderMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.CreateFolderMetadata' + ) as gax.protobuf.Type; + const updateFolderResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Folder' + ) as gax.protobuf.Type; + const updateFolderMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UpdateFolderMetadata' + ) as gax.protobuf.Type; + const moveFolderResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Folder' + ) as gax.protobuf.Type; + const moveFolderMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.MoveFolderMetadata' + ) as gax.protobuf.Type; + const deleteFolderResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Folder' + ) as gax.protobuf.Type; + const deleteFolderMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.DeleteFolderMetadata' + ) as gax.protobuf.Type; + const undeleteFolderResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Folder' + ) as gax.protobuf.Type; + const undeleteFolderMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UndeleteFolderMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFolderResponse.decode.bind(createFolderResponse), + createFolderMetadata.decode.bind(createFolderMetadata) + ), + updateFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFolderResponse.decode.bind(updateFolderResponse), + updateFolderMetadata.decode.bind(updateFolderMetadata) + ), + moveFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + moveFolderResponse.decode.bind(moveFolderResponse), + moveFolderMetadata.decode.bind(moveFolderMetadata) + ), + deleteFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFolderResponse.decode.bind(deleteFolderResponse), + deleteFolderMetadata.decode.bind(deleteFolderMetadata) + ), + undeleteFolder: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteFolderResponse.decode.bind(undeleteFolderResponse), + undeleteFolderMetadata.decode.bind(undeleteFolderMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.Folders', + 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.foldersStub) { + return this.foldersStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.Folders. + this.foldersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.Folders' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.Folders, + 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 foldersStubMethods = [ + 'getFolder', + 'listFolders', + 'searchFolders', + 'createFolder', + 'updateFolder', + 'moveFolder', + 'deleteFolder', + 'undeleteFolder', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of foldersStubMethods) { + const callPromise = this.foldersStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.foldersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves a folder identified by the supplied resource name. + * Valid folder resource names have the format `folders/{folder_id}` + * (for example, `folders/1234`). + * The caller must have `resourcemanager.folders.get` permission on the + * identified folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the folder to retrieve. + * Must be of the form `folders/{folder_id}`. + * @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 [Folder]{@link google.cloud.resourcemanager.v3.Folder}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/folders.get_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_GetFolder_async + */ + getFolder( + request?: protos.google.cloud.resourcemanager.v3.IGetFolderRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IGetFolderRequest | undefined, + {} | undefined + ] + >; + getFolder( + request: protos.google.cloud.resourcemanager.v3.IGetFolderRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IFolder, + | protos.google.cloud.resourcemanager.v3.IGetFolderRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFolder( + request: protos.google.cloud.resourcemanager.v3.IGetFolderRequest, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IFolder, + | protos.google.cloud.resourcemanager.v3.IGetFolderRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFolder( + request?: protos.google.cloud.resourcemanager.v3.IGetFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.resourcemanager.v3.IFolder, + | protos.google.cloud.resourcemanager.v3.IGetFolderRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.resourcemanager.v3.IFolder, + | protos.google.cloud.resourcemanager.v3.IGetFolderRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IGetFolderRequest | 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.getFolder(request, options, callback); + } + /** + * Gets the access control policy for a folder. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the folder's resource name, for example: "folders/1234". + * The caller must have `resourcemanager.folders.getIamPolicy` permission + * on the identified folder. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/folders.get_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Folders_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the access control policy on a folder, replacing any existing policy. + * The `resource` field should be the folder's resource name, for example: + * "folders/1234". + * The caller must have `resourcemanager.folders.setIamPolicy` permission + * on the identified folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/folders.set_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Folders_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns permissions that a caller has on the specified folder. + * The `resource` field should be the folder's resource name, + * for example: "folders/1234". + * + * There are no permissions required for making this API call. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/folders.test_iam_permissions.js + * region_tag:cloudresourcemanager_v3_generated_Folders_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Creates a folder in the resource hierarchy. + * Returns an `Operation` which can be used to track the progress of the + * folder creation workflow. + * Upon success, the `Operation.response` field will be populated with the + * created Folder. + * + * In order to succeed, the addition of this new folder must not violate + * the folder naming, height, or fanout constraints. + * + * + The folder's `display_name` must be distinct from all other folders that + * share its parent. + * + The addition of the folder must not cause the active folder hierarchy + * to exceed a height of 10. Note, the full active + deleted folder hierarchy + * is allowed to reach a height of 20; this provides additional headroom when + * moving folders that contain deleted folders. + * + The addition of the folder must not cause the total number of folders + * under its parent to exceed 300. + * + * If the operation fails due to a folder constraint violation, some errors + * may be returned by the `CreateFolder` request, with status code + * `FAILED_PRECONDITION` and an error description. Other folder constraint + * violations will be communicated in the `Operation`, with the specific + * `PreconditionFailure` returned in the details list in the `Operation.error` + * field. + * + * The caller must have `resourcemanager.folders.create` permission on the + * identified parent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.Folder} request.folder + * Required. The folder being created, only the display name and parent will be + * consulted. All other fields will be ignored. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.create_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_CreateFolder_async + */ + createFolder( + request?: protos.google.cloud.resourcemanager.v3.ICreateFolderRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createFolder( + request: protos.google.cloud.resourcemanager.v3.ICreateFolderRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createFolder( + request: protos.google.cloud.resourcemanager.v3.ICreateFolderRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createFolder( + request?: protos.google.cloud.resourcemanager.v3.ICreateFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >, + protos.google.longrunning.IOperation | 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 || {}; + this.initialize(); + return this.innerApiCalls.createFolder(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.create_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_CreateFolder_async + */ + async checkCreateFolderProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.CreateFolderMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createFolder, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.CreateFolderMetadata + >; + } + /** + * Updates a folder, changing its `display_name`. + * Changes to the folder `display_name` will be rejected if they violate + * either the `display_name` formatting rules or the naming constraints + * described in the {@link google.cloud.resourcemanager.v3.Folders.CreateFolder|CreateFolder} documentation. + * + * The folder's `display_name` must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * between 3 and 30 characters. This is captured by the regular expression: + * `{@link \p{L}\p{N}_- |\p{L}\p{N}}{1,28}[\p{L}\p{N}]`. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. + * + * If the update fails due to the unique name constraint then a + * `PreconditionFailure` explaining this violation will be returned + * in the Status.details field. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.Folder} request.folder + * Required. The new definition of the Folder. It must include the `name` field, which + * cannot be changed. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Fields to be updated. + * Only the `display_name` can be updated. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.update_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_UpdateFolder_async + */ + updateFolder( + request?: protos.google.cloud.resourcemanager.v3.IUpdateFolderRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateFolder( + request: protos.google.cloud.resourcemanager.v3.IUpdateFolderRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateFolder( + request: protos.google.cloud.resourcemanager.v3.IUpdateFolderRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateFolder( + request?: protos.google.cloud.resourcemanager.v3.IUpdateFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'folder.name': request.folder!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFolder(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.update_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_UpdateFolder_async + */ + async checkUpdateFolderProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.UpdateFolderMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateFolder, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.UpdateFolderMetadata + >; + } + /** + * Moves a folder under a new resource parent. + * Returns an `Operation` which can be used to track the progress of the + * folder move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved folder. + * Upon failure, a `FolderOperationError` categorizing the failure cause will + * be returned - if the failure occurs synchronously then the + * `FolderOperationError` will be returned in the `Status.details` field. + * If it occurs asynchronously, then the FolderOperation will be returned + * in the `Operation.error` field. + * In addition, the `Operation.metadata` field will be populated with a + * `FolderOperation` message as an aid to stateless clients. + * Folder moves will be rejected if they violate either the naming, height, + * or fanout constraints described in the + * {@link google.cloud.resourcemanager.v3.Folders.CreateFolder|CreateFolder} documentation. + * The caller must have `resourcemanager.folders.move` permission on the + * folder's current and proposed new parent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Folder to move. + * Must be of the form folders/{folder_id} + * @param {string} request.destinationParent + * Required. The resource name of the folder or organization which should be the + * folder's new parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.move_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_MoveFolder_async + */ + moveFolder( + request?: protos.google.cloud.resourcemanager.v3.IMoveFolderRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + moveFolder( + request: protos.google.cloud.resourcemanager.v3.IMoveFolderRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + moveFolder( + request: protos.google.cloud.resourcemanager.v3.IMoveFolderRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + moveFolder( + request?: protos.google.cloud.resourcemanager.v3.IMoveFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >, + protos.google.longrunning.IOperation | 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.moveFolder(request, options, callback); + } + /** + * Check the status of the long running operation returned by `moveFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.move_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_MoveFolder_async + */ + async checkMoveFolderProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.MoveFolderMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.moveFolder, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.MoveFolderMetadata + >; + } + /** + * Requests deletion of a folder. The folder is moved into the + * {@link google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED|DELETE_REQUESTED} state + * immediately, and is deleted approximately 30 days later. This method may + * only be called on an empty folder, where a folder is empty if it doesn't + * contain any folders or projects in the {@link google.cloud.resourcemanager.v3.Folder.State.ACTIVE|ACTIVE} state. + * If called on a folder in {@link google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED|DELETE_REQUESTED} + * state the operation will result in a no-op success. + * The caller must have `resourcemanager.folders.delete` permission on the + * identified folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the folder to be deleted. + * Must be of the form `folders/{folder_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.delete_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_DeleteFolder_async + */ + deleteFolder( + request?: protos.google.cloud.resourcemanager.v3.IDeleteFolderRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteFolder( + request: protos.google.cloud.resourcemanager.v3.IDeleteFolderRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteFolder( + request: protos.google.cloud.resourcemanager.v3.IDeleteFolderRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteFolder( + request?: protos.google.cloud.resourcemanager.v3.IDeleteFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >, + protos.google.longrunning.IOperation | 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.deleteFolder(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.delete_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_DeleteFolder_async + */ + async checkDeleteFolderProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.DeleteFolderMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteFolder, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.DeleteFolderMetadata + >; + } + /** + * Cancels the deletion request for a folder. This method may be called on a + * folder in any state. If the folder is in the {@link google.cloud.resourcemanager.v3.Folder.State.ACTIVE|ACTIVE} + * state the result will be a no-op success. In order to succeed, the folder's + * parent must be in the {@link google.cloud.resourcemanager.v3.Folder.State.ACTIVE|ACTIVE} state. In addition, + * reintroducing the folder into the tree must not violate folder naming, + * height, and fanout constraints described in the + * {@link google.cloud.resourcemanager.v3.Folders.CreateFolder|CreateFolder} documentation. + * The caller must have `resourcemanager.folders.undelete` permission on the + * identified folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the folder to undelete. + * Must be of the form `folders/{folder_id}`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.undelete_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_UndeleteFolder_async + */ + undeleteFolder( + request?: protos.google.cloud.resourcemanager.v3.IUndeleteFolderRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + undeleteFolder( + request: protos.google.cloud.resourcemanager.v3.IUndeleteFolderRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteFolder( + request: protos.google.cloud.resourcemanager.v3.IUndeleteFolderRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteFolder( + request?: protos.google.cloud.resourcemanager.v3.IUndeleteFolderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >, + protos.google.longrunning.IOperation | 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.undeleteFolder(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeleteFolder()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/folders.undelete_folder.js + * region_tag:cloudresourcemanager_v3_generated_Folders_UndeleteFolder_async + */ + async checkUndeleteFolderProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.UndeleteFolderMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeleteFolder, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Folder, + protos.google.cloud.resourcemanager.v3.UndeleteFolderMetadata + >; + } + /** + * Lists the folders that are direct descendants of supplied parent resource. + * `list()` provides a strongly consistent view of the folders underneath + * the specified parent resource. + * `list()` returns folders sorted based upon the (ascending) lexical ordering + * of their display_name. + * The caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the organization or folder whose folders are + * being listed. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @param {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * @param {boolean} [request.showDeleted] + * Optional. Controls whether folders in the + * {@link google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED|DELETE_REQUESTED} + * state should be returned. Defaults to false. + * @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 [Folder]{@link google.cloud.resourcemanager.v3.Folder}. + * 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 `listFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFolders( + request?: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder[], + protos.google.cloud.resourcemanager.v3.IListFoldersRequest | null, + protos.google.cloud.resourcemanager.v3.IListFoldersResponse + ] + >; + listFolders( + request: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + | protos.google.cloud.resourcemanager.v3.IListFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): void; + listFolders( + request: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + | protos.google.cloud.resourcemanager.v3.IListFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): void; + listFolders( + request?: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + | protos.google.cloud.resourcemanager.v3.IListFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + | protos.google.cloud.resourcemanager.v3.IListFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder[], + protos.google.cloud.resourcemanager.v3.IListFoldersRequest | null, + protos.google.cloud.resourcemanager.v3.IListFoldersResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listFolders(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 resource name of the organization or folder whose folders are + * being listed. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @param {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * @param {boolean} [request.showDeleted] + * Optional. Controls whether folders in the + * {@link google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED|DELETE_REQUESTED} + * state should be returned. Defaults to false. + * @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 [Folder]{@link google.cloud.resourcemanager.v3.Folder} 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 `listFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFoldersStream( + request?: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFolders.createStream( + this.innerApiCalls.listFolders as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listFolders`, 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 resource name of the organization or folder whose folders are + * being listed. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * Access to this method is controlled by checking the + * `resourcemanager.folders.list` permission on the `parent`. + * @param {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListFolders` + * that indicates where this listing should continue from. + * @param {boolean} [request.showDeleted] + * Optional. Controls whether folders in the + * {@link google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED|DELETE_REQUESTED} + * state should be returned. Defaults to false. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Folder]{@link google.cloud.resourcemanager.v3.Folder}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/folders.list_folders.js + * region_tag:cloudresourcemanager_v3_generated_Folders_ListFolders_async + */ + listFoldersAsync( + request?: protos.google.cloud.resourcemanager.v3.IListFoldersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFolders.asyncIterate( + this.innerApiCalls['listFolders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search for folders that match specific filter criteria. + * `search()` provides an eventually consistent view of the folders a user has + * access to which meet the specified filter criteria. + * + * This will only return folders on which the caller has the + * permission `resourcemanager.folders.get`. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchFolders` + * that indicates from where search should continue. + * @param {string} [request.query] + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * + * Some example queries are: + * + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * @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 [Folder]{@link google.cloud.resourcemanager.v3.Folder}. + * 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 `searchFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFolders( + request?: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder[], + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + ] + >; + searchFolders( + request: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + | protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): void; + searchFolders( + request: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + | protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): void; + searchFolders( + request?: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + | protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + | protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IFolder + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IFolder[], + protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchFoldersResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.searchFolders(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 {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchFolders` + * that indicates from where search should continue. + * @param {string} [request.query] + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * + * Some example queries are: + * + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * @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 [Folder]{@link google.cloud.resourcemanager.v3.Folder} 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 `searchFoldersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchFoldersStream( + request?: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFolders.createStream( + this.innerApiCalls.searchFolders as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchFolders`, 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 {number} [request.pageSize] + * Optional. The maximum number of folders to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchFolders` + * that indicates from where search should continue. + * @param {string} [request.query] + * Optional. Search criteria used to select the folders to return. + * If no search criteria is specified then all accessible folders will be + * returned. + * + * Query expressions can be used to restrict results based upon displayName, + * state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. + * + * The `displayName` field in a query expression should use escaped quotes + * for values that include whitespace to prevent unexpected behavior. + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------| + * | displayName | Filters by displayName. | + * | parent | Filters by parent (for example: folders/123). | + * | state, lifecycleState | Filters by state. | + * ``` + * + * Some example queries are: + * + * * Query `displayName=Test*` returns Folder resources whose display name + * starts with "Test". + * * Query `state=ACTIVE` returns Folder resources with + * `state` set to `ACTIVE`. + * * Query `parent=folders/123` returns Folder resources that have + * `folders/123` as a parent resource. + * * Query `parent=folders/123 AND state=ACTIVE` returns active + * Folder resources that have `folders/123` as a parent resource. + * * Query `displayName=\\"Test String\\"` returns Folder resources with + * display names that include both "Test" and "String". + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Folder]{@link google.cloud.resourcemanager.v3.Folder}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/folders.search_folders.js + * region_tag:cloudresourcemanager_v3_generated_Folders_SearchFolders_async + */ + searchFoldersAsync( + request?: protos.google.cloud.resourcemanager.v3.ISearchFoldersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchFolders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchFolders.asyncIterate( + this.innerApiCalls['searchFolders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.foldersStub && !this._terminated) { + return this.foldersStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/folders_client_config.json b/packages/google-cloud-resourcemanager/src/v3/folders_client_config.json new file mode 100644 index 000000000000..a2bed85d6e80 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/folders_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Folders": { + "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": { + "GetFolder": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListFolders": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SearchFolders": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteFolder": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/folders_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/folders_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/folders_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/src/v3/gapic_metadata.json b/packages/google-cloud-resourcemanager/src/v3/gapic_metadata.json new file mode 100644 index 000000000000..066fbe71144b --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/gapic_metadata.json @@ -0,0 +1,585 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.resourcemanager.v3", + "libraryPackage": "@google-cloud/resource-manager", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "FoldersClient", + "rpcs": { + "GetFolder": { + "methods": [ + "getFolder" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateFolder": { + "methods": [ + "createFolder" + ] + }, + "UpdateFolder": { + "methods": [ + "updateFolder" + ] + }, + "MoveFolder": { + "methods": [ + "moveFolder" + ] + }, + "DeleteFolder": { + "methods": [ + "deleteFolder" + ] + }, + "UndeleteFolder": { + "methods": [ + "undeleteFolder" + ] + }, + "ListFolders": { + "methods": [ + "listFolders", + "listFoldersStream", + "listFoldersAsync" + ] + }, + "SearchFolders": { + "methods": [ + "searchFolders", + "searchFoldersStream", + "searchFoldersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FoldersClient", + "rpcs": { + "GetFolder": { + "methods": [ + "getFolder" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateFolder": { + "methods": [ + "createFolder" + ] + }, + "UpdateFolder": { + "methods": [ + "updateFolder" + ] + }, + "MoveFolder": { + "methods": [ + "moveFolder" + ] + }, + "DeleteFolder": { + "methods": [ + "deleteFolder" + ] + }, + "UndeleteFolder": { + "methods": [ + "undeleteFolder" + ] + }, + "ListFolders": { + "methods": [ + "listFolders", + "listFoldersStream", + "listFoldersAsync" + ] + }, + "SearchFolders": { + "methods": [ + "searchFolders", + "searchFoldersStream", + "searchFoldersAsync" + ] + } + } + } + } + }, + "Organizations": { + "clients": { + "grpc": { + "libraryClient": "OrganizationsClient", + "rpcs": { + "GetOrganization": { + "methods": [ + "getOrganization" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "SearchOrganizations": { + "methods": [ + "searchOrganizations", + "searchOrganizationsStream", + "searchOrganizationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OrganizationsClient", + "rpcs": { + "GetOrganization": { + "methods": [ + "getOrganization" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "SearchOrganizations": { + "methods": [ + "searchOrganizations", + "searchOrganizationsStream", + "searchOrganizationsAsync" + ] + } + } + } + } + }, + "Projects": { + "clients": { + "grpc": { + "libraryClient": "ProjectsClient", + "rpcs": { + "GetProject": { + "methods": [ + "getProject" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateProject": { + "methods": [ + "createProject" + ] + }, + "UpdateProject": { + "methods": [ + "updateProject" + ] + }, + "MoveProject": { + "methods": [ + "moveProject" + ] + }, + "DeleteProject": { + "methods": [ + "deleteProject" + ] + }, + "UndeleteProject": { + "methods": [ + "undeleteProject" + ] + }, + "ListProjects": { + "methods": [ + "listProjects", + "listProjectsStream", + "listProjectsAsync" + ] + }, + "SearchProjects": { + "methods": [ + "searchProjects", + "searchProjectsStream", + "searchProjectsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProjectsClient", + "rpcs": { + "GetProject": { + "methods": [ + "getProject" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateProject": { + "methods": [ + "createProject" + ] + }, + "UpdateProject": { + "methods": [ + "updateProject" + ] + }, + "MoveProject": { + "methods": [ + "moveProject" + ] + }, + "DeleteProject": { + "methods": [ + "deleteProject" + ] + }, + "UndeleteProject": { + "methods": [ + "undeleteProject" + ] + }, + "ListProjects": { + "methods": [ + "listProjects", + "listProjectsStream", + "listProjectsAsync" + ] + }, + "SearchProjects": { + "methods": [ + "searchProjects", + "searchProjectsStream", + "searchProjectsAsync" + ] + } + } + } + } + }, + "TagBindings": { + "clients": { + "grpc": { + "libraryClient": "TagBindingsClient", + "rpcs": { + "CreateTagBinding": { + "methods": [ + "createTagBinding" + ] + }, + "DeleteTagBinding": { + "methods": [ + "deleteTagBinding" + ] + }, + "ListTagBindings": { + "methods": [ + "listTagBindings", + "listTagBindingsStream", + "listTagBindingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TagBindingsClient", + "rpcs": { + "CreateTagBinding": { + "methods": [ + "createTagBinding" + ] + }, + "DeleteTagBinding": { + "methods": [ + "deleteTagBinding" + ] + }, + "ListTagBindings": { + "methods": [ + "listTagBindings", + "listTagBindingsStream", + "listTagBindingsAsync" + ] + } + } + } + } + }, + "TagKeys": { + "clients": { + "grpc": { + "libraryClient": "TagKeysClient", + "rpcs": { + "GetTagKey": { + "methods": [ + "getTagKey" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateTagKey": { + "methods": [ + "createTagKey" + ] + }, + "UpdateTagKey": { + "methods": [ + "updateTagKey" + ] + }, + "DeleteTagKey": { + "methods": [ + "deleteTagKey" + ] + }, + "ListTagKeys": { + "methods": [ + "listTagKeys", + "listTagKeysStream", + "listTagKeysAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TagKeysClient", + "rpcs": { + "GetTagKey": { + "methods": [ + "getTagKey" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateTagKey": { + "methods": [ + "createTagKey" + ] + }, + "UpdateTagKey": { + "methods": [ + "updateTagKey" + ] + }, + "DeleteTagKey": { + "methods": [ + "deleteTagKey" + ] + }, + "ListTagKeys": { + "methods": [ + "listTagKeys", + "listTagKeysStream", + "listTagKeysAsync" + ] + } + } + } + } + }, + "TagValues": { + "clients": { + "grpc": { + "libraryClient": "TagValuesClient", + "rpcs": { + "GetTagValue": { + "methods": [ + "getTagValue" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateTagValue": { + "methods": [ + "createTagValue" + ] + }, + "UpdateTagValue": { + "methods": [ + "updateTagValue" + ] + }, + "DeleteTagValue": { + "methods": [ + "deleteTagValue" + ] + }, + "ListTagValues": { + "methods": [ + "listTagValues", + "listTagValuesStream", + "listTagValuesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TagValuesClient", + "rpcs": { + "GetTagValue": { + "methods": [ + "getTagValue" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateTagValue": { + "methods": [ + "createTagValue" + ] + }, + "UpdateTagValue": { + "methods": [ + "updateTagValue" + ] + }, + "DeleteTagValue": { + "methods": [ + "deleteTagValue" + ] + }, + "ListTagValues": { + "methods": [ + "listTagValues", + "listTagValuesStream", + "listTagValuesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/index.ts b/packages/google-cloud-resourcemanager/src/v3/index.ts new file mode 100644 index 000000000000..dc937f5b87d5 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/index.ts @@ -0,0 +1,24 @@ +// Copyright 2022 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 {FoldersClient} from './folders_client'; +export {OrganizationsClient} from './organizations_client'; +export {ProjectsClient} from './projects_client'; +export {TagBindingsClient} from './tag_bindings_client'; +export {TagKeysClient} from './tag_keys_client'; +export {TagValuesClient} from './tag_values_client'; diff --git a/packages/google-cloud-resourcemanager/src/v3/organizations_client.ts b/packages/google-cloud-resourcemanager/src/v3/organizations_client.ts new file mode 100644 index 000000000000..c2e1ebc86374 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/organizations_client.ts @@ -0,0 +1,1131 @@ +// Copyright 2022 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, +} 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/v3/organizations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './organizations_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Allows users to manage their organization resources. + * @class + * @memberof v3 + */ +export class OrganizationsClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + organizationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OrganizationsClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 OrganizationsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof OrganizationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + searchOrganizations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'organizations' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.Organizations', + 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.organizationsStub) { + return this.organizationsStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.Organizations. + this.organizationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.Organizations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.Organizations, + 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 organizationsStubMethods = [ + 'getOrganization', + 'searchOrganizations', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of organizationsStubMethods) { + const callPromise = this.organizationsStub.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.organizationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Fetches an organization resource identified by the specified resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Organization to fetch. This is the organization's + * relative path in the API, formatted as "organizations/[organizationId]". + * For example, "organizations/1234". + * @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 [Organization]{@link google.cloud.resourcemanager.v3.Organization}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/organizations.get_organization.js + * region_tag:cloudresourcemanager_v3_generated_Organizations_GetOrganization_async + */ + getOrganization( + request?: protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IOrganization, + ( + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | undefined + ), + {} | undefined + ] + >; + getOrganization( + request: protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IOrganization, + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganization( + request: protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IOrganization, + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getOrganization( + request?: protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.resourcemanager.v3.IOrganization, + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.resourcemanager.v3.IOrganization, + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IOrganization, + ( + | protos.google.cloud.resourcemanager.v3.IGetOrganizationRequest + | 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.getOrganization(request, options, callback); + } + /** + * Gets the access control policy for an organization resource. The policy may + * be empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/organizations.get_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the access control policy on an organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, for example: "organizations/123". + * + * Authorization requires the IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/organizations.set_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns the permissions that a caller has on the specified organization. + * The `resource` field should be the organization's resource name, + * for example: "organizations/123". + * + * There are no permissions required for making this API call. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/organizations.test_iam_permissions.js + * region_tag:cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Searches organization resources that are visible to the user and satisfy + * the specified filter. This method returns organizations in an unspecified + * order. New organizations do not necessarily appear at the end of the + * results, and may take a small amount of time to appear. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of organizations to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + * @param {string} [request.query] + * Optional. An optional query string used to filter the Organizations to return in + * the response. Query rules are case-insensitive. + * + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * @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 [Organization]{@link google.cloud.resourcemanager.v3.Organization}. + * 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 `searchOrganizationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchOrganizations( + request?: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IOrganization[], + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + ] + >; + searchOrganizations( + request: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IOrganization + > + ): void; + searchOrganizations( + request: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IOrganization + > + ): void; + searchOrganizations( + request?: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IOrganization + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IOrganization + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IOrganization[], + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchOrganizationsResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.searchOrganizations(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 {number} [request.pageSize] + * Optional. The maximum number of organizations to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + * @param {string} [request.query] + * Optional. An optional query string used to filter the Organizations to return in + * the response. Query rules are case-insensitive. + * + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * @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 [Organization]{@link google.cloud.resourcemanager.v3.Organization} 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 `searchOrganizationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchOrganizationsStream( + request?: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchOrganizations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchOrganizations.createStream( + this.innerApiCalls.searchOrganizations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchOrganizations`, 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 {number} [request.pageSize] + * Optional. The maximum number of organizations to return in the response. + * If unspecified, server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + * @param {string} [request.query] + * Optional. An optional query string used to filter the Organizations to return in + * the response. Query rules are case-insensitive. + * + * ``` + * | Field | Description | + * |------------------|--------------------------------------------| + * | directoryCustomerId, owner.directoryCustomerId | Filters by directory + * customer id. | + * | domain | Filters by domain. | + * ``` + * + * Organizations may be queried by `directoryCustomerId` or by + * `domain`, where the domain is a G Suite domain, for example: + * + * * Query `directorycustomerid:123456789` returns Organization + * resources with `owner.directory_customer_id` equal to `123456789`. + * * Query `domain:google.com` returns Organization resources corresponding + * to the domain `google.com`. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Organization]{@link google.cloud.resourcemanager.v3.Organization}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/organizations.search_organizations.js + * region_tag:cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_async + */ + searchOrganizationsAsync( + request?: protos.google.cloud.resourcemanager.v3.ISearchOrganizationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchOrganizations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchOrganizations.asyncIterate( + this.innerApiCalls['searchOrganizations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.organizationsStub && !this._terminated) { + return this.organizationsStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/organizations_client_config.json b/packages/google-cloud-resourcemanager/src/v3/organizations_client_config.json new file mode 100644 index 000000000000..ca62d9146f17 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/organizations_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Organizations": { + "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": { + "GetOrganization": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SearchOrganizations": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/organizations_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/organizations_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/organizations_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/src/v3/projects_client.ts b/packages/google-cloud-resourcemanager/src/v3/projects_client.ts new file mode 100644 index 000000000000..f107d3f433c5 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/projects_client.ts @@ -0,0 +1,2298 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v3/projects_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './projects_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages Google Cloud Projects. + * @class + * @memberof v3 + */ +export class ProjectsClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + projectsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProjectsClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 ProjectsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ProjectsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + listProjects: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'projects' + ), + searchProjects: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'projects' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=operations/**}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createProjectResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Project' + ) as gax.protobuf.Type; + const createProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.CreateProjectMetadata' + ) as gax.protobuf.Type; + const updateProjectResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Project' + ) as gax.protobuf.Type; + const updateProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UpdateProjectMetadata' + ) as gax.protobuf.Type; + const moveProjectResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Project' + ) as gax.protobuf.Type; + const moveProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.MoveProjectMetadata' + ) as gax.protobuf.Type; + const deleteProjectResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Project' + ) as gax.protobuf.Type; + const deleteProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.DeleteProjectMetadata' + ) as gax.protobuf.Type; + const undeleteProjectResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.Project' + ) as gax.protobuf.Type; + const undeleteProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UndeleteProjectMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createProjectResponse.decode.bind(createProjectResponse), + createProjectMetadata.decode.bind(createProjectMetadata) + ), + updateProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateProjectResponse.decode.bind(updateProjectResponse), + updateProjectMetadata.decode.bind(updateProjectMetadata) + ), + moveProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + moveProjectResponse.decode.bind(moveProjectResponse), + moveProjectMetadata.decode.bind(moveProjectMetadata) + ), + deleteProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProjectResponse.decode.bind(deleteProjectResponse), + deleteProjectMetadata.decode.bind(deleteProjectMetadata) + ), + undeleteProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeleteProjectResponse.decode.bind(undeleteProjectResponse), + undeleteProjectMetadata.decode.bind(undeleteProjectMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.Projects', + 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.projectsStub) { + return this.projectsStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.Projects. + this.projectsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.Projects' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.Projects, + 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 projectsStubMethods = [ + 'getProject', + 'listProjects', + 'searchProjects', + 'createProject', + 'updateProject', + 'moveProject', + 'deleteProject', + 'undeleteProject', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of projectsStubMethods) { + const callPromise = this.projectsStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.projectsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves the project identified by the specified `name` (for example, + * `projects/415104041262`). + * + * The caller must have `resourcemanager.projects.get` permission + * for this project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the project (for example, `projects/415104041262`). + * @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 [Project]{@link google.cloud.resourcemanager.v3.Project}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/projects.get_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_GetProject_async + */ + getProject( + request?: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IGetProjectRequest | undefined, + {} | undefined + ] + >; + getProject( + request: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IProject, + | protos.google.cloud.resourcemanager.v3.IGetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getProject( + request: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, + callback: Callback< + protos.google.cloud.resourcemanager.v3.IProject, + | protos.google.cloud.resourcemanager.v3.IGetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getProject( + request?: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.resourcemanager.v3.IProject, + | protos.google.cloud.resourcemanager.v3.IGetProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.resourcemanager.v3.IProject, + | protos.google.cloud.resourcemanager.v3.IGetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IGetProjectRequest | 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.getProject(request, options, callback); + } + /** + * Returns the IAM access control policy for the specified project. + * Permission is denied if the policy or the resource do not exist. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/projects.get_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Projects_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the IAM access control policy for the specified project. + * + * CAUTION: This method will replace the existing policy, and cannot be used + * to append additional IAM settings. + * + * Note: Removing service accounts from policies or changing their roles can + * render services completely inoperable. It is important to understand how + * the service account is being used before removing or updating its roles. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted to a `user`, `serviceAccount`, or a group + * that is part of an organization. For example, + * group@myownpersonaldomain.com could be added as an owner to a project in + * the myownpersonaldomain.com organization, but not the examplepetstore.com + * organization. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited using the Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + * + * + Calling this method requires enabling the App Engine Admin API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/projects.set_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_Projects_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns permissions that a caller has on the specified project. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/projects.test_iam_permissions.js + * region_tag:cloudresourcemanager_v3_generated_Projects_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Request that a new project be created. The result is an `Operation` which + * can be used to track the creation process. This process usually takes a few + * seconds, but can sometimes take much longer. The tracking `Operation` is + * automatically deleted after a few hours, so there is no need to call + * `DeleteOperation`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.Project} request.project + * Required. The Project to create. + * + * Project ID is required. If the requested ID is unavailable, the request + * fails. + * + * If the `parent` field is set, the `resourcemanager.projects.create` + * permission is checked on the parent resource. If no parent is set and + * the authorization credentials belong to an Organziation, the parent + * will be set to that Organization. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.create_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_CreateProject_async + */ + createProject( + request?: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createProject( + request: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createProject( + request: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createProject( + request?: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >, + protos.google.longrunning.IOperation | 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 || {}; + this.initialize(); + return this.innerApiCalls.createProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createProject()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.create_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_CreateProject_async + */ + async checkCreateProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.CreateProjectMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.CreateProjectMetadata + >; + } + /** + * Updates the `display_name` and labels of the project identified by the + * specified `name` (for example, `projects/415104041262`). Deleting all + * labels requires an update mask for labels field. + * + * The caller must have `resourcemanager.projects.update` permission for this + * project. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.Project} request.project + * Required. The new definition of the project. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. An update mask to selectively update fields. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.update_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_UpdateProject_async + */ + updateProject( + request?: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateProject( + request: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateProject( + request: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateProject( + request?: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'project.name': request.project!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateProject()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.update_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_UpdateProject_async + */ + async checkUpdateProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.UpdateProjectMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.UpdateProjectMetadata + >; + } + /** + * Move a project to another place in your resource hierarchy, under a new + * resource parent. + * + * Returns an operation which can be used to track the process of the project + * move workflow. + * Upon success, the `Operation.response` field will be populated with the + * moved project. + * + * The caller must have `resourcemanager.projects.update` permission on the + * project and have `resourcemanager.projects.move` permission on the + * project's current and proposed new parent. + * + * + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the project to move. + * @param {string} request.destinationParent + * Required. The new parent to move the Project under. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.move_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_MoveProject_async + */ + moveProject( + request?: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + moveProject( + request: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + moveProject( + request: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + moveProject( + request?: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >, + protos.google.longrunning.IOperation | 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.moveProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `moveProject()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.move_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_MoveProject_async + */ + async checkMoveProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.MoveProjectMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.moveProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.MoveProjectMetadata + >; + } + /** + * Marks the project identified by the specified + * `name` (for example, `projects/415104041262`) for deletion. + * + * This method will only affect the project if it has a lifecycle state of + * {@link google.cloud.resourcemanager.v3.Project.State.ACTIVE|ACTIVE}. + * + * This method changes the Project's lifecycle state from + * {@link google.cloud.resourcemanager.v3.Project.State.ACTIVE|ACTIVE} + * to {@link google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED|DELETE_REQUESTED}. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the project with [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * and the project remains visible to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects]. + * However, you cannot update the project. + * + * After the deletion completes, the project is not retrievable by + * the [GetProject] + * [google.cloud.resourcemanager.v3.Projects.GetProject], + * [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects], and + * {@link google.cloud.resourcemanager.v3.Projects.SearchProjects|SearchProjects} + * methods. + * + * This method behaves idempotently, such that deleting a `DELETE_REQUESTED` + * project will not cause an error, but also won't do anything. + * + * The caller must have `resourcemanager.projects.delete` permissions for this + * project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Project (for example, `projects/415104041262`). + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.delete_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_DeleteProject_async + */ + deleteProject( + request?: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteProject( + request: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteProject( + request: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteProject( + request?: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >, + protos.google.longrunning.IOperation | 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.deleteProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteProject()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.delete_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_DeleteProject_async + */ + async checkDeleteProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.DeleteProjectMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.DeleteProjectMetadata + >; + } + /** + * Restores the project identified by the specified + * `name` (for example, `projects/415104041262`). + * You can only use this method for a project that has a lifecycle state of + * [DELETE_REQUESTED] + * [Projects.State.DELETE_REQUESTED]. + * After deletion starts, the project cannot be restored. + * + * The caller must have `resourcemanager.projects.undelete` permission for + * this project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the project (for example, `projects/415104041262`). + * + * Required. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.undelete_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_UndeleteProject_async + */ + undeleteProject( + request?: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + undeleteProject( + request: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteProject( + request: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeleteProject( + request?: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >, + protos.google.longrunning.IOperation | 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.undeleteProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeleteProject()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/projects.undelete_project.js + * region_tag:cloudresourcemanager_v3_generated_Projects_UndeleteProject_async + */ + async checkUndeleteProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.UndeleteProjectMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.undeleteProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.Project, + protos.google.cloud.resourcemanager.v3.UndeleteProjectMetadata + >; + } + /** + * Lists projects that are direct children of the specified folder or + * organization resource. `list()` provides a strongly consistent view of the + * projects underneath the specified parent resource. `list()` returns + * projects sorted based upon the (ascending) lexical ordering of their + * `display_name`. The caller must have `resourcemanager.projects.list` + * permission on the identified parent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent resource to list projects under. + * + * For example, setting this field to 'folders/1234' would list all projects + * directly under that folder. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @param {boolean} [request.showDeleted] + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + * returned. Normally only `ACTIVE` projects are returned. + * @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 [Project]{@link google.cloud.resourcemanager.v3.Project}. + * 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 `listProjectsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listProjects( + request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject[], + protos.google.cloud.resourcemanager.v3.IListProjectsRequest | null, + protos.google.cloud.resourcemanager.v3.IListProjectsResponse + ] + >; + listProjects( + request: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + | protos.google.cloud.resourcemanager.v3.IListProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): void; + listProjects( + request: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + | protos.google.cloud.resourcemanager.v3.IListProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): void; + listProjects( + request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + | protos.google.cloud.resourcemanager.v3.IListProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + | protos.google.cloud.resourcemanager.v3.IListProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject[], + protos.google.cloud.resourcemanager.v3.IListProjectsRequest | null, + protos.google.cloud.resourcemanager.v3.IListProjectsResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listProjects(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 parent resource to list projects under. + * + * For example, setting this field to 'folders/1234' would list all projects + * directly under that folder. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @param {boolean} [request.showDeleted] + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + * returned. Normally only `ACTIVE` projects are returned. + * @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 [Project]{@link google.cloud.resourcemanager.v3.Project} 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 `listProjectsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listProjectsStream( + request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProjects.createStream( + this.innerApiCalls.listProjects as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listProjects`, 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 parent resource to list projects under. + * + * For example, setting this field to 'folders/1234' would list all projects + * directly under that folder. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @param {boolean} [request.showDeleted] + * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + * returned. Normally only `ACTIVE` projects are returned. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Project]{@link google.cloud.resourcemanager.v3.Project}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/projects.list_projects.js + * region_tag:cloudresourcemanager_v3_generated_Projects_ListProjects_async + */ + listProjectsAsync( + request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProjects.asyncIterate( + this.innerApiCalls['listProjects'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Search for projects that the caller has both `resourcemanager.projects.get` + * permission on, and also satisfy the specified query. + * + * This method returns projects in an unspecified order. + * + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the + * {@link google.cloud.resourcemanager.v3.Projects.GetProject|GetProject} method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.query] + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, the it will return results that match any of the + * fields. Some eligible fields are: + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------------| + * | displayName, name | Filters by displayName. | + * | parent | Project's parent. (for example: folders/123, + * organizations/*) Prefer parent field over parent.type and parent.id. | + * | parent.type | Parent's type: `folder` or `organization`. | + * | parent.id | Parent's id number (for example: 123) | + * | id, projectId | Filters by projectId. | + * | state, lifecycleState | Filters by state. | + * | labels | Filters by label name or value. | + * | labels. (where *key* is the name of a label) | Filters by label + * name. | + * ``` + * + * Search expressions are case insensitive. + * + * Some examples queries: + * + * ``` + * | Query | Description | + * |------------------|-----------------------------------------------------| + * | name:how* | The project's name starts with "how". | + * | name:Howl | The project's name is `Howl` or `howl`. | + * | name:HOWL | Equivalent to above. | + * | NAME:howl | Equivalent to above. | + * | labels.color:* | The project has the label `color`. | + * | labels.color:red | The project's label `color` has the value `red`. | + * | labels.color:red labels.size:big | The project's label `color` has + * the value `red` and its label `size` has the value `big`. | + * ``` + * + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @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 [Project]{@link google.cloud.resourcemanager.v3.Project}. + * 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 `searchProjectsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchProjects( + request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject[], + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + ] + >; + searchProjects( + request: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): void; + searchProjects( + request: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): void; + searchProjects( + request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + | protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.IProject + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.IProject[], + protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest | null, + protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.searchProjects(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.query] + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, the it will return results that match any of the + * fields. Some eligible fields are: + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------------| + * | displayName, name | Filters by displayName. | + * | parent | Project's parent. (for example: folders/123, + * organizations/*) Prefer parent field over parent.type and parent.id. | + * | parent.type | Parent's type: `folder` or `organization`. | + * | parent.id | Parent's id number (for example: 123) | + * | id, projectId | Filters by projectId. | + * | state, lifecycleState | Filters by state. | + * | labels | Filters by label name or value. | + * | labels. (where *key* is the name of a label) | Filters by label + * name. | + * ``` + * + * Search expressions are case insensitive. + * + * Some examples queries: + * + * ``` + * | Query | Description | + * |------------------|-----------------------------------------------------| + * | name:how* | The project's name starts with "how". | + * | name:Howl | The project's name is `Howl` or `howl`. | + * | name:HOWL | Equivalent to above. | + * | NAME:howl | Equivalent to above. | + * | labels.color:* | The project has the label `color`. | + * | labels.color:red | The project's label `color` has the value `red`. | + * | labels.color:red labels.size:big | The project's label `color` has + * the value `red` and its label `size` has the value `big`. | + * ``` + * + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @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 [Project]{@link google.cloud.resourcemanager.v3.Project} 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 `searchProjectsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + searchProjectsStream( + request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchProjects.createStream( + this.innerApiCalls.searchProjects as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchProjects`, 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.query] + * Optional. A query string for searching for projects that the caller has + * `resourcemanager.projects.get` permission to. If multiple fields are + * included in the query, the it will return results that match any of the + * fields. Some eligible fields are: + * + * ``` + * | Field | Description | + * |-------------------------|----------------------------------------------| + * | displayName, name | Filters by displayName. | + * | parent | Project's parent. (for example: folders/123, + * organizations/*) Prefer parent field over parent.type and parent.id. | + * | parent.type | Parent's type: `folder` or `organization`. | + * | parent.id | Parent's id number (for example: 123) | + * | id, projectId | Filters by projectId. | + * | state, lifecycleState | Filters by state. | + * | labels | Filters by label name or value. | + * | labels. (where *key* is the name of a label) | Filters by label + * name. | + * ``` + * + * Search expressions are case insensitive. + * + * Some examples queries: + * + * ``` + * | Query | Description | + * |------------------|-----------------------------------------------------| + * | name:how* | The project's name starts with "how". | + * | name:Howl | The project's name is `Howl` or `howl`. | + * | name:HOWL | Equivalent to above. | + * | NAME:howl | Equivalent to above. | + * | labels.color:* | The project has the label `color`. | + * | labels.color:red | The project's label `color` has the value `red`. | + * | labels.color:red labels.size:big | The project's label `color` has + * the value `red` and its label `size` has the value `big`. | + * ``` + * + * If no query is specified, the call will return projects for which the user + * has the `resourcemanager.projects.get` permission. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to [ListProjects] + * [google.cloud.resourcemanager.v3.Projects.ListProjects] + * that indicates from where listing should continue. + * @param {number} [request.pageSize] + * Optional. The maximum number of projects to return in the response. + * The server can return fewer projects than requested. + * If unspecified, server picks an appropriate default. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Project]{@link google.cloud.resourcemanager.v3.Project}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/projects.search_projects.js + * region_tag:cloudresourcemanager_v3_generated_Projects_SearchProjects_async + */ + searchProjectsAsync( + request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['searchProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchProjects.asyncIterate( + this.innerApiCalls['searchProjects'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.projectsStub && !this._terminated) { + return this.projectsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/projects_client_config.json b/packages/google-cloud-resourcemanager/src/v3/projects_client_config.json new file mode 100644 index 000000000000..f1308d459310 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/projects_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.Projects": { + "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": { + "GetProject": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListProjects": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SearchProjects": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/projects_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/projects_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/projects_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client.ts b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client.ts new file mode 100644 index 000000000000..357622bc6205 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client.ts @@ -0,0 +1,1033 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v3/tag_bindings_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tag_bindings_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Allow users to create and manage TagBindings between TagValues and + * different cloud resources throughout the GCP resource hierarchy. + * @class + * @memberof v3 + */ +export class TagBindingsClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + tagBindingsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TagBindingsClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 TagBindingsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TagBindingsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + listTagBindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tagBindings' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=operations/**}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTagBindingResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagBinding' + ) as gax.protobuf.Type; + const createTagBindingMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.CreateTagBindingMetadata' + ) as gax.protobuf.Type; + const deleteTagBindingResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTagBindingMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTagBinding: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTagBindingResponse.decode.bind(createTagBindingResponse), + createTagBindingMetadata.decode.bind(createTagBindingMetadata) + ), + deleteTagBinding: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTagBindingResponse.decode.bind(deleteTagBindingResponse), + deleteTagBindingMetadata.decode.bind(deleteTagBindingMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.TagBindings', + 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.tagBindingsStub) { + return this.tagBindingsStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.TagBindings. + this.tagBindingsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.TagBindings' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.TagBindings, + 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 tagBindingsStubMethods = [ + 'listTagBindings', + 'createTagBinding', + 'deleteTagBinding', + ]; + for (const methodName of tagBindingsStubMethods) { + const callPromise = this.tagBindingsStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tagBindingsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 TagBinding between a TagValue and a cloud resource + * (currently project, folder, or organization). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.TagBinding} request.tagBinding + * Required. The TagBinding to be created. + * @param {boolean} [request.validateOnly] + * Optional. Set to true to perform the validations necessary for creating the resource, + * but not actually perform the action. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_bindings.create_tag_binding.js + * region_tag:cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_async + */ + createTagBinding( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagBindingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTagBinding( + request: protos.google.cloud.resourcemanager.v3.ICreateTagBindingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagBinding( + request: protos.google.cloud.resourcemanager.v3.ICreateTagBindingRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagBinding( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagBindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >, + protos.google.longrunning.IOperation | 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 || {}; + this.initialize(); + return this.innerApiCalls.createTagBinding(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTagBinding()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_bindings.create_tag_binding.js + * region_tag:cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_async + */ + async checkCreateTagBindingProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagBinding, + protos.google.cloud.resourcemanager.v3.CreateTagBindingMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTagBinding, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagBinding, + protos.google.cloud.resourcemanager.v3.CreateTagBindingMetadata + >; + } + /** + * Deletes a TagBinding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the TagBinding. This is a String of the form: + * `tagBindings/{id}` (e.g. + * `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`). + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_bindings.delete_tag_binding.js + * region_tag:cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_async + */ + deleteTagBinding( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTagBinding( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagBinding( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagBinding( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagBindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >, + protos.google.longrunning.IOperation | 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.deleteTagBinding(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTagBinding()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_bindings.delete_tag_binding.js + * region_tag:cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_async + */ + async checkDeleteTagBindingProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteTagBinding, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + >; + } + /** + * Lists the TagBindings for the given cloud resource, as specified with + * `parent`. + * + * NOTE: The `parent` field is expected to be a full resource name: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The full resource name of a resource for which you want to list existing + * TagBindings. + * E.g. "//cloudresourcemanager.googleapis.com/projects/123" + * @param {number} [request.pageSize] + * Optional. The maximum number of TagBindings to return in the response. The server + * allows a maximum of 300 TagBindings to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagBindings` + * that indicates where this listing should continue from. + * @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 [TagBinding]{@link google.cloud.resourcemanager.v3.TagBinding}. + * 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 `listTagBindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagBindings( + request?: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagBinding[], + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + ] + >; + listTagBindings( + request: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + | protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagBinding + > + ): void; + listTagBindings( + request: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + | protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagBinding + > + ): void; + listTagBindings( + request?: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + | protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagBinding + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + | protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagBinding + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagBinding[], + protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagBindingsResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listTagBindings(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 full resource name of a resource for which you want to list existing + * TagBindings. + * E.g. "//cloudresourcemanager.googleapis.com/projects/123" + * @param {number} [request.pageSize] + * Optional. The maximum number of TagBindings to return in the response. The server + * allows a maximum of 300 TagBindings to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagBindings` + * that indicates where this listing should continue from. + * @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 [TagBinding]{@link google.cloud.resourcemanager.v3.TagBinding} 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 `listTagBindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagBindingsStream( + request?: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagBindings.createStream( + this.innerApiCalls.listTagBindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTagBindings`, 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 full resource name of a resource for which you want to list existing + * TagBindings. + * E.g. "//cloudresourcemanager.googleapis.com/projects/123" + * @param {number} [request.pageSize] + * Optional. The maximum number of TagBindings to return in the response. The server + * allows a maximum of 300 TagBindings to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagBindings` + * that indicates where this listing should continue from. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TagBinding]{@link google.cloud.resourcemanager.v3.TagBinding}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/tag_bindings.list_tag_bindings.js + * region_tag:cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_async + */ + listTagBindingsAsync( + request?: protos.google.cloud.resourcemanager.v3.IListTagBindingsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagBindings.asyncIterate( + this.innerApiCalls['listTagBindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.tagBindingsStub && !this._terminated) { + return this.tagBindingsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client_config.json b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client_config.json new file mode 100644 index 000000000000..25129f4ee675 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagBindings": { + "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": { + "ListTagBindings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTagBinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_bindings_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_bindings_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_keys_client.ts b/packages/google-cloud-resourcemanager/src/v3/tag_keys_client.ts new file mode 100644 index 000000000000..6cfe726f89ed --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_keys_client.ts @@ -0,0 +1,1576 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v3/tag_keys_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tag_keys_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Allow users to create and manage tag keys. + * @class + * @memberof v3 + */ +export class TagKeysClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + tagKeysStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TagKeysClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 TagKeysClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TagKeysClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + listTagKeys: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tagKeys' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=operations/**}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTagKeyResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagKey' + ) as gax.protobuf.Type; + const createTagKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.CreateTagKeyMetadata' + ) as gax.protobuf.Type; + const updateTagKeyResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagKey' + ) as gax.protobuf.Type; + const updateTagKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata' + ) as gax.protobuf.Type; + const deleteTagKeyResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagKey' + ) as gax.protobuf.Type; + const deleteTagKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTagKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTagKeyResponse.decode.bind(createTagKeyResponse), + createTagKeyMetadata.decode.bind(createTagKeyMetadata) + ), + updateTagKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTagKeyResponse.decode.bind(updateTagKeyResponse), + updateTagKeyMetadata.decode.bind(updateTagKeyMetadata) + ), + deleteTagKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTagKeyResponse.decode.bind(deleteTagKeyResponse), + deleteTagKeyMetadata.decode.bind(deleteTagKeyMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.TagKeys', + 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.tagKeysStub) { + return this.tagKeysStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.TagKeys. + this.tagKeysStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.TagKeys' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.TagKeys, + 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 tagKeysStubMethods = [ + 'listTagKeys', + 'getTagKey', + 'createTagKey', + 'updateTagKey', + 'deleteTagKey', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of tagKeysStubMethods) { + const callPromise = this.tagKeysStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tagKeysStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves a TagKey. This method will return `PERMISSION_DENIED` if the + * key does not exist or the user does not have permission to view it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A resource name in the format `tagKeys/{id}`, such as + * `tagKeys/123`. + * @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 [TagKey]{@link google.cloud.resourcemanager.v3.TagKey}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.get_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_GetTagKey_async + */ + getTagKey( + request?: protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest | undefined, + {} | undefined + ] + >; + getTagKey( + request: protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.resourcemanager.v3.ITagKey, + | protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTagKey( + request: protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest, + callback: Callback< + protos.google.cloud.resourcemanager.v3.ITagKey, + | protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTagKey( + request?: protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.resourcemanager.v3.ITagKey, + | protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.resourcemanager.v3.ITagKey, + | protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IGetTagKeyRequest | 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.getTagKey(request, options, callback); + } + /** + * Gets the access control policy for a TagKey. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagKey's resource name. For example, "tagKeys/1234". + * The caller must have + * `cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy` permission on + * the specified TagKey. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.get_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the access control policy on a TagKey, replacing any existing + * policy. The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * The caller must have `resourcemanager.tagKeys.setIamPolicy` permission + * on the identified tagValue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.set_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns permissions that a caller has on the specified TagKey. + * The `resource` field should be the TagKey's resource name. + * For example, "tagKeys/1234". + * + * There are no permissions required for making this API call. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.test_iam_permissions.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Creates a new TagKey. If another request with the same parameters is + * sent while the original request is in process, the second request + * will receive an error. A maximum of 300 TagKeys can exist under a parent at + * any given time. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.TagKey} request.tagKey + * Required. The TagKey to be created. Only fields `short_name`, `description`, + * and `parent` are considered during the creation request. + * @param {boolean} [request.validateOnly] + * Optional. Set to true to perform validations necessary for creating the resource, but + * not actually perform the action. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.create_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_async + */ + createTagKey( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTagKey( + request: protos.google.cloud.resourcemanager.v3.ICreateTagKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagKey( + request: protos.google.cloud.resourcemanager.v3.ICreateTagKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagKey( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >, + protos.google.longrunning.IOperation | 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 || {}; + this.initialize(); + return this.innerApiCalls.createTagKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTagKey()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.create_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_async + */ + async checkCreateTagKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.CreateTagKeyMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTagKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.CreateTagKeyMetadata + >; + } + /** + * Updates the attributes of the TagKey resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.TagKey} request.tagKey + * Required. The new definition of the TagKey. Only the `description` and `etag` fields + * can be updated by this request. If the `etag` field is not empty, it + * must match the `etag` field of the existing tag key. Otherwise, + * `FAILED_PRECONDITION` will be returned. + * @param {google.protobuf.FieldMask} request.updateMask + * Fields to be updated. The mask may only contain `description` or + * `etag`. If omitted entirely, both `description` and `etag` are assumed to + * be significant. + * @param {boolean} request.validateOnly + * Set as true to perform validations necessary for updating the resource, but + * not actually perform the action. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.update_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_async + */ + updateTagKey( + request?: protos.google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTagKey( + request: protos.google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTagKey( + request: protos.google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTagKey( + request?: protos.google.cloud.resourcemanager.v3.IUpdateTagKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'tag_key.name': request.tagKey!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTagKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTagKey()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.update_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_async + */ + async checkUpdateTagKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateTagKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata + >; + } + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child + * TagValues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of a TagKey to be deleted in the format `tagKeys/123`. + * The TagKey cannot be a parent of any existing TagValues or it will not be + * deleted successfully. + * @param {boolean} [request.validateOnly] + * Optional. Set as true to perform validations necessary for deletion, but not actually + * perform the action. + * @param {string} [request.etag] + * Optional. The etag known to the client for the expected state of the TagKey. This is + * to be used for optimistic concurrency. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.delete_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_async + */ + deleteTagKey( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTagKey( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagKey( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagKey( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >, + protos.google.longrunning.IOperation | 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.deleteTagKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTagKey()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.delete_tag_key.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_async + */ + async checkDeleteTagKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteTagKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagKey, + protos.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata + >; + } + /** + * Lists all TagKeys for a parent resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the new TagKey's parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagKeys to return in the response. The server allows + * a maximum of 300 TagKeys to return. If unspecified, the server will use 100 + * as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * @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 [TagKey]{@link google.cloud.resourcemanager.v3.TagKey}. + * 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 `listTagKeysAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagKeys( + request?: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagKey[], + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + ] + >; + listTagKeys( + request: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + | protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagKey + > + ): void; + listTagKeys( + request: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + | protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagKey + > + ): void; + listTagKeys( + request?: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + | protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagKey + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + | protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagKey + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagKey[], + protos.google.cloud.resourcemanager.v3.IListTagKeysRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagKeysResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listTagKeys(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 resource name of the new TagKey's parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagKeys to return in the response. The server allows + * a maximum of 300 TagKeys to return. If unspecified, the server will use 100 + * as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * @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 [TagKey]{@link google.cloud.resourcemanager.v3.TagKey} 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 `listTagKeysAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagKeysStream( + request?: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagKeys']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagKeys.createStream( + this.innerApiCalls.listTagKeys as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTagKeys`, 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 resource name of the new TagKey's parent. + * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagKeys to return in the response. The server allows + * a maximum of 300 TagKeys to return. If unspecified, the server will use 100 + * as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagKey` + * that indicates where this listing should continue from. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TagKey]{@link google.cloud.resourcemanager.v3.TagKey}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/tag_keys.list_tag_keys.js + * region_tag:cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_async + */ + listTagKeysAsync( + request?: protos.google.cloud.resourcemanager.v3.IListTagKeysRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagKeys']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagKeys.asyncIterate( + this.innerApiCalls['listTagKeys'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.tagKeysStub && !this._terminated) { + return this.tagKeysStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_keys_client_config.json b/packages/google-cloud-resourcemanager/src/v3/tag_keys_client_config.json new file mode 100644 index 000000000000..b72c6518fd29 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_keys_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagKeys": { + "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": { + "ListTagKeys": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTagKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_keys_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/tag_keys_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_keys_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_values_client.ts b/packages/google-cloud-resourcemanager/src/v3/tag_values_client.ts new file mode 100644 index 000000000000..7e437f9d7a9e --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_values_client.ts @@ -0,0 +1,1572 @@ +// Copyright 2022 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, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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/v3/tag_values_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tag_values_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Allow users to create and manage tag values. + * @class + * @memberof v3 + */ +export class TagValuesClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + tagValuesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TagValuesClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 TagValuesClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TagValuesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + folderPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}'), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + tagBindingPathTemplate: new this._gaxModule.PathTemplate( + 'tagBindings/{tag_binding}' + ), + tagKeyPathTemplate: new this._gaxModule.PathTemplate('tagKeys/{tag_key}'), + tagValuePathTemplate: new this._gaxModule.PathTemplate( + 'tagValues/{tag_value}' + ), + }; + + // 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 = { + listTagValues: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tagValues' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v3/{name=operations/**}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTagValueResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagValue' + ) as gax.protobuf.Type; + const createTagValueMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.CreateTagValueMetadata' + ) as gax.protobuf.Type; + const updateTagValueResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagValue' + ) as gax.protobuf.Type; + const updateTagValueMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.UpdateTagValueMetadata' + ) as gax.protobuf.Type; + const deleteTagValueResponse = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.TagValue' + ) as gax.protobuf.Type; + const deleteTagValueMetadata = protoFilesRoot.lookup( + '.google.cloud.resourcemanager.v3.DeleteTagValueMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTagValue: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTagValueResponse.decode.bind(createTagValueResponse), + createTagValueMetadata.decode.bind(createTagValueMetadata) + ), + updateTagValue: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTagValueResponse.decode.bind(updateTagValueResponse), + updateTagValueMetadata.decode.bind(updateTagValueMetadata) + ), + deleteTagValue: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTagValueResponse.decode.bind(deleteTagValueResponse), + deleteTagValueMetadata.decode.bind(deleteTagValueMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.resourcemanager.v3.TagValues', + 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.tagValuesStub) { + return this.tagValuesStub; + } + + // Put together the "service stub" for + // google.cloud.resourcemanager.v3.TagValues. + this.tagValuesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.resourcemanager.v3.TagValues' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.resourcemanager.v3.TagValues, + 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 tagValuesStubMethods = [ + 'listTagValues', + 'getTagValue', + 'createTagValue', + 'updateTagValue', + 'deleteTagValue', + 'getIamPolicy', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of tagValuesStubMethods) { + const callPromise = this.tagValuesStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tagValuesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudresourcemanager.googleapis.com'; + } + + /** + * 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/cloud-platform.read-only', + ]; + } + + 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 -- + // ------------------- + /** + * Retrieves TagValue. If the TagValue or namespaced name does not exist, or + * if the user does not have permission to view it, this method will return + * `PERMISSION_DENIED`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + * @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 [TagValue]{@link google.cloud.resourcemanager.v3.TagValue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.get_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_GetTagValue_async + */ + getTagValue( + request?: protos.google.cloud.resourcemanager.v3.IGetTagValueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IGetTagValueRequest | undefined, + {} | undefined + ] + >; + getTagValue( + request: protos.google.cloud.resourcemanager.v3.IGetTagValueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.resourcemanager.v3.ITagValue, + | protos.google.cloud.resourcemanager.v3.IGetTagValueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTagValue( + request: protos.google.cloud.resourcemanager.v3.IGetTagValueRequest, + callback: Callback< + protos.google.cloud.resourcemanager.v3.ITagValue, + | protos.google.cloud.resourcemanager.v3.IGetTagValueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTagValue( + request?: protos.google.cloud.resourcemanager.v3.IGetTagValueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.resourcemanager.v3.ITagValue, + | protos.google.cloud.resourcemanager.v3.IGetTagValueRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.resourcemanager.v3.ITagValue, + | protos.google.cloud.resourcemanager.v3.IGetTagValueRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IGetTagValueRequest | 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.getTagValue(request, options, callback); + } + /** + * Gets the access control policy for a TagValue. The returned policy may be + * empty if no such policy or resource exists. The `resource` field should + * be the TagValue's resource name. For example: `tagValues/1234`. + * The caller must have the + * `cloudresourcemanager.googleapis.com/tagValues.getIamPolicy` permission on + * the identified TagValue to get the access control policy. + * + * @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 {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.get_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + /** + * Sets the access control policy on a TagValue, replacing any existing + * policy. The `resource` field should be the TagValue's resource name. + * For example: `tagValues/1234`. + * The caller must have `resourcemanager.tagValues.setIamPolicy` permission + * on the identified tagValue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @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 [Policy]{@link google.iam.v1.Policy}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.set_iam_policy.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + /** + * Returns permissions that a caller has on the specified TagValue. + * The `resource` field should be the TagValue's resource name. For example: + * `tagValues/1234`. + * + * There are no permissions required for making this API call. + * + * @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 + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.test_iam_permissions.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | 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({ + resource: request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Creates a TagValue as a child of the specified TagKey. If a another + * request with the same parameters is sent while the original request is in + * process the second request will receive an error. A maximum of 300 + * TagValues can exist under a TagKey at any given time. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.TagValue} request.tagValue + * Required. The TagValue to be created. Only fields `short_name`, `description`, + * and `parent` are considered during the creation request. + * @param {boolean} [request.validateOnly] + * Optional. Set as true to perform the validations necessary for creating the resource, + * but not actually perform the action. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.create_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_CreateTagValue_async + */ + createTagValue( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagValueRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTagValue( + request: protos.google.cloud.resourcemanager.v3.ICreateTagValueRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagValue( + request: protos.google.cloud.resourcemanager.v3.ICreateTagValueRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTagValue( + request?: protos.google.cloud.resourcemanager.v3.ICreateTagValueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >, + protos.google.longrunning.IOperation | 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 || {}; + this.initialize(); + return this.innerApiCalls.createTagValue(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTagValue()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.create_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_CreateTagValue_async + */ + async checkCreateTagValueProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.CreateTagValueMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTagValue, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.CreateTagValueMetadata + >; + } + /** + * Updates the attributes of the TagValue resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.resourcemanager.v3.TagValue} request.tagValue + * Required. The new definition of the TagValue. Only fields `description` and `etag` + * fields can be updated by this request. If the `etag` field is nonempty, it + * must match the `etag` field of the existing ControlGroup. Otherwise, + * `FAILED_PRECONDITION` will be returned. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Fields to be updated. + * @param {boolean} [request.validateOnly] + * Optional. True to perform validations necessary for updating the resource, but not + * actually perform the action. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.update_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_async + */ + updateTagValue( + request?: protos.google.cloud.resourcemanager.v3.IUpdateTagValueRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTagValue( + request: protos.google.cloud.resourcemanager.v3.IUpdateTagValueRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTagValue( + request: protos.google.cloud.resourcemanager.v3.IUpdateTagValueRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTagValue( + request?: protos.google.cloud.resourcemanager.v3.IUpdateTagValueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >, + protos.google.longrunning.IOperation | 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({ + 'tag_value.name': request.tagValue!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTagValue(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTagValue()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.update_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_async + */ + async checkUpdateTagValueProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.UpdateTagValueMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateTagValue, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.UpdateTagValueMetadata + >; + } + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is + * deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for TagValue to be deleted in the format tagValues/456. + * @param {boolean} [request.validateOnly] + * Optional. Set as true to perform the validations necessary for deletion, but not + * actually perform the action. + * @param {string} [request.etag] + * Optional. The etag known to the client for the expected state of the TagValue. This + * is to be used for optimistic concurrency. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.delete_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_async + */ + deleteTagValue( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagValueRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTagValue( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagValueRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagValue( + request: protos.google.cloud.resourcemanager.v3.IDeleteTagValueRequest, + callback: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTagValue( + request?: protos.google.cloud.resourcemanager.v3.IDeleteTagValueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >, + protos.google.longrunning.IOperation | 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.deleteTagValue(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTagValue()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.delete_tag_value.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_async + */ + async checkDeleteTagValueProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.DeleteTagValueMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteTagValue, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.resourcemanager.v3.TagValue, + protos.google.cloud.resourcemanager.v3.DeleteTagValueMetadata + >; + } + /** + * Lists all TagValues for a specific TagKey. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name for TagKey, parent of the TagValues to be listed, + * in the format `tagKeys/123`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagValues to return in the response. The server + * allows a maximum of 300 TagValues to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagValues` + * that indicates where this listing should continue from. + * @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 [TagValue]{@link google.cloud.resourcemanager.v3.TagValue}. + * 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 `listTagValuesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagValues( + request?: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagValue[], + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + ] + >; + listTagValues( + request: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + | protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagValue + > + ): void; + listTagValues( + request: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + callback: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + | protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagValue + > + ): void; + listTagValues( + request?: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + | protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagValue + >, + callback?: PaginationCallback< + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + | protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + | null + | undefined, + protos.google.cloud.resourcemanager.v3.ITagValue + > + ): Promise< + [ + protos.google.cloud.resourcemanager.v3.ITagValue[], + protos.google.cloud.resourcemanager.v3.IListTagValuesRequest | null, + protos.google.cloud.resourcemanager.v3.IListTagValuesResponse + ] + > | 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 || {}; + this.initialize(); + return this.innerApiCalls.listTagValues(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. Resource name for TagKey, parent of the TagValues to be listed, + * in the format `tagKeys/123`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagValues to return in the response. The server + * allows a maximum of 300 TagValues to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagValues` + * that indicates where this listing should continue from. + * @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 [TagValue]{@link google.cloud.resourcemanager.v3.TagValue} 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 `listTagValuesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listTagValuesStream( + request?: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagValues']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagValues.createStream( + this.innerApiCalls.listTagValues as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTagValues`, 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. Resource name for TagKey, parent of the TagValues to be listed, + * in the format `tagKeys/123`. + * @param {number} [request.pageSize] + * Optional. The maximum number of TagValues to return in the response. The server + * allows a maximum of 300 TagValues to return. If unspecified, the server + * will use 100 as the default. + * @param {string} [request.pageToken] + * Optional. A pagination token returned from a previous call to `ListTagValues` + * that indicates where this listing should continue from. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TagValue]{@link google.cloud.resourcemanager.v3.TagValue}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v3/tag_values.list_tag_values.js + * region_tag:cloudresourcemanager_v3_generated_TagValues_ListTagValues_async + */ + listTagValuesAsync( + request?: protos.google.cloud.resourcemanager.v3.IListTagValuesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTagValues']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTagValues.asyncIterate( + this.innerApiCalls['listTagValues'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folder resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderPath(folder: string) { + return this.pathTemplates.folderPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from Folder resource. + * + * @param {string} folderName + * A fully-qualified path representing Folder resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderName(folderName: string) { + return this.pathTemplates.folderPathTemplate.match(folderName).folder; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * 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 tagBinding resource name string. + * + * @param {string} tag_binding + * @returns {string} Resource name string. + */ + tagBindingPath(tagBinding: string) { + return this.pathTemplates.tagBindingPathTemplate.render({ + tag_binding: tagBinding, + }); + } + + /** + * Parse the tag_binding from TagBinding resource. + * + * @param {string} tagBindingName + * A fully-qualified path representing TagBinding resource. + * @returns {string} A string representing the tag_binding. + */ + matchTagBindingFromTagBindingName(tagBindingName: string) { + return this.pathTemplates.tagBindingPathTemplate.match(tagBindingName) + .tag_binding; + } + + /** + * Return a fully-qualified tagKey resource name string. + * + * @param {string} tag_key + * @returns {string} Resource name string. + */ + tagKeyPath(tagKey: string) { + return this.pathTemplates.tagKeyPathTemplate.render({ + tag_key: tagKey, + }); + } + + /** + * Parse the tag_key from TagKey resource. + * + * @param {string} tagKeyName + * A fully-qualified path representing TagKey resource. + * @returns {string} A string representing the tag_key. + */ + matchTagKeyFromTagKeyName(tagKeyName: string) { + return this.pathTemplates.tagKeyPathTemplate.match(tagKeyName).tag_key; + } + + /** + * Return a fully-qualified tagValue resource name string. + * + * @param {string} tag_value + * @returns {string} Resource name string. + */ + tagValuePath(tagValue: string) { + return this.pathTemplates.tagValuePathTemplate.render({ + tag_value: tagValue, + }); + } + + /** + * Parse the tag_value from TagValue resource. + * + * @param {string} tagValueName + * A fully-qualified path representing TagValue resource. + * @returns {string} A string representing the tag_value. + */ + matchTagValueFromTagValueName(tagValueName: string) { + return this.pathTemplates.tagValuePathTemplate.match(tagValueName) + .tag_value; + } + + /** + * 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.tagValuesStub && !this._terminated) { + return this.tagValuesStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_values_client_config.json b/packages/google-cloud-resourcemanager/src/v3/tag_values_client_config.json new file mode 100644 index 000000000000..01ac77022d9d --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_values_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.resourcemanager.v3.TagValues": { + "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": { + "ListTagValues": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTagValue": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-resourcemanager/src/v3/tag_values_proto_list.json b/packages/google-cloud-resourcemanager/src/v3/tag_values_proto_list.json new file mode 100644 index 000000000000..0c0066033c06 --- /dev/null +++ b/packages/google-cloud-resourcemanager/src/v3/tag_values_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/resourcemanager/v3/folders.proto", + "../../protos/google/cloud/resourcemanager/v3/organizations.proto", + "../../protos/google/cloud/resourcemanager/v3/projects.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_bindings.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_keys.proto", + "../../protos/google/cloud/resourcemanager/v3/tag_values.proto" +] diff --git a/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.js b/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..caf52033cf86 --- /dev/null +++ b/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.js @@ -0,0 +1,31 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const resourcemanager = require('@google-cloud/resource-manager'); + +function main() { + const foldersClient = new resourcemanager.FoldersClient(); + const organizationsClient = new resourcemanager.OrganizationsClient(); + const projectsClient = new resourcemanager.ProjectsClient(); + const tagBindingsClient = new resourcemanager.TagBindingsClient(); + const tagKeysClient = new resourcemanager.TagKeysClient(); + const tagValuesClient = new resourcemanager.TagValuesClient(); +} + +main(); diff --git a/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..199ff029bb04 --- /dev/null +++ b/packages/google-cloud-resourcemanager/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,69 @@ +// Copyright 2022 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 { + FoldersClient, + OrganizationsClient, + ProjectsClient, + TagBindingsClient, + TagKeysClient, + TagValuesClient, +} from '@google-cloud/resource-manager'; + +// check that the client class type name can be used +function doStuffWithFoldersClient(client: FoldersClient) { + client.close(); +} +function doStuffWithOrganizationsClient(client: OrganizationsClient) { + client.close(); +} +function doStuffWithProjectsClient(client: ProjectsClient) { + client.close(); +} +function doStuffWithTagBindingsClient(client: TagBindingsClient) { + client.close(); +} +function doStuffWithTagKeysClient(client: TagKeysClient) { + client.close(); +} +function doStuffWithTagValuesClient(client: TagValuesClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const foldersClient = new FoldersClient(); + doStuffWithFoldersClient(foldersClient); + // check that the client instance can be created + const organizationsClient = new OrganizationsClient(); + doStuffWithOrganizationsClient(organizationsClient); + // check that the client instance can be created + const projectsClient = new ProjectsClient(); + doStuffWithProjectsClient(projectsClient); + // check that the client instance can be created + const tagBindingsClient = new TagBindingsClient(); + doStuffWithTagBindingsClient(tagBindingsClient); + // check that the client instance can be created + const tagKeysClient = new TagKeysClient(); + doStuffWithTagKeysClient(tagKeysClient); + // check that the client instance can be created + const tagValuesClient = new TagValuesClient(); + doStuffWithTagValuesClient(tagValuesClient); +} + +main(); diff --git a/packages/google-cloud-resourcemanager/system-test/install.ts b/packages/google-cloud-resourcemanager/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-cloud-resourcemanager/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_folders_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_folders_v3.ts new file mode 100644 index 000000000000..843c46d1ee96 --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_folders_v3.ts @@ -0,0 +1,2375 @@ +// Copyright 2022 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 foldersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v3.FoldersClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = foldersModule.v3.FoldersClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = foldersModule.v3.FoldersClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = foldersModule.v3.FoldersClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new foldersModule.v3.FoldersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new foldersModule.v3.FoldersClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.foldersStub, undefined); + await client.initialize(); + assert(client.foldersStub); + }); + + it('has close method for the initialized client', done => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.foldersStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.foldersStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new foldersModule.v3.FoldersClient({ + 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 foldersModule.v3.FoldersClient({ + 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('getFolder', () => { + it('invokes getFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ); + client.innerApiCalls.getFolder = stubSimpleCall(expectedResponse); + const [response] = await client.getFolder(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ); + client.innerApiCalls.getFolder = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFolder( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IFolder | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolder with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFolder = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFolder(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFolder with closed client', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFolder(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createFolder', () => { + it('invokes createFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateFolderRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFolder = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateFolderRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFolder = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFolder( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.ICreateFolderMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createFolder with call error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateFolderRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createFolder = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createFolder(request), expectedError); + }); + + it('invokes createFolder with LRO error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateFolderRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createFolder = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createFolder(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateFolderProgress without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFolderProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFolderProgress with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateFolderProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateFolder', () => { + it('invokes updateFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateFolderRequest() + ); + request.folder ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateFolderRequest', + ['folder', 'name'] + ); + request.folder.name = defaultValue1; + const expectedHeaderRequestParams = `folder.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFolder = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateFolderRequest() + ); + request.folder ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateFolderRequest', + ['folder', 'name'] + ); + request.folder.name = defaultValue1; + const expectedHeaderRequestParams = `folder.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFolder = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFolder( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUpdateFolderMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolder with call error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateFolderRequest() + ); + request.folder ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateFolderRequest', + ['folder', 'name'] + ); + request.folder.name = defaultValue1; + const expectedHeaderRequestParams = `folder.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFolder = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateFolder(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFolder with LRO error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateFolderRequest() + ); + request.folder ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateFolderRequest', + ['folder', 'name'] + ); + request.folder.name = defaultValue1; + const expectedHeaderRequestParams = `folder.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFolder = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateFolder(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateFolderProgress without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateFolderProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFolderProgress with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateFolderProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('moveFolder', () => { + it('invokes moveFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveFolder = stubLongRunningCall(expectedResponse); + const [operation] = await client.moveFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveFolder = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveFolder( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IMoveFolderMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveFolder with call error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveFolder = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.moveFolder(request), expectedError); + const actualRequest = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveFolder with LRO error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveFolder = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.moveFolder(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMoveFolderProgress without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMoveFolderProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMoveFolderProgress with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkMoveFolderProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteFolder', () => { + it('invokes deleteFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFolder = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFolder = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFolder( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IDeleteFolderMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFolder with call error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFolder = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteFolder(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFolder with LRO error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFolder = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteFolder(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteFolderProgress without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFolderProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFolderProgress with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteFolderProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeleteFolder', () => { + it('invokes undeleteFolder without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteFolder = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteFolder(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteFolder without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteFolder = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteFolder( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IFolder, + protos.google.cloud.resourcemanager.v3.IUndeleteFolderMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteFolder with call error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteFolder = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeleteFolder(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteFolder with LRO error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteFolderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteFolderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteFolder = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeleteFolder(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteFolder as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteFolderProgress without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteFolderProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteFolderProgress with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUndeleteFolderProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listFolders', () => { + it('invokes listFolders without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.innerApiCalls.listFolders = stubSimpleCall(expectedResponse); + const [response] = await client.listFolders(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listFolders without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.innerApiCalls.listFolders = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFolders( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IFolder[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listFolders with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listFolders = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFolders(request), expectedError); + }); + + it('invokes listFoldersStream without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.descriptors.page.listFolders.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Folder[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Folder) => { + 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.listFolders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFolders, request) + ); + }); + + it('invokes listFoldersStream with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listFolders.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Folder[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Folder) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFolders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFolders, request) + ); + }); + + it('uses async iteration with listFolders without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.descriptors.page.listFolders.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.IFolder[] = []; + const iterable = client.listFoldersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFolders.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + + it('uses async iteration with listFolders with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListFoldersRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listFolders.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listFoldersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.IFolder[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFolders.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + }); + + describe('searchFolders', () => { + it('invokes searchFolders without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.innerApiCalls.searchFolders = stubSimpleCall(expectedResponse); + const [response] = await client.searchFolders(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchFolders without error using callback', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.innerApiCalls.searchFolders = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchFolders( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IFolder[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchFolders with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchFolders = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchFolders(request), expectedError); + }); + + it('invokes searchFoldersStream without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.descriptors.page.searchFolders.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Folder[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Folder) => { + 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.searchFolders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchFolders, request) + ); + }); + + it('invokes searchFoldersStream with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchFolders.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchFoldersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Folder[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Folder) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchFolders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchFolders, request) + ); + }); + + it('uses async iteration with searchFolders without error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Folder() + ), + ]; + client.descriptors.page.searchFolders.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.IFolder[] = []; + const iterable = client.searchFoldersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchFolders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with searchFolders with error', async () => { + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchFoldersRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchFolders.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchFoldersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.IFolder[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchFolders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new foldersModule.v3.FoldersClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new foldersModule.v3.FoldersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_organizations_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_organizations_v3.ts new file mode 100644 index 000000000000..e6e74d8fd5c0 --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_organizations_v3.ts @@ -0,0 +1,1218 @@ +// Copyright 2022 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 organizationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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('v3.OrganizationsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + organizationsModule.v3.OrganizationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + organizationsModule.v3.OrganizationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = organizationsModule.v3.OrganizationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new organizationsModule.v3.OrganizationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new organizationsModule.v3.OrganizationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.organizationsStub, undefined); + await client.initialize(); + assert(client.organizationsStub); + }); + + it('has close method for the initialized client', done => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.organizationsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.organizationsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new organizationsModule.v3.OrganizationsClient({ + 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 organizationsModule.v3.OrganizationsClient({ + 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('getOrganization', () => { + it('invokes getOrganization without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetOrganizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetOrganizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ); + client.innerApiCalls.getOrganization = stubSimpleCall(expectedResponse); + const [response] = await client.getOrganization(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganization without error using callback', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetOrganizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetOrganizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ); + client.innerApiCalls.getOrganization = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOrganization( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IOrganization | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganization with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetOrganizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetOrganizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOrganization = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getOrganization(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getOrganization as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOrganization with closed client', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetOrganizationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetOrganizationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOrganization(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('searchOrganizations', () => { + it('invokes searchOrganizations without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + ]; + client.innerApiCalls.searchOrganizations = + stubSimpleCall(expectedResponse); + const [response] = await client.searchOrganizations(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchOrganizations without error using callback', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + ]; + client.innerApiCalls.searchOrganizations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchOrganizations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.resourcemanager.v3.IOrganization[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchOrganizations with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchOrganizations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchOrganizations(request), expectedError); + }); + + it('invokes searchOrganizationsStream without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + ]; + client.descriptors.page.searchOrganizations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchOrganizationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Organization[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Organization) => { + 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.searchOrganizations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchOrganizations, request) + ); + }); + + it('invokes searchOrganizationsStream with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchOrganizations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchOrganizationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Organization[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Organization) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchOrganizations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchOrganizations, request) + ); + }); + + it('uses async iteration with searchOrganizations without error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Organization() + ), + ]; + client.descriptors.page.searchOrganizations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.IOrganization[] = + []; + const iterable = client.searchOrganizationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchOrganizations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with searchOrganizations with error', async () => { + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchOrganizationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchOrganizations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchOrganizationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.IOrganization[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchOrganizations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new organizationsModule.v3.OrganizationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_projects_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_projects_v3.ts new file mode 100644 index 000000000000..f615383b40bb --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_projects_v3.ts @@ -0,0 +1,2388 @@ +// Copyright 2022 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 projectsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v3.ProjectsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = projectsModule.v3.ProjectsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = projectsModule.v3.ProjectsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = projectsModule.v3.ProjectsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new projectsModule.v3.ProjectsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new projectsModule.v3.ProjectsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.projectsStub, undefined); + await client.initialize(); + assert(client.projectsStub); + }); + + it('has close method for the initialized client', done => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.projectsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.projectsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new projectsModule.v3.ProjectsClient({ + 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 projectsModule.v3.ProjectsClient({ + 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('getProject', () => { + it('invokes getProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ); + client.innerApiCalls.getProject = stubSimpleCall(expectedResponse); + const [response] = await client.getProject(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ); + client.innerApiCalls.getProject = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProject( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProject = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject with closed client', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProject(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createProject', () => { + it('invokes createProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateProjectRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateProjectRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createProject with call error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateProjectRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createProject(request), expectedError); + }); + + it('invokes createProject with LRO error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateProjectRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createProject(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateProjectProgress without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateProjectProgress with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateProject', () => { + it('invokes updateProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateProjectRequest() + ); + request.project ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateProjectRequest', + ['project', 'name'] + ); + request.project.name = defaultValue1; + const expectedHeaderRequestParams = `project.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateProjectRequest() + ); + request.project ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateProjectRequest', + ['project', 'name'] + ); + request.project.name = defaultValue1; + const expectedHeaderRequestParams = `project.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProject with call error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateProjectRequest() + ); + request.project ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateProjectRequest', + ['project', 'name'] + ); + request.project.name = defaultValue1; + const expectedHeaderRequestParams = `project.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProject with LRO error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateProjectRequest() + ); + request.project ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateProjectRequest', + ['project', 'name'] + ); + request.project.name = defaultValue1; + const expectedHeaderRequestParams = `project.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateProjectProgress without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateProjectProgress with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('moveProject', () => { + it('invokes moveProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveProject = stubLongRunningCall(expectedResponse); + const [operation] = await client.moveProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.moveProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveProject with call error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.moveProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes moveProject with LRO error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.MoveProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.MoveProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.moveProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.moveProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkMoveProjectProgress without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkMoveProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkMoveProjectProgress with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkMoveProjectProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteProject', () => { + it('invokes deleteProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProject with call error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProject with LRO error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProjectProgress without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProjectProgress with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeleteProject', () => { + it('invokes undeleteProject without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeleteProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteProject without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeleteProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.IProject, + protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteProject with call error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeleteProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteProject with LRO error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UndeleteProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UndeleteProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeleteProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeleteProjectProgress without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeleteProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeleteProjectProgress with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUndeleteProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listProjects', () => { + it('invokes listProjects without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.innerApiCalls.listProjects = stubSimpleCall(expectedResponse); + const [response] = await client.listProjects(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProjects without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.innerApiCalls.listProjects = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProjects( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IProject[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProjects with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listProjects = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listProjects(request), expectedError); + }); + + it('invokes listProjectsStream without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.descriptors.page.listProjects.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Project) => { + 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.listProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProjects, request) + ); + }); + + it('invokes listProjectsStream with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listProjects.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Project) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProjects, request) + ); + }); + + it('uses async iteration with listProjects without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.descriptors.page.listProjects.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.IProject[] = []; + const iterable = client.listProjectsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listProjects with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListProjectsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listProjects.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProjectsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.IProject[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('searchProjects', () => { + it('invokes searchProjects without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.innerApiCalls.searchProjects = stubSimpleCall(expectedResponse); + const [response] = await client.searchProjects(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchProjects without error using callback', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.innerApiCalls.searchProjects = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchProjects( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.IProject[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes searchProjects with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.searchProjects = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchProjects(request), expectedError); + }); + + it('invokes searchProjectsStream without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.descriptors.page.searchProjects.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Project) => { + 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.searchProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchProjects, request) + ); + }); + + it('invokes searchProjectsStream with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchProjects.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.Project) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchProjects, request) + ); + }); + + it('uses async iteration with searchProjects without error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.Project() + ), + ]; + client.descriptors.page.searchProjects.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.IProject[] = []; + const iterable = client.searchProjectsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with searchProjects with error', async () => { + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.SearchProjectsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.searchProjects.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchProjectsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.IProject[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new projectsModule.v3.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_tag_bindings_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_tag_bindings_v3.ts new file mode 100644 index 000000000000..3df0d461ba34 --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_tag_bindings_v3.ts @@ -0,0 +1,1056 @@ +// Copyright 2022 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 tagbindingsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v3.TagBindingsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = tagbindingsModule.v3.TagBindingsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = tagbindingsModule.v3.TagBindingsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tagbindingsModule.v3.TagBindingsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tagbindingsModule.v3.TagBindingsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagBindingsStub, undefined); + await client.initialize(); + assert(client.tagBindingsStub); + }); + + it('has close method for the initialized client', done => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tagBindingsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagBindingsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tagbindingsModule.v3.TagBindingsClient({ + 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 tagbindingsModule.v3.TagBindingsClient({ + 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('createTagBinding', () => { + it('invokes createTagBinding without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagBindingRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagBinding = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTagBinding(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagBinding without error using callback', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagBindingRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagBinding = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTagBinding( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagBinding, + protos.google.cloud.resourcemanager.v3.ICreateTagBindingMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagBinding with call error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagBindingRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagBinding = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTagBinding(request), expectedError); + }); + + it('invokes createTagBinding with LRO error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagBindingRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagBinding = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTagBinding(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateTagBindingProgress without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTagBindingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTagBindingProgress with error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTagBindingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTagBinding', () => { + it('invokes deleteTagBinding without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagBinding = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTagBinding(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagBinding without error using callback', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagBinding = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTagBinding( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.resourcemanager.v3.IDeleteTagBindingMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagBinding with call error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagBinding = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTagBinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagBinding with LRO error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagBinding = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTagBinding(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTagBindingProgress without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTagBindingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTagBindingProgress with error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteTagBindingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTagBindings', () => { + it('invokes listTagBindings without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + ]; + client.innerApiCalls.listTagBindings = stubSimpleCall(expectedResponse); + const [response] = await client.listTagBindings(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagBindings without error using callback', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + ]; + client.innerApiCalls.listTagBindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTagBindings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.ITagBinding[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagBindings with error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTagBindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTagBindings(request), expectedError); + }); + + it('invokes listTagBindingsStream without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + ]; + client.descriptors.page.listTagBindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTagBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagBinding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagBinding) => { + 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.listTagBindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagBindings, request) + ); + }); + + it('invokes listTagBindingsStream with error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagBindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTagBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagBinding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagBinding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTagBindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagBindings, request) + ); + }); + + it('uses async iteration with listTagBindings without error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagBinding() + ), + ]; + client.descriptors.page.listTagBindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.ITagBinding[] = + []; + const iterable = client.listTagBindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTagBindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listTagBindings with error', async () => { + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagBindingsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagBindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTagBindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.ITagBinding[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTagBindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new tagbindingsModule.v3.TagBindingsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_tag_keys_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_tag_keys_v3.ts new file mode 100644 index 000000000000..2bcd995e9012 --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_tag_keys_v3.ts @@ -0,0 +1,1760 @@ +// Copyright 2022 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 tagkeysModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v3.TagKeysClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = tagkeysModule.v3.TagKeysClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = tagkeysModule.v3.TagKeysClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tagkeysModule.v3.TagKeysClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tagkeysModule.v3.TagKeysClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tagkeysModule.v3.TagKeysClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagKeysStub, undefined); + await client.initialize(); + assert(client.tagKeysStub); + }); + + it('has close method for the initialized client', done => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tagKeysStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagKeysStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tagkeysModule.v3.TagKeysClient({ + 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 tagkeysModule.v3.TagKeysClient({ + 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('getTagKey', () => { + it('invokes getTagKey without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ); + client.innerApiCalls.getTagKey = stubSimpleCall(expectedResponse); + const [response] = await client.getTagKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagKey without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ); + client.innerApiCalls.getTagKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTagKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.ITagKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagKey with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTagKey = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTagKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagKey with closed client', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTagKey(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createTagKey', () => { + it('invokes createTagKey without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagKeyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTagKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagKey without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagKeyRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTagKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.ICreateTagKeyMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagKey with call error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagKeyRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTagKey(request), expectedError); + }); + + it('invokes createTagKey with LRO error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagKeyRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTagKey(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateTagKeyProgress without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTagKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTagKeyProgress with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateTagKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTagKey', () => { + it('invokes updateTagKey without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagKeyRequest() + ); + request.tagKey ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagKeyRequest', + ['tagKey', 'name'] + ); + request.tagKey.name = defaultValue1; + const expectedHeaderRequestParams = `tag_key.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTagKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTagKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagKey without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagKeyRequest() + ); + request.tagKey ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagKeyRequest', + ['tagKey', 'name'] + ); + request.tagKey.name = defaultValue1; + const expectedHeaderRequestParams = `tag_key.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTagKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTagKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IUpdateTagKeyMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagKey with call error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagKeyRequest() + ); + request.tagKey ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagKeyRequest', + ['tagKey', 'name'] + ); + request.tagKey.name = defaultValue1; + const expectedHeaderRequestParams = `tag_key.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTagKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTagKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagKey with LRO error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagKeyRequest() + ); + request.tagKey ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagKeyRequest', + ['tagKey', 'name'] + ); + request.tagKey.name = defaultValue1; + const expectedHeaderRequestParams = `tag_key.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTagKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTagKey(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTagKeyProgress without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTagKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTagKeyProgress with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateTagKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTagKey', () => { + it('invokes deleteTagKey without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTagKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagKey without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTagKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagKey, + protos.google.cloud.resourcemanager.v3.IDeleteTagKeyMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagKey with call error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTagKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagKey with LRO error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTagKey(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTagKeyProgress without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTagKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTagKeyProgress with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteTagKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTagKeys', () => { + it('invokes listTagKeys without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + ]; + client.innerApiCalls.listTagKeys = stubSimpleCall(expectedResponse); + const [response] = await client.listTagKeys(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagKeys without error using callback', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + ]; + client.innerApiCalls.listTagKeys = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTagKeys( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.ITagKey[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagKeys with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTagKeys = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTagKeys(request), expectedError); + }); + + it('invokes listTagKeysStream without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + ]; + client.descriptors.page.listTagKeys.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTagKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagKey[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagKey) => { + 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.listTagKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagKeys, request) + ); + }); + + it('invokes listTagKeysStream with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagKeys.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listTagKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagKey[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagKey) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTagKeys.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagKeys, request) + ); + }); + + it('uses async iteration with listTagKeys without error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagKey() + ), + ]; + client.descriptors.page.listTagKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.ITagKey[] = []; + const iterable = client.listTagKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTagKeys.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + + it('uses async iteration with listTagKeys with error', async () => { + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagKeysRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagKeys.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listTagKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.ITagKey[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTagKeys.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new tagkeysModule.v3.TagKeysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/test/gapic_tag_values_v3.ts b/packages/google-cloud-resourcemanager/test/gapic_tag_values_v3.ts new file mode 100644 index 000000000000..2114294c9d2a --- /dev/null +++ b/packages/google-cloud-resourcemanager/test/gapic_tag_values_v3.ts @@ -0,0 +1,1772 @@ +// Copyright 2022 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 tagvaluesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} 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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +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('v3.TagValuesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = tagvaluesModule.v3.TagValuesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = tagvaluesModule.v3.TagValuesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = tagvaluesModule.v3.TagValuesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tagvaluesModule.v3.TagValuesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagValuesStub, undefined); + await client.initialize(); + assert(client.tagValuesStub); + }); + + it('has close method for the initialized client', done => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.tagValuesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tagValuesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tagvaluesModule.v3.TagValuesClient({ + 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 tagvaluesModule.v3.TagValuesClient({ + 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('getTagValue', () => { + it('invokes getTagValue without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ); + client.innerApiCalls.getTagValue = stubSimpleCall(expectedResponse); + const [response] = await client.getTagValue(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagValue without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ); + client.innerApiCalls.getTagValue = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTagValue( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.ITagValue | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagValue with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTagValue = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTagValue(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTagValue with closed client', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.GetTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.GetTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTagValue(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.GetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.setIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.SetIamPolicyRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.iam.v1.ITestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.testIamPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.iam.v1.TestIamPermissionsRequest', + ['resource'] + ); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createTagValue', () => { + it('invokes createTagValue without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagValueRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagValue = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTagValue(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagValue without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagValueRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTagValue = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTagValue( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.ICreateTagValueMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTagValue with call error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagValueRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagValue = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTagValue(request), expectedError); + }); + + it('invokes createTagValue with LRO error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.CreateTagValueRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTagValue = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTagValue(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateTagValueProgress without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTagValueProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTagValueProgress with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTagValueProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTagValue', () => { + it('invokes updateTagValue without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagValueRequest() + ); + request.tagValue ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagValueRequest', + ['tagValue', 'name'] + ); + request.tagValue.name = defaultValue1; + const expectedHeaderRequestParams = `tag_value.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTagValue = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTagValue(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagValue without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagValueRequest() + ); + request.tagValue ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagValueRequest', + ['tagValue', 'name'] + ); + request.tagValue.name = defaultValue1; + const expectedHeaderRequestParams = `tag_value.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTagValue = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTagValue( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IUpdateTagValueMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagValue with call error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagValueRequest() + ); + request.tagValue ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagValueRequest', + ['tagValue', 'name'] + ); + request.tagValue.name = defaultValue1; + const expectedHeaderRequestParams = `tag_value.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTagValue = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTagValue(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTagValue with LRO error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.UpdateTagValueRequest() + ); + request.tagValue ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.UpdateTagValueRequest', + ['tagValue', 'name'] + ); + request.tagValue.name = defaultValue1; + const expectedHeaderRequestParams = `tag_value.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTagValue = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTagValue(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTagValueProgress without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTagValueProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTagValueProgress with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateTagValueProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTagValue', () => { + it('invokes deleteTagValue without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagValue = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTagValue(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagValue without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTagValue = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTagValue( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.resourcemanager.v3.ITagValue, + protos.google.cloud.resourcemanager.v3.IDeleteTagValueMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagValue with call error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagValue = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTagValue(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTagValue with LRO error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.DeleteTagValueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.resourcemanager.v3.DeleteTagValueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTagValue = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTagValue(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTagValue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTagValueProgress without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTagValueProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTagValueProgress with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteTagValueProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listTagValues', () => { + it('invokes listTagValues without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + ]; + client.innerApiCalls.listTagValues = stubSimpleCall(expectedResponse); + const [response] = await client.listTagValues(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagValues without error using callback', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + ]; + client.innerApiCalls.listTagValues = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTagValues( + request, + ( + err?: Error | null, + result?: protos.google.cloud.resourcemanager.v3.ITagValue[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTagValues with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTagValues = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTagValues(request), expectedError); + }); + + it('invokes listTagValuesStream without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + ]; + client.descriptors.page.listTagValues.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTagValuesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagValue[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagValue) => { + 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.listTagValues.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagValues, request) + ); + }); + + it('invokes listTagValuesStream with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagValues.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTagValuesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.resourcemanager.v3.TagValue[] = []; + stream.on( + 'data', + (response: protos.google.cloud.resourcemanager.v3.TagValue) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTagValues.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTagValues, request) + ); + }); + + it('uses async iteration with listTagValues without error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.TagValue() + ), + ]; + client.descriptors.page.listTagValues.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.resourcemanager.v3.ITagValue[] = []; + const iterable = client.listTagValuesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTagValues.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listTagValues with error', async () => { + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.resourcemanager.v3.ListTagValuesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTagValues.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTagValuesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.resourcemanager.v3.ITagValue[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTagValues.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('folder', () => { + const fakePath = '/rendered/path/folder'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderPath', () => { + const result = client.folderPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderName', () => { + const result = client.matchFolderFromFolderName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + 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('tagBinding', () => { + const fakePath = '/rendered/path/tagBinding'; + const expectedParameters = { + tag_binding: 'tagBindingValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagBindingPath', () => { + const result = client.tagBindingPath('tagBindingValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagBindingFromTagBindingName', () => { + const result = client.matchTagBindingFromTagBindingName(fakePath); + assert.strictEqual(result, 'tagBindingValue'); + assert( + (client.pathTemplates.tagBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagKey', () => { + const fakePath = '/rendered/path/tagKey'; + const expectedParameters = { + tag_key: 'tagKeyValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagKeyPath', () => { + const result = client.tagKeyPath('tagKeyValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagKeyFromTagKeyName', () => { + const result = client.matchTagKeyFromTagKeyName(fakePath); + assert.strictEqual(result, 'tagKeyValue'); + assert( + (client.pathTemplates.tagKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tagValue', () => { + const fakePath = '/rendered/path/tagValue'; + const expectedParameters = { + tag_value: 'tagValueValue', + }; + const client = new tagvaluesModule.v3.TagValuesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tagValuePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tagValuePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tagValuePath', () => { + const result = client.tagValuePath('tagValueValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tagValuePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTagValueFromTagValueName', () => { + const result = client.matchTagValueFromTagValueName(fakePath); + assert.strictEqual(result, 'tagValueValue'); + assert( + (client.pathTemplates.tagValuePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-resourcemanager/tsconfig.json b/packages/google-cloud-resourcemanager/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-resourcemanager/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/packages/google-cloud-resourcemanager/webpack.config.js b/packages/google-cloud-resourcemanager/webpack.config.js new file mode 100644 index 000000000000..5ac0b8776a88 --- /dev/null +++ b/packages/google-cloud-resourcemanager/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: 'Folders', + filename: './folders.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/packages/google-cloud-shell/.OwlBot.yaml b/packages/google-cloud-shell/.OwlBot.yaml new file mode 100644 index 000000000000..fde389e13e0f --- /dev/null +++ b/packages/google-cloud-shell/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/shell/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-shell/$1 diff --git a/packages/google-cloud-shell/.eslintignore b/packages/google-cloud-shell/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-cloud-shell/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-shell/.eslintrc.json b/packages/google-cloud-shell/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-cloud-shell/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-shell/.gitattributes b/packages/google-cloud-shell/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-cloud-shell/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-shell/.gitignore b/packages/google-cloud-shell/.gitignore new file mode 100644 index 000000000000..f73bce1a7978 --- /dev/null +++ b/packages/google-cloud-shell/.gitignore @@ -0,0 +1,15 @@ +**/*.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__ +owl-bot-staging \ No newline at end of file diff --git a/packages/google-cloud-shell/.jsdoc.js b/packages/google-cloud-shell/.jsdoc.js new file mode 100644 index 000000000000..4db91f5d5952 --- /dev/null +++ b/packages/google-cloud-shell/.jsdoc.js @@ -0,0 +1,55 @@ +// 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. +// +// ** 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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/shell', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; \ No newline at end of file diff --git a/packages/google-cloud-shell/.mocharc.js b/packages/google-cloud-shell/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-cloud-shell/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-cloud-shell/.nycrc b/packages/google-cloud-shell/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-cloud-shell/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-shell/.prettierignore b/packages/google-cloud-shell/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-cloud-shell/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-shell/.prettierrc.js b/packages/google-cloud-shell/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-cloud-shell/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-shell/.repo-metadata.json b/packages/google-cloud-shell/.repo-metadata.json new file mode 100644 index 000000000000..4fcf5c7868df --- /dev/null +++ b/packages/google-cloud-shell/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "cloudshell", + "name_pretty": "Cloud Shell", + "product_documentation": "https://cloud.google.com/shell/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/shell/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/shell", + "api_id": "shell.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "cloudshell", + "library_type": "GAPIC_AUTO", + "codeowner_team": "@googleapis/aap-dpes" +} diff --git a/packages/google-cloud-shell/CHANGELOG.md b/packages/google-cloud-shell/CHANGELOG.md new file mode 100644 index 000000000000..ac11367affe7 --- /dev/null +++ b/packages/google-cloud-shell/CHANGELOG.md @@ -0,0 +1,88 @@ +# Changelog + +## [2.0.2](https://github.com/googleapis/google-cloud-node/compare/shell-v2.0.1...shell-v2.0.2) (2022-10-13) + + +### Bug Fixes + +* Change import long to require ([#99](https://github.com/googleapis/google-cloud-node/issues/99)) ([6fadfbf](https://github.com/googleapis/google-cloud-node/commit/6fadfbff2f58b32f58a97d222008126f08122464)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/google-cloud-node/issues/1553)) ([#102](https://github.com/googleapis/google-cloud-node/issues/102)) ([0cb1a1a](https://github.com/googleapis/google-cloud-node/commit/0cb1a1a97898d4e9bfa9a46382782a8b38f8a90c)) +* use google-gax v3.3.0 ([0cb1a1a](https://github.com/googleapis/google-cloud-node/commit/0cb1a1a97898d4e9bfa9a46382782a8b38f8a90c)) + +## [2.0.1](https://github.com/googleapis/nodejs-cloud-shell/compare/v2.0.0...v2.0.1) (2022-08-27) + + +### Bug Fixes + +* change import long to require ([#99](https://github.com/googleapis/nodejs-cloud-shell/issues/99)) ([4ff9cc0](https://github.com/googleapis/nodejs-cloud-shell/commit/4ff9cc0cbf92bdb372994b27e81116412b46a10b)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-cloud-shell/issues/1553)) ([#102](https://github.com/googleapis/nodejs-cloud-shell/issues/102)) ([157f47b](https://github.com/googleapis/nodejs-cloud-shell/commit/157f47b06a9ed2b664e8a2a9a14916bce786adbc)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-cloud-shell/issues/1546)) ([#101](https://github.com/googleapis/nodejs-cloud-shell/issues/101)) ([2b0a031](https://github.com/googleapis/nodejs-cloud-shell/commit/2b0a031a6c7340a9cba6e779bca7afc9d01e9640)) +* use google-gax v3.3.0 ([157f47b](https://github.com/googleapis/nodejs-cloud-shell/commit/157f47b06a9ed2b664e8a2a9a14916bce786adbc)) + +## [2.0.0](https://github.com/googleapis/nodejs-cloud-shell/compare/v1.1.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#89) + +### Build System + +* update library to use Node 12 ([#89](https://github.com/googleapis/nodejs-cloud-shell/issues/89)) ([314345e](https://github.com/googleapis/nodejs-cloud-shell/commit/314345e76607e76c4ee4e5866080e1eff599e261)) + +## [1.1.0](https://github.com/googleapis/nodejs-cloud-shell/compare/v1.0.5...v1.1.0) (2022-04-21) + + +### Features + +* upgrade library to ga ([#69](https://github.com/googleapis/nodejs-cloud-shell/issues/69)) ([e878a84](https://github.com/googleapis/nodejs-cloud-shell/commit/e878a84014054ecfc2cd2d090c6762eaeca20fca)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-cloud-shell/compare/v1.0.4...v1.0.5) (2021-08-30) + + +### Bug Fixes + +* flag module as GA ([#33](https://www.github.com/googleapis/nodejs-cloud-shell/issues/33)) ([cf357c8](https://www.github.com/googleapis/nodejs-cloud-shell/commit/cf357c81140d75b3c7106dc747bac328da247363)) + +### [1.0.4](https://www.github.com/googleapis/nodejs-cloud-shell/compare/v1.0.3...v1.0.4) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#30](https://www.github.com/googleapis/nodejs-cloud-shell/issues/30)) ([2b47854](https://www.github.com/googleapis/nodejs-cloud-shell/commit/2b4785463941a7260631280b38175196f220e2ae)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-cloud-shell/compare/v1.0.2...v1.0.3) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#28](https://www.github.com/googleapis/nodejs-cloud-shell/issues/28)) ([89f824d](https://www.github.com/googleapis/nodejs-cloud-shell/commit/89f824d75bd1190568c8e28ccef8ee896b86ecdc)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-cloud-shell/compare/v1.0.1...v1.0.2) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#19](https://www.github.com/googleapis/nodejs-cloud-shell/issues/19)) ([f241f55](https://www.github.com/googleapis/nodejs-cloud-shell/commit/f241f55a0bd87224b297a7724c3db38593a3f94b)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-cloud-shell/compare/v1.0.0...v1.0.1) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#16](https://www.github.com/googleapis/nodejs-cloud-shell/issues/16)) ([8a0d38d](https://www.github.com/googleapis/nodejs-cloud-shell/commit/8a0d38df49000efdaa011f82cdc0f26af9c0468d)) + +## 1.0.0 (2021-06-08) + + +### Features + +* add initial samples and tests ([#4](https://www.github.com/googleapis/nodejs-cloud-shell/issues/4)) ([3900384](https://www.github.com/googleapis/nodejs-cloud-shell/commit/3900384736a8e66e5b00c8ca298d3d4fb9a1b4b3)) +* add initial template samples ([226fea0](https://www.github.com/googleapis/nodejs-cloud-shell/commit/226fea0042f75dcff523d47477583b9180fa7b46)) +* initial lib generation ([d309d59](https://www.github.com/googleapis/nodejs-cloud-shell/commit/d309d59eed1de379b13c328a82d86c88f7aa453c)) + + +### Bug Fixes + +* add gitignore, and samples ([4951579](https://www.github.com/googleapis/nodejs-cloud-shell/commit/4951579c22c3a230621898ec6f581faa0a5df28b)) +* remove additional v1 folder ([7c5353c](https://www.github.com/googleapis/nodejs-cloud-shell/commit/7c5353c89630fb61ec3f264196766ecf51669e0e)) diff --git a/packages/google-cloud-shell/CODE_OF_CONDUCT.md b/packages/google-cloud-shell/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-cloud-shell/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-shell/CONTRIBUTING.md b/packages/google-cloud-shell/CONTRIBUTING.md new file mode 100644 index 000000000000..037ea8c7d633 --- /dev/null +++ b/packages/google-cloud-shell/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Shell API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=shell.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-shell/LICENSE b/packages/google-cloud-shell/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-cloud-shell/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-cloud-shell/README.md b/packages/google-cloud-shell/README.md new file mode 100644 index 000000000000..9cc649b3a126 --- /dev/null +++ b/packages/google-cloud-shell/README.md @@ -0,0 +1,161 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Shell: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/shell.svg)](https://www.npmjs.org/package/@google-cloud/shell) + + + + +cloudshell client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Cloud Shell Node.js Client API Reference][client-docs] +* [Cloud Shell Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Shell API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/shell +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +// remove this line after package is released +// eslint-disable-next-line node/no-missing-require +const {CloudShellServiceClient} = require('@google-cloud/shell'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' + +// Creates a client +// eslint-disable-next-line no-unused-vars +const client = new CloudShellServiceClient(); + +//TODO(library generator): write the actual function you will be testing +async function initializeClient() { + const operation = await client.initialize(); + console.info(operation); +} +initializeClient(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-shell/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-shell/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-shell/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-shell/samples/test/quickstart.js,samples/README.md) | + + + +The [Cloud Shell Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/shell@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/shell/latest +[product-docs]: https://cloud.google.com/shell/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=shell.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-shell/linkinator.config.json b/packages/google-cloud-shell/linkinator.config.json new file mode 100644 index 000000000000..4e8e9438f7a9 --- /dev/null +++ b/packages/google-cloud-shell/linkinator.config.json @@ -0,0 +1,11 @@ +{ + "recurse": true, + "skip": [ + "https://github.com/googleapis/nodejs-cloud-shell/blob/master/CHANGELOG.md", + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-shell/package-lock.json b/packages/google-cloud-shell/package-lock.json new file mode 100644 index 000000000000..d3dadaef4579 --- /dev/null +++ b/packages/google-cloud-shell/package-lock.json @@ -0,0 +1,5865 @@ +{ + "name": "@google-cloud/shell", + "version": "2.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", + "dev": true + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@discoveryjs/json-ext": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", + "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@grpc/grpc-js": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.6.7.tgz", + "integrity": "sha512-eBM03pu9hd3VqDQG+kHahiG1x80RGkkqqRb1Pchcwqej/KkAH95gAvKs6laqaHCycYaPK+TKuNQnOz9UXYA8qw==", + "requires": { + "@grpc/proto-loader": "^0.6.4", + "@types/node": ">=12.12.47" + } + }, + "@grpc/proto-loader": { + "version": "0.6.12", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.12.tgz", + "integrity": "sha512-filTVbETFnxb9CyRX98zN18ilChTuf/C5scZ2xyaOTp0EHGq0/ufX8rjqXUcSb1Gpv7eZq4M2jDvbh9BogKnrg==", + "requires": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^6.10.0", + "yargs": "^16.2.0" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@pnpm/network.ca-file": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", + "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", + "dev": true, + "requires": { + "graceful-fs": "4.2.10" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + } + } + }, + "@pnpm/npm-conf": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.4.tgz", + "integrity": "sha512-o5YFq/+ksEJMbSzzkaQDHlp00aonLDU5xNPVTRL12hTWBbVSSeWXxPukq75h+mvXnoOWT95vV2u1HSTw2C4XOw==", + "dev": true, + "requires": { + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", + "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@sinonjs/samsam": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.1.1.tgz", + "integrity": "sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/cacheable-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", + "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "dev": true, + "requires": { + "@types/http-cache-semantics": "*", + "@types/keyv": "*", + "@types/node": "*", + "@types/responselike": "*" + } + }, + "@types/eslint": { + "version": "7.2.13", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.13.tgz", + "integrity": "sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.47", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.47.tgz", + "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", + "dev": true + }, + "@types/http-cache-semantics": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", + "dev": true + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "@types/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "@types/minimist": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", + "dev": true + }, + "@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "@types/node": { + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/responselike": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/sinon": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.1.tgz", + "integrity": "sha512-tZulsvuJwif5ddTBtscflI7gJcd+RpENcNZ7QCp0jKEl0bZY3Pu6PbJs4GR3SfQkGgsUa+FrlKsKQ0XyGNvDuA==", + "dev": true, + "requires": { + "@sinonjs/fake-timers": "^7.1.0" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "debug": "^4.3.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", + "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0" + } + }, + "@typescript-eslint/types": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.33.0", + "eslint-visitor-keys": "^2.0.0" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.0.tgz", + "integrity": "sha512-kX2W49LWsbthrmIRMbQZuQDhGtjyqXfEmmHyEi4XWnSZtPmxY0+3anPIzsnRb45VH/J55zlOfWvZuY47aJZTJg==", + "dev": true, + "requires": { + "@webassemblyjs/helper-numbers": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz", + "integrity": "sha512-Q/aVYs/VnPDVYvsCBL/gSgwmfjeCb4LW8+TMrO3cSzJImgv8lxxEPM2JA5jMrivE7LSz3V+PFqtMbls3m1exDA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz", + "integrity": "sha512-baT/va95eXiXb2QflSx95QGT5ClzWpGaa8L7JnJbgzoYeaA27FCvuBXU758l+KXWRndEmUXjP0Q5fibhavIn8w==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz", + "integrity": "sha512-u9HPBEl4DS+vA8qLQdEQ6N/eJQ7gT7aNvMIo8AAWvAl/xMrcOSiI2M0MAnMCy3jIFke7bEee/JwdX1nUpCtdyA==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz", + "integrity": "sha512-DhRQKelIj01s5IgdsOJMKLppI+4zpmcMQ3XboFPLwCpSNH6Hqo1ritgHgD0nqHeSYqofA6aBN/NmXuGjM1jEfQ==", + "dev": true, + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz", + "integrity": "sha512-MbmhvxXExm542tWREgSFnOVo07fDpsBJg3sIl6fSp9xuu75eGz5lz31q7wTLffwL3Za7XNRCMZy210+tnsUSEA==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz", + "integrity": "sha512-3Eb88hcbfY/FCukrg6i3EH8H2UsD7x8Vy47iVJrP967A9JGqgBVL9aH71SETPx1JrGsOUVLo0c7vMCN22ytJew==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz", + "integrity": "sha512-KXzOqpcYQwAfeQ6WbF6HXo+0udBNmw0iXDmEK5sFlmQdmND+tr773Ti8/5T/M6Tl/413ArSJErATd8In3B+WBA==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.0.tgz", + "integrity": "sha512-aqbsHa1mSQAbeeNcl38un6qVY++hh8OpCOzxhixSYgbRfNWcxJNJQwe2rezK9XEcssJbbWIkblaJRwGMS9zp+g==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.0.tgz", + "integrity": "sha512-A/lclGxH6SpSLSyFowMzO/+aDEPU4hvEiooCMXQPcQFPPJaYcPQNKGOCLUySJsYJ4trbpr+Fs08n4jelkVTGVw==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz", + "integrity": "sha512-JHQ0damXy0G6J9ucyKVXO2j08JVJ2ntkdJlq1UTiUrIgfGMmA7Ik5VdC/L8hBK46kVJgujkBIoMtT8yVr+yVOQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/helper-wasm-section": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-opt": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "@webassemblyjs/wast-printer": "1.11.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz", + "integrity": "sha512-BEUv1aj0WptCZ9kIS30th5ILASUnAPEvE3tVMTrItnZRT9tXCLW2LEXT8ezLw59rqPP9klh9LPmpU+WmRQmCPQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz", + "integrity": "sha512-tHUSP5F4ywyh3hZ0+fDQuWxKx3mJiPeFufg+9gwTpYp324mPCQgnuVKwzLTZVqj0duRDovnPaZqDwoyhIO8kYg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-buffer": "1.11.0", + "@webassemblyjs/wasm-gen": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz", + "integrity": "sha512-6L285Sgu9gphrcpDXINvm0M9BskznnzJTE7gYkjDbxET28shDqp27wpruyx3C2S/dvEwiigBwLA1cz7lNUi0kw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/helper-api-error": "1.11.0", + "@webassemblyjs/helper-wasm-bytecode": "1.11.0", + "@webassemblyjs/ieee754": "1.11.0", + "@webassemblyjs/leb128": "1.11.0", + "@webassemblyjs/utf8": "1.11.0" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz", + "integrity": "sha512-Fg5OX46pRdTgB7rKIUojkh9vXaVN6sGYCnEiJN1GYkb0RPwShZXp6KTDqmoMdQPKhcroOXh3fEzmkWmCYaKYhQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.11.0", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/configtest": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.3.tgz", + "integrity": "sha512-WQs0ep98FXX2XBAfQpRbY0Ma6ADw8JR6xoIkaIiJIzClGOMqVRvPCWqndTxf28DgFopWan0EKtHtg/5W1h0Zkw==", + "dev": true + }, + "@webpack-cli/info": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.4.tgz", + "integrity": "sha512-ogE2T4+pLhTTPS/8MM3IjHn0IYplKM4HbVNMCWA9N4NrdPzunwenpCsqKEXyejMfRu6K8mhauIPYf8ZxWG5O6g==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.4.0.tgz", + "integrity": "sha512-xgT/HqJ+uLWGX+Mzufusl3cgjAcnqYYskaB7o0vRcwOEfuu6hMzSILQpnIzFMGsTaeaX4Nnekl+6fadLbl1/Vg==", + "dev": true + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "bignumber.js": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", + "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "boxen": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.0.1.tgz", + "integrity": "sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.0", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "c8": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.7.2.tgz", + "integrity": "sha512-8AqNnUMxB3hsgYCYso2GJjlwnaNPlrEEbYbCQb7N76V1nrOgCKXiTcE3gXU18rIj0FeduPywROrIBMC7XAKApg==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^7.1.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.7" + }, + "dependencies": { + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + } + } + }, + "cacheable-lookup": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.0.4.tgz", + "integrity": "sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==", + "dev": true + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "caniuse-lite": { + "version": "1.0.30001232", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001232.tgz", + "integrity": "sha512-e4Gyp7P8vqC2qV2iHA+cJNf/yqUKOShXQOJHQt81OHxlIZl/j/j3soEA0adAQi8CPUQgvOdDENyQ5kd6a6mNSg==", + "dev": true + }, + "catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "compress-brotli": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz", + "integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==", + "dev": true, + "requires": { + "@types/json-buffer": "~3.0.0", + "json-buffer": "~3.0.1" + }, + "dependencies": { + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + } + } + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "dependencies": { + "entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true + } + } + }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "duplexify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", + "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "electron-to-chromium": { + "version": "1.3.743", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.743.tgz", + "integrity": "sha512-K2wXfo9iZQzNJNx67+Pld0DRF+9bYinj62gXCdgPhcu1vidwVuLPHQPPFnCdO55njWigXXpfBiT90jGUPbw8Zg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", + "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", + "dev": true + }, + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-module-lexer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.4.1.tgz", + "integrity": "sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-7.2.0.tgz", + "integrity": "sha512-rV4Qu0C3nfJKPOAhFujFxB7RMP+URFyQqqOZW9DMRD7ZDTFyjaIlETU3xzHELt++4ugC0+Jm084HQYkkJe+Ivg==", + "dev": true + }, + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "eslint-plugin-prettier": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", + "integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "execa": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "form-data-encoder": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.1.tgz", + "integrity": "sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==", + "dev": true + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gaxios": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.3.0.tgz", + "integrity": "sha512-pHplNbslpwCLMyII/lHPWFQbJWOX0B3R1hwBEOvzYi1GmdKZruuEHK4N9V6f7tf1EaPYyF80mui1+344p6SmLg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.0.tgz", + "integrity": "sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA==", + "requires": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "dependencies": { + "gaxios": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.0.tgz", + "integrity": "sha512-VD/yc5ln6XU8Ch1hyYY6kRMBE0Yc2np3fPyeJeYHhrPs1i8rgnsApPMWyrugkl7LLoSqpOJVBWlQIa87OAvt8Q==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + } + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + } + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dev": true, + "requires": { + "ini": "2.0.0" + } + }, + "globals": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "google-auth-library": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.0.2.tgz", + "integrity": "sha512-HoG+nWFAThLovKpvcbYzxgn+nBJPTfAwtq0GxPN821nOO+21+8oP7MoEHfd1sbDulUFFGfcjJr2CnJ4YssHcyg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^5.0.0", + "gcp-metadata": "^5.0.0", + "gtoken": "^5.3.2", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + }, + "dependencies": { + "gaxios": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.0.tgz", + "integrity": "sha512-VD/yc5ln6XU8Ch1hyYY6kRMBE0Yc2np3fPyeJeYHhrPs1i8rgnsApPMWyrugkl7LLoSqpOJVBWlQIa87OAvt8Q==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + } + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + } + } + }, + "google-gax": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.0.1.tgz", + "integrity": "sha512-vCCWt/wgxho52ombbfdG+ECKQx2quwYzVGhM39ylXFRg35nlr3387/tDdfqxxEQy8cg9Q7s6GNRROdZqr+9XYA==", + "requires": { + "@grpc/grpc-js": "~1.6.0", + "@grpc/proto-loader": "^0.6.12", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "fast-text-encoding": "^1.0.3", + "google-auth-library": "^8.0.2", + "is-stream-ended": "^0.1.4", + "node-fetch": "^2.6.1", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^0.1.8", + "protobufjs": "6.11.2", + "retry-request": "^5.0.0" + } + }, + "google-p12-pem": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.1.4.tgz", + "integrity": "sha512-HHuHmkLgwjdmVRngf5+gSmpkyaRI6QmOg77J8tkNBHhNEI62sGHyw4/+UkgyZEI7h84NbWprXDJ+sa3xOYFvTg==", + "requires": { + "node-forge": "^1.3.1" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + } + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "gtoken": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.3.2.tgz", + "integrity": "sha512-gkvEKREW7dXWF8NV8pVrKfW7WqReAmjjkMBh6lNCCGOM4ucS0r0YyXXl0r/9Yj8wcW/32ISkfc8h5mPTDbtifQ==", + "requires": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.1.3", + "jws": "^4.0.0" + } + }, + "gts": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/gts/-/gts-3.1.0.tgz", + "integrity": "sha512-Pbj3ob1VR1IRlEVEBNtKoQ1wHOa8cZz62KEojK8Fn/qeS2ClWI4gLNfhek3lD68aZSmUEg8TFb6AHXIwUMgyqQ==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": "^4.2.0", + "@typescript-eslint/parser": "^4.2.0", + "chalk": "^4.1.0", + "eslint": "^7.10.0", + "eslint-config-prettier": "^7.0.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^3.1.4", + "execa": "^5.0.0", + "inquirer": "^7.3.3", + "json5": "^2.1.3", + "meow": "^9.0.0", + "ncp": "^2.0.0", + "prettier": "^2.1.2", + "rimraf": "^3.0.2", + "update-notifier": "^5.0.0", + "write-file-atomic": "^3.0.3" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hosted-git-info": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "htmlparser2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", + "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "dev": true, + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "entities": "^4.3.0" + }, + "dependencies": { + "entities": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", + "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "dev": true + } + } + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http2-wrapper": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", + "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", + "dev": true, + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "dependencies": { + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", + "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true + }, + "inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "requires": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + } + }, + "is-npm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest-worker": { + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.2.tgz", + "integrity": "sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "js2xmlparser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", + "dev": true, + "requires": { + "xmlcreate": "^2.0.3" + } + }, + "jsdoc": { + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.7.tgz", + "integrity": "sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw==", + "dev": true, + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^2.0.3", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.1" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "jsdoc-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-fresh/-/jsdoc-fresh-2.0.0.tgz", + "integrity": "sha512-KNQ3gjqHP3AEctcwPBNNdeArkpvcR0i1d4DrpnzohK5EdOcCKzedBvt5kDjUPvaJ/oF+W5bey2IW+xpiS5nEfQ==", + "dev": true, + "requires": { + "taffydb": "^2.7.3" + }, + "dependencies": { + "taffydb": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", + "integrity": "sha1-KtNxaWKUmPylvIQkMJbTzeDsOjQ=", + "dev": true + } + } + }, + "jsdoc-region-tag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-region-tag/-/jsdoc-region-tag-2.0.0.tgz", + "integrity": "sha512-CwoEF5zALHVjhV5EtyH5QXhq+vblT6YOOatyBXug4fTwSgd9GyyKeUuBl6NJVpRFtIJ+/xS+X4vCnD5qsqgYZQ==", + "dev": true, + "requires": { + "glob": "^7.1.6" + } + }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, + "linkinator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/linkinator/-/linkinator-4.0.0.tgz", + "integrity": "sha512-NKJmdp90A8/UYiWy4f0FzcBFoA9ntfUPKrvDJqevos5Are9O9KgEGcZKARmN+ZYWsioySQFlS5ySiYxvDxNtQA==", + "dev": true, + "requires": { + "chalk": "^5.0.0", + "escape-html": "^1.0.3", + "gaxios": "^5.0.0", + "glob": "^8.0.1", + "htmlparser2": "^8.0.1", + "marked": "^4.0.3", + "meow": "^10.1.1", + "mime": "^3.0.0", + "server-destroy": "^1.0.1", + "update-notifier": "^6.0.0" + }, + "dependencies": { + "@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, + "requires": { + "defer-to-connect": "^2.0.1" + } + }, + "@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, + "ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dev": true, + "requires": { + "string-width": "^4.1.0" + }, + "dependencies": { + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + } + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.0.tgz", + "integrity": "sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==", + "dev": true + }, + "boxen": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", + "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", + "dev": true, + "requires": { + "ansi-align": "^3.0.1", + "camelcase": "^7.0.0", + "chalk": "^5.0.1", + "cli-boxes": "^3.0.0", + "string-width": "^5.1.2", + "type-fest": "^2.13.0", + "widest-line": "^4.0.1", + "wrap-ansi": "^8.0.1" + }, + "dependencies": { + "camelcase": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", + "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", + "dev": true + }, + "type-fest": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.16.0.tgz", + "integrity": "sha512-qpaThT2HQkFb83gMOrdKVsfCN7LKxP26Yq+smPzY1FqoHRjqmjqHXA7n5Gkxi8efirtbeEUxzfEdePthQWCuHw==", + "dev": true + } + } + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cacheable-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "requires": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + } + }, + "chalk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", + "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "dev": true + }, + "ci-info": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "dev": true + }, + "cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "dev": true + }, + "configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "dev": true, + "requires": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + } + }, + "crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "requires": { + "type-fest": "^1.0.1" + } + }, + "decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "requires": { + "mimic-response": "^3.1.0" + } + }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true + }, + "dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "escape-goat": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz", + "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "gaxios": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.1.tgz", + "integrity": "sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw==", + "dev": true, + "requires": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + } + }, + "glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "got": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-12.1.0.tgz", + "integrity": "sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==", + "dev": true, + "requires": { + "@sindresorhus/is": "^4.6.0", + "@szmarczak/http-timer": "^5.0.1", + "@types/cacheable-request": "^6.0.2", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^6.0.4", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "form-data-encoder": "1.7.1", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^2.0.0" + } + }, + "has-yarn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", + "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", + "dev": true + }, + "import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true + }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, + "is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dev": true, + "requires": { + "ci-info": "^3.2.0" + } + }, + "is-npm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-6.0.0.tgz", + "integrity": "sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==", + "dev": true + }, + "is-yarn-global": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", + "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "keyv": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.3.2.tgz", + "integrity": "sha512-kn8WmodVBe12lmHpA6W8OY7SNh6wVR+Z+wZESF4iF5FCazaVXGWOtnbnvX0tMQ1bO+/TmOD9LziuYMvrIIs0xw==", + "dev": true, + "requires": { + "compress-brotli": "^1.3.8", + "json-buffer": "3.0.1" + } + }, + "latest-version": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", + "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", + "dev": true, + "requires": { + "package-json": "^8.1.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "dev": true + }, + "marked": { + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.17.tgz", + "integrity": "sha512-Wfk0ATOK5iPxM4ptrORkFemqroz0ZDxp5MWfYA7H/F+wO17NRWV5Ypxi6p3g2Xmw2bKeiYOl6oVnLHKxBA0VhA==", + "dev": true + }, + "meow": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.3.tgz", + "integrity": "sha512-0WL7RMCPPdUTE00+GxJjL4d5Dm6eUbmAzxlzywJWiRUKCW093owmZ7/q74tH9VI91vxw9KJJNxAcvdpxb2G4iA==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + } + }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true + }, + "p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "package-json": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", + "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", + "dev": true, + "requires": { + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" + } + }, + "pupa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", + "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==", + "dev": true, + "requires": { + "escape-goat": "^4.0.0" + } + }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true + }, + "read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + } + }, + "read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "requires": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + } + }, + "redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "requires": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + } + }, + "registry-auth-token": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", + "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", + "dev": true, + "requires": { + "@pnpm/npm-conf": "^1.0.4" + } + }, + "registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "dev": true, + "requires": { + "rc": "1.2.8" + } + }, + "responselike": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", + "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", + "dev": true, + "requires": { + "lowercase-keys": "^2.0.0" + }, + "dependencies": { + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "semver-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", + "dev": true, + "requires": { + "semver": "^7.3.5" + } + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "requires": { + "min-indent": "^1.0.1" + } + }, + "trim-newlines": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz", + "integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew==", + "dev": true + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + }, + "unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dev": true, + "requires": { + "crypto-random-string": "^4.0.0" + } + }, + "update-notifier": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", + "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", + "dev": true, + "requires": { + "boxen": "^7.0.0", + "chalk": "^5.0.1", + "configstore": "^6.0.0", + "has-yarn": "^3.0.0", + "import-lazy": "^4.0.0", + "is-ci": "^3.0.1", + "is-installed-globally": "^0.4.0", + "is-npm": "^6.0.0", + "is-yarn-global": "^0.4.0", + "latest-version": "^7.0.0", + "pupa": "^3.1.0", + "semver": "^7.3.7", + "semver-diff": "^4.0.0", + "xdg-basedir": "^5.1.0" + } + }, + "widest-line": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", + "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", + "dev": true, + "requires": { + "string-width": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", + "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "dev": true + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } + } + }, + "loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "dev": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "map-obj": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", + "dev": true + }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", + "dev": true + }, + "marked": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.7.tgz", + "integrity": "sha512-BJXxkuIfJchcXOJWTT2DOL+yFWifFv2yGYOUzvXg8Qz610QKw+sHCvTMYwA+qWGhlA2uivBezChZ/pBy1tWdkQ==", + "dev": true + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, + "meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "dependencies": { + "type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true + }, + "mime-db": { + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "dev": true, + "requires": { + "mime-db": "1.48.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + } + } + }, + "minipass": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", + "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "mocha": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + } + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nise": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.1.tgz", + "integrity": "sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": ">=5", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" + }, + "node-releases": { + "version": "1.1.72", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", + "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==", + "dev": true + }, + "normalize-package-data": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-packlist": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", + "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", + "dev": true, + "requires": { + "glob": "^7.1.6", + "ignore-walk": "^3.0.3", + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "null-loader": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/null-loader/-/null-loader-4.0.1.tgz", + "integrity": "sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + } + }, + "object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pack-n-play": { + "version": "1.0.0-2", + "resolved": "https://registry.npmjs.org/pack-n-play/-/pack-n-play-1.0.0-2.tgz", + "integrity": "sha512-AUCSyqk/UAD79KPSK678HrVyRGqYZrSeqpjXCwLujR11cW0R3mlc3uHrYrrMniTbfGPzkDXbW8HZj6lZm0KD5w==", + "dev": true, + "requires": { + "glob": "^7.1.2", + "npm-packlist": "^2.0.0", + "once": "^1.4.0", + "rimraf": "^3.0.0", + "tar": "^5.0.0", + "tmp": "0.1.0" + }, + "dependencies": { + "tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "dev": true, + "requires": { + "rimraf": "^2.6.3" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + } + } + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, + "proto3-json-serializer": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.9.tgz", + "integrity": "sha512-A60IisqvnuI45qNRygJjrnNjX2TMdQGMY+57tR3nul3ZgO2zXkR9OGR8AXxJhkqx84g0FTnrfi3D5fWMSdANdQ==", + "requires": { + "protobufjs": "^6.11.2" + } + }, + "protobufjs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", + "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + } + } + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "retry-request": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-5.0.0.tgz", + "integrity": "sha512-vBZdBxUordje9253imlmGtppC5gdcwZmNz7JnU2ui+KKFPk25keR+0c020AVV20oesYxIFOI0Kh3HE88/59ieg==", + "requires": { + "debug": "^4.1.1", + "extend": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==", + "dev": true + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "sinon": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-14.0.0.tgz", + "integrity": "sha512-ugA6BFmE+WrJdh0owRZHToLd32Uw3Lxq6E6LtNRU+xTVBefx632h03Q7apXWRsRdZAJ41LB8aUfn2+O4jsDNMw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^9.1.2", + "@sinonjs/samsam": "^6.1.1", + "diff": "^5.0.0", + "nise": "^5.1.1", + "supports-color": "^7.2.0" + }, + "dependencies": { + "@sinonjs/fake-timers": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", + "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + } + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "table": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "tapable": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", + "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", + "dev": true + }, + "tar": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/tar/-/tar-5.0.5.tgz", + "integrity": "sha512-MNIgJddrV2TkuwChwcSNds/5E9VijOiw7kAc1y5hTNJoLDSuIyid2QtLYiCYNnICebpuvjhPQZsXwUL0O3l7OQ==", + "dev": true, + "requires": { + "chownr": "^1.1.3", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.0", + "mkdirp": "^0.5.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } + } + }, + "terser": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", + "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz", + "integrity": "sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==", + "dev": true, + "requires": { + "jest-worker": "^27.0.2", + "p-limit": "^3.1.0", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.7.0" + }, + "dependencies": { + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true + }, + "ts-loader": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.2.tgz", + "integrity": "sha512-hNIhGTQHtNKjOzR2ZtQ2OSVbXPykOae+zostf1IlHCf61Mt41GMJurKNqrYUbzHgpmj6UWRu8eBfb7q0XliV0g==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4" + }, + "dependencies": { + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", + "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, + "underscore": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", + "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", + "dev": true + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-notifier": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "dev": true, + "requires": { + "boxen": "^5.0.0", + "chalk": "^4.1.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "v8-to-istanbul": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", + "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "watchpack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz", + "integrity": "sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "webpack": { + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.38.1.tgz", + "integrity": "sha512-OqRmYD1OJbHZph6RUMD93GcCZy4Z4wC0ele4FXyYF0J6AxO1vOSuIlU1hkS/lDlR9CDYBz64MZRmdbdnFFoT2g==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.47", + "@webassemblyjs/ast": "1.11.0", + "@webassemblyjs/wasm-edit": "1.11.0", + "@webassemblyjs/wasm-parser": "1.11.0", + "acorn": "^8.2.1", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.8.0", + "es-module-lexer": "^0.4.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.0.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.1", + "watchpack": "^2.2.0", + "webpack-sources": "^2.3.0" + }, + "dependencies": { + "acorn": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.3.0.tgz", + "integrity": "sha512-tqPKHZ5CaBJw0Xmy0ZZvLs1qTV+BNFSyvn77ASXkpBNfIRk8ev26fKrD9iLGwGA9zedPao52GSHzq8lyZG0NUw==", + "dev": true + } + } + }, + "webpack-cli": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.7.0.tgz", + "integrity": "sha512-7bKr9182/sGfjFm+xdZSwgQuFjgEcy0iCTIBxRUeteJ2Kr8/Wz0qNJX+jw60LU36jApt4nmMkep6+W5AKhok6g==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.0.3", + "@webpack-cli/info": "^1.2.4", + "@webpack-cli/serve": "^1.4.0", + "colorette": "^1.2.1", + "commander": "^7.0.0", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^5.7.3" + }, + "dependencies": { + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", + "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, + "webpack-sources": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.3.0.tgz", + "integrity": "sha512-WyOdtwSvOML1kbgtXbTDnEW0jkJ7hZr/bDByIwszhWd/4XX1A3XMkrbFMsuH4+/MfLlZCUzlAdg4r7jaGKEIgQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, + "xmlcreate": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==" + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/packages/google-cloud-shell/package.json b/packages/google-cloud-shell/package.json new file mode 100644 index 000000000000..8d27366b7c17 --- /dev/null +++ b/packages/google-cloud-shell/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/shell", + "version": "2.0.2", + "description": "cloudshell client for Node.js", + "repository": "googleapis/nodejs-cloud-shell", + "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 cloudshell", + "cloudshell", + "cloudshell service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-shell/protos/google/cloud/shell/v1/cloudshell.proto b/packages/google-cloud-shell/protos/google/cloud/shell/v1/cloudshell.proto new file mode 100644 index 000000000000..f4b35b171cdc --- /dev/null +++ b/packages/google-cloud-shell/protos/google/cloud/shell/v1/cloudshell.proto @@ -0,0 +1,388 @@ +// 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 +// +// 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.cloud.shell.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/shell/v1;shell"; +option java_multiple_files = true; +option java_outer_classname = "CloudShellProto"; +option java_package = "com.google.cloud.shell.v1"; + +// API for interacting with Google Cloud Shell. Each user of Cloud Shell has at +// least one environment, which has the ID "default". Environment consists of a +// Docker image defining what is installed on the environment and a home +// directory containing the user's data that will remain across sessions. +// Clients use this API to start and fetch information about their environment, +// which can then be used to connect to that environment via a separate SSH +// client. +service CloudShellService { + option (google.api.default_host) = "cloudshell.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Gets an environment. Returns NOT_FOUND if the environment does not exist. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v1/{name=users/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Starts an existing environment, allowing clients to connect to it. The + // returned operation will contain an instance of StartEnvironmentMetadata in + // its metadata field. Users can wait for the environment to start by polling + // this operation via GetOperation. Once the environment has finished starting + // and is ready to accept connections, the operation will contain a + // StartEnvironmentResponse in its response field. + rpc StartEnvironment(StartEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=users/*/environments/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "StartEnvironmentResponse" + metadata_type: "StartEnvironmentMetadata" + }; + } + + // Sends OAuth credentials to a running environment on behalf of a user. When + // this completes, the environment will be authorized to run various Google + // Cloud command line tools without requiring the user to manually + // authenticate. + rpc AuthorizeEnvironment(AuthorizeEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=users/*/environments/*}:authorize" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AuthorizeEnvironmentResponse" + metadata_type: "AuthorizeEnvironmentMetadata" + }; + } + + // Adds a public SSH key to an environment, allowing clients with the + // corresponding private key to connect to that environment via SSH. If a key + // with the same content already exists, this will error with ALREADY_EXISTS. + rpc AddPublicKey(AddPublicKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=users/*/environments/*}:addPublicKey" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AddPublicKeyResponse" + metadata_type: "AddPublicKeyMetadata" + }; + } + + // Removes a public SSH key from an environment. Clients will no longer be + // able to connect to the environment using the corresponding private key. + // If a key with the same content is not present, this will error with + // NOT_FOUND. + rpc RemovePublicKey(RemovePublicKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=users/*/environments/*}:removePublicKey" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RemovePublicKeyResponse" + metadata_type: "RemovePublicKeyMetadata" + }; + } +} + +// A Cloud Shell environment, which is defined as the combination of a Docker +// image specifying what is installed on the environment and a home directory +// containing the user's data that will remain across sessions. Each user has +// at least an environment with the ID "default". +message Environment { + option (google.api.resource) = { + type: "cloudshell.googleapis.com/Environment" + pattern: "users/{user}/environments/{environment}" + }; + + // Possible execution states for an environment. + enum State { + // The environment's states is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is not running and can't be connected to. Starting the + // environment will transition it to the PENDING state. + SUSPENDED = 1; + + // The environment is being started but is not yet ready to accept + // connections. + PENDING = 2; + + // The environment is running and ready to accept connections. It will + // automatically transition back to DISABLED after a period of inactivity or + // if another environment is started. + RUNNING = 3; + + // The environment is being deleted and can't be connected to. + DELETING = 4; + } + + // Immutable. Full name of this resource, in the format + // `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the + // email address of the user to whom this environment belongs, and + // `{environment_id}` is the identifier of this environment. For example, + // `users/someone@example.com/environments/default`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The environment's identifier, unique among the user's + // environments. + string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Full path to the Docker image used to run this environment, e.g. + // "gcr.io/dev-con/cloud-devshell:latest". + string docker_image = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Current execution state of this environment. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can connect to initiate HTTPS or WSS + // connections with the environment. + string web_host = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Username that clients should use when initiating SSH sessions + // with the environment. + string ssh_username = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can connect to initiate SSH sessions + // with the environment. + string ssh_host = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Port to which clients can connect to initiate SSH sessions + // with the environment. + int32 ssh_port = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Public keys associated with the environment. Clients can + // connect to this environment via SSH only if they possess a private key + // corresponding to at least one of these public keys. Keys can be added to or + // removed from the environment using the AddPublicKey and RemovePublicKey + // methods. + repeated string public_keys = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for +// [GetEnvironment][google.cloud.shell.v1.CloudShellService.GetEnvironment]. +message GetEnvironmentRequest { + // Required. Name of the requested resource, for example `users/me/environments/default` + // or `users/someone@example.com/environments/default`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudshell.googleapis.com/Environment" + } + ]; +} + +// Message included in the metadata field of operations returned from +// [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment]. +message CreateEnvironmentMetadata { + +} + +// Message included in the metadata field of operations returned from +// [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment]. +message DeleteEnvironmentMetadata { + +} + +// Request message for +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]. +message StartEnvironmentRequest { + // Name of the resource that should be started, for example + // `users/me/environments/default` or + // `users/someone@example.com/environments/default`. + string name = 1; + + // The initial access token passed to the environment. If this is present and + // valid, the environment will be pre-authenticated with gcloud so that the + // user can run gcloud commands in Cloud Shell without having to log in. This + // code can be updated later by calling AuthorizeEnvironment. + string access_token = 2; + + // Public keys that should be added to the environment before it is started. + repeated string public_keys = 3; +} + +// Request message for +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentRequest { + // Name of the resource that should receive the credentials, for example + // `users/me/environments/default` or + // `users/someone@example.com/environments/default`. + string name = 1; + + // The OAuth access token that should be sent to the environment. + string access_token = 2; + + // The OAuth ID token that should be sent to the environment. + string id_token = 4; + + // The time when the credentials expire. If not set, defaults to one hour from + // when the server received the request. + google.protobuf.Timestamp expire_time = 3; +} + +// Response message for +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentResponse { + +} + +// Message included in the metadata field of operations returned from +// [AuthorizeEnvironment][google.cloud.shell.v1.CloudShellService.AuthorizeEnvironment]. +message AuthorizeEnvironmentMetadata { + +} + +// Message included in the metadata field of operations returned from +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment]. +message StartEnvironmentMetadata { + // Possible states an environment might transition between during startup. + // These states are not normally actionable by clients, but may be used to + // show a progress message to the user. An environment won't necessarily go + // through all of these states when starting. More states are likely to be + // added in the future. + enum State { + // The environment's start state is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is in the process of being started, but no additional + // details are available. + STARTING = 1; + + // Startup is waiting for the user's disk to be unarchived. This can happen + // when the user returns to Cloud Shell after not having used it for a + // while, and suggests that startup will take longer than normal. + UNARCHIVING_DISK = 2; + + // Startup is waiting for compute resources to be assigned to the + // environment. This should normally happen very quickly, but an environment + // might stay in this state for an extended period of time if the system is + // experiencing heavy load. + AWAITING_COMPUTE_RESOURCES = 4; + + // Startup has completed. If the start operation was successful, the user + // should be able to establish an SSH connection to their environment. + // Otherwise, the operation will contain details of the failure. + FINISHED = 3; + } + + // Current state of the environment being started. + State state = 1; +} + +// Message included in the response field of operations returned from +// [StartEnvironment][google.cloud.shell.v1.CloudShellService.StartEnvironment] +// once the operation is complete. +message StartEnvironmentResponse { + // Environment that was started. + Environment environment = 1; +} + +// Request message for +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyRequest { + // Environment this key should be added to, e.g. + // `users/me/environments/default`. + string environment = 1; + + // Key that should be added to the environment. Supported formats are + // `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + // (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + // `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + // <format> <content>, where <content> part is encoded with + // Base64. + string key = 2; +} + +// Response message for +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyResponse { + // Key that was added to the environment. + string key = 1; +} + +// Message included in the metadata field of operations returned from +// [AddPublicKey][google.cloud.shell.v1.CloudShellService.AddPublicKey]. +message AddPublicKeyMetadata { + +} + +// Request message for +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyRequest { + // Environment this key should be removed from, e.g. + // `users/me/environments/default`. + string environment = 1; + + // Key that should be removed from the environment. + string key = 2; +} + +// Response message for +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyResponse { + +} + +// Message included in the metadata field of operations returned from +// [RemovePublicKey][google.cloud.shell.v1.CloudShellService.RemovePublicKey]. +message RemovePublicKeyMetadata { + +} + +// Cloud-shell specific information that will be included as details in failure +// responses. +message CloudShellErrorDetails { + // Set of possible errors returned from API calls. + enum CloudShellErrorCode { + // An unknown error occurred. + CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0; + + // The image used by the Cloud Shell environment either does not exist or + // the user does not have access to it. + IMAGE_UNAVAILABLE = 1; + + // Cloud Shell has been disabled by an administrator for the user making the + // request. + CLOUD_SHELL_DISABLED = 2; + + // Cloud Shell has been permanently disabled due to a Terms of Service + // violation by the user. + TOS_VIOLATION = 4; + + // The user has exhausted their weekly Cloud Shell quota, and Cloud Shell + // will be disabled until the quota resets. + QUOTA_EXCEEDED = 5; + } + + // Code indicating the specific error the occurred. + CloudShellErrorCode code = 1; +} diff --git a/packages/google-cloud-shell/protos/protos.d.ts b/packages/google-cloud-shell/protos/protos.d.ts new file mode 100644 index 000000000000..31d8787fc321 --- /dev/null +++ b/packages/google-cloud-shell/protos/protos.d.ts @@ -0,0 +1,7453 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace shell. */ + namespace shell { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudShellService */ + class CloudShellService extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudShellService 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 CloudShellService 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): CloudShellService; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment + */ + public getEnvironment(request: google.cloud.shell.v1.IGetEnvironmentRequest, callback: google.cloud.shell.v1.CloudShellService.GetEnvironmentCallback): void; + + /** + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise + */ + public getEnvironment(request: google.cloud.shell.v1.IGetEnvironmentRequest): Promise; + + /** + * Calls StartEnvironment. + * @param request StartEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startEnvironment(request: google.cloud.shell.v1.IStartEnvironmentRequest, callback: google.cloud.shell.v1.CloudShellService.StartEnvironmentCallback): void; + + /** + * Calls StartEnvironment. + * @param request StartEnvironmentRequest message or plain object + * @returns Promise + */ + public startEnvironment(request: google.cloud.shell.v1.IStartEnvironmentRequest): Promise; + + /** + * Calls AuthorizeEnvironment. + * @param request AuthorizeEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public authorizeEnvironment(request: google.cloud.shell.v1.IAuthorizeEnvironmentRequest, callback: google.cloud.shell.v1.CloudShellService.AuthorizeEnvironmentCallback): void; + + /** + * Calls AuthorizeEnvironment. + * @param request AuthorizeEnvironmentRequest message or plain object + * @returns Promise + */ + public authorizeEnvironment(request: google.cloud.shell.v1.IAuthorizeEnvironmentRequest): Promise; + + /** + * Calls AddPublicKey. + * @param request AddPublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addPublicKey(request: google.cloud.shell.v1.IAddPublicKeyRequest, callback: google.cloud.shell.v1.CloudShellService.AddPublicKeyCallback): void; + + /** + * Calls AddPublicKey. + * @param request AddPublicKeyRequest message or plain object + * @returns Promise + */ + public addPublicKey(request: google.cloud.shell.v1.IAddPublicKeyRequest): Promise; + + /** + * Calls RemovePublicKey. + * @param request RemovePublicKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removePublicKey(request: google.cloud.shell.v1.IRemovePublicKeyRequest, callback: google.cloud.shell.v1.CloudShellService.RemovePublicKeyCallback): void; + + /** + * Calls RemovePublicKey. + * @param request RemovePublicKeyRequest message or plain object + * @returns Promise + */ + public removePublicKey(request: google.cloud.shell.v1.IRemovePublicKeyRequest): Promise; + } + + namespace CloudShellService { + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.shell.v1.Environment) => void; + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|startEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type StartEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|authorizeEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type AuthorizeEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|addPublicKey}. + * @param error Error, if any + * @param [response] Operation + */ + type AddPublicKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|removePublicKey}. + * @param error Error, if any + * @param [response] Operation + */ + type RemovePublicKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment id */ + id?: (string|null); + + /** Environment dockerImage */ + dockerImage?: (string|null); + + /** Environment state */ + state?: (google.cloud.shell.v1.Environment.State|keyof typeof google.cloud.shell.v1.Environment.State|null); + + /** Environment webHost */ + webHost?: (string|null); + + /** Environment sshUsername */ + sshUsername?: (string|null); + + /** Environment sshHost */ + sshHost?: (string|null); + + /** Environment sshPort */ + sshPort?: (number|null); + + /** Environment publicKeys */ + publicKeys?: (string[]|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment id. */ + public id: string; + + /** Environment dockerImage. */ + public dockerImage: string; + + /** Environment state. */ + public state: (google.cloud.shell.v1.Environment.State|keyof typeof google.cloud.shell.v1.Environment.State); + + /** Environment webHost. */ + public webHost: string; + + /** Environment sshUsername. */ + public sshUsername: string; + + /** Environment sshHost. */ + public sshHost: string; + + /** Environment sshPort. */ + public sshPort: number; + + /** Environment publicKeys. */ + public publicKeys: string[]; + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.shell.v1.IEnvironment): google.cloud.shell.v1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.shell.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.shell.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SUSPENDED = 1, + PENDING = 2, + RUNNING = 3, + DELETING = 4 + } + } + + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { + + /** GetEnvironmentRequest name */ + name?: (string|null); + } + + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { + + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IGetEnvironmentRequest); + + /** GetEnvironmentRequest name. */ + public name: string; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.shell.v1.IGetEnvironmentRequest): google.cloud.shell.v1.GetEnvironmentRequest; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.GetEnvironmentRequest; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.GetEnvironmentRequest; + + /** + * Verifies a GetEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.GetEnvironmentRequest; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEnvironmentMetadata. */ + interface ICreateEnvironmentMetadata { + } + + /** Represents a CreateEnvironmentMetadata. */ + class CreateEnvironmentMetadata implements ICreateEnvironmentMetadata { + + /** + * Constructs a new CreateEnvironmentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.ICreateEnvironmentMetadata); + + /** + * Creates a new CreateEnvironmentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEnvironmentMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.ICreateEnvironmentMetadata): google.cloud.shell.v1.CreateEnvironmentMetadata; + + /** + * Encodes the specified CreateEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.CreateEnvironmentMetadata.verify|verify} messages. + * @param message CreateEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.ICreateEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.CreateEnvironmentMetadata.verify|verify} messages. + * @param message CreateEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.ICreateEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEnvironmentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.CreateEnvironmentMetadata; + + /** + * Decodes a CreateEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.CreateEnvironmentMetadata; + + /** + * Verifies a CreateEnvironmentMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEnvironmentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.CreateEnvironmentMetadata; + + /** + * Creates a plain object from a CreateEnvironmentMetadata message. Also converts values to other types if specified. + * @param message CreateEnvironmentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.CreateEnvironmentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEnvironmentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEnvironmentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEnvironmentMetadata. */ + interface IDeleteEnvironmentMetadata { + } + + /** Represents a DeleteEnvironmentMetadata. */ + class DeleteEnvironmentMetadata implements IDeleteEnvironmentMetadata { + + /** + * Constructs a new DeleteEnvironmentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IDeleteEnvironmentMetadata); + + /** + * Creates a new DeleteEnvironmentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEnvironmentMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.IDeleteEnvironmentMetadata): google.cloud.shell.v1.DeleteEnvironmentMetadata; + + /** + * Encodes the specified DeleteEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.DeleteEnvironmentMetadata.verify|verify} messages. + * @param message DeleteEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IDeleteEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.DeleteEnvironmentMetadata.verify|verify} messages. + * @param message DeleteEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IDeleteEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEnvironmentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.DeleteEnvironmentMetadata; + + /** + * Decodes a DeleteEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.DeleteEnvironmentMetadata; + + /** + * Verifies a DeleteEnvironmentMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEnvironmentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.DeleteEnvironmentMetadata; + + /** + * Creates a plain object from a DeleteEnvironmentMetadata message. Also converts values to other types if specified. + * @param message DeleteEnvironmentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.DeleteEnvironmentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEnvironmentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEnvironmentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartEnvironmentRequest. */ + interface IStartEnvironmentRequest { + + /** StartEnvironmentRequest name */ + name?: (string|null); + + /** StartEnvironmentRequest accessToken */ + accessToken?: (string|null); + + /** StartEnvironmentRequest publicKeys */ + publicKeys?: (string[]|null); + } + + /** Represents a StartEnvironmentRequest. */ + class StartEnvironmentRequest implements IStartEnvironmentRequest { + + /** + * Constructs a new StartEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IStartEnvironmentRequest); + + /** StartEnvironmentRequest name. */ + public name: string; + + /** StartEnvironmentRequest accessToken. */ + public accessToken: string; + + /** StartEnvironmentRequest publicKeys. */ + public publicKeys: string[]; + + /** + * Creates a new StartEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartEnvironmentRequest instance + */ + public static create(properties?: google.cloud.shell.v1.IStartEnvironmentRequest): google.cloud.shell.v1.StartEnvironmentRequest; + + /** + * Encodes the specified StartEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentRequest.verify|verify} messages. + * @param message StartEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IStartEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentRequest.verify|verify} messages. + * @param message StartEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IStartEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.StartEnvironmentRequest; + + /** + * Decodes a StartEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.StartEnvironmentRequest; + + /** + * Verifies a StartEnvironmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.StartEnvironmentRequest; + + /** + * Creates a plain object from a StartEnvironmentRequest message. Also converts values to other types if specified. + * @param message StartEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.StartEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthorizeEnvironmentRequest. */ + interface IAuthorizeEnvironmentRequest { + + /** AuthorizeEnvironmentRequest name */ + name?: (string|null); + + /** AuthorizeEnvironmentRequest accessToken */ + accessToken?: (string|null); + + /** AuthorizeEnvironmentRequest idToken */ + idToken?: (string|null); + + /** AuthorizeEnvironmentRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AuthorizeEnvironmentRequest. */ + class AuthorizeEnvironmentRequest implements IAuthorizeEnvironmentRequest { + + /** + * Constructs a new AuthorizeEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentRequest); + + /** AuthorizeEnvironmentRequest name. */ + public name: string; + + /** AuthorizeEnvironmentRequest accessToken. */ + public accessToken: string; + + /** AuthorizeEnvironmentRequest idToken. */ + public idToken: string; + + /** AuthorizeEnvironmentRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new AuthorizeEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizeEnvironmentRequest instance + */ + public static create(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentRequest): google.cloud.shell.v1.AuthorizeEnvironmentRequest; + + /** + * Encodes the specified AuthorizeEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentRequest.verify|verify} messages. + * @param message AuthorizeEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAuthorizeEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizeEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentRequest.verify|verify} messages. + * @param message AuthorizeEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAuthorizeEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizeEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizeEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AuthorizeEnvironmentRequest; + + /** + * Decodes an AuthorizeEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizeEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AuthorizeEnvironmentRequest; + + /** + * Verifies an AuthorizeEnvironmentRequest message. + * @param message Plain 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 AuthorizeEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizeEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AuthorizeEnvironmentRequest; + + /** + * Creates a plain object from an AuthorizeEnvironmentRequest message. Also converts values to other types if specified. + * @param message AuthorizeEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AuthorizeEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizeEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizeEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthorizeEnvironmentResponse. */ + interface IAuthorizeEnvironmentResponse { + } + + /** Represents an AuthorizeEnvironmentResponse. */ + class AuthorizeEnvironmentResponse implements IAuthorizeEnvironmentResponse { + + /** + * Constructs a new AuthorizeEnvironmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentResponse); + + /** + * Creates a new AuthorizeEnvironmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizeEnvironmentResponse instance + */ + public static create(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentResponse): google.cloud.shell.v1.AuthorizeEnvironmentResponse; + + /** + * Encodes the specified AuthorizeEnvironmentResponse message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentResponse.verify|verify} messages. + * @param message AuthorizeEnvironmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAuthorizeEnvironmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizeEnvironmentResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentResponse.verify|verify} messages. + * @param message AuthorizeEnvironmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAuthorizeEnvironmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizeEnvironmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizeEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AuthorizeEnvironmentResponse; + + /** + * Decodes an AuthorizeEnvironmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizeEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AuthorizeEnvironmentResponse; + + /** + * Verifies an AuthorizeEnvironmentResponse message. + * @param message Plain 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 AuthorizeEnvironmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizeEnvironmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AuthorizeEnvironmentResponse; + + /** + * Creates a plain object from an AuthorizeEnvironmentResponse message. Also converts values to other types if specified. + * @param message AuthorizeEnvironmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AuthorizeEnvironmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizeEnvironmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizeEnvironmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthorizeEnvironmentMetadata. */ + interface IAuthorizeEnvironmentMetadata { + } + + /** Represents an AuthorizeEnvironmentMetadata. */ + class AuthorizeEnvironmentMetadata implements IAuthorizeEnvironmentMetadata { + + /** + * Constructs a new AuthorizeEnvironmentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentMetadata); + + /** + * Creates a new AuthorizeEnvironmentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizeEnvironmentMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.IAuthorizeEnvironmentMetadata): google.cloud.shell.v1.AuthorizeEnvironmentMetadata; + + /** + * Encodes the specified AuthorizeEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentMetadata.verify|verify} messages. + * @param message AuthorizeEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAuthorizeEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizeEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentMetadata.verify|verify} messages. + * @param message AuthorizeEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAuthorizeEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizeEnvironmentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizeEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AuthorizeEnvironmentMetadata; + + /** + * Decodes an AuthorizeEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizeEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AuthorizeEnvironmentMetadata; + + /** + * Verifies an AuthorizeEnvironmentMetadata message. + * @param message Plain 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 AuthorizeEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizeEnvironmentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AuthorizeEnvironmentMetadata; + + /** + * Creates a plain object from an AuthorizeEnvironmentMetadata message. Also converts values to other types if specified. + * @param message AuthorizeEnvironmentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AuthorizeEnvironmentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizeEnvironmentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizeEnvironmentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartEnvironmentMetadata. */ + interface IStartEnvironmentMetadata { + + /** StartEnvironmentMetadata state */ + state?: (google.cloud.shell.v1.StartEnvironmentMetadata.State|keyof typeof google.cloud.shell.v1.StartEnvironmentMetadata.State|null); + } + + /** Represents a StartEnvironmentMetadata. */ + class StartEnvironmentMetadata implements IStartEnvironmentMetadata { + + /** + * Constructs a new StartEnvironmentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IStartEnvironmentMetadata); + + /** StartEnvironmentMetadata state. */ + public state: (google.cloud.shell.v1.StartEnvironmentMetadata.State|keyof typeof google.cloud.shell.v1.StartEnvironmentMetadata.State); + + /** + * Creates a new StartEnvironmentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns StartEnvironmentMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.IStartEnvironmentMetadata): google.cloud.shell.v1.StartEnvironmentMetadata; + + /** + * Encodes the specified StartEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentMetadata.verify|verify} messages. + * @param message StartEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IStartEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentMetadata.verify|verify} messages. + * @param message StartEnvironmentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IStartEnvironmentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartEnvironmentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.StartEnvironmentMetadata; + + /** + * Decodes a StartEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.StartEnvironmentMetadata; + + /** + * Verifies a StartEnvironmentMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartEnvironmentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.StartEnvironmentMetadata; + + /** + * Creates a plain object from a StartEnvironmentMetadata message. Also converts values to other types if specified. + * @param message StartEnvironmentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.StartEnvironmentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartEnvironmentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartEnvironmentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StartEnvironmentMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STARTING = 1, + UNARCHIVING_DISK = 2, + AWAITING_COMPUTE_RESOURCES = 4, + FINISHED = 3 + } + } + + /** Properties of a StartEnvironmentResponse. */ + interface IStartEnvironmentResponse { + + /** StartEnvironmentResponse environment */ + environment?: (google.cloud.shell.v1.IEnvironment|null); + } + + /** Represents a StartEnvironmentResponse. */ + class StartEnvironmentResponse implements IStartEnvironmentResponse { + + /** + * Constructs a new StartEnvironmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IStartEnvironmentResponse); + + /** StartEnvironmentResponse environment. */ + public environment?: (google.cloud.shell.v1.IEnvironment|null); + + /** + * Creates a new StartEnvironmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StartEnvironmentResponse instance + */ + public static create(properties?: google.cloud.shell.v1.IStartEnvironmentResponse): google.cloud.shell.v1.StartEnvironmentResponse; + + /** + * Encodes the specified StartEnvironmentResponse message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentResponse.verify|verify} messages. + * @param message StartEnvironmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IStartEnvironmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartEnvironmentResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentResponse.verify|verify} messages. + * @param message StartEnvironmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IStartEnvironmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartEnvironmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.StartEnvironmentResponse; + + /** + * Decodes a StartEnvironmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.StartEnvironmentResponse; + + /** + * Verifies a StartEnvironmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartEnvironmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartEnvironmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.StartEnvironmentResponse; + + /** + * Creates a plain object from a StartEnvironmentResponse message. Also converts values to other types if specified. + * @param message StartEnvironmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.StartEnvironmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartEnvironmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartEnvironmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddPublicKeyRequest. */ + interface IAddPublicKeyRequest { + + /** AddPublicKeyRequest environment */ + environment?: (string|null); + + /** AddPublicKeyRequest key */ + key?: (string|null); + } + + /** Represents an AddPublicKeyRequest. */ + class AddPublicKeyRequest implements IAddPublicKeyRequest { + + /** + * Constructs a new AddPublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAddPublicKeyRequest); + + /** AddPublicKeyRequest environment. */ + public environment: string; + + /** AddPublicKeyRequest key. */ + public key: string; + + /** + * Creates a new AddPublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddPublicKeyRequest instance + */ + public static create(properties?: google.cloud.shell.v1.IAddPublicKeyRequest): google.cloud.shell.v1.AddPublicKeyRequest; + + /** + * Encodes the specified AddPublicKeyRequest message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyRequest.verify|verify} messages. + * @param message AddPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAddPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyRequest.verify|verify} messages. + * @param message AddPublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAddPublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddPublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AddPublicKeyRequest; + + /** + * Decodes an AddPublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AddPublicKeyRequest; + + /** + * Verifies an AddPublicKeyRequest message. + * @param message Plain 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 AddPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddPublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AddPublicKeyRequest; + + /** + * Creates a plain object from an AddPublicKeyRequest message. Also converts values to other types if specified. + * @param message AddPublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AddPublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddPublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddPublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddPublicKeyResponse. */ + interface IAddPublicKeyResponse { + + /** AddPublicKeyResponse key */ + key?: (string|null); + } + + /** Represents an AddPublicKeyResponse. */ + class AddPublicKeyResponse implements IAddPublicKeyResponse { + + /** + * Constructs a new AddPublicKeyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAddPublicKeyResponse); + + /** AddPublicKeyResponse key. */ + public key: string; + + /** + * Creates a new AddPublicKeyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddPublicKeyResponse instance + */ + public static create(properties?: google.cloud.shell.v1.IAddPublicKeyResponse): google.cloud.shell.v1.AddPublicKeyResponse; + + /** + * Encodes the specified AddPublicKeyResponse message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyResponse.verify|verify} messages. + * @param message AddPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAddPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyResponse.verify|verify} messages. + * @param message AddPublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAddPublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddPublicKeyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AddPublicKeyResponse; + + /** + * Decodes an AddPublicKeyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AddPublicKeyResponse; + + /** + * Verifies an AddPublicKeyResponse message. + * @param message Plain 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 AddPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddPublicKeyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AddPublicKeyResponse; + + /** + * Creates a plain object from an AddPublicKeyResponse message. Also converts values to other types if specified. + * @param message AddPublicKeyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AddPublicKeyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddPublicKeyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddPublicKeyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddPublicKeyMetadata. */ + interface IAddPublicKeyMetadata { + } + + /** Represents an AddPublicKeyMetadata. */ + class AddPublicKeyMetadata implements IAddPublicKeyMetadata { + + /** + * Constructs a new AddPublicKeyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IAddPublicKeyMetadata); + + /** + * Creates a new AddPublicKeyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AddPublicKeyMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.IAddPublicKeyMetadata): google.cloud.shell.v1.AddPublicKeyMetadata; + + /** + * Encodes the specified AddPublicKeyMetadata message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyMetadata.verify|verify} messages. + * @param message AddPublicKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IAddPublicKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddPublicKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyMetadata.verify|verify} messages. + * @param message AddPublicKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IAddPublicKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddPublicKeyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddPublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.AddPublicKeyMetadata; + + /** + * Decodes an AddPublicKeyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddPublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.AddPublicKeyMetadata; + + /** + * Verifies an AddPublicKeyMetadata message. + * @param message Plain 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 AddPublicKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddPublicKeyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.AddPublicKeyMetadata; + + /** + * Creates a plain object from an AddPublicKeyMetadata message. Also converts values to other types if specified. + * @param message AddPublicKeyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.AddPublicKeyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddPublicKeyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddPublicKeyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemovePublicKeyRequest. */ + interface IRemovePublicKeyRequest { + + /** RemovePublicKeyRequest environment */ + environment?: (string|null); + + /** RemovePublicKeyRequest key */ + key?: (string|null); + } + + /** Represents a RemovePublicKeyRequest. */ + class RemovePublicKeyRequest implements IRemovePublicKeyRequest { + + /** + * Constructs a new RemovePublicKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IRemovePublicKeyRequest); + + /** RemovePublicKeyRequest environment. */ + public environment: string; + + /** RemovePublicKeyRequest key. */ + public key: string; + + /** + * Creates a new RemovePublicKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePublicKeyRequest instance + */ + public static create(properties?: google.cloud.shell.v1.IRemovePublicKeyRequest): google.cloud.shell.v1.RemovePublicKeyRequest; + + /** + * Encodes the specified RemovePublicKeyRequest message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyRequest.verify|verify} messages. + * @param message RemovePublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IRemovePublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyRequest.verify|verify} messages. + * @param message RemovePublicKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IRemovePublicKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePublicKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.RemovePublicKeyRequest; + + /** + * Decodes a RemovePublicKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.RemovePublicKeyRequest; + + /** + * Verifies a RemovePublicKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePublicKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.RemovePublicKeyRequest; + + /** + * Creates a plain object from a RemovePublicKeyRequest message. Also converts values to other types if specified. + * @param message RemovePublicKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.RemovePublicKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePublicKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemovePublicKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemovePublicKeyResponse. */ + interface IRemovePublicKeyResponse { + } + + /** Represents a RemovePublicKeyResponse. */ + class RemovePublicKeyResponse implements IRemovePublicKeyResponse { + + /** + * Constructs a new RemovePublicKeyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IRemovePublicKeyResponse); + + /** + * Creates a new RemovePublicKeyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePublicKeyResponse instance + */ + public static create(properties?: google.cloud.shell.v1.IRemovePublicKeyResponse): google.cloud.shell.v1.RemovePublicKeyResponse; + + /** + * Encodes the specified RemovePublicKeyResponse message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyResponse.verify|verify} messages. + * @param message RemovePublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IRemovePublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyResponse.verify|verify} messages. + * @param message RemovePublicKeyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IRemovePublicKeyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePublicKeyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.RemovePublicKeyResponse; + + /** + * Decodes a RemovePublicKeyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.RemovePublicKeyResponse; + + /** + * Verifies a RemovePublicKeyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePublicKeyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.RemovePublicKeyResponse; + + /** + * Creates a plain object from a RemovePublicKeyResponse message. Also converts values to other types if specified. + * @param message RemovePublicKeyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.RemovePublicKeyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePublicKeyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemovePublicKeyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemovePublicKeyMetadata. */ + interface IRemovePublicKeyMetadata { + } + + /** Represents a RemovePublicKeyMetadata. */ + class RemovePublicKeyMetadata implements IRemovePublicKeyMetadata { + + /** + * Constructs a new RemovePublicKeyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.IRemovePublicKeyMetadata); + + /** + * Creates a new RemovePublicKeyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePublicKeyMetadata instance + */ + public static create(properties?: google.cloud.shell.v1.IRemovePublicKeyMetadata): google.cloud.shell.v1.RemovePublicKeyMetadata; + + /** + * Encodes the specified RemovePublicKeyMetadata message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyMetadata.verify|verify} messages. + * @param message RemovePublicKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.IRemovePublicKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePublicKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyMetadata.verify|verify} messages. + * @param message RemovePublicKeyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.IRemovePublicKeyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePublicKeyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.RemovePublicKeyMetadata; + + /** + * Decodes a RemovePublicKeyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.RemovePublicKeyMetadata; + + /** + * Verifies a RemovePublicKeyMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePublicKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePublicKeyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.RemovePublicKeyMetadata; + + /** + * Creates a plain object from a RemovePublicKeyMetadata message. Also converts values to other types if specified. + * @param message RemovePublicKeyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.RemovePublicKeyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePublicKeyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemovePublicKeyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudShellErrorDetails. */ + interface ICloudShellErrorDetails { + + /** CloudShellErrorDetails code */ + code?: (google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode|keyof typeof google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode|null); + } + + /** Represents a CloudShellErrorDetails. */ + class CloudShellErrorDetails implements ICloudShellErrorDetails { + + /** + * Constructs a new CloudShellErrorDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.shell.v1.ICloudShellErrorDetails); + + /** CloudShellErrorDetails code. */ + public code: (google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode|keyof typeof google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode); + + /** + * Creates a new CloudShellErrorDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudShellErrorDetails instance + */ + public static create(properties?: google.cloud.shell.v1.ICloudShellErrorDetails): google.cloud.shell.v1.CloudShellErrorDetails; + + /** + * Encodes the specified CloudShellErrorDetails message. Does not implicitly {@link google.cloud.shell.v1.CloudShellErrorDetails.verify|verify} messages. + * @param message CloudShellErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.shell.v1.ICloudShellErrorDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudShellErrorDetails message, length delimited. Does not implicitly {@link google.cloud.shell.v1.CloudShellErrorDetails.verify|verify} messages. + * @param message CloudShellErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.shell.v1.ICloudShellErrorDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudShellErrorDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudShellErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.shell.v1.CloudShellErrorDetails; + + /** + * Decodes a CloudShellErrorDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudShellErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.shell.v1.CloudShellErrorDetails; + + /** + * Verifies a CloudShellErrorDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudShellErrorDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudShellErrorDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.shell.v1.CloudShellErrorDetails; + + /** + * Creates a plain object from a CloudShellErrorDetails message. Also converts values to other types if specified. + * @param message CloudShellErrorDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.shell.v1.CloudShellErrorDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudShellErrorDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudShellErrorDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudShellErrorDetails { + + /** CloudShellErrorCode enum. */ + enum CloudShellErrorCode { + CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0, + IMAGE_UNAVAILABLE = 1, + CLOUD_SHELL_DISABLED = 2, + TOS_VIOLATION = 4, + QUOTA_EXCEEDED = 5 + } + } + } + } + } + + /** 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; + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|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 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 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-shell/protos/protos.js b/packages/google-cloud-shell/protos/protos.js new file mode 100644 index 000000000000..5fa2e28e0a92 --- /dev/null +++ b/packages/google-cloud-shell/protos/protos.js @@ -0,0 +1,18651 @@ +// Copyright 2022 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_shell_protos || ($protobuf.roots._google_cloud_shell_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.shell = (function() { + + /** + * Namespace shell. + * @memberof google.cloud + * @namespace + */ + var shell = {}; + + shell.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.shell + * @namespace + */ + var v1 = {}; + + v1.CloudShellService = (function() { + + /** + * Constructs a new CloudShellService service. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a CloudShellService + * @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 CloudShellService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudShellService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudShellService; + + /** + * Creates new CloudShellService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.shell.v1.CloudShellService + * @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 {CloudShellService} RPC service. Useful where requests and/or responses are streamed. + */ + CloudShellService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|getEnvironment}. + * @memberof google.cloud.shell.v1.CloudShellService + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.shell.v1.Environment} [response] Environment + */ + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.shell.v1.CloudShellService.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudShellService.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.shell.v1.GetEnvironmentRequest, $root.google.cloud.shell.v1.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); + + /** + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|startEnvironment}. + * @memberof google.cloud.shell.v1.CloudShellService + * @typedef StartEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartEnvironment. + * @function startEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IStartEnvironmentRequest} request StartEnvironmentRequest message or plain object + * @param {google.cloud.shell.v1.CloudShellService.StartEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudShellService.prototype.startEnvironment = function startEnvironment(request, callback) { + return this.rpcCall(startEnvironment, $root.google.cloud.shell.v1.StartEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartEnvironment" }); + + /** + * Calls StartEnvironment. + * @function startEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IStartEnvironmentRequest} request StartEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|authorizeEnvironment}. + * @memberof google.cloud.shell.v1.CloudShellService + * @typedef AuthorizeEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AuthorizeEnvironment. + * @function authorizeEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest} request AuthorizeEnvironmentRequest message or plain object + * @param {google.cloud.shell.v1.CloudShellService.AuthorizeEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudShellService.prototype.authorizeEnvironment = function authorizeEnvironment(request, callback) { + return this.rpcCall(authorizeEnvironment, $root.google.cloud.shell.v1.AuthorizeEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AuthorizeEnvironment" }); + + /** + * Calls AuthorizeEnvironment. + * @function authorizeEnvironment + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest} request AuthorizeEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|addPublicKey}. + * @memberof google.cloud.shell.v1.CloudShellService + * @typedef AddPublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddPublicKey. + * @function addPublicKey + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IAddPublicKeyRequest} request AddPublicKeyRequest message or plain object + * @param {google.cloud.shell.v1.CloudShellService.AddPublicKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudShellService.prototype.addPublicKey = function addPublicKey(request, callback) { + return this.rpcCall(addPublicKey, $root.google.cloud.shell.v1.AddPublicKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddPublicKey" }); + + /** + * Calls AddPublicKey. + * @function addPublicKey + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IAddPublicKeyRequest} request AddPublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.shell.v1.CloudShellService|removePublicKey}. + * @memberof google.cloud.shell.v1.CloudShellService + * @typedef RemovePublicKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemovePublicKey. + * @function removePublicKey + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest} request RemovePublicKeyRequest message or plain object + * @param {google.cloud.shell.v1.CloudShellService.RemovePublicKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudShellService.prototype.removePublicKey = function removePublicKey(request, callback) { + return this.rpcCall(removePublicKey, $root.google.cloud.shell.v1.RemovePublicKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemovePublicKey" }); + + /** + * Calls RemovePublicKey. + * @function removePublicKey + * @memberof google.cloud.shell.v1.CloudShellService + * @instance + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest} request RemovePublicKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudShellService; + })(); + + v1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.shell.v1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [id] Environment id + * @property {string|null} [dockerImage] Environment dockerImage + * @property {google.cloud.shell.v1.Environment.State|null} [state] Environment state + * @property {string|null} [webHost] Environment webHost + * @property {string|null} [sshUsername] Environment sshUsername + * @property {string|null} [sshHost] Environment sshHost + * @property {number|null} [sshPort] Environment sshPort + * @property {Array.|null} [publicKeys] Environment publicKeys + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.shell.v1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.publicKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment id. + * @member {string} id + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.id = ""; + + /** + * Environment dockerImage. + * @member {string} dockerImage + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.dockerImage = ""; + + /** + * Environment state. + * @member {google.cloud.shell.v1.Environment.State} state + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.state = 0; + + /** + * Environment webHost. + * @member {string} webHost + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.webHost = ""; + + /** + * Environment sshUsername. + * @member {string} sshUsername + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.sshUsername = ""; + + /** + * Environment sshHost. + * @member {string} sshHost + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.sshHost = ""; + + /** + * Environment sshPort. + * @member {number} sshPort + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.sshPort = 0; + + /** + * Environment publicKeys. + * @member {Array.} publicKeys + * @memberof google.cloud.shell.v1.Environment + * @instance + */ + Environment.prototype.publicKeys = $util.emptyArray; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {google.cloud.shell.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.shell.v1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.shell.v1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {google.cloud.shell.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.dockerImage != null && Object.hasOwnProperty.call(message, "dockerImage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dockerImage); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.sshUsername != null && Object.hasOwnProperty.call(message, "sshUsername")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sshUsername); + if (message.sshHost != null && Object.hasOwnProperty.call(message, "sshHost")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sshHost); + if (message.sshPort != null && Object.hasOwnProperty.call(message, "sshPort")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.sshPort); + if (message.publicKeys != null && message.publicKeys.length) + for (var i = 0; i < message.publicKeys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.publicKeys[i]); + if (message.webHost != null && Object.hasOwnProperty.call(message, "webHost")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.webHost); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.shell.v1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {google.cloud.shell.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.dockerImage = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 12: { + message.webHost = reader.string(); + break; + } + case 5: { + message.sshUsername = reader.string(); + break; + } + case 6: { + message.sshHost = reader.string(); + break; + } + case 7: { + message.sshPort = reader.int32(); + break; + } + case 8: { + if (!(message.publicKeys && message.publicKeys.length)) + message.publicKeys = []; + message.publicKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.dockerImage != null && message.hasOwnProperty("dockerImage")) + if (!$util.isString(message.dockerImage)) + return "dockerImage: string 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: + break; + } + if (message.webHost != null && message.hasOwnProperty("webHost")) + if (!$util.isString(message.webHost)) + return "webHost: string expected"; + if (message.sshUsername != null && message.hasOwnProperty("sshUsername")) + if (!$util.isString(message.sshUsername)) + return "sshUsername: string expected"; + if (message.sshHost != null && message.hasOwnProperty("sshHost")) + if (!$util.isString(message.sshHost)) + return "sshHost: string expected"; + if (message.sshPort != null && message.hasOwnProperty("sshPort")) + if (!$util.isInteger(message.sshPort)) + return "sshPort: integer expected"; + if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) { + if (!Array.isArray(message.publicKeys)) + return "publicKeys: array expected"; + for (var i = 0; i < message.publicKeys.length; ++i) + if (!$util.isString(message.publicKeys[i])) + return "publicKeys: string[] expected"; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.Environment) + return object; + var message = new $root.google.cloud.shell.v1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.dockerImage != null) + message.dockerImage = String(object.dockerImage); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SUSPENDED": + case 1: + message.state = 1; + break; + case "PENDING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + if (object.webHost != null) + message.webHost = String(object.webHost); + if (object.sshUsername != null) + message.sshUsername = String(object.sshUsername); + if (object.sshHost != null) + message.sshHost = String(object.sshHost); + if (object.sshPort != null) + message.sshPort = object.sshPort | 0; + if (object.publicKeys) { + if (!Array.isArray(object.publicKeys)) + throw TypeError(".google.cloud.shell.v1.Environment.publicKeys: array expected"); + message.publicKeys = []; + for (var i = 0; i < object.publicKeys.length; ++i) + message.publicKeys[i] = String(object.publicKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {google.cloud.shell.v1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicKeys = []; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.dockerImage = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.sshUsername = ""; + object.sshHost = ""; + object.sshPort = 0; + object.webHost = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.dockerImage != null && message.hasOwnProperty("dockerImage")) + object.dockerImage = message.dockerImage; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.shell.v1.Environment.State[message.state] : message.state; + if (message.sshUsername != null && message.hasOwnProperty("sshUsername")) + object.sshUsername = message.sshUsername; + if (message.sshHost != null && message.hasOwnProperty("sshHost")) + object.sshHost = message.sshHost; + if (message.sshPort != null && message.hasOwnProperty("sshPort")) + object.sshPort = message.sshPort; + if (message.publicKeys && message.publicKeys.length) { + object.publicKeys = []; + for (var j = 0; j < message.publicKeys.length; ++j) + object.publicKeys[j] = message.publicKeys[j]; + } + if (message.webHost != null && message.hasOwnProperty("webHost")) + object.webHost = message.webHost; + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.shell.v1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.Environment"; + }; + + /** + * State enum. + * @name google.cloud.shell.v1.Environment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SUSPENDED=1 SUSPENDED value + * @property {number} PENDING=2 PENDING value + * @property {number} RUNNING=3 RUNNING value + * @property {number} DELETING=4 DELETING value + */ + Environment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUSPENDED"] = 1; + values[valuesById[2] = "PENDING"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Environment; + })(); + + v1.GetEnvironmentRequest = (function() { + + /** + * Properties of a GetEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name + */ + + /** + * Constructs a new GetEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest + * @constructor + * @param {google.cloud.shell.v1.IGetEnvironmentRequest=} [properties] Properties to set + */ + function GetEnvironmentRequest(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]]; + } + + /** + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @instance + */ + GetEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.shell.v1.GetEnvironmentRequest} GetEnvironmentRequest instance + */ + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); + }; + + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.GetEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.GetEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.GetEnvironmentRequest(); + 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 GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.GetEnvironmentRequest} GetEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEnvironmentRequest message. + * @function verify + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEnvironmentRequest.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 GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.GetEnvironmentRequest} GetEnvironmentRequest + */ + GetEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.GetEnvironmentRequest) + return object; + var message = new $root.google.cloud.shell.v1.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEnvironmentRequest.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 GetEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.shell.v1.GetEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.GetEnvironmentRequest"; + }; + + return GetEnvironmentRequest; + })(); + + v1.CreateEnvironmentMetadata = (function() { + + /** + * Properties of a CreateEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @interface ICreateEnvironmentMetadata + */ + + /** + * Constructs a new CreateEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a CreateEnvironmentMetadata. + * @implements ICreateEnvironmentMetadata + * @constructor + * @param {google.cloud.shell.v1.ICreateEnvironmentMetadata=} [properties] Properties to set + */ + function CreateEnvironmentMetadata(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 CreateEnvironmentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.ICreateEnvironmentMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.CreateEnvironmentMetadata} CreateEnvironmentMetadata instance + */ + CreateEnvironmentMetadata.create = function create(properties) { + return new CreateEnvironmentMetadata(properties); + }; + + /** + * Encodes the specified CreateEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.CreateEnvironmentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.ICreateEnvironmentMetadata} message CreateEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.CreateEnvironmentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.ICreateEnvironmentMetadata} message CreateEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnvironmentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEnvironmentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.CreateEnvironmentMetadata} CreateEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.CreateEnvironmentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.CreateEnvironmentMetadata} CreateEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnvironmentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnvironmentMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnvironmentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.CreateEnvironmentMetadata} CreateEnvironmentMetadata + */ + CreateEnvironmentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.CreateEnvironmentMetadata) + return object; + return new $root.google.cloud.shell.v1.CreateEnvironmentMetadata(); + }; + + /** + * Creates a plain object from a CreateEnvironmentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.CreateEnvironmentMetadata} message CreateEnvironmentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEnvironmentMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateEnvironmentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateEnvironmentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEnvironmentMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.CreateEnvironmentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEnvironmentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.CreateEnvironmentMetadata"; + }; + + return CreateEnvironmentMetadata; + })(); + + v1.DeleteEnvironmentMetadata = (function() { + + /** + * Properties of a DeleteEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @interface IDeleteEnvironmentMetadata + */ + + /** + * Constructs a new DeleteEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a DeleteEnvironmentMetadata. + * @implements IDeleteEnvironmentMetadata + * @constructor + * @param {google.cloud.shell.v1.IDeleteEnvironmentMetadata=} [properties] Properties to set + */ + function DeleteEnvironmentMetadata(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 DeleteEnvironmentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IDeleteEnvironmentMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.DeleteEnvironmentMetadata} DeleteEnvironmentMetadata instance + */ + DeleteEnvironmentMetadata.create = function create(properties) { + return new DeleteEnvironmentMetadata(properties); + }; + + /** + * Encodes the specified DeleteEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.DeleteEnvironmentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IDeleteEnvironmentMetadata} message DeleteEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.DeleteEnvironmentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IDeleteEnvironmentMetadata} message DeleteEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEnvironmentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.DeleteEnvironmentMetadata} DeleteEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.DeleteEnvironmentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.DeleteEnvironmentMetadata} DeleteEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEnvironmentMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEnvironmentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.DeleteEnvironmentMetadata} DeleteEnvironmentMetadata + */ + DeleteEnvironmentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.DeleteEnvironmentMetadata) + return object; + return new $root.google.cloud.shell.v1.DeleteEnvironmentMetadata(); + }; + + /** + * Creates a plain object from a DeleteEnvironmentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.DeleteEnvironmentMetadata} message DeleteEnvironmentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEnvironmentMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteEnvironmentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteEnvironmentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEnvironmentMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.DeleteEnvironmentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEnvironmentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.DeleteEnvironmentMetadata"; + }; + + return DeleteEnvironmentMetadata; + })(); + + v1.StartEnvironmentRequest = (function() { + + /** + * Properties of a StartEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @interface IStartEnvironmentRequest + * @property {string|null} [name] StartEnvironmentRequest name + * @property {string|null} [accessToken] StartEnvironmentRequest accessToken + * @property {Array.|null} [publicKeys] StartEnvironmentRequest publicKeys + */ + + /** + * Constructs a new StartEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a StartEnvironmentRequest. + * @implements IStartEnvironmentRequest + * @constructor + * @param {google.cloud.shell.v1.IStartEnvironmentRequest=} [properties] Properties to set + */ + function StartEnvironmentRequest(properties) { + this.publicKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @instance + */ + StartEnvironmentRequest.prototype.name = ""; + + /** + * StartEnvironmentRequest accessToken. + * @member {string} accessToken + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @instance + */ + StartEnvironmentRequest.prototype.accessToken = ""; + + /** + * StartEnvironmentRequest publicKeys. + * @member {Array.} publicKeys + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @instance + */ + StartEnvironmentRequest.prototype.publicKeys = $util.emptyArray; + + /** + * Creates a new StartEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.shell.v1.StartEnvironmentRequest} StartEnvironmentRequest instance + */ + StartEnvironmentRequest.create = function create(properties) { + return new StartEnvironmentRequest(properties); + }; + + /** + * Encodes the specified StartEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentRequest} message StartEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentRequest.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.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessToken); + if (message.publicKeys != null && message.publicKeys.length) + for (var i = 0; i < message.publicKeys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicKeys[i]); + return writer; + }; + + /** + * Encodes the specified StartEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentRequest} message StartEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.StartEnvironmentRequest} StartEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.StartEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.accessToken = reader.string(); + break; + } + case 3: { + if (!(message.publicKeys && message.publicKeys.length)) + message.publicKeys = []; + message.publicKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.StartEnvironmentRequest} StartEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartEnvironmentRequest message. + * @function verify + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartEnvironmentRequest.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.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) { + if (!Array.isArray(message.publicKeys)) + return "publicKeys: array expected"; + for (var i = 0; i < message.publicKeys.length; ++i) + if (!$util.isString(message.publicKeys[i])) + return "publicKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a StartEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.StartEnvironmentRequest} StartEnvironmentRequest + */ + StartEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.StartEnvironmentRequest) + return object; + var message = new $root.google.cloud.shell.v1.StartEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.publicKeys) { + if (!Array.isArray(object.publicKeys)) + throw TypeError(".google.cloud.shell.v1.StartEnvironmentRequest.publicKeys: array expected"); + message.publicKeys = []; + for (var i = 0; i < object.publicKeys.length; ++i) + message.publicKeys[i] = String(object.publicKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a StartEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.StartEnvironmentRequest} message StartEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicKeys = []; + if (options.defaults) { + object.name = ""; + object.accessToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.publicKeys && message.publicKeys.length) { + object.publicKeys = []; + for (var j = 0; j < message.publicKeys.length; ++j) + object.publicKeys[j] = message.publicKeys[j]; + } + return object; + }; + + /** + * Converts this StartEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + StartEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.shell.v1.StartEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.StartEnvironmentRequest"; + }; + + return StartEnvironmentRequest; + })(); + + v1.AuthorizeEnvironmentRequest = (function() { + + /** + * Properties of an AuthorizeEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @interface IAuthorizeEnvironmentRequest + * @property {string|null} [name] AuthorizeEnvironmentRequest name + * @property {string|null} [accessToken] AuthorizeEnvironmentRequest accessToken + * @property {string|null} [idToken] AuthorizeEnvironmentRequest idToken + * @property {google.protobuf.ITimestamp|null} [expireTime] AuthorizeEnvironmentRequest expireTime + */ + + /** + * Constructs a new AuthorizeEnvironmentRequest. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AuthorizeEnvironmentRequest. + * @implements IAuthorizeEnvironmentRequest + * @constructor + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest=} [properties] Properties to set + */ + function AuthorizeEnvironmentRequest(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]]; + } + + /** + * AuthorizeEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @instance + */ + AuthorizeEnvironmentRequest.prototype.name = ""; + + /** + * AuthorizeEnvironmentRequest accessToken. + * @member {string} accessToken + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @instance + */ + AuthorizeEnvironmentRequest.prototype.accessToken = ""; + + /** + * AuthorizeEnvironmentRequest idToken. + * @member {string} idToken + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @instance + */ + AuthorizeEnvironmentRequest.prototype.idToken = ""; + + /** + * AuthorizeEnvironmentRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @instance + */ + AuthorizeEnvironmentRequest.prototype.expireTime = null; + + /** + * Creates a new AuthorizeEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentRequest} AuthorizeEnvironmentRequest instance + */ + AuthorizeEnvironmentRequest.create = function create(properties) { + return new AuthorizeEnvironmentRequest(properties); + }; + + /** + * Encodes the specified AuthorizeEnvironmentRequest message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest} message AuthorizeEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentRequest.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.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessToken); + 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.idToken != null && Object.hasOwnProperty.call(message, "idToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.idToken); + return writer; + }; + + /** + * Encodes the specified AuthorizeEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentRequest} message AuthorizeEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizeEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentRequest} AuthorizeEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AuthorizeEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.accessToken = reader.string(); + break; + } + case 4: { + message.idToken = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizeEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentRequest} AuthorizeEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizeEnvironmentRequest message. + * @function verify + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizeEnvironmentRequest.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.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.idToken != null && message.hasOwnProperty("idToken")) + if (!$util.isString(message.idToken)) + return "idToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates an AuthorizeEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentRequest} AuthorizeEnvironmentRequest + */ + AuthorizeEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AuthorizeEnvironmentRequest) + return object; + var message = new $root.google.cloud.shell.v1.AuthorizeEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.idToken != null) + message.idToken = String(object.idToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.shell.v1.AuthorizeEnvironmentRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from an AuthorizeEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {google.cloud.shell.v1.AuthorizeEnvironmentRequest} message AuthorizeEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizeEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.accessToken = ""; + object.expireTime = null; + object.idToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.idToken != null && message.hasOwnProperty("idToken")) + object.idToken = message.idToken; + return object; + }; + + /** + * Converts this AuthorizeEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + AuthorizeEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizeEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizeEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AuthorizeEnvironmentRequest"; + }; + + return AuthorizeEnvironmentRequest; + })(); + + v1.AuthorizeEnvironmentResponse = (function() { + + /** + * Properties of an AuthorizeEnvironmentResponse. + * @memberof google.cloud.shell.v1 + * @interface IAuthorizeEnvironmentResponse + */ + + /** + * Constructs a new AuthorizeEnvironmentResponse. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AuthorizeEnvironmentResponse. + * @implements IAuthorizeEnvironmentResponse + * @constructor + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentResponse=} [properties] Properties to set + */ + function AuthorizeEnvironmentResponse(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 AuthorizeEnvironmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentResponse=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentResponse} AuthorizeEnvironmentResponse instance + */ + AuthorizeEnvironmentResponse.create = function create(properties) { + return new AuthorizeEnvironmentResponse(properties); + }; + + /** + * Encodes the specified AuthorizeEnvironmentResponse message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentResponse} message AuthorizeEnvironmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AuthorizeEnvironmentResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentResponse} message AuthorizeEnvironmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizeEnvironmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentResponse} AuthorizeEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AuthorizeEnvironmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizeEnvironmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentResponse} AuthorizeEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizeEnvironmentResponse message. + * @function verify + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizeEnvironmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AuthorizeEnvironmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentResponse} AuthorizeEnvironmentResponse + */ + AuthorizeEnvironmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AuthorizeEnvironmentResponse) + return object; + return new $root.google.cloud.shell.v1.AuthorizeEnvironmentResponse(); + }; + + /** + * Creates a plain object from an AuthorizeEnvironmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.AuthorizeEnvironmentResponse} message AuthorizeEnvironmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizeEnvironmentResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AuthorizeEnvironmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @instance + * @returns {Object.} JSON object + */ + AuthorizeEnvironmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizeEnvironmentResponse + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizeEnvironmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AuthorizeEnvironmentResponse"; + }; + + return AuthorizeEnvironmentResponse; + })(); + + v1.AuthorizeEnvironmentMetadata = (function() { + + /** + * Properties of an AuthorizeEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @interface IAuthorizeEnvironmentMetadata + */ + + /** + * Constructs a new AuthorizeEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AuthorizeEnvironmentMetadata. + * @implements IAuthorizeEnvironmentMetadata + * @constructor + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentMetadata=} [properties] Properties to set + */ + function AuthorizeEnvironmentMetadata(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 AuthorizeEnvironmentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentMetadata} AuthorizeEnvironmentMetadata instance + */ + AuthorizeEnvironmentMetadata.create = function create(properties) { + return new AuthorizeEnvironmentMetadata(properties); + }; + + /** + * Encodes the specified AuthorizeEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentMetadata} message AuthorizeEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AuthorizeEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AuthorizeEnvironmentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IAuthorizeEnvironmentMetadata} message AuthorizeEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizeEnvironmentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizeEnvironmentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentMetadata} AuthorizeEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AuthorizeEnvironmentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizeEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentMetadata} AuthorizeEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizeEnvironmentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizeEnvironmentMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizeEnvironmentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AuthorizeEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AuthorizeEnvironmentMetadata} AuthorizeEnvironmentMetadata + */ + AuthorizeEnvironmentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AuthorizeEnvironmentMetadata) + return object; + return new $root.google.cloud.shell.v1.AuthorizeEnvironmentMetadata(); + }; + + /** + * Creates a plain object from an AuthorizeEnvironmentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.AuthorizeEnvironmentMetadata} message AuthorizeEnvironmentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizeEnvironmentMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AuthorizeEnvironmentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @instance + * @returns {Object.} JSON object + */ + AuthorizeEnvironmentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizeEnvironmentMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AuthorizeEnvironmentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizeEnvironmentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AuthorizeEnvironmentMetadata"; + }; + + return AuthorizeEnvironmentMetadata; + })(); + + v1.StartEnvironmentMetadata = (function() { + + /** + * Properties of a StartEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @interface IStartEnvironmentMetadata + * @property {google.cloud.shell.v1.StartEnvironmentMetadata.State|null} [state] StartEnvironmentMetadata state + */ + + /** + * Constructs a new StartEnvironmentMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a StartEnvironmentMetadata. + * @implements IStartEnvironmentMetadata + * @constructor + * @param {google.cloud.shell.v1.IStartEnvironmentMetadata=} [properties] Properties to set + */ + function StartEnvironmentMetadata(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]]; + } + + /** + * StartEnvironmentMetadata state. + * @member {google.cloud.shell.v1.StartEnvironmentMetadata.State} state + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @instance + */ + StartEnvironmentMetadata.prototype.state = 0; + + /** + * Creates a new StartEnvironmentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.StartEnvironmentMetadata} StartEnvironmentMetadata instance + */ + StartEnvironmentMetadata.create = function create(properties) { + return new StartEnvironmentMetadata(properties); + }; + + /** + * Encodes the specified StartEnvironmentMetadata message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentMetadata} message StartEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentMetadata.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); + return writer; + }; + + /** + * Encodes the specified StartEnvironmentMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentMetadata} message StartEnvironmentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartEnvironmentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.StartEnvironmentMetadata} StartEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.StartEnvironmentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartEnvironmentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.StartEnvironmentMetadata} StartEnvironmentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartEnvironmentMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartEnvironmentMetadata.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 4: + case 3: + break; + } + return null; + }; + + /** + * Creates a StartEnvironmentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.StartEnvironmentMetadata} StartEnvironmentMetadata + */ + StartEnvironmentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.StartEnvironmentMetadata) + return object; + var message = new $root.google.cloud.shell.v1.StartEnvironmentMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STARTING": + case 1: + message.state = 1; + break; + case "UNARCHIVING_DISK": + case 2: + message.state = 2; + break; + case "AWAITING_COMPUTE_RESOURCES": + case 4: + message.state = 4; + break; + case "FINISHED": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a StartEnvironmentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {google.cloud.shell.v1.StartEnvironmentMetadata} message StartEnvironmentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartEnvironmentMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.shell.v1.StartEnvironmentMetadata.State[message.state] : message.state; + return object; + }; + + /** + * Converts this StartEnvironmentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @instance + * @returns {Object.} JSON object + */ + StartEnvironmentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartEnvironmentMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.StartEnvironmentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartEnvironmentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.StartEnvironmentMetadata"; + }; + + /** + * State enum. + * @name google.cloud.shell.v1.StartEnvironmentMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STARTING=1 STARTING value + * @property {number} UNARCHIVING_DISK=2 UNARCHIVING_DISK value + * @property {number} AWAITING_COMPUTE_RESOURCES=4 AWAITING_COMPUTE_RESOURCES value + * @property {number} FINISHED=3 FINISHED value + */ + StartEnvironmentMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STARTING"] = 1; + values[valuesById[2] = "UNARCHIVING_DISK"] = 2; + values[valuesById[4] = "AWAITING_COMPUTE_RESOURCES"] = 4; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + return StartEnvironmentMetadata; + })(); + + v1.StartEnvironmentResponse = (function() { + + /** + * Properties of a StartEnvironmentResponse. + * @memberof google.cloud.shell.v1 + * @interface IStartEnvironmentResponse + * @property {google.cloud.shell.v1.IEnvironment|null} [environment] StartEnvironmentResponse environment + */ + + /** + * Constructs a new StartEnvironmentResponse. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a StartEnvironmentResponse. + * @implements IStartEnvironmentResponse + * @constructor + * @param {google.cloud.shell.v1.IStartEnvironmentResponse=} [properties] Properties to set + */ + function StartEnvironmentResponse(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]]; + } + + /** + * StartEnvironmentResponse environment. + * @member {google.cloud.shell.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @instance + */ + StartEnvironmentResponse.prototype.environment = null; + + /** + * Creates a new StartEnvironmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentResponse=} [properties] Properties to set + * @returns {google.cloud.shell.v1.StartEnvironmentResponse} StartEnvironmentResponse instance + */ + StartEnvironmentResponse.create = function create(properties) { + return new StartEnvironmentResponse(properties); + }; + + /** + * Encodes the specified StartEnvironmentResponse message. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentResponse} message StartEnvironmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.shell.v1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartEnvironmentResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.StartEnvironmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.IStartEnvironmentResponse} message StartEnvironmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartEnvironmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartEnvironmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.StartEnvironmentResponse} StartEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.StartEnvironmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = $root.google.cloud.shell.v1.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartEnvironmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.StartEnvironmentResponse} StartEnvironmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartEnvironmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartEnvironmentResponse message. + * @function verify + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartEnvironmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.shell.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a StartEnvironmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.StartEnvironmentResponse} StartEnvironmentResponse + */ + StartEnvironmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.StartEnvironmentResponse) + return object; + var message = new $root.google.cloud.shell.v1.StartEnvironmentResponse(); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.shell.v1.StartEnvironmentResponse.environment: object expected"); + message.environment = $root.google.cloud.shell.v1.Environment.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a StartEnvironmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {google.cloud.shell.v1.StartEnvironmentResponse} message StartEnvironmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartEnvironmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.environment = null; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.shell.v1.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this StartEnvironmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @instance + * @returns {Object.} JSON object + */ + StartEnvironmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartEnvironmentResponse + * @function getTypeUrl + * @memberof google.cloud.shell.v1.StartEnvironmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartEnvironmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.StartEnvironmentResponse"; + }; + + return StartEnvironmentResponse; + })(); + + v1.AddPublicKeyRequest = (function() { + + /** + * Properties of an AddPublicKeyRequest. + * @memberof google.cloud.shell.v1 + * @interface IAddPublicKeyRequest + * @property {string|null} [environment] AddPublicKeyRequest environment + * @property {string|null} [key] AddPublicKeyRequest key + */ + + /** + * Constructs a new AddPublicKeyRequest. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AddPublicKeyRequest. + * @implements IAddPublicKeyRequest + * @constructor + * @param {google.cloud.shell.v1.IAddPublicKeyRequest=} [properties] Properties to set + */ + function AddPublicKeyRequest(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]]; + } + + /** + * AddPublicKeyRequest environment. + * @member {string} environment + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @instance + */ + AddPublicKeyRequest.prototype.environment = ""; + + /** + * AddPublicKeyRequest key. + * @member {string} key + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @instance + */ + AddPublicKeyRequest.prototype.key = ""; + + /** + * Creates a new AddPublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AddPublicKeyRequest} AddPublicKeyRequest instance + */ + AddPublicKeyRequest.create = function create(properties) { + return new AddPublicKeyRequest(properties); + }; + + /** + * Encodes the specified AddPublicKeyRequest message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyRequest} message AddPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + return writer; + }; + + /** + * Encodes the specified AddPublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyRequest} message AddPublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddPublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AddPublicKeyRequest} AddPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AddPublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddPublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AddPublicKeyRequest} AddPublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddPublicKeyRequest message. + * @function verify + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddPublicKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates an AddPublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AddPublicKeyRequest} AddPublicKeyRequest + */ + AddPublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AddPublicKeyRequest) + return object; + var message = new $root.google.cloud.shell.v1.AddPublicKeyRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from an AddPublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {google.cloud.shell.v1.AddPublicKeyRequest} message AddPublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddPublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.key = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this AddPublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + AddPublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddPublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AddPublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AddPublicKeyRequest"; + }; + + return AddPublicKeyRequest; + })(); + + v1.AddPublicKeyResponse = (function() { + + /** + * Properties of an AddPublicKeyResponse. + * @memberof google.cloud.shell.v1 + * @interface IAddPublicKeyResponse + * @property {string|null} [key] AddPublicKeyResponse key + */ + + /** + * Constructs a new AddPublicKeyResponse. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AddPublicKeyResponse. + * @implements IAddPublicKeyResponse + * @constructor + * @param {google.cloud.shell.v1.IAddPublicKeyResponse=} [properties] Properties to set + */ + function AddPublicKeyResponse(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]]; + } + + /** + * AddPublicKeyResponse key. + * @member {string} key + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @instance + */ + AddPublicKeyResponse.prototype.key = ""; + + /** + * Creates a new AddPublicKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyResponse=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AddPublicKeyResponse} AddPublicKeyResponse instance + */ + AddPublicKeyResponse.create = function create(properties) { + return new AddPublicKeyResponse(properties); + }; + + /** + * Encodes the specified AddPublicKeyResponse message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyResponse} message AddPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + return writer; + }; + + /** + * Encodes the specified AddPublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyResponse} message AddPublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddPublicKeyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AddPublicKeyResponse} AddPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AddPublicKeyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddPublicKeyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AddPublicKeyResponse} AddPublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddPublicKeyResponse message. + * @function verify + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddPublicKeyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates an AddPublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AddPublicKeyResponse} AddPublicKeyResponse + */ + AddPublicKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AddPublicKeyResponse) + return object; + var message = new $root.google.cloud.shell.v1.AddPublicKeyResponse(); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from an AddPublicKeyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {google.cloud.shell.v1.AddPublicKeyResponse} message AddPublicKeyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddPublicKeyResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this AddPublicKeyResponse to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @instance + * @returns {Object.} JSON object + */ + AddPublicKeyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddPublicKeyResponse + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AddPublicKeyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddPublicKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AddPublicKeyResponse"; + }; + + return AddPublicKeyResponse; + })(); + + v1.AddPublicKeyMetadata = (function() { + + /** + * Properties of an AddPublicKeyMetadata. + * @memberof google.cloud.shell.v1 + * @interface IAddPublicKeyMetadata + */ + + /** + * Constructs a new AddPublicKeyMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents an AddPublicKeyMetadata. + * @implements IAddPublicKeyMetadata + * @constructor + * @param {google.cloud.shell.v1.IAddPublicKeyMetadata=} [properties] Properties to set + */ + function AddPublicKeyMetadata(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 AddPublicKeyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.AddPublicKeyMetadata} AddPublicKeyMetadata instance + */ + AddPublicKeyMetadata.create = function create(properties) { + return new AddPublicKeyMetadata(properties); + }; + + /** + * Encodes the specified AddPublicKeyMetadata message. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyMetadata} message AddPublicKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddPublicKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.AddPublicKeyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IAddPublicKeyMetadata} message AddPublicKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPublicKeyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddPublicKeyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.AddPublicKeyMetadata} AddPublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.AddPublicKeyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddPublicKeyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.AddPublicKeyMetadata} AddPublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPublicKeyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddPublicKeyMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddPublicKeyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddPublicKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.AddPublicKeyMetadata} AddPublicKeyMetadata + */ + AddPublicKeyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.AddPublicKeyMetadata) + return object; + return new $root.google.cloud.shell.v1.AddPublicKeyMetadata(); + }; + + /** + * Creates a plain object from an AddPublicKeyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.AddPublicKeyMetadata} message AddPublicKeyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddPublicKeyMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddPublicKeyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @instance + * @returns {Object.} JSON object + */ + AddPublicKeyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddPublicKeyMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.AddPublicKeyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddPublicKeyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.AddPublicKeyMetadata"; + }; + + return AddPublicKeyMetadata; + })(); + + v1.RemovePublicKeyRequest = (function() { + + /** + * Properties of a RemovePublicKeyRequest. + * @memberof google.cloud.shell.v1 + * @interface IRemovePublicKeyRequest + * @property {string|null} [environment] RemovePublicKeyRequest environment + * @property {string|null} [key] RemovePublicKeyRequest key + */ + + /** + * Constructs a new RemovePublicKeyRequest. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a RemovePublicKeyRequest. + * @implements IRemovePublicKeyRequest + * @constructor + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest=} [properties] Properties to set + */ + function RemovePublicKeyRequest(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]]; + } + + /** + * RemovePublicKeyRequest environment. + * @member {string} environment + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @instance + */ + RemovePublicKeyRequest.prototype.environment = ""; + + /** + * RemovePublicKeyRequest key. + * @member {string} key + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @instance + */ + RemovePublicKeyRequest.prototype.key = ""; + + /** + * Creates a new RemovePublicKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest=} [properties] Properties to set + * @returns {google.cloud.shell.v1.RemovePublicKeyRequest} RemovePublicKeyRequest instance + */ + RemovePublicKeyRequest.create = function create(properties) { + return new RemovePublicKeyRequest(properties); + }; + + /** + * Encodes the specified RemovePublicKeyRequest message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest} message RemovePublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + return writer; + }; + + /** + * Encodes the specified RemovePublicKeyRequest message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyRequest} message RemovePublicKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemovePublicKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.RemovePublicKeyRequest} RemovePublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.RemovePublicKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemovePublicKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.RemovePublicKeyRequest} RemovePublicKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemovePublicKeyRequest message. + * @function verify + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemovePublicKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a RemovePublicKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.RemovePublicKeyRequest} RemovePublicKeyRequest + */ + RemovePublicKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.RemovePublicKeyRequest) + return object; + var message = new $root.google.cloud.shell.v1.RemovePublicKeyRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a RemovePublicKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {google.cloud.shell.v1.RemovePublicKeyRequest} message RemovePublicKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemovePublicKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.key = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this RemovePublicKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @instance + * @returns {Object.} JSON object + */ + RemovePublicKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemovePublicKeyRequest + * @function getTypeUrl + * @memberof google.cloud.shell.v1.RemovePublicKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemovePublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.RemovePublicKeyRequest"; + }; + + return RemovePublicKeyRequest; + })(); + + v1.RemovePublicKeyResponse = (function() { + + /** + * Properties of a RemovePublicKeyResponse. + * @memberof google.cloud.shell.v1 + * @interface IRemovePublicKeyResponse + */ + + /** + * Constructs a new RemovePublicKeyResponse. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a RemovePublicKeyResponse. + * @implements IRemovePublicKeyResponse + * @constructor + * @param {google.cloud.shell.v1.IRemovePublicKeyResponse=} [properties] Properties to set + */ + function RemovePublicKeyResponse(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 RemovePublicKeyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyResponse=} [properties] Properties to set + * @returns {google.cloud.shell.v1.RemovePublicKeyResponse} RemovePublicKeyResponse instance + */ + RemovePublicKeyResponse.create = function create(properties) { + return new RemovePublicKeyResponse(properties); + }; + + /** + * Encodes the specified RemovePublicKeyResponse message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyResponse} message RemovePublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemovePublicKeyResponse message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyResponse} message RemovePublicKeyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemovePublicKeyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.RemovePublicKeyResponse} RemovePublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.RemovePublicKeyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemovePublicKeyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.RemovePublicKeyResponse} RemovePublicKeyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemovePublicKeyResponse message. + * @function verify + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemovePublicKeyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemovePublicKeyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.RemovePublicKeyResponse} RemovePublicKeyResponse + */ + RemovePublicKeyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.RemovePublicKeyResponse) + return object; + return new $root.google.cloud.shell.v1.RemovePublicKeyResponse(); + }; + + /** + * Creates a plain object from a RemovePublicKeyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {google.cloud.shell.v1.RemovePublicKeyResponse} message RemovePublicKeyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemovePublicKeyResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemovePublicKeyResponse to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @instance + * @returns {Object.} JSON object + */ + RemovePublicKeyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemovePublicKeyResponse + * @function getTypeUrl + * @memberof google.cloud.shell.v1.RemovePublicKeyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemovePublicKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.RemovePublicKeyResponse"; + }; + + return RemovePublicKeyResponse; + })(); + + v1.RemovePublicKeyMetadata = (function() { + + /** + * Properties of a RemovePublicKeyMetadata. + * @memberof google.cloud.shell.v1 + * @interface IRemovePublicKeyMetadata + */ + + /** + * Constructs a new RemovePublicKeyMetadata. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a RemovePublicKeyMetadata. + * @implements IRemovePublicKeyMetadata + * @constructor + * @param {google.cloud.shell.v1.IRemovePublicKeyMetadata=} [properties] Properties to set + */ + function RemovePublicKeyMetadata(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 RemovePublicKeyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyMetadata=} [properties] Properties to set + * @returns {google.cloud.shell.v1.RemovePublicKeyMetadata} RemovePublicKeyMetadata instance + */ + RemovePublicKeyMetadata.create = function create(properties) { + return new RemovePublicKeyMetadata(properties); + }; + + /** + * Encodes the specified RemovePublicKeyMetadata message. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyMetadata} message RemovePublicKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemovePublicKeyMetadata message, length delimited. Does not implicitly {@link google.cloud.shell.v1.RemovePublicKeyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.IRemovePublicKeyMetadata} message RemovePublicKeyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePublicKeyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemovePublicKeyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.RemovePublicKeyMetadata} RemovePublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.RemovePublicKeyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemovePublicKeyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.RemovePublicKeyMetadata} RemovePublicKeyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePublicKeyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemovePublicKeyMetadata message. + * @function verify + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemovePublicKeyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemovePublicKeyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.RemovePublicKeyMetadata} RemovePublicKeyMetadata + */ + RemovePublicKeyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.RemovePublicKeyMetadata) + return object; + return new $root.google.cloud.shell.v1.RemovePublicKeyMetadata(); + }; + + /** + * Creates a plain object from a RemovePublicKeyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {google.cloud.shell.v1.RemovePublicKeyMetadata} message RemovePublicKeyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemovePublicKeyMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemovePublicKeyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @instance + * @returns {Object.} JSON object + */ + RemovePublicKeyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemovePublicKeyMetadata + * @function getTypeUrl + * @memberof google.cloud.shell.v1.RemovePublicKeyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemovePublicKeyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.RemovePublicKeyMetadata"; + }; + + return RemovePublicKeyMetadata; + })(); + + v1.CloudShellErrorDetails = (function() { + + /** + * Properties of a CloudShellErrorDetails. + * @memberof google.cloud.shell.v1 + * @interface ICloudShellErrorDetails + * @property {google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode|null} [code] CloudShellErrorDetails code + */ + + /** + * Constructs a new CloudShellErrorDetails. + * @memberof google.cloud.shell.v1 + * @classdesc Represents a CloudShellErrorDetails. + * @implements ICloudShellErrorDetails + * @constructor + * @param {google.cloud.shell.v1.ICloudShellErrorDetails=} [properties] Properties to set + */ + function CloudShellErrorDetails(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]]; + } + + /** + * CloudShellErrorDetails code. + * @member {google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode} code + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @instance + */ + CloudShellErrorDetails.prototype.code = 0; + + /** + * Creates a new CloudShellErrorDetails instance using the specified properties. + * @function create + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {google.cloud.shell.v1.ICloudShellErrorDetails=} [properties] Properties to set + * @returns {google.cloud.shell.v1.CloudShellErrorDetails} CloudShellErrorDetails instance + */ + CloudShellErrorDetails.create = function create(properties) { + return new CloudShellErrorDetails(properties); + }; + + /** + * Encodes the specified CloudShellErrorDetails message. Does not implicitly {@link google.cloud.shell.v1.CloudShellErrorDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {google.cloud.shell.v1.ICloudShellErrorDetails} message CloudShellErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudShellErrorDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + return writer; + }; + + /** + * Encodes the specified CloudShellErrorDetails message, length delimited. Does not implicitly {@link google.cloud.shell.v1.CloudShellErrorDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {google.cloud.shell.v1.ICloudShellErrorDetails} message CloudShellErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudShellErrorDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudShellErrorDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.shell.v1.CloudShellErrorDetails} CloudShellErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudShellErrorDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.shell.v1.CloudShellErrorDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudShellErrorDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.shell.v1.CloudShellErrorDetails} CloudShellErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudShellErrorDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudShellErrorDetails message. + * @function verify + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudShellErrorDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a CloudShellErrorDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.shell.v1.CloudShellErrorDetails} CloudShellErrorDetails + */ + CloudShellErrorDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.shell.v1.CloudShellErrorDetails) + return object; + var message = new $root.google.cloud.shell.v1.CloudShellErrorDetails(); + switch (object.code) { + case "CLOUD_SHELL_ERROR_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "IMAGE_UNAVAILABLE": + case 1: + message.code = 1; + break; + case "CLOUD_SHELL_DISABLED": + case 2: + message.code = 2; + break; + case "TOS_VIOLATION": + case 4: + message.code = 4; + break; + case "QUOTA_EXCEEDED": + case 5: + message.code = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a CloudShellErrorDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {google.cloud.shell.v1.CloudShellErrorDetails} message CloudShellErrorDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudShellErrorDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = options.enums === String ? "CLOUD_SHELL_ERROR_CODE_UNSPECIFIED" : 0; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode[message.code] : message.code; + return object; + }; + + /** + * Converts this CloudShellErrorDetails to JSON. + * @function toJSON + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @instance + * @returns {Object.} JSON object + */ + CloudShellErrorDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudShellErrorDetails + * @function getTypeUrl + * @memberof google.cloud.shell.v1.CloudShellErrorDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudShellErrorDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.shell.v1.CloudShellErrorDetails"; + }; + + /** + * CloudShellErrorCode enum. + * @name google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode + * @enum {number} + * @property {number} CLOUD_SHELL_ERROR_CODE_UNSPECIFIED=0 CLOUD_SHELL_ERROR_CODE_UNSPECIFIED value + * @property {number} IMAGE_UNAVAILABLE=1 IMAGE_UNAVAILABLE value + * @property {number} CLOUD_SHELL_DISABLED=2 CLOUD_SHELL_DISABLED value + * @property {number} TOS_VIOLATION=4 TOS_VIOLATION value + * @property {number} QUOTA_EXCEEDED=5 QUOTA_EXCEEDED value + */ + CloudShellErrorDetails.CloudShellErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLOUD_SHELL_ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE_UNAVAILABLE"] = 1; + values[valuesById[2] = "CLOUD_SHELL_DISABLED"] = 2; + values[valuesById[4] = "TOS_VIOLATION"] = 4; + values[valuesById[5] = "QUOTA_EXCEEDED"] = 5; + return values; + })(); + + return CloudShellErrorDetails; + })(); + + return v1; + })(); + + return shell; + })(); + + return cloud; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * 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 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; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * 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.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.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).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 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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.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"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} 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) { + 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.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]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @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[".google.longrunning.operationInfo"] = 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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @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.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) { + 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] : 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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + 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; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.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.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.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 GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + 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 GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.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 GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = 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 ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[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 ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.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 CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + 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 CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.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 DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + 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 DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.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.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-shell/protos/protos.json b/packages/google-cloud-shell/protos/protos.json new file mode 100644 index 000000000000..e614cad6cc9e --- /dev/null +++ b/packages/google-cloud-shell/protos/protos.json @@ -0,0 +1,1815 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "shell": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/shell/v1;shell", + "java_multiple_files": true, + "java_outer_classname": "CloudShellProto", + "java_package": "com.google.cloud.shell.v1" + }, + "nested": { + "CloudShellService": { + "options": { + "(google.api.default_host)": "cloudshell.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetEnvironment": { + "requestType": "GetEnvironmentRequest", + "responseType": "Environment", + "options": { + "(google.api.http).get": "/v1/{name=users/*/environments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "StartEnvironment": { + "requestType": "StartEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=users/*/environments/*}:start", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "StartEnvironmentResponse", + "(google.longrunning.operation_info).metadata_type": "StartEnvironmentMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=users/*/environments/*}:start", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "StartEnvironmentResponse", + "metadata_type": "StartEnvironmentMetadata" + } + } + ] + }, + "AuthorizeEnvironment": { + "requestType": "AuthorizeEnvironmentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=users/*/environments/*}:authorize", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "AuthorizeEnvironmentResponse", + "(google.longrunning.operation_info).metadata_type": "AuthorizeEnvironmentMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=users/*/environments/*}:authorize", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizeEnvironmentResponse", + "metadata_type": "AuthorizeEnvironmentMetadata" + } + } + ] + }, + "AddPublicKey": { + "requestType": "AddPublicKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{environment=users/*/environments/*}:addPublicKey", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "AddPublicKeyResponse", + "(google.longrunning.operation_info).metadata_type": "AddPublicKeyMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=users/*/environments/*}:addPublicKey", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AddPublicKeyResponse", + "metadata_type": "AddPublicKeyMetadata" + } + } + ] + }, + "RemovePublicKey": { + "requestType": "RemovePublicKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{environment=users/*/environments/*}:removePublicKey", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RemovePublicKeyResponse", + "(google.longrunning.operation_info).metadata_type": "RemovePublicKeyMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=users/*/environments/*}:removePublicKey", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RemovePublicKeyResponse", + "metadata_type": "RemovePublicKeyMetadata" + } + } + ] + } + } + }, + "Environment": { + "options": { + "(google.api.resource).type": "cloudshell.googleapis.com/Environment", + "(google.api.resource).pattern": "users/{user}/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dockerImage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webHost": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sshUsername": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sshHost": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sshPort": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicKeys": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SUSPENDED": 1, + "PENDING": 2, + "RUNNING": 3, + "DELETING": 4 + } + } + } + }, + "GetEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudshell.googleapis.com/Environment" + } + } + } + }, + "CreateEnvironmentMetadata": { + "fields": {} + }, + "DeleteEnvironmentMetadata": { + "fields": {} + }, + "StartEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "accessToken": { + "type": "string", + "id": 2 + }, + "publicKeys": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "AuthorizeEnvironmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "accessToken": { + "type": "string", + "id": 2 + }, + "idToken": { + "type": "string", + "id": 4 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "AuthorizeEnvironmentResponse": { + "fields": {} + }, + "AuthorizeEnvironmentMetadata": { + "fields": {} + }, + "StartEnvironmentMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STARTING": 1, + "UNARCHIVING_DISK": 2, + "AWAITING_COMPUTE_RESOURCES": 4, + "FINISHED": 3 + } + } + } + }, + "StartEnvironmentResponse": { + "fields": { + "environment": { + "type": "Environment", + "id": 1 + } + } + }, + "AddPublicKeyRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "key": { + "type": "string", + "id": 2 + } + } + }, + "AddPublicKeyResponse": { + "fields": { + "key": { + "type": "string", + "id": 1 + } + } + }, + "AddPublicKeyMetadata": { + "fields": {} + }, + "RemovePublicKeyRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "key": { + "type": "string", + "id": 2 + } + } + }, + "RemovePublicKeyResponse": { + "fields": {} + }, + "RemovePublicKeyMetadata": { + "fields": {} + }, + "CloudShellErrorDetails": { + "fields": { + "code": { + "type": "CloudShellErrorCode", + "id": 1 + } + }, + "nested": { + "CloudShellErrorCode": { + "values": { + "CLOUD_SHELL_ERROR_CODE_UNSPECIFIED": 0, + "IMAGE_UNAVAILABLE": 1, + "CLOUD_SHELL_DISABLED": 2, + "TOS_VIOLATION": 4, + "QUOTA_EXCEEDED": 5 + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-shell/samples/README.md b/packages/google-cloud-shell/samples/README.md new file mode 100644 index 000000000000..6faeb3cff52b --- /dev/null +++ b/packages/google-cloud-shell/samples/README.md @@ -0,0 +1,68 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Shell: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-shell/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-shell/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-shell/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-shell/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-shell/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-shell/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/shell/ diff --git a/packages/google-cloud-shell/samples/package.json b/packages/google-cloud-shell/samples/package.json new file mode 100644 index 000000000000..382cc50bedfe --- /dev/null +++ b/packages/google-cloud-shell/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-cloud-shell", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/shell": "^2.0.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0" + } +} diff --git a/packages/google-cloud-shell/samples/quickstart.js b/packages/google-cloud-shell/samples/quickstart.js new file mode 100644 index 000000000000..ce52d0685bda --- /dev/null +++ b/packages/google-cloud-shell/samples/quickstart.js @@ -0,0 +1,47 @@ +// 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. +// + +'use strict'; + +async function main() { + // [START nodejs_cloud_shell_quickstart] + // Imports the Google Cloud client library + + // remove this line after package is released + // eslint-disable-next-line node/no-missing-require + const {CloudShellServiceClient} = require('@google-cloud/shell'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + // eslint-disable-next-line no-unused-vars + const client = new CloudShellServiceClient(); + + //TODO(library generator): write the actual function you will be testing + async function initializeClient() { + const operation = await client.initialize(); + console.info(operation); + } + initializeClient(); + // [END nodejs_cloud_shell_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-shell/samples/test/quickstart.js b/packages/google-cloud-shell/samples/test/quickstart.js new file mode 100644 index 000000000000..86410163dbaf --- /dev/null +++ b/packages/google-cloud-shell/samples/test/quickstart.js @@ -0,0 +1,34 @@ +// +// 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'; + +const path = require('path'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const stdout = execSync('node ./quickstart.js', {cwd}); + assert.match(stdout, /ServiceClientImpl/); + }); +}); diff --git a/packages/google-cloud-shell/src/index.ts b/packages/google-cloud-shell/src/index.ts new file mode 100644 index 000000000000..58c1968a8331 --- /dev/null +++ b/packages/google-cloud-shell/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const CloudShellServiceClient = v1.CloudShellServiceClient; +type CloudShellServiceClient = v1.CloudShellServiceClient; + +export {v1, CloudShellServiceClient}; +export default {v1, CloudShellServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts b/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts new file mode 100644 index 000000000000..74d4a4b80abb --- /dev/null +++ b/packages/google-cloud-shell/src/v1/cloud_shell_service_client.ts @@ -0,0 +1,1109 @@ +// 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. +// +// ** 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 * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_shell_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_shell_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * API for interacting with Google Cloud Shell. Each user of Cloud Shell has at + * least one environment, which has the ID "default". Environment consists of a + * Docker image defining what is installed on the environment and a home + * directory containing the user's data that will remain across sessions. + * Clients use this API to start and fetch information about their environment, + * which can then be used to connect to that environment via a separate SSH + * client. + * @class + * @memberof v1 + */ +export class CloudShellServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudShellServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudShellServiceClient. + * + * @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/master/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 fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CloudShellServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // 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 the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/environments/{environment}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const startEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.shell.v1.StartEnvironmentResponse' + ) as gax.protobuf.Type; + const startEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.shell.v1.StartEnvironmentMetadata' + ) as gax.protobuf.Type; + const authorizeEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.shell.v1.AuthorizeEnvironmentResponse' + ) as gax.protobuf.Type; + const authorizeEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.shell.v1.AuthorizeEnvironmentMetadata' + ) as gax.protobuf.Type; + const addPublicKeyResponse = protoFilesRoot.lookup( + '.google.cloud.shell.v1.AddPublicKeyResponse' + ) as gax.protobuf.Type; + const addPublicKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.shell.v1.AddPublicKeyMetadata' + ) as gax.protobuf.Type; + const removePublicKeyResponse = protoFilesRoot.lookup( + '.google.cloud.shell.v1.RemovePublicKeyResponse' + ) as gax.protobuf.Type; + const removePublicKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.shell.v1.RemovePublicKeyMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + startEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startEnvironmentResponse.decode.bind(startEnvironmentResponse), + startEnvironmentMetadata.decode.bind(startEnvironmentMetadata) + ), + authorizeEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + authorizeEnvironmentResponse.decode.bind(authorizeEnvironmentResponse), + authorizeEnvironmentMetadata.decode.bind(authorizeEnvironmentMetadata) + ), + addPublicKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + addPublicKeyResponse.decode.bind(addPublicKeyResponse), + addPublicKeyMetadata.decode.bind(addPublicKeyMetadata) + ), + removePublicKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + removePublicKeyResponse.decode.bind(removePublicKeyResponse), + removePublicKeyMetadata.decode.bind(removePublicKeyMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.shell.v1.CloudShellService', + 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 = {}; + } + + /** + * 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.cloudShellServiceStub) { + return this.cloudShellServiceStub; + } + + // Put together the "service stub" for + // google.cloud.shell.v1.CloudShellService. + this.cloudShellServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.shell.v1.CloudShellService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.shell.v1.CloudShellService, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const cloudShellServiceStubMethods = [ + 'getEnvironment', + 'startEnvironment', + 'authorizeEnvironment', + 'addPublicKey', + 'removePublicKey', + ]; + for (const methodName of cloudShellServiceStubMethods) { + const callPromise = this.cloudShellServiceStub.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.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudShellServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudshell.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudshell.googleapis.com'; + } + + /** + * 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']; + } + + 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 -- + // ------------------- + getEnvironment( + request: protos.google.cloud.shell.v1.IGetEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.shell.v1.IEnvironment, + protos.google.cloud.shell.v1.IGetEnvironmentRequest | undefined, + {} | undefined + ] + >; + getEnvironment( + request: protos.google.cloud.shell.v1.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.shell.v1.IEnvironment, + protos.google.cloud.shell.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): void; + getEnvironment( + request: protos.google.cloud.shell.v1.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.shell.v1.IEnvironment, + protos.google.cloud.shell.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets an environment. Returns NOT_FOUND if the environment does not exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested resource, for example `users/me/environments/default` + * or `users/someone@example.com/environments/default`. + * @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 [Environment]{@link google.cloud.shell.v1.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getEnvironment(request); + */ + getEnvironment( + request: protos.google.cloud.shell.v1.IGetEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.shell.v1.IEnvironment, + | protos.google.cloud.shell.v1.IGetEnvironmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.shell.v1.IEnvironment, + protos.google.cloud.shell.v1.IGetEnvironmentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.shell.v1.IEnvironment, + protos.google.cloud.shell.v1.IGetEnvironmentRequest | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getEnvironment(request, options, callback); + } + + startEnvironment( + request: protos.google.cloud.shell.v1.IStartEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startEnvironment( + request: protos.google.cloud.shell.v1.IStartEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startEnvironment( + request: protos.google.cloud.shell.v1.IStartEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Starts an existing environment, allowing clients to connect to it. The + * returned operation will contain an instance of StartEnvironmentMetadata in + * its metadata field. Users can wait for the environment to start by polling + * this operation via GetOperation. Once the environment has finished starting + * and is ready to accept connections, the operation will contain a + * StartEnvironmentResponse in its response field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource that should be started, for example + * `users/me/environments/default` or + * `users/someone@example.com/environments/default`. + * @param {string} request.accessToken + * The initial access token passed to the environment. If this is present and + * valid, the environment will be pre-authenticated with gcloud so that the + * user can run gcloud commands in Cloud Shell without having to log in. This + * code can be updated later by calling AuthorizeEnvironment. + * @param {string[]} request.publicKeys + * Public keys that should be added to the environment before it is started. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.startEnvironment(request); + * const [response] = await operation.promise(); + */ + startEnvironment( + request: protos.google.cloud.shell.v1.IStartEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.startEnvironment(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startEnvironment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkStartEnvironmentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkStartEnvironmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.shell.v1.StartEnvironmentResponse, + protos.google.cloud.shell.v1.StartEnvironmentMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.startEnvironment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.shell.v1.StartEnvironmentResponse, + protos.google.cloud.shell.v1.StartEnvironmentMetadata + >; + } + authorizeEnvironment( + request: protos.google.cloud.shell.v1.IAuthorizeEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + authorizeEnvironment( + request: protos.google.cloud.shell.v1.IAuthorizeEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + authorizeEnvironment( + request: protos.google.cloud.shell.v1.IAuthorizeEnvironmentRequest, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sends OAuth credentials to a running environment on behalf of a user. When + * this completes, the environment will be authorized to run various Google + * Cloud command line tools without requiring the user to manually + * authenticate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the resource that should receive the credentials, for example + * `users/me/environments/default` or + * `users/someone@example.com/environments/default`. + * @param {string} request.accessToken + * The OAuth access token that should be sent to the environment. + * @param {string} request.idToken + * The OAuth ID token that should be sent to the environment. + * @param {google.protobuf.Timestamp} request.expireTime + * The time when the credentials expire. If not set, defaults to one hour from + * when the server received the request. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.authorizeEnvironment(request); + * const [response] = await operation.promise(); + */ + authorizeEnvironment( + request: protos.google.cloud.shell.v1.IAuthorizeEnvironmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.authorizeEnvironment(request, options, callback); + } + /** + * Check the status of the long running operation returned by `authorizeEnvironment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkAuthorizeEnvironmentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkAuthorizeEnvironmentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.shell.v1.AuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.AuthorizeEnvironmentMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.authorizeEnvironment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.shell.v1.AuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.AuthorizeEnvironmentMetadata + >; + } + addPublicKey( + request: protos.google.cloud.shell.v1.IAddPublicKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + addPublicKey( + request: protos.google.cloud.shell.v1.IAddPublicKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addPublicKey( + request: protos.google.cloud.shell.v1.IAddPublicKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a public SSH key to an environment, allowing clients with the + * corresponding private key to connect to that environment via SSH. If a key + * with the same content already exists, this will error with ALREADY_EXISTS. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Environment this key should be added to, e.g. + * `users/me/environments/default`. + * @param {string} request.key + * Key that should be added to the environment. Supported formats are + * `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` + * (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and + * `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as + * <format> <content>, where <content> part is encoded with + * Base64. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.addPublicKey(request); + * const [response] = await operation.promise(); + */ + addPublicKey( + request: protos.google.cloud.shell.v1.IAddPublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + environment: request.environment || '', + }); + this.initialize(); + return this.innerApiCalls.addPublicKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `addPublicKey()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkAddPublicKeyProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkAddPublicKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.shell.v1.AddPublicKeyResponse, + protos.google.cloud.shell.v1.AddPublicKeyMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.addPublicKey, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.shell.v1.AddPublicKeyResponse, + protos.google.cloud.shell.v1.AddPublicKeyMetadata + >; + } + removePublicKey( + request: protos.google.cloud.shell.v1.IRemovePublicKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + removePublicKey( + request: protos.google.cloud.shell.v1.IRemovePublicKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removePublicKey( + request: protos.google.cloud.shell.v1.IRemovePublicKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Removes a public SSH key from an environment. Clients will no longer be + * able to connect to the environment using the corresponding private key. + * If a key with the same content is not present, this will error with + * NOT_FOUND. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Environment this key should be removed from, e.g. + * `users/me/environments/default`. + * @param {string} request.key + * Key that should be removed from the environment. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.removePublicKey(request); + * const [response] = await operation.promise(); + */ + removePublicKey( + request: protos.google.cloud.shell.v1.IRemovePublicKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >, + protos.google.longrunning.IOperation | 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'] = + gax.routingHeader.fromParams({ + environment: request.environment || '', + }); + this.initialize(); + return this.innerApiCalls.removePublicKey(request, options, callback); + } + /** + * Check the status of the long running operation returned by `removePublicKey()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRemovePublicKeyProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRemovePublicKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.shell.v1.RemovePublicKeyResponse, + protos.google.cloud.shell.v1.RemovePublicKeyMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.removePublicKey, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.shell.v1.RemovePublicKeyResponse, + protos.google.cloud.shell.v1.RemovePublicKeyMetadata + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} user + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(user: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + user: user, + environment: environment, + }); + } + + /** + * Parse the user from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the user. + */ + matchUserFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .user; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.cloudShellServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-shell/src/v1/cloud_shell_service_client_config.json b/packages/google-cloud-shell/src/v1/cloud_shell_service_client_config.json new file mode 100644 index 000000000000..fe310e2b6771 --- /dev/null +++ b/packages/google-cloud-shell/src/v1/cloud_shell_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.cloud.shell.v1.CloudShellService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_unavailable": [ + "UNKNOWN", + "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 + }, + "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c": { + "initial_retry_delay_millis": 1000, + "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": { + "GetEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "01d6d956b4dadd7e38ee9dec12ed8720e6e6f90c" + }, + "StartEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AuthorizeEnvironment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddPublicKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemovePublicKey": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-shell/src/v1/cloud_shell_service_proto_list.json b/packages/google-cloud-shell/src/v1/cloud_shell_service_proto_list.json new file mode 100644 index 000000000000..ef5795fc8675 --- /dev/null +++ b/packages/google-cloud-shell/src/v1/cloud_shell_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/shell/v1/cloudshell.proto" +] diff --git a/packages/google-cloud-shell/src/v1/gapic_metadata.json b/packages/google-cloud-shell/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..81105cd05299 --- /dev/null +++ b/packages/google-cloud-shell/src/v1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.shell.v1", + "libraryPackage": "@google-cloud/shell", + "services": { + "CloudShellService": { + "clients": { + "grpc": { + "libraryClient": "CloudShellServiceClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "StartEnvironment": { + "methods": [ + "startEnvironment" + ] + }, + "AuthorizeEnvironment": { + "methods": [ + "authorizeEnvironment" + ] + }, + "AddPublicKey": { + "methods": [ + "addPublicKey" + ] + }, + "RemovePublicKey": { + "methods": [ + "removePublicKey" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudShellServiceClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "StartEnvironment": { + "methods": [ + "startEnvironment" + ] + }, + "AuthorizeEnvironment": { + "methods": [ + "authorizeEnvironment" + ] + }, + "AddPublicKey": { + "methods": [ + "addPublicKey" + ] + }, + "RemovePublicKey": { + "methods": [ + "removePublicKey" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-shell/src/v1/index.ts b/packages/google-cloud-shell/src/v1/index.ts new file mode 100644 index 000000000000..f56f0d6ebd45 --- /dev/null +++ b/packages/google-cloud-shell/src/v1/index.ts @@ -0,0 +1,19 @@ +// 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. +// +// ** 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 {CloudShellServiceClient} from './cloud_shell_service_client'; diff --git a/packages/google-cloud-shell/system-test/fixtures/sample/src/index.js b/packages/google-cloud-shell/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..6656dcae689f --- /dev/null +++ b/packages/google-cloud-shell/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const shell = require('@google-cloud/shell'); + +function main() { + const cloudShellServiceClient = new shell.CloudShellServiceClient(); +} + +main(); diff --git a/packages/google-cloud-shell/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-shell/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..d4d46e08a1d6 --- /dev/null +++ b/packages/google-cloud-shell/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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. +// +// ** 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 {CloudShellServiceClient} from '@google-cloud/shell'; + +// check that the client class type name can be used +function doStuffWithCloudShellServiceClient(client: CloudShellServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudShellServiceClient = new CloudShellServiceClient(); + doStuffWithCloudShellServiceClient(cloudShellServiceClient); +} + +main(); diff --git a/packages/google-cloud-shell/system-test/install.ts b/packages/google-cloud-shell/system-test/install.ts new file mode 100644 index 000000000000..d2d61c0396fc --- /dev/null +++ b/packages/google-cloud-shell/system-test/install.ts @@ -0,0 +1,51 @@ +// 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. +// +// ** 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-shell/test/gapic_cloud_shell_service_v1.ts b/packages/google-cloud-shell/test/gapic_cloud_shell_service_v1.ts new file mode 100644 index 000000000000..6920622e1dc9 --- /dev/null +++ b/packages/google-cloud-shell/test/gapic_cloud_shell_service_v1.ts @@ -0,0 +1,1100 @@ +// 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. +// +// ** 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 cloudshellserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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 stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1.CloudShellServiceClient', () => { + it('has servicePath', () => { + const servicePath = + cloudshellserviceModule.v1.CloudShellServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudshellserviceModule.v1.CloudShellServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudshellserviceModule.v1.CloudShellServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudShellServiceStub, undefined); + await client.initialize(); + assert(client.cloudShellServiceStub); + }); + + it('has close method', () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + 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 cloudshellserviceModule.v1.CloudShellServiceClient({ + 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('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.GetEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.shell.v1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.GetEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.shell.v1.Environment() + ); + client.innerApiCalls.getEnvironment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.shell.v1.IEnvironment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getEnvironment with error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.GetEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEnvironment(request), expectedError); + assert( + (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('startEnvironment', () => { + it('invokes startEnvironment without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.StartEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.startEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.startEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes startEnvironment without error using callback', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.StartEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.shell.v1.IStartEnvironmentResponse, + protos.google.cloud.shell.v1.IStartEnvironmentMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.startEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes startEnvironment with call error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.StartEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.startEnvironment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startEnvironment(request), expectedError); + assert( + (client.innerApiCalls.startEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes startEnvironment with LRO error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.StartEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.startEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.startEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkStartEnvironmentProgress without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStartEnvironmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartEnvironmentProgress with error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkStartEnvironmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('authorizeEnvironment', () => { + it('invokes authorizeEnvironment without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AuthorizeEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.authorizeEnvironment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.authorizeEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.authorizeEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes authorizeEnvironment without error using callback', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AuthorizeEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.authorizeEnvironment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.authorizeEnvironment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.shell.v1.IAuthorizeEnvironmentResponse, + protos.google.cloud.shell.v1.IAuthorizeEnvironmentMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.authorizeEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes authorizeEnvironment with call error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AuthorizeEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.authorizeEnvironment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.authorizeEnvironment(request), expectedError); + assert( + (client.innerApiCalls.authorizeEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes authorizeEnvironment with LRO error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AuthorizeEnvironmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.authorizeEnvironment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.authorizeEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.authorizeEnvironment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAuthorizeEnvironmentProgress without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAuthorizeEnvironmentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAuthorizeEnvironmentProgress with error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAuthorizeEnvironmentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('addPublicKey', () => { + it('invokes addPublicKey without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AddPublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addPublicKey = stubLongRunningCall(expectedResponse); + const [operation] = await client.addPublicKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addPublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addPublicKey without error using callback', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AddPublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addPublicKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addPublicKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.shell.v1.IAddPublicKeyResponse, + protos.google.cloud.shell.v1.IAddPublicKeyMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addPublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addPublicKey with call error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AddPublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addPublicKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.addPublicKey(request), expectedError); + assert( + (client.innerApiCalls.addPublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addPublicKey with LRO error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.AddPublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addPublicKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.addPublicKey(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.addPublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkAddPublicKeyProgress without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAddPublicKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAddPublicKeyProgress with error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkAddPublicKeyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('removePublicKey', () => { + it('invokes removePublicKey without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.RemovePublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removePublicKey = + stubLongRunningCall(expectedResponse); + const [operation] = await client.removePublicKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removePublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removePublicKey without error using callback', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.RemovePublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removePublicKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removePublicKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.shell.v1.IRemovePublicKeyResponse, + protos.google.cloud.shell.v1.IRemovePublicKeyMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removePublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removePublicKey with call error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.RemovePublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removePublicKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.removePublicKey(request), expectedError); + assert( + (client.innerApiCalls.removePublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removePublicKey with LRO error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.shell.v1.RemovePublicKeyRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removePublicKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.removePublicKey(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.removePublicKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRemovePublicKeyProgress without error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRemovePublicKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRemovePublicKeyProgress with error', async () => { + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRemovePublicKeyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + user: 'userValue', + environment: 'environmentValue', + }; + const client = new cloudshellserviceModule.v1.CloudShellServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath('userValue', 'environmentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromEnvironmentName', () => { + const result = client.matchUserFromEnvironmentName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-shell/tsconfig.json b/packages/google-cloud-shell/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-cloud-shell/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/packages/google-cloud-shell/webpack.config.js b/packages/google-cloud-shell/webpack.config.js new file mode 100644 index 000000000000..5d621ccf0aa0 --- /dev/null +++ b/packages/google-cloud-shell/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: 'CloudShellService', + filename: './cloud-shell-service.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/packages/google-iam/CHANGELOG.md b/packages/google-iam/CHANGELOG.md index 2d78ba664f0a..dc5a08e885f8 100644 --- a/packages/google-iam/CHANGELOG.md +++ b/packages/google-iam/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/iam-v0.1.1...iam-v0.2.0) (2022-09-30) + + +### Features + +* remove unused ListApplicablePolicies ([5d5b1bc](https://github.com/googleapis/google-cloud-node/commit/5d5b1bcaaccaf87a3bd58fa0499fa77de80bffe4)) +* Remove unused ListApplicablePolicies ([#3370](https://github.com/googleapis/google-cloud-node/issues/3370)) ([5d5b1bc](https://github.com/googleapis/google-cloud-node/commit/5d5b1bcaaccaf87a3bd58fa0499fa77de80bffe4)) + ## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/iam-v0.1.0...iam-v0.1.1) (2022-09-28) diff --git a/packages/google-iam/package.json b/packages/google-iam/package.json index 2a252d388f11..b5dafb6a6b27 100644 --- a/packages/google-iam/package.json +++ b/packages/google-iam/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/iam", - "version": "0.1.1", + "version": "0.2.0", "description": "Identity and Access Management client for Node.js", "repository": "googleapis/google-cloud-node", "license": "Apache-2.0", diff --git a/packages/google-iam/protos/google/iam/v2/policy.proto b/packages/google-iam/protos/google/iam/v2/policy.proto index b21d44fabbf7..d8923d3b8337 100644 --- a/packages/google-iam/protos/google/iam/v2/policy.proto +++ b/packages/google-iam/protos/google/iam/v2/policy.proto @@ -33,8 +33,7 @@ option php_namespace = "Google\\Cloud\\Iam\\V2"; // An interface for managing Identity and Access Management (IAM) policies. service Policies { option (google.api.default_host) = "iam.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Retrieves the policies of the specified kind that are attached to a // resource. @@ -75,8 +74,7 @@ service Policies { // // To update a policy, you should use a read-modify-write loop: // - // 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current - // version of the policy. + // 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. // 2. Modify the policy as needed. // 3. Use `UpdatePolicy` to write the updated policy. // @@ -103,24 +101,6 @@ service Policies { metadata_type: "PolicyOperationMetadata" }; } - - // Retrieves all the policies that are attached to the specified resource, - // or anywhere in the ancestry of the resource. For example, for a project - // this endpoint would return all the `denyPolicy` kind policies attached to - // the project, its parent folder (if any), and its parent organization (if - // any). - // The endpoint requires the same permissions that it would take to call - // `ListPolicies` or `GetPolicy`. - // - // The main reason to use this endpoint is as a policy admin to debug access - // issues for a resource. - rpc ListApplicablePolicies(ListApplicablePoliciesRequest) - returns (ListApplicablePoliciesResponse) { - option (google.api.http) = { - get: "/v2/{attachment_point=*}:listApplicablePolicies" - }; - option (google.api.method_signature) = "attachment_point"; - } } // Data for an IAM policy. @@ -139,12 +119,11 @@ message Policy { // Responses always contain the numeric ID. string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - // Immutable. The globally unique ID of the `Policy`. Assigned automatically - // when the `Policy` is created. + // Immutable. The globally unique ID of the `Policy`. Assigned automatically when the + // `Policy` is created. string uid = 2 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. The kind of the `Policy`. Always contains the value - // `DenyPolicy`. + // Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`. string kind = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // A user-specified description of the `Policy`. This value can be up to 63 @@ -164,24 +143,20 @@ message Policy { string etag = 6; // Output only. The time when the `Policy` was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time when the `Policy` was last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The time when the `Policy` was deleted. Empty if the policy is - // not deleted. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted. + google.protobuf.Timestamp delete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // A list of rules that specify the behavior of the `Policy`. All of the rules // should be of the `kind` specified in the `Policy`. repeated PolicyRule rules = 10; - // Immutable. Specifies that this policy is managed by an authority and can - // only be modified by that authority. Usage is restricted. + // Immutable. Specifies that this policy is managed by an authority and can only be + // modified by that authority. Usage is restricted. string managing_authority = 11 [(google.api.field_behavior) = IMMUTABLE]; } @@ -199,8 +174,9 @@ message PolicyRule { // Request message for `ListPolicies`. message ListPoliciesRequest { - // Required. The resource that the policy is attached to, along with the kind - // of policy to list. Format: `policies/{attachment_point}/denypolicies` + // Required. The resource that the policy is attached to, along with the kind of policy + // to list. Format: + // `policies/{attachment_point}/denypolicies` // // // The attachment point is identified by its URL-encoded full resource name, @@ -216,9 +192,8 @@ message ListPoliciesRequest { // the value 1000. int32 page_size = 2; - // A page token received in a - // [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this - // token to retrieve the next page. + // A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to + // retrieve the next page. string page_token = 3; } @@ -227,8 +202,7 @@ message ListPoliciesResponse { // Metadata for the policies that are attached to the resource. repeated Policy policies = 1; - // A page token that you can use in a - // [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the + // A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the // next page. If this field is omitted, there are no additional pages. string next_page_token = 2; } @@ -250,8 +224,8 @@ message GetPolicyRequest { // Request message for `CreatePolicy`. message CreatePolicyRequest { - // Required. The resource that the policy is attached to, along with the kind - // of policy to create. Format: `policies/{attachment_point}/denypolicies` + // Required. The resource that the policy is attached to, along with the kind of policy + // to create. Format: `policies/{attachment_point}/denypolicies` // // // The attachment point is identified by its URL-encoded full resource name, @@ -297,78 +271,15 @@ message DeletePolicyRequest { // name. For projects, you can use the alphanumeric or the numeric ID. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The expected `etag` of the policy to delete. If the value does - // not match the value that is stored in IAM, the request fails with a `409` - // error code and `ABORTED` status. + // Optional. The expected `etag` of the policy to delete. If the value does not match + // the value that is stored in IAM, the request fails with a `409` error code + // and `ABORTED` status. // // If you omit this field, the policy is deleted regardless of its current // `etag`. string etag = 2 [(google.api.field_behavior) = OPTIONAL]; } -// `ListApplicablePoliciesRequest` represents the Request message for the -// `ListApplicablePolicies` method. It provides the input for a filterable query -// of Policies that apply to a certain GCP Resource, specified by the field -// `attachment_point`, found on this message. -// Example: -// ``` -// { -// attachment_point: -// 'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901' -// filter: 'kind:denyPolicies' -// } -// ``` -message ListApplicablePoliciesRequest { - // Required. The Cloud resource at which the applicable policies are to be - // retrieved. Format: `{attachment-point}` Use the URL-encoded full resource - // name, which means that the forward-slash character, `/`, must be written as - // `%2F`. For example, - // `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - string attachment_point = 1 [(google.api.field_behavior) = REQUIRED]; - - // Filtering currently only supports the kind of policies to return, and - // must be in the format “kind:[policyKind1] OR kind:[policyKind2]”. New - // policy kinds may be added in the future without notice. - // - // Example value: “kind:denyPolicies” - string filter = 2; - - // If present, then retrieve the batch of results following the results from - // the preceding call to this method. `page_token` must be the value of - // `next_page_token` - // [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token] - // from the previous response. The values of other method parameters should - // be identical to those in the previous call. - string page_token = 3; - - // Limit on the number of policies to include in the response. - // Further policies can subsequently be obtained by including the - // [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token] - // in a subsequent request. - // The minimum is 25, and the maximum is 100. - int32 page_size = 4; -} - -// Response message for [ListApplicablePolicies][] method. -message ListApplicablePoliciesResponse { - // Ordered list starting from the resource on which this API was called - // then proceeding up the hierarchy. Policies for the same attachment point - // will be grouped, but no further ordering is guaranteed. - repeated Policy policies = 1; - - // A list of resources that the caller does not have permission to retrieve. - // List or Get can be used to get detailed error messages. - // Get: `policies/{attachment-point}/denypolicies/{policy-id}` - // List: `policies/{attachment-point}/denypolicies` - repeated string inaccessible = 2; - - // A page token that can be used in a - // [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest] - // to retrieve the next page. If this field is blank, there are no additional - // pages. - string next_page_token = 3; -} - // Metadata for long-running `Policy` operations. message PolicyOperationMetadata { // Timestamp when the `google.longrunning.Operation` was created. diff --git a/packages/google-iam/protos/protos.d.ts b/packages/google-iam/protos/protos.d.ts index 46078bfe5d59..3f933af18fab 100644 --- a/packages/google-iam/protos/protos.d.ts +++ b/packages/google-iam/protos/protos.d.ts @@ -233,20 +233,6 @@ export namespace google { * @returns Promise */ public deletePolicy(request: google.iam.v2.IDeletePolicyRequest): Promise; - - /** - * Calls ListApplicablePolicies. - * @param request ListApplicablePoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListApplicablePoliciesResponse - */ - public listApplicablePolicies(request: google.iam.v2.IListApplicablePoliciesRequest, callback: google.iam.v2.Policies.ListApplicablePoliciesCallback): void; - - /** - * Calls ListApplicablePolicies. - * @param request ListApplicablePoliciesRequest message or plain object - * @returns Promise - */ - public listApplicablePolicies(request: google.iam.v2.IListApplicablePoliciesRequest): Promise; } namespace Policies { @@ -285,13 +271,6 @@ export namespace google { * @param [response] Operation */ type DeletePolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.iam.v2.Policies|listApplicablePolicies}. - * @param error Error, if any - * @param [response] ListApplicablePoliciesResponse - */ - type ListApplicablePoliciesCallback = (error: (Error|null), response?: google.iam.v2.ListApplicablePoliciesResponse) => void; } /** Properties of a Policy. */ @@ -1175,230 +1154,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListApplicablePoliciesRequest. */ - interface IListApplicablePoliciesRequest { - - /** ListApplicablePoliciesRequest attachmentPoint */ - attachmentPoint?: (string|null); - - /** ListApplicablePoliciesRequest filter */ - filter?: (string|null); - - /** ListApplicablePoliciesRequest pageToken */ - pageToken?: (string|null); - - /** ListApplicablePoliciesRequest pageSize */ - pageSize?: (number|null); - } - - /** Represents a ListApplicablePoliciesRequest. */ - class ListApplicablePoliciesRequest implements IListApplicablePoliciesRequest { - - /** - * Constructs a new ListApplicablePoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v2.IListApplicablePoliciesRequest); - - /** ListApplicablePoliciesRequest attachmentPoint. */ - public attachmentPoint: string; - - /** ListApplicablePoliciesRequest filter. */ - public filter: string; - - /** ListApplicablePoliciesRequest pageToken. */ - public pageToken: string; - - /** ListApplicablePoliciesRequest pageSize. */ - public pageSize: number; - - /** - * Creates a new ListApplicablePoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApplicablePoliciesRequest instance - */ - public static create(properties?: google.iam.v2.IListApplicablePoliciesRequest): google.iam.v2.ListApplicablePoliciesRequest; - - /** - * Encodes the specified ListApplicablePoliciesRequest message. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesRequest.verify|verify} messages. - * @param message ListApplicablePoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v2.IListApplicablePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApplicablePoliciesRequest message, length delimited. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesRequest.verify|verify} messages. - * @param message ListApplicablePoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v2.IListApplicablePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApplicablePoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApplicablePoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v2.ListApplicablePoliciesRequest; - - /** - * Decodes a ListApplicablePoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApplicablePoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v2.ListApplicablePoliciesRequest; - - /** - * Verifies a ListApplicablePoliciesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApplicablePoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApplicablePoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v2.ListApplicablePoliciesRequest; - - /** - * Creates a plain object from a ListApplicablePoliciesRequest message. Also converts values to other types if specified. - * @param message ListApplicablePoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v2.ListApplicablePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApplicablePoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApplicablePoliciesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListApplicablePoliciesResponse. */ - interface IListApplicablePoliciesResponse { - - /** ListApplicablePoliciesResponse policies */ - policies?: (google.iam.v2.IPolicy[]|null); - - /** ListApplicablePoliciesResponse inaccessible */ - inaccessible?: (string[]|null); - - /** ListApplicablePoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListApplicablePoliciesResponse. */ - class ListApplicablePoliciesResponse implements IListApplicablePoliciesResponse { - - /** - * Constructs a new ListApplicablePoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v2.IListApplicablePoliciesResponse); - - /** ListApplicablePoliciesResponse policies. */ - public policies: google.iam.v2.IPolicy[]; - - /** ListApplicablePoliciesResponse inaccessible. */ - public inaccessible: string[]; - - /** ListApplicablePoliciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListApplicablePoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListApplicablePoliciesResponse instance - */ - public static create(properties?: google.iam.v2.IListApplicablePoliciesResponse): google.iam.v2.ListApplicablePoliciesResponse; - - /** - * Encodes the specified ListApplicablePoliciesResponse message. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesResponse.verify|verify} messages. - * @param message ListApplicablePoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v2.IListApplicablePoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListApplicablePoliciesResponse message, length delimited. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesResponse.verify|verify} messages. - * @param message ListApplicablePoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v2.IListApplicablePoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListApplicablePoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListApplicablePoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v2.ListApplicablePoliciesResponse; - - /** - * Decodes a ListApplicablePoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListApplicablePoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v2.ListApplicablePoliciesResponse; - - /** - * Verifies a ListApplicablePoliciesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListApplicablePoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListApplicablePoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v2.ListApplicablePoliciesResponse; - - /** - * Creates a plain object from a ListApplicablePoliciesResponse message. Also converts values to other types if specified. - * @param message ListApplicablePoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v2.ListApplicablePoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListApplicablePoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListApplicablePoliciesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a PolicyOperationMetadata. */ interface IPolicyOperationMetadata { diff --git a/packages/google-iam/protos/protos.js b/packages/google-iam/protos/protos.js index fb92c00869d3..ba9e6fa16049 100644 --- a/packages/google-iam/protos/protos.js +++ b/packages/google-iam/protos/protos.js @@ -620,39 +620,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.iam.v2.Policies|listApplicablePolicies}. - * @memberof google.iam.v2.Policies - * @typedef ListApplicablePoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v2.ListApplicablePoliciesResponse} [response] ListApplicablePoliciesResponse - */ - - /** - * Calls ListApplicablePolicies. - * @function listApplicablePolicies - * @memberof google.iam.v2.Policies - * @instance - * @param {google.iam.v2.IListApplicablePoliciesRequest} request ListApplicablePoliciesRequest message or plain object - * @param {google.iam.v2.Policies.ListApplicablePoliciesCallback} callback Node-style callback called with the error, if any, and ListApplicablePoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Policies.prototype.listApplicablePolicies = function listApplicablePolicies(request, callback) { - return this.rpcCall(listApplicablePolicies, $root.google.iam.v2.ListApplicablePoliciesRequest, $root.google.iam.v2.ListApplicablePoliciesResponse, request, callback); - }, "name", { value: "ListApplicablePolicies" }); - - /** - * Calls ListApplicablePolicies. - * @function listApplicablePolicies - * @memberof google.iam.v2.Policies - * @instance - * @param {google.iam.v2.IListApplicablePoliciesRequest} request ListApplicablePoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return Policies; })(); @@ -2805,567 +2772,6 @@ return DeletePolicyRequest; })(); - v2.ListApplicablePoliciesRequest = (function() { - - /** - * Properties of a ListApplicablePoliciesRequest. - * @memberof google.iam.v2 - * @interface IListApplicablePoliciesRequest - * @property {string|null} [attachmentPoint] ListApplicablePoliciesRequest attachmentPoint - * @property {string|null} [filter] ListApplicablePoliciesRequest filter - * @property {string|null} [pageToken] ListApplicablePoliciesRequest pageToken - * @property {number|null} [pageSize] ListApplicablePoliciesRequest pageSize - */ - - /** - * Constructs a new ListApplicablePoliciesRequest. - * @memberof google.iam.v2 - * @classdesc Represents a ListApplicablePoliciesRequest. - * @implements IListApplicablePoliciesRequest - * @constructor - * @param {google.iam.v2.IListApplicablePoliciesRequest=} [properties] Properties to set - */ - function ListApplicablePoliciesRequest(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]]; - } - - /** - * ListApplicablePoliciesRequest attachmentPoint. - * @member {string} attachmentPoint - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @instance - */ - ListApplicablePoliciesRequest.prototype.attachmentPoint = ""; - - /** - * ListApplicablePoliciesRequest filter. - * @member {string} filter - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @instance - */ - ListApplicablePoliciesRequest.prototype.filter = ""; - - /** - * ListApplicablePoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @instance - */ - ListApplicablePoliciesRequest.prototype.pageToken = ""; - - /** - * ListApplicablePoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @instance - */ - ListApplicablePoliciesRequest.prototype.pageSize = 0; - - /** - * Creates a new ListApplicablePoliciesRequest instance using the specified properties. - * @function create - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {google.iam.v2.IListApplicablePoliciesRequest=} [properties] Properties to set - * @returns {google.iam.v2.ListApplicablePoliciesRequest} ListApplicablePoliciesRequest instance - */ - ListApplicablePoliciesRequest.create = function create(properties) { - return new ListApplicablePoliciesRequest(properties); - }; - - /** - * Encodes the specified ListApplicablePoliciesRequest message. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {google.iam.v2.IListApplicablePoliciesRequest} message ListApplicablePoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApplicablePoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attachmentPoint != null && Object.hasOwnProperty.call(message, "attachmentPoint")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachmentPoint); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - return writer; - }; - - /** - * Encodes the specified ListApplicablePoliciesRequest message, length delimited. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {google.iam.v2.IListApplicablePoliciesRequest} message ListApplicablePoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApplicablePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApplicablePoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v2.ListApplicablePoliciesRequest} ListApplicablePoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApplicablePoliciesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v2.ListApplicablePoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.attachmentPoint = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApplicablePoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v2.ListApplicablePoliciesRequest} ListApplicablePoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApplicablePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApplicablePoliciesRequest message. - * @function verify - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApplicablePoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attachmentPoint != null && message.hasOwnProperty("attachmentPoint")) - if (!$util.isString(message.attachmentPoint)) - return "attachmentPoint: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - return null; - }; - - /** - * Creates a ListApplicablePoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v2.ListApplicablePoliciesRequest} ListApplicablePoliciesRequest - */ - ListApplicablePoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v2.ListApplicablePoliciesRequest) - return object; - var message = new $root.google.iam.v2.ListApplicablePoliciesRequest(); - if (object.attachmentPoint != null) - message.attachmentPoint = String(object.attachmentPoint); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - return message; - }; - - /** - * Creates a plain object from a ListApplicablePoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {google.iam.v2.ListApplicablePoliciesRequest} message ListApplicablePoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApplicablePoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.attachmentPoint = ""; - object.filter = ""; - object.pageToken = ""; - object.pageSize = 0; - } - if (message.attachmentPoint != null && message.hasOwnProperty("attachmentPoint")) - object.attachmentPoint = message.attachmentPoint; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - return object; - }; - - /** - * Converts this ListApplicablePoliciesRequest to JSON. - * @function toJSON - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListApplicablePoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApplicablePoliciesRequest - * @function getTypeUrl - * @memberof google.iam.v2.ListApplicablePoliciesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApplicablePoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v2.ListApplicablePoliciesRequest"; - }; - - return ListApplicablePoliciesRequest; - })(); - - v2.ListApplicablePoliciesResponse = (function() { - - /** - * Properties of a ListApplicablePoliciesResponse. - * @memberof google.iam.v2 - * @interface IListApplicablePoliciesResponse - * @property {Array.|null} [policies] ListApplicablePoliciesResponse policies - * @property {Array.|null} [inaccessible] ListApplicablePoliciesResponse inaccessible - * @property {string|null} [nextPageToken] ListApplicablePoliciesResponse nextPageToken - */ - - /** - * Constructs a new ListApplicablePoliciesResponse. - * @memberof google.iam.v2 - * @classdesc Represents a ListApplicablePoliciesResponse. - * @implements IListApplicablePoliciesResponse - * @constructor - * @param {google.iam.v2.IListApplicablePoliciesResponse=} [properties] Properties to set - */ - function ListApplicablePoliciesResponse(properties) { - this.policies = []; - this.inaccessible = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListApplicablePoliciesResponse policies. - * @member {Array.} policies - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @instance - */ - ListApplicablePoliciesResponse.prototype.policies = $util.emptyArray; - - /** - * ListApplicablePoliciesResponse inaccessible. - * @member {Array.} inaccessible - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @instance - */ - ListApplicablePoliciesResponse.prototype.inaccessible = $util.emptyArray; - - /** - * ListApplicablePoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @instance - */ - ListApplicablePoliciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListApplicablePoliciesResponse instance using the specified properties. - * @function create - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {google.iam.v2.IListApplicablePoliciesResponse=} [properties] Properties to set - * @returns {google.iam.v2.ListApplicablePoliciesResponse} ListApplicablePoliciesResponse instance - */ - ListApplicablePoliciesResponse.create = function create(properties) { - return new ListApplicablePoliciesResponse(properties); - }; - - /** - * Encodes the specified ListApplicablePoliciesResponse message. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {google.iam.v2.IListApplicablePoliciesResponse} message ListApplicablePoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApplicablePoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policies != null && message.policies.length) - for (var i = 0; i < message.policies.length; ++i) - $root.google.iam.v2.Policy.encode(message.policies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.inaccessible != null && message.inaccessible.length) - for (var i = 0; i < message.inaccessible.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inaccessible[i]); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListApplicablePoliciesResponse message, length delimited. Does not implicitly {@link google.iam.v2.ListApplicablePoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {google.iam.v2.IListApplicablePoliciesResponse} message ListApplicablePoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListApplicablePoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListApplicablePoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v2.ListApplicablePoliciesResponse} ListApplicablePoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApplicablePoliciesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v2.ListApplicablePoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.policies && message.policies.length)) - message.policies = []; - message.policies.push($root.google.iam.v2.Policy.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.inaccessible && message.inaccessible.length)) - message.inaccessible = []; - message.inaccessible.push(reader.string()); - break; - } - case 3: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListApplicablePoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v2.ListApplicablePoliciesResponse} ListApplicablePoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListApplicablePoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListApplicablePoliciesResponse message. - * @function verify - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListApplicablePoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policies != null && message.hasOwnProperty("policies")) { - if (!Array.isArray(message.policies)) - return "policies: array expected"; - for (var i = 0; i < message.policies.length; ++i) { - var error = $root.google.iam.v2.Policy.verify(message.policies[i]); - if (error) - return "policies." + error; - } - } - if (message.inaccessible != null && message.hasOwnProperty("inaccessible")) { - if (!Array.isArray(message.inaccessible)) - return "inaccessible: array expected"; - for (var i = 0; i < message.inaccessible.length; ++i) - if (!$util.isString(message.inaccessible[i])) - return "inaccessible: string[] expected"; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListApplicablePoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v2.ListApplicablePoliciesResponse} ListApplicablePoliciesResponse - */ - ListApplicablePoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v2.ListApplicablePoliciesResponse) - return object; - var message = new $root.google.iam.v2.ListApplicablePoliciesResponse(); - if (object.policies) { - if (!Array.isArray(object.policies)) - throw TypeError(".google.iam.v2.ListApplicablePoliciesResponse.policies: array expected"); - message.policies = []; - for (var i = 0; i < object.policies.length; ++i) { - if (typeof object.policies[i] !== "object") - throw TypeError(".google.iam.v2.ListApplicablePoliciesResponse.policies: object expected"); - message.policies[i] = $root.google.iam.v2.Policy.fromObject(object.policies[i]); - } - } - if (object.inaccessible) { - if (!Array.isArray(object.inaccessible)) - throw TypeError(".google.iam.v2.ListApplicablePoliciesResponse.inaccessible: array expected"); - message.inaccessible = []; - for (var i = 0; i < object.inaccessible.length; ++i) - message.inaccessible[i] = String(object.inaccessible[i]); - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListApplicablePoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {google.iam.v2.ListApplicablePoliciesResponse} message ListApplicablePoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListApplicablePoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.policies = []; - object.inaccessible = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.policies && message.policies.length) { - object.policies = []; - for (var j = 0; j < message.policies.length; ++j) - object.policies[j] = $root.google.iam.v2.Policy.toObject(message.policies[j], options); - } - if (message.inaccessible && message.inaccessible.length) { - object.inaccessible = []; - for (var j = 0; j < message.inaccessible.length; ++j) - object.inaccessible[j] = message.inaccessible[j]; - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListApplicablePoliciesResponse to JSON. - * @function toJSON - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - ListApplicablePoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListApplicablePoliciesResponse - * @function getTypeUrl - * @memberof google.iam.v2.ListApplicablePoliciesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListApplicablePoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v2.ListApplicablePoliciesResponse"; - }; - - return ListApplicablePoliciesResponse; - })(); - v2.PolicyOperationMetadata = (function() { /** diff --git a/packages/google-iam/protos/protos.json b/packages/google-iam/protos/protos.json index 473593f762fd..024de0cea645 100644 --- a/packages/google-iam/protos/protos.json +++ b/packages/google-iam/protos/protos.json @@ -161,24 +161,6 @@ } } ] - }, - "ListApplicablePolicies": { - "requestType": "ListApplicablePoliciesRequest", - "responseType": "ListApplicablePoliciesResponse", - "options": { - "(google.api.http).get": "/v2/{attachment_point=*}:listApplicablePolicies", - "(google.api.method_signature)": "attachment_point" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{attachment_point=*}:listApplicablePolicies" - } - }, - { - "(google.api.method_signature)": "attachment_point" - } - ] } } }, @@ -366,47 +348,6 @@ } } }, - "ListApplicablePoliciesRequest": { - "fields": { - "attachmentPoint": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - } - } - }, - "ListApplicablePoliciesResponse": { - "fields": { - "policies": { - "rule": "repeated", - "type": "Policy", - "id": 1 - }, - "inaccessible": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nextPageToken": { - "type": "string", - "id": 3 - } - } - }, "PolicyOperationMetadata": { "fields": { "createTime": { diff --git a/packages/google-iam/samples/generated/v2/policies.create_policy.js b/packages/google-iam/samples/generated/v2/policies.create_policy.js index 21d18265b909..6495933a74ac 100644 --- a/packages/google-iam/samples/generated/v2/policies.create_policy.js +++ b/packages/google-iam/samples/generated/v2/policies.create_policy.js @@ -29,8 +29,8 @@ function main(parent, policy) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource that the policy is attached to, along with the kind - * of policy to create. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to create. Format: `policies/{attachment_point}/denypolicies` * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, diff --git a/packages/google-iam/samples/generated/v2/policies.delete_policy.js b/packages/google-iam/samples/generated/v2/policies.delete_policy.js index ec68a6cdab4b..c1fac73a13fe 100644 --- a/packages/google-iam/samples/generated/v2/policies.delete_policy.js +++ b/packages/google-iam/samples/generated/v2/policies.delete_policy.js @@ -39,9 +39,9 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. The expected `etag` of the policy to delete. If the value does - * not match the value that is stored in IAM, the request fails with a `409` - * error code and `ABORTED` status. + * Optional. The expected `etag` of the policy to delete. If the value does not match + * the value that is stored in IAM, the request fails with a `409` error code + * and `ABORTED` status. * If you omit this field, the policy is deleted regardless of its current * `etag`. */ diff --git a/packages/google-iam/samples/generated/v2/policies.list_policies.js b/packages/google-iam/samples/generated/v2/policies.list_policies.js index a82e222a0003..e5634200b4f5 100644 --- a/packages/google-iam/samples/generated/v2/policies.list_policies.js +++ b/packages/google-iam/samples/generated/v2/policies.list_policies.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource that the policy is attached to, along with the kind - * of policy to list. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to list. Format: + * `policies/{attachment_point}/denypolicies` * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, @@ -45,9 +46,8 @@ function main(parent) { */ // const pageSize = 1234 /** - * A page token received in a - * ListPoliciesResponse google.iam.v2.ListPoliciesResponse. Provide this - * token to retrieve the next page. + * A page token received in a ListPoliciesResponse google.iam.v2.ListPoliciesResponse. Provide this token to + * retrieve the next page. */ // const pageToken = 'abc123' diff --git a/packages/google-iam/samples/generated/v2/snippet_metadata.google.iam.v2.json b/packages/google-iam/samples/generated/v2/snippet_metadata.google.iam.v2.json index bcfb76530aec..01df2e803de1 100644 --- a/packages/google-iam/samples/generated/v2/snippet_metadata.google.iam.v2.json +++ b/packages/google-iam/samples/generated/v2/snippet_metadata.google.iam.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iam", - "version": "0.1.1", + "version": "0.2.0", "language": "TYPESCRIPT", "apis": [ { @@ -230,58 +230,6 @@ } } } - }, - { - "regionTag": "iam_v2_generated_Policies_ListApplicablePolicies_async", - "title": "Policies listApplicablePolicies Sample", - "origin": "API_DEFINITION", - "description": " Retrieves all the policies that are attached to the specified resource, or anywhere in the ancestry of the resource. For example, for a project this endpoint would return all the `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent organization (if any). The endpoint requires the same permissions that it would take to call `ListPolicies` or `GetPolicy`. The main reason to use this endpoint is as a policy admin to debug access issues for a resource.", - "canonical": true, - "file": "policies.list_applicable_policies.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApplicablePolicies", - "fullName": "google.iam.v2.Policies.ListApplicablePolicies", - "async": true, - "parameters": [ - { - "name": "attachment_point", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.iam.v2.ListApplicablePoliciesResponse", - "client": { - "shortName": "PoliciesClient", - "fullName": "google.iam.v2.PoliciesClient" - }, - "method": { - "shortName": "ListApplicablePolicies", - "fullName": "google.iam.v2.Policies.ListApplicablePolicies", - "service": { - "shortName": "Policies", - "fullName": "google.iam.v2.Policies" - } - } - } } ] } \ No newline at end of file diff --git a/packages/google-iam/samples/package.json b/packages/google-iam/samples/package.json index c8da47c01aab..607682ed1069 100644 --- a/packages/google-iam/samples/package.json +++ b/packages/google-iam/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/iam": "^0.1.1" + "@google-cloud/iam": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-iam/src/v2/gapic_metadata.json b/packages/google-iam/src/v2/gapic_metadata.json index 02cd3309b47c..5e81e797a268 100644 --- a/packages/google-iam/src/v2/gapic_metadata.json +++ b/packages/google-iam/src/v2/gapic_metadata.json @@ -36,13 +36,6 @@ "listPoliciesStream", "listPoliciesAsync" ] - }, - "ListApplicablePolicies": { - "methods": [ - "listApplicablePolicies", - "listApplicablePoliciesStream", - "listApplicablePoliciesAsync" - ] } } }, @@ -75,13 +68,6 @@ "listPoliciesStream", "listPoliciesAsync" ] - }, - "ListApplicablePolicies": { - "methods": [ - "listApplicablePolicies", - "listApplicablePoliciesStream", - "listApplicablePoliciesAsync" - ] } } } diff --git a/packages/google-iam/src/v2/policies_client.ts b/packages/google-iam/src/v2/policies_client.ts index da70d18b996c..6d282616c973 100644 --- a/packages/google-iam/src/v2/policies_client.ts +++ b/packages/google-iam/src/v2/policies_client.ts @@ -182,11 +182,6 @@ export class PoliciesClient { 'nextPageToken', 'policies' ), - listApplicablePolicies: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'policies' - ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -301,7 +296,6 @@ export class PoliciesClient { 'createPolicy', 'updatePolicy', 'deletePolicy', - 'listApplicablePolicies', ]; for (const methodName of policiesStubMethods) { const callPromise = this.policiesStub.then( @@ -487,8 +481,8 @@ export class PoliciesClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource that the policy is attached to, along with the kind - * of policy to create. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to create. Format: `policies/{attachment_point}/denypolicies` * * * The attachment point is identified by its URL-encoded full resource name, @@ -643,8 +637,7 @@ export class PoliciesClient { * * To update a policy, you should use a read-modify-write loop: * - * 1. Use {@link google.iam.v2.Policies.GetPolicy|GetPolicy} to read the current - * version of the policy. + * 1. Use {@link google.iam.v2.Policies.GetPolicy|GetPolicy} to read the current version of the policy. * 2. Modify the policy as needed. * 3. Use `UpdatePolicy` to write the updated policy. * @@ -806,9 +799,9 @@ export class PoliciesClient { * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @param {string} [request.etag] - * Optional. The expected `etag` of the policy to delete. If the value does - * not match the value that is stored in IAM, the request fails with a `409` - * error code and `ABORTED` status. + * Optional. The expected `etag` of the policy to delete. If the value does not match + * the value that is stored in IAM, the request fails with a `409` error code + * and `ABORTED` status. * * If you omit this field, the policy is deleted regardless of its current * `etag`. @@ -953,8 +946,9 @@ export class PoliciesClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource that the policy is attached to, along with the kind - * of policy to list. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to list. Format: + * `policies/{attachment_point}/denypolicies` * * * The attachment point is identified by its URL-encoded full resource name, @@ -968,9 +962,8 @@ export class PoliciesClient { * The maximum number of policies to return. IAM ignores this value and uses * the value 1000. * @param {string} request.pageToken - * A page token received in a - * {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this - * token to retrieve the next page. + * A page token received in a {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this token to + * retrieve the next 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. @@ -1056,8 +1049,9 @@ export class PoliciesClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource that the policy is attached to, along with the kind - * of policy to list. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to list. Format: + * `policies/{attachment_point}/denypolicies` * * * The attachment point is identified by its URL-encoded full resource name, @@ -1071,9 +1065,8 @@ export class PoliciesClient { * The maximum number of policies to return. IAM ignores this value and uses * the value 1000. * @param {string} request.pageToken - * A page token received in a - * {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this - * token to retrieve the next page. + * A page token received in a {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this token to + * retrieve the next page. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1115,8 +1108,9 @@ export class PoliciesClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource that the policy is attached to, along with the kind - * of policy to list. Format: `policies/{attachment_point}/denypolicies` + * Required. The resource that the policy is attached to, along with the kind of policy + * to list. Format: + * `policies/{attachment_point}/denypolicies` * * * The attachment point is identified by its URL-encoded full resource name, @@ -1130,9 +1124,8 @@ export class PoliciesClient { * The maximum number of policies to return. IAM ignores this value and uses * the value 1000. * @param {string} request.pageToken - * A page token received in a - * {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this - * token to retrieve the next page. + * A page token received in a {@link google.iam.v2.ListPoliciesResponse|ListPoliciesResponse}. Provide this token to + * retrieve the next page. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1167,259 +1160,6 @@ export class PoliciesClient { callSettings ) as AsyncIterable; } - /** - * Retrieves all the policies that are attached to the specified resource, - * or anywhere in the ancestry of the resource. For example, for a project - * this endpoint would return all the `denyPolicy` kind policies attached to - * the project, its parent folder (if any), and its parent organization (if - * any). - * The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * - * The main reason to use this endpoint is as a policy admin to debug access - * issues for a resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.attachmentPoint - * Required. The Cloud resource at which the applicable policies are to be - * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource - * name, which means that the forward-slash character, `/`, must be written as - * `%2F`. For example, - * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - * @param {string} request.filter - * Filtering currently only supports the kind of policies to return, and - * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”. New - * policy kinds may be added in the future without notice. - * - * Example value: “kind:denyPolicies” - * @param {string} request.pageToken - * If present, then retrieve the batch of results following the results from - * the preceding call to this method. `page_token` must be the value of - * `next_page_token` - * {@link google.iam.v2.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * from the previous response. The values of other method parameters should - * be identical to those in the previous call. - * @param {number} request.pageSize - * Limit on the number of policies to include in the response. - * Further policies can subsequently be obtained by including the - * {@link google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * in a subsequent request. - * The minimum is 25, and the maximum is 100. - * @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 [Policy]{@link google.iam.v2.Policy}. - * 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 `listApplicablePoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listApplicablePolicies( - request?: protos.google.iam.v2.IListApplicablePoliciesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v2.IPolicy[], - protos.google.iam.v2.IListApplicablePoliciesRequest | null, - protos.google.iam.v2.IListApplicablePoliciesResponse - ] - >; - listApplicablePolicies( - request: protos.google.iam.v2.IListApplicablePoliciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.iam.v2.IListApplicablePoliciesRequest, - protos.google.iam.v2.IListApplicablePoliciesResponse | null | undefined, - protos.google.iam.v2.IPolicy - > - ): void; - listApplicablePolicies( - request: protos.google.iam.v2.IListApplicablePoliciesRequest, - callback: PaginationCallback< - protos.google.iam.v2.IListApplicablePoliciesRequest, - protos.google.iam.v2.IListApplicablePoliciesResponse | null | undefined, - protos.google.iam.v2.IPolicy - > - ): void; - listApplicablePolicies( - request?: protos.google.iam.v2.IListApplicablePoliciesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.iam.v2.IListApplicablePoliciesRequest, - | protos.google.iam.v2.IListApplicablePoliciesResponse - | null - | undefined, - protos.google.iam.v2.IPolicy - >, - callback?: PaginationCallback< - protos.google.iam.v2.IListApplicablePoliciesRequest, - protos.google.iam.v2.IListApplicablePoliciesResponse | null | undefined, - protos.google.iam.v2.IPolicy - > - ): Promise< - [ - protos.google.iam.v2.IPolicy[], - protos.google.iam.v2.IListApplicablePoliciesRequest | null, - protos.google.iam.v2.IListApplicablePoliciesResponse - ] - > | 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({ - attachment_point: request.attachmentPoint ?? '', - }); - this.initialize(); - return this.innerApiCalls.listApplicablePolicies( - 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.attachmentPoint - * Required. The Cloud resource at which the applicable policies are to be - * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource - * name, which means that the forward-slash character, `/`, must be written as - * `%2F`. For example, - * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - * @param {string} request.filter - * Filtering currently only supports the kind of policies to return, and - * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”. New - * policy kinds may be added in the future without notice. - * - * Example value: “kind:denyPolicies” - * @param {string} request.pageToken - * If present, then retrieve the batch of results following the results from - * the preceding call to this method. `page_token` must be the value of - * `next_page_token` - * {@link google.iam.v2.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * from the previous response. The values of other method parameters should - * be identical to those in the previous call. - * @param {number} request.pageSize - * Limit on the number of policies to include in the response. - * Further policies can subsequently be obtained by including the - * {@link google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * in a subsequent request. - * The minimum is 25, and the maximum is 100. - * @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 [Policy]{@link google.iam.v2.Policy} 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 `listApplicablePoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listApplicablePoliciesStream( - request?: protos.google.iam.v2.IListApplicablePoliciesRequest, - 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({ - attachment_point: request.attachmentPoint ?? '', - }); - const defaultCallSettings = this._defaults['listApplicablePolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApplicablePolicies.createStream( - this.innerApiCalls.listApplicablePolicies as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listApplicablePolicies`, 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.attachmentPoint - * Required. The Cloud resource at which the applicable policies are to be - * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource - * name, which means that the forward-slash character, `/`, must be written as - * `%2F`. For example, - * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - * @param {string} request.filter - * Filtering currently only supports the kind of policies to return, and - * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”. New - * policy kinds may be added in the future without notice. - * - * Example value: “kind:denyPolicies” - * @param {string} request.pageToken - * If present, then retrieve the batch of results following the results from - * the preceding call to this method. `page_token` must be the value of - * `next_page_token` - * {@link google.iam.v2.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * from the previous response. The values of other method parameters should - * be identical to those in the previous call. - * @param {number} request.pageSize - * Limit on the number of policies to include in the response. - * Further policies can subsequently be obtained by including the - * {@link google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token|ListApplicablePoliciesResponse.next_page_token} - * in a subsequent request. - * The minimum is 25, and the maximum is 100. - * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Policy]{@link google.iam.v2.Policy}. 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 - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v2/policies.list_applicable_policies.js - * region_tag:iam_v2_generated_Policies_ListApplicablePolicies_async - */ - listApplicablePoliciesAsync( - request?: protos.google.iam.v2.IListApplicablePoliciesRequest, - 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({ - attachment_point: request.attachmentPoint ?? '', - }); - const defaultCallSettings = this._defaults['listApplicablePolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApplicablePolicies.asyncIterate( - this.innerApiCalls['listApplicablePolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API diff --git a/packages/google-iam/src/v2/policies_client_config.json b/packages/google-iam/src/v2/policies_client_config.json index 9ccc2133643f..8203a45ed799 100644 --- a/packages/google-iam/src/v2/policies_client_config.json +++ b/packages/google-iam/src/v2/policies_client_config.json @@ -56,10 +56,6 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListApplicablePolicies": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" } } } diff --git a/packages/google-iam/test/gapic_policies_v2.ts b/packages/google-iam/test/gapic_policies_v2.ts index 82c31be83e7b..630b8b20ef7b 100644 --- a/packages/google-iam/test/gapic_policies_v2.ts +++ b/packages/google-iam/test/gapic_policies_v2.ts @@ -1254,325 +1254,6 @@ describe('v2.PoliciesClient', () => { ); }); }); - - describe('listApplicablePolicies', () => { - it('invokes listApplicablePolicies without error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - ]; - client.innerApiCalls.listApplicablePolicies = - stubSimpleCall(expectedResponse); - const [response] = await client.listApplicablePolicies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApplicablePolicies without error using callback', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - ]; - client.innerApiCalls.listApplicablePolicies = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApplicablePolicies( - request, - ( - err?: Error | null, - result?: protos.google.iam.v2.IPolicy[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApplicablePolicies with error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApplicablePolicies = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.listApplicablePolicies(request), - expectedError - ); - const actualRequest = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listApplicablePolicies as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApplicablePoliciesStream without error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - ]; - client.descriptors.page.listApplicablePolicies.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listApplicablePoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.iam.v2.Policy[] = []; - stream.on('data', (response: protos.google.iam.v2.Policy) => { - 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.listApplicablePolicies - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listApplicablePolicies, request) - ); - assert( - ( - client.descriptors.page.listApplicablePolicies - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApplicablePoliciesStream with error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApplicablePolicies.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listApplicablePoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.iam.v2.Policy[] = []; - stream.on('data', (response: protos.google.iam.v2.Policy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listApplicablePolicies - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listApplicablePolicies, request) - ); - assert( - ( - client.descriptors.page.listApplicablePolicies - .createStream as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApplicablePolicies without error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - generateSampleMessage(new protos.google.iam.v2.Policy()), - ]; - client.descriptors.page.listApplicablePolicies.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.iam.v2.IPolicy[] = []; - const iterable = client.listApplicablePoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listApplicablePolicies - .asyncIterate as SinonStub - ).getCall(0).args[1], - request - ); - assert( - ( - client.descriptors.page.listApplicablePolicies - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApplicablePolicies with error', async () => { - const client = new policiesModule.v2.PoliciesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v2.ListApplicablePoliciesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v2.ListApplicablePoliciesRequest', - ['attachmentPoint'] - ); - request.attachmentPoint = defaultValue1; - const expectedHeaderRequestParams = `attachment_point=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApplicablePolicies.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApplicablePoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.iam.v2.IPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listApplicablePolicies - .asyncIterate as SinonStub - ).getCall(0).args[1], - request - ); - assert( - ( - client.descriptors.page.listApplicablePolicies - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); describe('getOperation', () => { it('invokes getOperation without error', async () => { const client = new policiesModule.v2.PoliciesClient({ diff --git a/packages/google-maps-routing/.OwlBot.yaml b/packages/google-maps-routing/.OwlBot.yaml new file mode 100644 index 000000000000..c84141e757d4 --- /dev/null +++ b/packages/google-maps-routing/.OwlBot.yaml @@ -0,0 +1,17 @@ +# Copyright 2022 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. + +deep-copy-regex: + - source: /google/maps/routing/(.*)/.*-nodejs + dest: /owl-bot-staging/google-maps-routing/$1 \ No newline at end of file diff --git a/packages/google-maps-routing/.eslintignore b/packages/google-maps-routing/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-maps-routing/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-maps-routing/.eslintrc.json b/packages/google-maps-routing/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-maps-routing/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-maps-routing/.gitattributes b/packages/google-maps-routing/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-maps-routing/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-maps-routing/.gitignore b/packages/google-maps-routing/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-maps-routing/.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/packages/google-maps-routing/.jsdoc.js b/packages/google-maps-routing/.jsdoc.js new file mode 100644 index 000000000000..9ebf5a876e01 --- /dev/null +++ b/packages/google-maps-routing/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@googlemaps/routing', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-maps-routing/.mocharc.js b/packages/google-maps-routing/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-maps-routing/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-maps-routing/.nycrc b/packages/google-maps-routing/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-maps-routing/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-maps-routing/.prettierignore b/packages/google-maps-routing/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-maps-routing/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-maps-routing/.prettierrc.js b/packages/google-maps-routing/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-maps-routing/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-maps-routing/.repo-metadata.json b/packages/google-maps-routing/.repo-metadata.json new file mode 100644 index 000000000000..1ade2d2a34ea --- /dev/null +++ b/packages/google-maps-routing/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "routing", + "name_pretty": "Google Maps Routing", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/routing/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@googlemaps/routing", + "api_id": "google.maps.routing.v2", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO" +} + diff --git a/packages/google-maps-routing/CHANGELOG.md b/packages/google-maps-routing/CHANGELOG.md new file mode 100644 index 000000000000..99f927d467a7 --- /dev/null +++ b/packages/google-maps-routing/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/routing-v0.1.0...routing-v0.1.1) (2022-09-30) + + +### Bug Fixes + +* **docs:** Add pretty name for API ([#3382](https://github.com/googleapis/google-cloud-node/issues/3382)) ([84db53b](https://github.com/googleapis/google-cloud-node/commit/84db53b4843df2511fee9da794b5429bd40b214d)) + +## 0.1.0 (2022-09-30) + + +### Features + +* add initial files for google.maps.routing.v2 ([1671258](https://github.com/googleapis/google-cloud-node/commit/1671258fe7d2ad326ed105107d788fb3c295fb3b)) diff --git a/packages/google-maps-routing/CODE_OF_CONDUCT.md b/packages/google-maps-routing/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-maps-routing/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-maps-routing/CONTRIBUTING.md b/packages/google-maps-routing/CONTRIBUTING.md new file mode 100644 index 000000000000..b8a810e1d175 --- /dev/null +++ b/packages/google-maps-routing/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Maps Routing API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=google.maps.routing.v2 +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-maps-routing/LICENSE b/packages/google-maps-routing/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-maps-routing/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-maps-routing/README.md b/packages/google-maps-routing/README.md new file mode 100644 index 000000000000..27d118faf943 --- /dev/null +++ b/packages/google-maps-routing/README.md @@ -0,0 +1,238 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Maps Routing: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@googlemaps/routing.svg)](https://www.npmjs.org/package/@googlemaps/routing) + + + + + client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Google Maps Routing Node.js Client API Reference][client-docs] + +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Maps Routing API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @googlemaps/routing +``` + + +### Using the client library + +```javascript +/** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. Origin waypoint. + */ +// const origin = {} +/** + * Required. Destination waypoint. + */ +// const destination = {} +/** + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + */ +// const intermediates = 1234 +/** + * Optional. Specifies the mode of transportation. + */ +// const travelMode = {} +/** + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. In the future, we might implement a fallback + * mechanism to use a different option when the preferred option does not give + * a valid result. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + */ +// const routingPreference = {} +/** + * Optional. Specifies your preference for the quality of the polyline. + */ +// const polylineQuality = {} +/** + * Optional. Specifies the preferred encoding for the polyline. + */ +// const polylineEncoding = {} +/** + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. If you set this value to a + * time that has already occurred, then the request fails. + */ +// const departureTime = {} +/** + * Optional. Specifies whether to calculate alternate routes in addition to the route. + */ +// const computeAlternativeRoutes = true +/** + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + */ +// const routeModifiers = {} +/** + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + * Language Support (https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + */ +// const languageCode = 'abc123' +/** + * Optional. Specifies the units of measure for the display fields. This + * includes the `instruction` field in `NavigationInstruction`. The units of + * measure used for the route, leg, step distance, and duration are not + * affected by this value. If you don't provide this value, then the display + * units are inferred from the location of the request. + */ +// const units = {} + +// Imports the Routing library +const {RoutesClient} = require('@googlemaps/routing').v2; + +// Instantiates a client +const routingClient = new RoutesClient(); + +async function callComputeRoutes() { + // Construct request + const request = { + origin, + destination, + }; + + // Run request + const response = await routingClient.computeRoutes(request); + console.log(response); +} + +callComputeRoutes(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Routes.compute_route_matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js,samples/README.md) | +| Routes.compute_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/test/quickstart.js,samples/README.md) | + + + +The [Google Maps Routing Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @googlemaps/routing@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/routing/latest + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=google.maps.routing.v2 +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-maps-routing/linkinator.config.json b/packages/google-maps-routing/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-maps-routing/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-maps-routing/package.json b/packages/google-maps-routing/package.json new file mode 100644 index 000000000000..3ef379aa1214 --- /dev/null +++ b/packages/google-maps-routing/package.json @@ -0,0 +1,66 @@ +{ + "name": "@googlemaps/routing", + "version": "0.1.1", + "description": " client for Node.js", + "repository": "googleapis/google-cloud-node", + "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 routing", + "routing", + "" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.0.1" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-maps-routing/protos/google/geo/type/viewport.proto b/packages/google-maps-routing/protos/google/geo/type/viewport.proto new file mode 100644 index 000000000000..ad5029f8360a --- /dev/null +++ b/packages/google-maps-routing/protos/google/geo/type/viewport.proto @@ -0,0 +1,69 @@ +// Copyright 2019 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.geo.type; + +import "google/type/latlng.proto"; + +option go_package = "google.golang.org/genproto/googleapis/geo/type/viewport;viewport"; +option java_multiple_files = true; +option java_outer_classname = "ViewportProto"; +option java_package = "com.google.geo.type"; +option objc_class_prefix = "GGTP"; + +// A latitude-longitude viewport, represented as two diagonally opposite `low` +// and `high` points. A viewport is considered a closed region, i.e. it includes +// its boundary. The latitude bounds must range between -90 to 90 degrees +// inclusive, and the longitude bounds must range between -180 to 180 degrees +// inclusive. Various cases include: +// +// - If `low` = `high`, the viewport consists of that single point. +// +// - If `low.longitude` > `high.longitude`, the longitude range is inverted +// (the viewport crosses the 180 degree longitude line). +// +// - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, +// the viewport includes all longitudes. +// +// - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, +// the longitude range is empty. +// +// - If `low.latitude` > `high.latitude`, the latitude range is empty. +// +// Both `low` and `high` must be populated, and the represented box cannot be +// empty (as specified by the definitions above). An empty viewport will result +// in an error. +// +// For example, this viewport fully encloses New York City: +// +// { +// "low": { +// "latitude": 40.477398, +// "longitude": -74.259087 +// }, +// "high": { +// "latitude": 40.91618, +// "longitude": -73.70018 +// } +// } +message Viewport { + // Required. The low point of the viewport. + google.type.LatLng low = 1; + + // Required. The high point of the viewport. + google.type.LatLng high = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto new file mode 100644 index 000000000000..e8ba9520555f --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/fallback_info.proto @@ -0,0 +1,72 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "FallbackInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Information related to how and why a fallback result was used. If this field +// is set, then it means the server used a different routing mode from your +// preferred mode as fallback. +message FallbackInfo { + // Routing mode used for the response. If fallback was triggered, the mode + // may be different from routing preference set in the original client + // request. + FallbackRoutingMode routing_mode = 1; + + // The reason why fallback response was used instead of the original response. + // This field is only populated when the fallback mode is triggered and the + // fallback response is returned. + FallbackReason reason = 2; +} + +// Reasons for using fallback response. +enum FallbackReason { + // No fallback reason specified. + FALLBACK_REASON_UNSPECIFIED = 0; + + // A server error happened while calculating routes with your preferred + // routing mode, but we were able to return a result calculated by an + // alternative mode. + SERVER_ERROR = 1; + + // We were not able to finish the calculation with your preferred routing mode + // on time, but we were able to return a result calculated by an alternative + // mode. + LATENCY_EXCEEDED = 2; +} + +// Actual routing mode used for returned fallback response. +enum FallbackRoutingMode { + // Not used. + FALLBACK_ROUTING_MODE_UNSPECIFIED = 0; + + // Indicates the "TRAFFIC_UNAWARE" routing mode was used to compute the + // response. + FALLBACK_TRAFFIC_UNAWARE = 1; + + // Indicates the "TRAFFIC_AWARE" routing mode was used to compute the + // response. + FALLBACK_TRAFFIC_AWARE = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto new file mode 100644 index 000000000000..45c08b808ac1 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/location.proto @@ -0,0 +1,43 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/protobuf/wrappers.proto"; +import "google/type/latlng.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a location (a geographic point, and an optional heading). +message Location { + // The waypoint's geographic coordinates. + google.type.LatLng lat_lng = 1; + + // The compass heading associated with the direction of the flow of traffic. + // This value is used to specify the side of the road to use for pickup and + // drop-off. Heading values can be from 0 to 360, where 0 specifies a heading + // of due North, 90 specifies a heading of due East, etc. You can use this + // field only for `DRIVE` and `TWO_WHEELER` travel modes. + google.protobuf.Int32Value heading = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto new file mode 100644 index 000000000000..b87f8f97f55d --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/maneuver.proto @@ -0,0 +1,88 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "ManeuverProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the navigation action to take for the current +// step (e.g., turn left, merge, straight, etc.). +enum Maneuver { + // Not used. + MANEUVER_UNSPECIFIED = 0; + + // Turn slightly to the left. + TURN_SLIGHT_LEFT = 1; + + // Turn sharply to the left. + TURN_SHARP_LEFT = 2; + + // Make a left u-turn. + UTURN_LEFT = 3; + + // Turn left. + TURN_LEFT = 4; + + // Turn slightly to the right. + TURN_SLIGHT_RIGHT = 5; + + // Turn sharply to the right. + TURN_SHARP_RIGHT = 6; + + // Make a right u-turn. + UTURN_RIGHT = 7; + + // Turn right. + TURN_RIGHT = 8; + + // Go straight. + STRAIGHT = 9; + + // Take the left ramp. + RAMP_LEFT = 10; + + // Take the right ramp. + RAMP_RIGHT = 11; + + // Merge into traffic. + MERGE = 12; + + // Take the left fork. + FORK_LEFT = 13; + + // Take the right fork. + FORK_RIGHT = 14; + + // Take the ferry. + FERRY = 15; + + // Take the train leading onto the ferry. + FERRY_TRAIN = 16; + + // Turn left at the roundabout. + ROUNDABOUT_LEFT = 17; + + // Turn right at the roundabout. + ROUNDABOUT_RIGHT = 18; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto new file mode 100644 index 000000000000..dfe017cf5922 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/navigation_instruction.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/maps/routing/v2/maneuver.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "NavigationInstructionProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates navigation instructions for a +// [RouteLegStep][google.maps.routing.v2.RouteLegStep] +message NavigationInstruction { + // Encapsulates the navigation instructions for the current step (e.g., turn + // left, merge, straight, etc.). This field determines which icon to display. + Maneuver maneuver = 1; + + // Instructions for navigating this step. + string instructions = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto new file mode 100644 index 000000000000..19f6b2679473 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/polyline.proto @@ -0,0 +1,74 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/protobuf/struct.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "PolylineProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates an encoded polyline. +message Polyline { + // Encapsulates the type of polyline. Defaults to encoded_polyline. + oneof polyline_type { + // The string encoding of the polyline using the [polyline encoding + // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) + string encoded_polyline = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + google.protobuf.Struct geo_json_linestring = 2; + } +} + +// A set of values that specify the quality of the polyline. +enum PolylineQuality { + // No polyline quality preference specified. Defaults to `OVERVIEW`. + POLYLINE_QUALITY_UNSPECIFIED = 0; + + // Specifies a high-quality polyline - which is composed using more points + // than `OVERVIEW`, at the cost of increased response size. Use this value + // when you need more precision. + HIGH_QUALITY = 1; + + // Specifies an overview polyline - which is composed using a small number of + // points. Use this value when displaying an overview of the route. Using this + // option has a lower request latency compared to using the + // `HIGH_QUALITY` option. + OVERVIEW = 2; +} + +// Specifies the preferred type of polyline to be returned. +enum PolylineEncoding { + // No polyline type preference specified. Defaults to `ENCODED_POLYLINE`. + POLYLINE_ENCODING_UNSPECIFIED = 0; + + // Specifies a polyline encoded using the [polyline encoding + // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm). + ENCODED_POLYLINE = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + GEO_JSON_LINESTRING = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto new file mode 100644 index 000000000000..8f4304f08e1f --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route.proto @@ -0,0 +1,208 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/geo/type/viewport.proto"; +import "google/maps/routing/v2/location.proto"; +import "google/maps/routing/v2/navigation_instruction.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/speed_reading_interval.proto"; +import "google/maps/routing/v2/toll_info.proto"; +import "google/protobuf/duration.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a route, which consists of a series of connected road segments +// that join beginning, ending, and intermediate waypoints. +message Route { + // A collection of legs (path segments between waypoints) that make-up the + // route. Each leg corresponds to the trip between two non-`via` Waypoints. + // For example, a route with no intermediate waypoints has only one leg. A + // route that includes one non-`via` intermediate waypoint has two legs. A + // route that includes one `via` intermediate waypoint has one leg. The order + // of the legs matches the order of Waypoints from `origin` to `intermediates` + // to `destination`. + repeated RouteLeg legs = 1; + + // The travel distance of the route, in meters. + int32 distance_meters = 2; + + // The length of time needed to navigate the route. If you set the + // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If you set the `routing_preference` to either + // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated + // taking traffic conditions into account. + google.protobuf.Duration duration = 3; + + // The duration of traveling through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 4; + + // The overall route polyline. This polyline will be the combined polyline of + // all `legs`. + Polyline polyline = 5; + + // A description of the route. + string description = 6; + + // An array of warnings to show when displaying the route. + repeated string warnings = 7; + + // The viewport bounding box of the polyline. + google.geo.type.Viewport viewport = 8; + + // Additional information about the route. + RouteTravelAdvisory travel_advisory = 9; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction etc. +message RouteTravelAdvisory { + // Encapsulates information about tolls on the Route. + // This field is only populated if we expect there are tolls on the Route. + // If this field is set but the estimated_price subfield is not populated, + // we expect that road contains tolls but we do not know an estimated price. + // If this field is not set, then we expect there is no toll on the Route. + TollInfo toll_info = 2; + + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the route without overlap. + // The start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 3; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction etc. on a route leg. +message RouteLegTravelAdvisory { + // Encapsulates information about tolls on the specific RouteLeg. + // This field is only populated if we expect there are tolls on the RouteLeg. + // If this field is set but the estimated_price subfield is not populated, + // we expect that road contains tolls but we do not know an estimated price. + // If this field does not exist, then there is no toll on the RouteLeg. + TollInfo toll_info = 1; + + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the RouteLg without overlap. + // The start point of a specified interval is the same as the end point of the + // preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 2; +} + +// Encapsulates the additional information that the user should be informed +// about, such as possible traffic zone restriction on a leg step. +message RouteLegStepTravelAdvisory { + // Speed reading intervals detailing traffic density. Applicable in case of + // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. + // The intervals cover the entire polyline of the RouteLegStep without + // overlap. The start point of a specified interval is the same as the end + // point of the preceding interval. + // + // Example: + // + // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G + // speed_reading_intervals: [A,C), [C,D), [D,G). + repeated SpeedReadingInterval speed_reading_intervals = 1; +} + +// Encapsulates a segment between non-`via` waypoints. +message RouteLeg { + // The travel distance of the route leg, in meters. + int32 distance_meters = 1; + + // The length of time needed to navigate the leg. If the `route_preference` + // is set to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or + // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic + // conditions into account. + google.protobuf.Duration duration = 2; + + // The duration of traveling through the leg, calculated without taking + // traffic conditions into consideration. + google.protobuf.Duration static_duration = 3; + + // The overall polyline for this leg. This includes that each `step`'s + // polyline. + Polyline polyline = 4; + + // The start location of this leg. This might be different from the provided + // `origin`. For example, when the provided `origin` is not near a road, this + // is a point on the road. + Location start_location = 5; + + // The end location of this leg. This might be different from the provided + // `destination`. For example, when the provided `destination` is not near a + // road, this is a point on the road. + Location end_location = 6; + + // An array of steps denoting segments within this leg. Each step represents + // one navigation instruction. + repeated RouteLegStep steps = 7; + + // Encapsulates the additional information that the user should be informed + // about, such as possible traffic zone restriction etc. on a route leg. + RouteLegTravelAdvisory travel_advisory = 8; +} + +// Encapsulates a segment of a `RouteLeg`. A step corresponds to a single +// navigation instruction. Route legs are made up of steps. +message RouteLegStep { + // The travel distance of this step, in meters. In some circumstances, this + // field might not have a value. + int32 distance_meters = 1; + + // The duration of travel through this step without taking traffic conditions + // into consideration. In some circumstances, this field might not have a + // value. + google.protobuf.Duration static_duration = 2; + + // The polyline associated with this step. + Polyline polyline = 3; + + // The start location of this step. + Location start_location = 4; + + // The end location of this step. + Location end_location = 5; + + // Navigation instructions. + NavigationInstruction navigation_instruction = 6; + + // Encapsulates the additional information that the user should be informed + // about, such as possible traffic zone restriction on a leg step. + RouteLegStepTravelAdvisory travel_advisory = 7; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto new file mode 100644 index 000000000000..01fcdad3eb66 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_modifiers.proto @@ -0,0 +1,64 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/maps/routing/v2/toll_passes.proto"; +import "google/maps/routing/v2/vehicle_info.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteModifiersProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a set of optional conditions to satisfy when calculating the +// routes. +message RouteModifiers { + // Specifies whether to avoid toll roads where reasonable. Preference will be + // given to routes not containing toll roads. Applies only to the `DRIVE` and + // `TWO_WHEELER` travel modes. + bool avoid_tolls = 1; + + // Specifies whether to avoid highways where reasonable. Preference will be + // given to routes not containing highways. Applies only to the `DRIVE` and + // `TWO_WHEELER` travel modes. + bool avoid_highways = 2; + + // Specifies whether to avoid ferries where reasonable. Preference will be + // given to routes not containing travel by ferries. + // Applies only to the `DRIVE` and`TWO_WHEELER` travel modes. + bool avoid_ferries = 3; + + // Specifies whether to avoid navigating indoors where reasonable. Preference + // will be given to routes not containing indoor navigation. + // Applies only to the `WALK` travel mode. + bool avoid_indoor = 4; + + // Specifies the vehicle information. + VehicleInfo vehicle_info = 5; + + // Encapsulates information about toll passes. + // If toll passes are provided, the API tries to return the pass price. If + // toll passes are not provided, the API treats the toll pass as unknown and + // tries to return the cash price. + // Applies only to the DRIVE and TWO_WHEELER travel modes. + repeated TollPass toll_passes = 6; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto new file mode 100644 index 000000000000..adc091e166fd --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/route_travel_mode.proto @@ -0,0 +1,46 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RouteTravelModeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values used to specify the mode of travel. +enum RouteTravelMode { + // No travel mode specified. Defaults to `DRIVE`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel by passenger car. + DRIVE = 1; + + // Travel by bicycle. + BICYCLE = 2; + + // Travel by walking. + WALK = 3; + + // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this + // differs from the `BICYCLE` travel mode which covers human-powered mode. + TWO_WHEELER = 4; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto new file mode 100644 index 000000000000..e252a87b6376 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto @@ -0,0 +1,311 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/maps/routing/v2/fallback_info.proto"; +import "google/maps/routing/v2/polyline.proto"; +import "google/maps/routing/v2/route.proto"; +import "google/maps/routing/v2/route_modifiers.proto"; +import "google/maps/routing/v2/route_travel_mode.proto"; +import "google/maps/routing/v2/routing_preference.proto"; +import "google/maps/routing/v2/units.proto"; +import "google/maps/routing/v2/waypoint.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RoutesServiceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// The Routes API. +service Routes { + option (google.api.default_host) = "routes.googleapis.com"; + + // Returns the primary route along with optional alternate routes, given a set + // of terminal and intermediate waypoints. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using URL parameter + // `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` + // (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters). The value + // is a comma separated list of field paths. See detailed documentation about + // [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of Route-level duration, distance, and polyline (an example + // production setup): + // `X-Goog-FieldMask: + // routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` + // + // Google discourage the use of the wildcard (`*`) response field mask, or + // specifying the field mask at the top level (`routes`), because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need + // in your production job ensures stable latency performance. We might add + // more response fields in the future, and those new fields might require + // extra computation time. If you select all fields, or if you select all + // fields at the top level, then you might experience performance degradation + // because any new field we add will be automatically included in the + // response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRoutes(ComputeRoutesRequest) returns (ComputeRoutesResponse) { + option (google.api.http) = { + post: "/directions/v2:computeRoutes" + body: "*" + }; + } + + // Takes in a list of origins and destinations and returns a stream containing + // route information for each combination of origin and destination. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using the URL + // parameter `$fields` or `fields`, or by using the HTTP/gRPC header + // `X-Goog-FieldMask` (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters). The value + // is a comma separated list of field paths. See this detailed documentation + // about [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of route durations, distances, element status, condition, and + // element indices (an example production setup): + // `X-Goog-FieldMask: + // originIndex,destinationIndex,status,condition,distanceMeters,duration` + // + // It is critical that you include `status` in your field mask as otherwise + // all messages will appear to be OK. Google discourages the use of the + // wildcard (`*`) response field mask, because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need in your production job ensures + // stable latency performance. We might add more response fields in the + // future, and those new fields might require extra computation time. If you + // select all fields, or if you select all fields at the top level, then you + // might experience performance degradation because any new field we add will + // be automatically included in the response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) { + option (google.api.http) = { + post: "/distanceMatrix/v2:computeRouteMatrix" + body: "*" + }; + } +} + +// ComputeRoutes request message. +message ComputeRoutesRequest { + // Required. Origin waypoint. + Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Destination waypoint. + Waypoint destination = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A set of waypoints along the route (excluding terminal points), + // for either stopping at or passing by. Up to 25 intermediate waypoints are + // supported. + repeated Waypoint intermediates = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server + // attempts to use the selected routing preference to compute the route. If + // the routing preference results in an error or an extra long latency, then + // an error is returned. In the future, we might implement a fallback + // mechanism to use a different option when the preferred option does not give + // a valid result. You can specify this option only when the `travel_mode` is + // `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + RoutingPreference routing_preference = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies your preference for the quality of the polyline. + PolylineQuality polyline_quality = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the preferred encoding for the polyline. + PolylineEncoding polyline_encoding = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, then this value + // defaults to the time that you made the request. If you set this value to a + // time that has already occurred, then the request fails. + google.protobuf.Timestamp departure_time = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether to calculate alternate routes in addition to the route. + bool compute_alternative_routes = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of conditions to satisfy that affect the way routes are + // calculated. + RouteModifiers route_modifiers = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + // [Language Support](https://developers.google.com/maps/faq#languagesupport) + // for the list of supported languages. When you don't provide this value, the + // display language is inferred from the location of the route request. + string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the units of measure for the display fields. This + // includes the `instruction` field in `NavigationInstruction`. The units of + // measure used for the route, leg, step distance, and duration are not + // affected by this value. If you don't provide this value, then the display + // units are inferred from the location of the request. + Units units = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeRoutes the response message. +message ComputeRoutesResponse { + // Contains an array of computed routes (up to three) when you specify + // compute_alternatives_routes, and contains just one route when you don't. + // When this array contains multiple entries, the first one is the most + // recommended route. If the array is empty, then it means no route could be + // found. + repeated Route routes = 1; + + // In some cases when the server is not able to compute the route results with + // all of the input preferences, it may fallback to using a different way of + // computation. When fallback mode is used, this field contains detailed info + // about the fallback response. Otherwise this field is unset. + FallbackInfo fallback_info = 2; +} + +// ComputeRouteMatrix request message +message ComputeRouteMatrixRequest { + // Required. Array of origins, which determines the rows of the response matrix. + // Several size restrictions apply to the cardinality of origins and + // destinations: + // + // * The number of elements (origins × destinations) must be no greater than + // 625 in any case. + // * The number of elements (origins × destinations) must be no greater than + // 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + // * The number of waypoints (origins + destinations) specified as `place_id` + // must be no greater than 50. + repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Array of destinations, which determines the columns of the response matrix. + repeated RouteMatrixDestination destinations = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the mode of transportation. + RouteTravelMode travel_mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the route. The server attempts to use the selected + // routing preference to compute the route. If the routing preference results + // in an error or an extra long latency, an error is returned. In the future, + // we might implement a fallback mechanism to use a different option when the + // preferred option does not give a valid result. You can specify this option + // only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the + // request fails. + RoutingPreference routing_preference = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The departure time. If you don't set this value, this defaults to the time + // that you made the request. If you set this value to a time that has already + // occurred, the request fails. + google.protobuf.Timestamp departure_time = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A single origin for ComputeRouteMatrixRequest +message RouteMatrixOrigin { + // Required. Origin waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Modifiers for every route that takes this as the origin + RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A single destination for ComputeRouteMatrixRequest +message RouteMatrixDestination { + // Required. Destination waypoint + Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Encapsulates route information computed for an origin/destination pair in the +// ComputeRouteMatrix API. This proto can be streamed to the client. +message RouteMatrixElement { + // Zero-based index of the origin in the request. + optional int32 origin_index = 1; + + // Zero-based index of the destination in the request. + optional int32 destination_index = 2; + + // Error status code for this element. + google.rpc.Status status = 3; + + // Indicates whether the route was found or not. Independent of status. + RouteMatrixElementCondition condition = 9; + + // The travel distance of the route, in meters. + int32 distance_meters = 4; + + // The length of time needed to navigate the route. If you set the + // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as + // `static_duration`. If you set the `routing_preference` to either + // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated + // taking traffic conditions into account. + google.protobuf.Duration duration = 5; + + // The duration of traveling through the route without taking traffic + // conditions into consideration. + google.protobuf.Duration static_duration = 6; + + // Additional information about the route. For example: restriction + // information and toll information + RouteTravelAdvisory travel_advisory = 7; + + // In some cases when the server is not able to compute the route with the + // given preferences for this particular origin/destination pair, it may + // fall back to using a different mode of computation. When fallback mode is + // used, this field contains detailed information about the fallback response. + // Otherwise this field is unset. + FallbackInfo fallback_info = 8; +} + +// The condition of the route being returned. +enum RouteMatrixElementCondition { + // Only used when the `status` of the element is not OK. + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; + + // A route was found, and the corresponding information was filled out for the + // element. + ROUTE_EXISTS = 1; + + // No route could be found. Fields containing route information, such as + // `distance_meters` or `duration`, will not be filled out in the element. + ROUTE_NOT_FOUND = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto new file mode 100644 index 000000000000..0b9108f1fec7 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/routing_preference.proto @@ -0,0 +1,55 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "RoutingPreferenceProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify factors to take into consideration when +// calculating the route. +enum RoutingPreference { + // No routing preference specified. Default to `TRAFFIC_UNAWARE`. + ROUTING_PREFERENCE_UNSPECIFIED = 0; + + // Computes routes without taking live traffic conditions into consideration. + // Suitable when traffic conditions don't matter or are not applicable. + // Using this value produces the lowest latency. + // Note: For `RouteTravelMode` DRIVE and TWO_WHEELER choice of route and + // duration are based on road network and average time-independent traffic + // conditions. Results for a given request may vary over time due to changes + // in the road network, updated average traffic conditions, and the + // distributed nature of the service. Results may also vary between + // nearly-equivalent routes at any time or frequency. + TRAFFIC_UNAWARE = 1; + + // Calculates routes taking live traffic conditions into consideration. + // In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to + // significantly reduce latency. + TRAFFIC_AWARE = 2; + + // Calculates the routes taking live traffic conditions into consideration, + // without applying most performance optimizations. Using this value produces + // the highest latency. + TRAFFIC_AWARE_OPTIMAL = 3; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto new file mode 100644 index 000000000000..6f43f7cc0b8a --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/speed_reading_interval.proto @@ -0,0 +1,57 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "SpeedReadingIntervalProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Traffic density indicator on a contiguous segment of a polyline or path. +// Given a path with points P_0, P_1, ... , P_N (zero-based index), the +// SpeedReadingInterval defines an interval and describes its traffic using the +// following categories. +message SpeedReadingInterval { + // The classification of polyline speed based on traffic data. + enum Speed { + // Default value. This value is unused. + SPEED_UNSPECIFIED = 0; + + // Normal speed, no slowdown is detected. + NORMAL = 1; + + // Slowdown detected, but no traffic jam formed. + SLOW = 2; + + // Traffic jam detected. + TRAFFIC_JAM = 3; + } + + // The starting index of this interval in the polyline. + optional int32 start_polyline_point_index = 1; + + // The ending index of this interval in the polyline. + optional int32 end_polyline_point_index = 2; + + // Traffic speed in this interval. + Speed speed = 3; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto new file mode 100644 index 000000000000..b98a0cbc2b97 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_info.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/type/money.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "TollInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates toll information on a `Route` or on a `RouteLeg`. +message TollInfo { + // The monetary amount of tolls for the corresponding Route or RouteLeg. + // This list contains a money amount for each currency that is expected + // to be charged by the toll stations. Typically this list will contain only + // one item for routes with tolls in one currency. For international trips, + // this list may contain multiple items to reflect tolls in different + // currencies. + repeated google.type.Money estimated_price = 1; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto new file mode 100644 index 000000000000..c46259bdf367 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/toll_passes.proto @@ -0,0 +1,321 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "TollPassesProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// List of toll passes around the world that we support. +enum TollPass { + // Not used. If this value is used, then the request fails. + TOLL_PASS_UNSPECIFIED = 0; + + // Sydney toll pass. See additional details at https://www.myetoll.com.au. + AU_ETOLL_TAG = 82; + + // Sydney toll pass. See additional details at https://www.tollpay.com.au. + AU_EWAY_TAG = 83; + + // Australia-wide toll pass. + // See additional details at https://www.linkt.com.au/. + AU_LINKT = 2; + + // Argentina toll pass. See additional details at https://telepase.com.ar + AR_TELEPASE = 3; + + // Brazil toll pass. See additional details at https://www.autoexpreso.com + BR_AUTO_EXPRESO = 81; + + // Brazil toll pass. See additional details at https://conectcar.com. + BR_CONECTCAR = 7; + + // Brazil toll pass. See additional details at https://movemais.com. + BR_MOVE_MAIS = 8; + + // Brazil toll pass. See additional details at https://pasorapido.gob.do/ + BR_PASSA_RAPIDO = 88; + + // Brazil toll pass. See additional details at https://www.semparar.com.br. + BR_SEM_PARAR = 9; + + // Brazil toll pass. See additional details at https://taggy.com.br. + BR_TAGGY = 10; + + // Brazil toll pass. See additional details at + // https://veloe.com.br/site/onde-usar. + BR_VELOE = 11; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84; + + // Canada to United States border crossing. + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_BLUE_WATER_EDGE_PASS = 18; + + // Ontario, Canada to Michigan, United States border crossing. + CA_US_CONNEXION = 19; + + // Canada to United States border crossing. + CA_US_NEXUS_CARD = 20; + + // Indonesia. + // E-card provided by multiple banks used to pay for tolls. All e-cards + // via banks are charged the same so only one enum value is needed. E.g. + // - Bank Mandiri https://www.bankmandiri.co.id/e-money + // - BCA https://www.bca.co.id/flazz + // - BNI https://www.bni.co.id/id-id/ebanking/tapcash + ID_E_TOLL = 16; + + // India. + IN_FASTAG = 78; + + // India, HP state plate exemption. + IN_LOCAL_HP_PLATE_EXEMPT = 79; + + // Mexico toll pass. + // https://iave.capufe.gob.mx/#/ + MX_IAVE = 90; + + // Mexico + // https://www.pase.com.mx + MX_PASE = 91; + + // Mexico + // https://operadoravial.com/quick-pass/ + MX_QUICKPASS = 93; + + // http://appsh.chihuahua.gob.mx/transparencia/?doc=/ingresos/TelepeajeFormato4.pdf + MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89; + + // Mexico + MX_TAG_IAVE = 12; + + // Mexico toll pass company. One of many operating in Mexico City. See + // additional details at https://www.televia.com.mx. + MX_TAG_TELEVIA = 13; + + // Mexico toll pass company. One of many operating in Mexico City. + // https://www.televia.com.mx + MX_TELEVIA = 92; + + // Mexico toll pass. See additional details at + // https://www.viapass.com.mx/viapass/web_home.aspx. + MX_VIAPASS = 14; + + // AL, USA. + US_AL_FREEDOM_PASS = 21; + + // AK, USA. + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22; + + // CA, USA. + US_CA_FASTRAK = 4; + + // Indicates driver has any FasTrak pass in addition to the DMV issued Clean + // Air Vehicle (CAV) sticker. + // https://www.bayareafastrak.org/en/guide/doINeedFlex.shtml + US_CA_FASTRAK_CAV_STICKER = 86; + + // CO, USA. + US_CO_EXPRESSTOLL = 23; + + // CO, USA. + US_CO_GO_PASS = 24; + + // DE, USA. + US_DE_EZPASSDE = 25; + + // FL, USA. + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65; + + // FL, USA. + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66; + + // FL, USA. + US_FL_EPASS = 67; + + // FL, USA. + US_FL_GIBA_TOLL_PASS = 68; + + // FL, USA. + US_FL_LEEWAY = 69; + + // FL, USA. + US_FL_SUNPASS = 70; + + // FL, USA. + US_FL_SUNPASS_PRO = 71; + + // IL, USA. + US_IL_EZPASSIL = 73; + + // IL, USA. + US_IL_IPASS = 72; + + // IN, USA. + US_IN_EZPASSIN = 26; + + // KS, USA. + US_KS_BESTPASS_HORIZON = 27; + + // KS, USA. + US_KS_KTAG = 28; + + // KS, USA. + US_KS_NATIONALPASS = 29; + + // KS, USA. + US_KS_PREPASS_ELITEPASS = 30; + + // KY, USA. + US_KY_RIVERLINK = 31; + + // LA, USA. + US_LA_GEAUXPASS = 32; + + // LA, USA. + US_LA_TOLL_TAG = 33; + + // MA, USA. + US_MA_EZPASSMA = 6; + + // MD, USA. + US_MD_EZPASSMD = 34; + + // ME, USA. + US_ME_EZPASSME = 35; + + // MI, USA. + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36; + + // MI, USA. + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37; + + // MI, USA. + US_MI_IQ_PROX_CARD = 38; + + // MI, USA. + US_MI_MACKINAC_BRIDGE_MAC_PASS = 39; + + // MI, USA. + US_MI_NEXPRESS_TOLL = 40; + + // MN, USA. + US_MN_EZPASSMN = 41; + + // NC, USA. + US_NC_EZPASSNC = 42; + + // NC, USA. + US_NC_PEACH_PASS = 87; + + // NC, USA. + US_NC_QUICK_PASS = 43; + + // NH, USA. + US_NH_EZPASSNH = 80; + + // NJ, USA. + US_NJ_DOWNBEACH_EXPRESS_PASS = 75; + + // NJ, USA. + US_NJ_EZPASSNJ = 74; + + // NY, USA. + US_NY_EXPRESSPASS = 76; + + // NY, USA. + US_NY_EZPASSNY = 77; + + // OH, USA. + US_OH_EZPASSOH = 44; + + // PA, USA. + US_PA_EZPASSPA = 45; + + // RI, USA. + US_RI_EZPASSRI = 46; + + // SC, USA. + US_SC_PALPASS = 47; + + // TX, USA. + US_TX_BANCPASS = 48; + + // TX, USA. + US_TX_DEL_RIO_PASS = 49; + + // TX, USA. + US_TX_EFAST_PASS = 50; + + // TX, USA. + US_TX_EAGLE_PASS_EXPRESS_CARD = 51; + + // TX, USA. + US_TX_EPTOLL = 52; + + // TX, USA. + US_TX_EZ_CROSS = 53; + + // TX, USA. + US_TX_EZTAG = 54; + + // TX, USA. + US_TX_LAREDO_TRADE_TAG = 55; + + // TX, USA. + US_TX_PLUSPASS = 56; + + // TX, USA. + US_TX_TOLLTAG = 57; + + // TX, USA. + US_TX_TXTAG = 58; + + // TX, USA. + US_TX_XPRESS_CARD = 59; + + // UT, USA. + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60; + + // VA, USA. + US_VA_EZPASSVA = 61; + + // WA, USA. + US_WA_BREEZEBY = 17; + + // WA, USA. + US_WA_GOOD_TO_GO = 1; + + // WV, USA. + US_WV_EZPASSWV = 62; + + // WV, USA. + US_WV_MEMORIAL_BRIDGE_TICKETS = 63; + + // WV, USA. + US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto new file mode 100644 index 000000000000..32424046a0cf --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/units.proto @@ -0,0 +1,40 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "UnitsProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values that specify the unit of measure used in the display. +enum Units { + // Units of measure not specified. Defaults to the unit of measure inferred + // from the request. + UNITS_UNSPECIFIED = 0; + + // Metric units of measure. + METRIC = 1; + + // Imperial (English) units of measure. + IMPERIAL = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto new file mode 100644 index 000000000000..d372986e6c8f --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto @@ -0,0 +1,43 @@ +// Copyright 2022 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.maps.routing.v2; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "VehicleEmissionTypeProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// A set of values describing the vehicle's emission type. +// Applies only to the DRIVE travel mode. +enum VehicleEmissionType { + // No emission type specified. Default to GASOLINE. + VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0; + + // Gasoline/petrol fueled vehicle. + GASOLINE = 1; + + // Electricity powered vehicle. + ELECTRIC = 2; + + // Hybrid fuel (such as gasoline + electric) vehicle. + HYBRID = 3; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto new file mode 100644 index 000000000000..1393fbde9e57 --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_info.proto @@ -0,0 +1,37 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/maps/routing/v2/vehicle_emission_type.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "VehicleInfoProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates the vehicle information, such as the license plate last +// character. +message VehicleInfo { + // Describes the vehicle's emission type. + // Applies only to the DRIVE travel mode. + VehicleEmissionType emission_type = 2; +} diff --git a/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto new file mode 100644 index 000000000000..a97b043c1f0f --- /dev/null +++ b/packages/google-maps-routing/protos/google/maps/routing/v2/waypoint.proto @@ -0,0 +1,71 @@ +// Copyright 2022 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.maps.routing.v2; + +import "google/maps/routing/v2/location.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Routing.V2"; +option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing"; +option java_multiple_files = true; +option java_outer_classname = "WaypointProto"; +option java_package = "com.google.maps.routing.v2"; +option objc_class_prefix = "GMRV2"; +option php_namespace = "Google\\Maps\\Routing\\V2"; +option ruby_package = "Google::Maps::Routing::V2"; + +// Encapsulates a waypoint. Waypoints mark both the beginning and end of a +// route, and include intermediate stops along the route. +message Waypoint { + // Different ways to represent a location. + oneof location_type { + // A point specified using geographic coordinates, including an optional + // heading. + Location location = 1; + + // The POI Place ID associated with the waypoint. + string place_id = 2; + } + + // Marks this waypoint as a milestone rather a stopping point. For + // each non-via waypoint in the request, the response appends an entry to the + // `legs` array to provide the details for stopovers on that leg of the + // trip. Set this value to true when you want the route to pass through this + // waypoint without stopping over. Via waypoints don't cause an entry to be + // added to the `legs` array, but they do route the journey through the + // waypoint. You can only set this value on waypoints that are intermediates. + // The request fails if you set this field on terminal waypoints. + // If `ComputeRoutesRequest.optimize_waypoint_order` + // is set to true then this field cannot be set to + // true; otherwise, the request fails. + bool via = 3; + + // Indicates that the waypoint is meant for vehicles to stop at, where the + // intention is to either pickup or drop-off. When you set this value, the + // calculated route won't include non-`via` waypoints on roads that are + // unsuitable for pickup and drop-off. This option works only for `DRIVE` and + // `TWO_WHEELER` travel modes, and when the `location_type` is `location`. + bool vehicle_stopover = 4; + + // Indicates that the location of this waypoint is meant to have a preference + // for the vehicle to stop at a particular side of road. When you set this + // value, the route will pass through the location so that the vehicle can + // stop at the side of road that the location is biased towards from the + // center of the road. This option works only for 'DRIVE' and 'TWO_WHEELER' + // travel modes. + bool side_of_road = 5; +} diff --git a/packages/google-maps-routing/protos/protos.d.ts b/packages/google-maps-routing/protos/protos.d.ts new file mode 100644 index 000000000000..3395d64cfb98 --- /dev/null +++ b/packages/google-maps-routing/protos/protos.d.ts @@ -0,0 +1,8392 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** 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 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 phpGenericServices. */ + public phpGenericServices: 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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|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 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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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 Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace geo. */ + namespace geo { + + /** Namespace type. */ + namespace type { + + /** Properties of a Viewport. */ + interface IViewport { + + /** Viewport low */ + low?: (google.type.ILatLng|null); + + /** Viewport high */ + high?: (google.type.ILatLng|null); + } + + /** Represents a Viewport. */ + class Viewport implements IViewport { + + /** + * Constructs a new Viewport. + * @param [properties] Properties to set + */ + constructor(properties?: google.geo.type.IViewport); + + /** Viewport low. */ + public low?: (google.type.ILatLng|null); + + /** Viewport high. */ + public high?: (google.type.ILatLng|null); + + /** + * Creates a new Viewport instance using the specified properties. + * @param [properties] Properties to set + * @returns Viewport instance + */ + public static create(properties?: google.geo.type.IViewport): google.geo.type.Viewport; + + /** + * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @param message Viewport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @param message Viewport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.geo.type.IViewport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Viewport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.geo.type.Viewport; + + /** + * Decodes a Viewport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.geo.type.Viewport; + + /** + * Verifies a Viewport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Viewport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Viewport + */ + public static fromObject(object: { [k: string]: any }): google.geo.type.Viewport; + + /** + * Creates a plain object from a Viewport message. Also converts values to other types if specified. + * @param message Viewport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.geo.type.Viewport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Viewport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Viewport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace maps. */ + namespace maps { + + /** Namespace routing. */ + namespace routing { + + /** Namespace v2. */ + namespace v2 { + + /** Properties of a FallbackInfo. */ + interface IFallbackInfo { + + /** FallbackInfo routingMode */ + routingMode?: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode|null); + + /** FallbackInfo reason */ + reason?: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason|null); + } + + /** Represents a FallbackInfo. */ + class FallbackInfo implements IFallbackInfo { + + /** + * Constructs a new FallbackInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IFallbackInfo); + + /** FallbackInfo routingMode. */ + public routingMode: (google.maps.routing.v2.FallbackRoutingMode|keyof typeof google.maps.routing.v2.FallbackRoutingMode); + + /** FallbackInfo reason. */ + public reason: (google.maps.routing.v2.FallbackReason|keyof typeof google.maps.routing.v2.FallbackReason); + + /** + * Creates a new FallbackInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FallbackInfo instance + */ + public static create(properties?: google.maps.routing.v2.IFallbackInfo): google.maps.routing.v2.FallbackInfo; + + /** + * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @param message FallbackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @param message FallbackInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IFallbackInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.FallbackInfo; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.FallbackInfo; + + /** + * Verifies a FallbackInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FallbackInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.FallbackInfo; + + /** + * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. + * @param message FallbackInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.FallbackInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FallbackInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FallbackInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FallbackReason enum. */ + enum FallbackReason { + FALLBACK_REASON_UNSPECIFIED = 0, + SERVER_ERROR = 1, + LATENCY_EXCEEDED = 2 + } + + /** FallbackRoutingMode enum. */ + enum FallbackRoutingMode { + FALLBACK_ROUTING_MODE_UNSPECIFIED = 0, + FALLBACK_TRAFFIC_UNAWARE = 1, + FALLBACK_TRAFFIC_AWARE = 2 + } + + /** Properties of a Location. */ + interface ILocation { + + /** Location latLng */ + latLng?: (google.type.ILatLng|null); + + /** Location heading */ + heading?: (google.protobuf.IInt32Value|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ILocation); + + /** Location latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** Location heading. */ + public heading?: (google.protobuf.IInt32Value|null); + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.maps.routing.v2.ILocation): google.maps.routing.v2.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.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.maps.routing.v2.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.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.maps.routing.v2.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.maps.routing.v2.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.maps.routing.v2.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.maps.routing.v2.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.maps.routing.v2.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; + } + + /** Maneuver enum. */ + enum Maneuver { + MANEUVER_UNSPECIFIED = 0, + TURN_SLIGHT_LEFT = 1, + TURN_SHARP_LEFT = 2, + UTURN_LEFT = 3, + TURN_LEFT = 4, + TURN_SLIGHT_RIGHT = 5, + TURN_SHARP_RIGHT = 6, + UTURN_RIGHT = 7, + TURN_RIGHT = 8, + STRAIGHT = 9, + RAMP_LEFT = 10, + RAMP_RIGHT = 11, + MERGE = 12, + FORK_LEFT = 13, + FORK_RIGHT = 14, + FERRY = 15, + FERRY_TRAIN = 16, + ROUNDABOUT_LEFT = 17, + ROUNDABOUT_RIGHT = 18 + } + + /** Properties of a NavigationInstruction. */ + interface INavigationInstruction { + + /** NavigationInstruction maneuver */ + maneuver?: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver|null); + + /** NavigationInstruction instructions */ + instructions?: (string|null); + } + + /** Represents a NavigationInstruction. */ + class NavigationInstruction implements INavigationInstruction { + + /** + * Constructs a new NavigationInstruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.INavigationInstruction); + + /** NavigationInstruction maneuver. */ + public maneuver: (google.maps.routing.v2.Maneuver|keyof typeof google.maps.routing.v2.Maneuver); + + /** NavigationInstruction instructions. */ + public instructions: string; + + /** + * Creates a new NavigationInstruction instance using the specified properties. + * @param [properties] Properties to set + * @returns NavigationInstruction instance + */ + public static create(properties?: google.maps.routing.v2.INavigationInstruction): google.maps.routing.v2.NavigationInstruction; + + /** + * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @param message NavigationInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @param message NavigationInstruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.INavigationInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.NavigationInstruction; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.NavigationInstruction; + + /** + * Verifies a NavigationInstruction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NavigationInstruction + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.NavigationInstruction; + + /** + * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. + * @param message NavigationInstruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.NavigationInstruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NavigationInstruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NavigationInstruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Polyline. */ + interface IPolyline { + + /** Polyline encodedPolyline */ + encodedPolyline?: (string|null); + + /** Polyline geoJsonLinestring */ + geoJsonLinestring?: (google.protobuf.IStruct|null); + } + + /** Represents a Polyline. */ + class Polyline implements IPolyline { + + /** + * Constructs a new Polyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IPolyline); + + /** Polyline encodedPolyline. */ + public encodedPolyline?: (string|null); + + /** Polyline geoJsonLinestring. */ + public geoJsonLinestring?: (google.protobuf.IStruct|null); + + /** Polyline polylineType. */ + public polylineType?: ("encodedPolyline"|"geoJsonLinestring"); + + /** + * Creates a new Polyline instance using the specified properties. + * @param [properties] Properties to set + * @returns Polyline instance + */ + public static create(properties?: google.maps.routing.v2.IPolyline): google.maps.routing.v2.Polyline; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.Polyline; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.Polyline; + + /** + * Verifies a Polyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Polyline + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Polyline; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @param message Polyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Polyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Polyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Polyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PolylineQuality enum. */ + enum PolylineQuality { + POLYLINE_QUALITY_UNSPECIFIED = 0, + HIGH_QUALITY = 1, + OVERVIEW = 2 + } + + /** PolylineEncoding enum. */ + enum PolylineEncoding { + POLYLINE_ENCODING_UNSPECIFIED = 0, + ENCODED_POLYLINE = 1, + GEO_JSON_LINESTRING = 2 + } + + /** Properties of a Route. */ + interface IRoute { + + /** Route legs */ + legs?: (google.maps.routing.v2.IRouteLeg[]|null); + + /** Route distanceMeters */ + distanceMeters?: (number|null); + + /** Route duration */ + duration?: (google.protobuf.IDuration|null); + + /** Route staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** Route polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** Route description */ + description?: (string|null); + + /** Route warnings */ + warnings?: (string[]|null); + + /** Route viewport */ + viewport?: (google.geo.type.IViewport|null); + + /** Route travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + } + + /** Represents a Route. */ + class Route implements IRoute { + + /** + * Constructs a new Route. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRoute); + + /** Route legs. */ + public legs: google.maps.routing.v2.IRouteLeg[]; + + /** Route distanceMeters. */ + public distanceMeters: number; + + /** Route duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Route staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** Route polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** Route description. */ + public description: string; + + /** Route warnings. */ + public warnings: string[]; + + /** Route viewport. */ + public viewport?: (google.geo.type.IViewport|null); + + /** Route travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** + * Creates a new Route instance using the specified properties. + * @param [properties] Properties to set + * @returns Route instance + */ + public static create(properties?: google.maps.routing.v2.IRoute): google.maps.routing.v2.Route; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @param message Route message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @param message Route message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Route message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.Route; + + /** + * Decodes a Route message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.Route; + + /** + * Verifies a Route message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Route + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Route; + + /** + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @param message Route + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Route, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Route to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Route + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteTravelAdvisory. */ + interface IRouteTravelAdvisory { + + /** RouteTravelAdvisory tollInfo */ + tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + } + + /** Represents a RouteTravelAdvisory. */ + class RouteTravelAdvisory implements IRouteTravelAdvisory { + + /** + * Constructs a new RouteTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteTravelAdvisory); + + /** RouteTravelAdvisory tollInfo. */ + public tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** + * Creates a new RouteTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteTravelAdvisory): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @param message RouteTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @param message RouteTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Verifies a RouteTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteTravelAdvisory; + + /** + * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLegTravelAdvisory. */ + interface IRouteLegTravelAdvisory { + + /** RouteLegTravelAdvisory tollInfo */ + tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteLegTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + } + + /** Represents a RouteLegTravelAdvisory. */ + class RouteLegTravelAdvisory implements IRouteLegTravelAdvisory { + + /** + * Constructs a new RouteLegTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory); + + /** RouteLegTravelAdvisory tollInfo. */ + public tollInfo?: (google.maps.routing.v2.ITollInfo|null); + + /** RouteLegTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** + * Creates a new RouteLegTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegTravelAdvisory): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @param message RouteLegTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @param message RouteLegTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Verifies a RouteLegTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegTravelAdvisory; + + /** + * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteLegTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLegStepTravelAdvisory. */ + interface IRouteLegStepTravelAdvisory { + + /** RouteLegStepTravelAdvisory speedReadingIntervals */ + speedReadingIntervals?: (google.maps.routing.v2.ISpeedReadingInterval[]|null); + } + + /** Represents a RouteLegStepTravelAdvisory. */ + class RouteLegStepTravelAdvisory implements IRouteLegStepTravelAdvisory { + + /** + * Constructs a new RouteLegStepTravelAdvisory. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory); + + /** RouteLegStepTravelAdvisory speedReadingIntervals. */ + public speedReadingIntervals: google.maps.routing.v2.ISpeedReadingInterval[]; + + /** + * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStepTravelAdvisory instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegStepTravelAdvisory): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @param message RouteLegStepTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @param message RouteLegStepTravelAdvisory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStepTravelAdvisory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Verifies a RouteLegStepTravelAdvisory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStepTravelAdvisory + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStepTravelAdvisory; + + /** + * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. + * @param message RouteLegStepTravelAdvisory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStepTravelAdvisory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStepTravelAdvisory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStepTravelAdvisory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLeg. */ + interface IRouteLeg { + + /** RouteLeg distanceMeters */ + distanceMeters?: (number|null); + + /** RouteLeg duration */ + duration?: (google.protobuf.IDuration|null); + + /** RouteLeg staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLeg polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLeg startLocation */ + startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg endLocation */ + endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg steps */ + steps?: (google.maps.routing.v2.IRouteLegStep[]|null); + + /** RouteLeg travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); + } + + /** Represents a RouteLeg. */ + class RouteLeg implements IRouteLeg { + + /** + * Constructs a new RouteLeg. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLeg); + + /** RouteLeg distanceMeters. */ + public distanceMeters: number; + + /** RouteLeg duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** RouteLeg staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLeg polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLeg startLocation. */ + public startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg endLocation. */ + public endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLeg steps. */ + public steps: google.maps.routing.v2.IRouteLegStep[]; + + /** RouteLeg travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteLegTravelAdvisory|null); + + /** + * Creates a new RouteLeg instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLeg instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLeg): google.maps.routing.v2.RouteLeg; + + /** + * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @param message RouteLeg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @param message RouteLeg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLeg message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteLeg; + + /** + * Decodes a RouteLeg message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteLeg; + + /** + * Verifies a RouteLeg message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLeg + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLeg; + + /** + * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. + * @param message RouteLeg + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLeg, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLeg to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLeg + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteLegStep. */ + interface IRouteLegStep { + + /** RouteLegStep distanceMeters */ + distanceMeters?: (number|null); + + /** RouteLegStep staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLegStep polyline */ + polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLegStep startLocation */ + startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep endLocation */ + endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep navigationInstruction */ + navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** RouteLegStep travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); + } + + /** Represents a RouteLegStep. */ + class RouteLegStep implements IRouteLegStep { + + /** + * Constructs a new RouteLegStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteLegStep); + + /** RouteLegStep distanceMeters. */ + public distanceMeters: number; + + /** RouteLegStep staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteLegStep polyline. */ + public polyline?: (google.maps.routing.v2.IPolyline|null); + + /** RouteLegStep startLocation. */ + public startLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep endLocation. */ + public endLocation?: (google.maps.routing.v2.ILocation|null); + + /** RouteLegStep navigationInstruction. */ + public navigationInstruction?: (google.maps.routing.v2.INavigationInstruction|null); + + /** RouteLegStep travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteLegStepTravelAdvisory|null); + + /** + * Creates a new RouteLegStep instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteLegStep instance + */ + public static create(properties?: google.maps.routing.v2.IRouteLegStep): google.maps.routing.v2.RouteLegStep; + + /** + * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @param message RouteLegStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @param message RouteLegStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteLegStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteLegStep; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteLegStep; + + /** + * Verifies a RouteLegStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteLegStep + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteLegStep; + + /** + * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. + * @param message RouteLegStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteLegStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteLegStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteLegStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeedReadingInterval. */ + interface ISpeedReadingInterval { + + /** SpeedReadingInterval startPolylinePointIndex */ + startPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval endPolylinePointIndex */ + endPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval speed */ + speed?: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed|null); + } + + /** Represents a SpeedReadingInterval. */ + class SpeedReadingInterval implements ISpeedReadingInterval { + + /** + * Constructs a new SpeedReadingInterval. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ISpeedReadingInterval); + + /** SpeedReadingInterval startPolylinePointIndex. */ + public startPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval endPolylinePointIndex. */ + public endPolylinePointIndex?: (number|null); + + /** SpeedReadingInterval speed. */ + public speed: (google.maps.routing.v2.SpeedReadingInterval.Speed|keyof typeof google.maps.routing.v2.SpeedReadingInterval.Speed); + + /** SpeedReadingInterval _startPolylinePointIndex. */ + public _startPolylinePointIndex?: "startPolylinePointIndex"; + + /** SpeedReadingInterval _endPolylinePointIndex. */ + public _endPolylinePointIndex?: "endPolylinePointIndex"; + + /** + * Creates a new SpeedReadingInterval instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeedReadingInterval instance + */ + public static create(properties?: google.maps.routing.v2.ISpeedReadingInterval): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @param message SpeedReadingInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @param message SpeedReadingInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ISpeedReadingInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Verifies a SpeedReadingInterval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeedReadingInterval + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.SpeedReadingInterval; + + /** + * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. + * @param message SpeedReadingInterval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.SpeedReadingInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeedReadingInterval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeedReadingInterval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpeedReadingInterval { + + /** Speed enum. */ + enum Speed { + SPEED_UNSPECIFIED = 0, + NORMAL = 1, + SLOW = 2, + TRAFFIC_JAM = 3 + } + } + + /** Properties of a TollInfo. */ + interface ITollInfo { + + /** TollInfo estimatedPrice */ + estimatedPrice?: (google.type.IMoney[]|null); + } + + /** Represents a TollInfo. */ + class TollInfo implements ITollInfo { + + /** + * Constructs a new TollInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.ITollInfo); + + /** TollInfo estimatedPrice. */ + public estimatedPrice: google.type.IMoney[]; + + /** + * Creates a new TollInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TollInfo instance + */ + public static create(properties?: google.maps.routing.v2.ITollInfo): google.maps.routing.v2.TollInfo; + + /** + * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @param message TollInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @param message TollInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.ITollInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TollInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.TollInfo; + + /** + * Decodes a TollInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.TollInfo; + + /** + * Verifies a TollInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TollInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.TollInfo; + + /** + * Creates a plain object from a TollInfo message. Also converts values to other types if specified. + * @param message TollInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.TollInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TollInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TollInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteModifiers. */ + interface IRouteModifiers { + + /** RouteModifiers avoidTolls */ + avoidTolls?: (boolean|null); + + /** RouteModifiers avoidHighways */ + avoidHighways?: (boolean|null); + + /** RouteModifiers avoidFerries */ + avoidFerries?: (boolean|null); + + /** RouteModifiers avoidIndoor */ + avoidIndoor?: (boolean|null); + + /** RouteModifiers vehicleInfo */ + vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); + + /** RouteModifiers tollPasses */ + tollPasses?: (google.maps.routing.v2.TollPass[]|null); + } + + /** Represents a RouteModifiers. */ + class RouteModifiers implements IRouteModifiers { + + /** + * Constructs a new RouteModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteModifiers); + + /** RouteModifiers avoidTolls. */ + public avoidTolls: boolean; + + /** RouteModifiers avoidHighways. */ + public avoidHighways: boolean; + + /** RouteModifiers avoidFerries. */ + public avoidFerries: boolean; + + /** RouteModifiers avoidIndoor. */ + public avoidIndoor: boolean; + + /** RouteModifiers vehicleInfo. */ + public vehicleInfo?: (google.maps.routing.v2.IVehicleInfo|null); + + /** RouteModifiers tollPasses. */ + public tollPasses: google.maps.routing.v2.TollPass[]; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteModifiers instance + */ + public static create(properties?: google.maps.routing.v2.IRouteModifiers): google.maps.routing.v2.RouteModifiers; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteModifiers; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteModifiers; + + /** + * Verifies a RouteModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteModifiers + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteModifiers; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @param message RouteModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteModifiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteModifiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TollPass enum. */ + enum TollPass { + TOLL_PASS_UNSPECIFIED = 0, + AU_ETOLL_TAG = 82, + AU_EWAY_TAG = 83, + AU_LINKT = 2, + AR_TELEPASE = 3, + BR_AUTO_EXPRESO = 81, + BR_CONECTCAR = 7, + BR_MOVE_MAIS = 8, + BR_PASSA_RAPIDO = 88, + BR_SEM_PARAR = 9, + BR_TAGGY = 10, + BR_VELOE = 11, + CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD = 84, + CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD = 85, + CA_US_BLUE_WATER_EDGE_PASS = 18, + CA_US_CONNEXION = 19, + CA_US_NEXUS_CARD = 20, + ID_E_TOLL = 16, + IN_FASTAG = 78, + IN_LOCAL_HP_PLATE_EXEMPT = 79, + MX_IAVE = 90, + MX_PASE = 91, + MX_QUICKPASS = 93, + MX_SISTEMA_TELEPEAJE_CHIHUAHUA = 89, + MX_TAG_IAVE = 12, + MX_TAG_TELEVIA = 13, + MX_TELEVIA = 92, + MX_VIAPASS = 14, + US_AL_FREEDOM_PASS = 21, + US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS = 22, + US_CA_FASTRAK = 4, + US_CA_FASTRAK_CAV_STICKER = 86, + US_CO_EXPRESSTOLL = 23, + US_CO_GO_PASS = 24, + US_DE_EZPASSDE = 25, + US_FL_BOB_SIKES_TOLL_BRIDGE_PASS = 65, + US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD = 66, + US_FL_EPASS = 67, + US_FL_GIBA_TOLL_PASS = 68, + US_FL_LEEWAY = 69, + US_FL_SUNPASS = 70, + US_FL_SUNPASS_PRO = 71, + US_IL_EZPASSIL = 73, + US_IL_IPASS = 72, + US_IN_EZPASSIN = 26, + US_KS_BESTPASS_HORIZON = 27, + US_KS_KTAG = 28, + US_KS_NATIONALPASS = 29, + US_KS_PREPASS_ELITEPASS = 30, + US_KY_RIVERLINK = 31, + US_LA_GEAUXPASS = 32, + US_LA_TOLL_TAG = 33, + US_MA_EZPASSMA = 6, + US_MD_EZPASSMD = 34, + US_ME_EZPASSME = 35, + US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD = 36, + US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37, + US_MI_IQ_PROX_CARD = 38, + US_MI_MACKINAC_BRIDGE_MAC_PASS = 39, + US_MI_NEXPRESS_TOLL = 40, + US_MN_EZPASSMN = 41, + US_NC_EZPASSNC = 42, + US_NC_PEACH_PASS = 87, + US_NC_QUICK_PASS = 43, + US_NH_EZPASSNH = 80, + US_NJ_DOWNBEACH_EXPRESS_PASS = 75, + US_NJ_EZPASSNJ = 74, + US_NY_EXPRESSPASS = 76, + US_NY_EZPASSNY = 77, + US_OH_EZPASSOH = 44, + US_PA_EZPASSPA = 45, + US_RI_EZPASSRI = 46, + US_SC_PALPASS = 47, + US_TX_BANCPASS = 48, + US_TX_DEL_RIO_PASS = 49, + US_TX_EFAST_PASS = 50, + US_TX_EAGLE_PASS_EXPRESS_CARD = 51, + US_TX_EPTOLL = 52, + US_TX_EZ_CROSS = 53, + US_TX_EZTAG = 54, + US_TX_LAREDO_TRADE_TAG = 55, + US_TX_PLUSPASS = 56, + US_TX_TOLLTAG = 57, + US_TX_TXTAG = 58, + US_TX_XPRESS_CARD = 59, + US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD = 60, + US_VA_EZPASSVA = 61, + US_WA_BREEZEBY = 17, + US_WA_GOOD_TO_GO = 1, + US_WV_EZPASSWV = 62, + US_WV_MEMORIAL_BRIDGE_TICKETS = 63, + US_WV_NEWELL_TOLL_BRIDGE_TICKET = 64 + } + + /** Properties of a VehicleInfo. */ + interface IVehicleInfo { + + /** VehicleInfo emissionType */ + emissionType?: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType|null); + } + + /** Represents a VehicleInfo. */ + class VehicleInfo implements IVehicleInfo { + + /** + * Constructs a new VehicleInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IVehicleInfo); + + /** VehicleInfo emissionType. */ + public emissionType: (google.maps.routing.v2.VehicleEmissionType|keyof typeof google.maps.routing.v2.VehicleEmissionType); + + /** + * Creates a new VehicleInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns VehicleInfo instance + */ + public static create(properties?: google.maps.routing.v2.IVehicleInfo): google.maps.routing.v2.VehicleInfo; + + /** + * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @param message VehicleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @param message VehicleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IVehicleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.VehicleInfo; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.VehicleInfo; + + /** + * Verifies a VehicleInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VehicleInfo + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.VehicleInfo; + + /** + * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. + * @param message VehicleInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.VehicleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VehicleInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VehicleInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VehicleEmissionType enum. */ + enum VehicleEmissionType { + VEHICLE_EMISSION_TYPE_UNSPECIFIED = 0, + GASOLINE = 1, + ELECTRIC = 2, + HYBRID = 3 + } + + /** RouteTravelMode enum. */ + enum RouteTravelMode { + TRAVEL_MODE_UNSPECIFIED = 0, + DRIVE = 1, + BICYCLE = 2, + WALK = 3, + TWO_WHEELER = 4 + } + + /** Represents a Routes */ + class Routes extends $protobuf.rpc.Service { + + /** + * Constructs a new Routes 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 Routes 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): Routes; + + /** + * Calls ComputeRoutes. + * @param request ComputeRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ComputeRoutesResponse + */ + public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest, callback: google.maps.routing.v2.Routes.ComputeRoutesCallback): void; + + /** + * Calls ComputeRoutes. + * @param request ComputeRoutesRequest message or plain object + * @returns Promise + */ + public computeRoutes(request: google.maps.routing.v2.IComputeRoutesRequest): Promise; + + /** + * Calls ComputeRouteMatrix. + * @param request ComputeRouteMatrixRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouteMatrixElement + */ + public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest, callback: google.maps.routing.v2.Routes.ComputeRouteMatrixCallback): void; + + /** + * Calls ComputeRouteMatrix. + * @param request ComputeRouteMatrixRequest message or plain object + * @returns Promise + */ + public computeRouteMatrix(request: google.maps.routing.v2.IComputeRouteMatrixRequest): Promise; + } + + namespace Routes { + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. + * @param error Error, if any + * @param [response] ComputeRoutesResponse + */ + type ComputeRoutesCallback = (error: (Error|null), response?: google.maps.routing.v2.ComputeRoutesResponse) => void; + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. + * @param error Error, if any + * @param [response] RouteMatrixElement + */ + type ComputeRouteMatrixCallback = (error: (Error|null), response?: google.maps.routing.v2.RouteMatrixElement) => void; + } + + /** Properties of a ComputeRoutesRequest. */ + interface IComputeRoutesRequest { + + /** ComputeRoutesRequest origin */ + origin?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest destination */ + destination?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest intermediates */ + intermediates?: (google.maps.routing.v2.IWaypoint[]|null); + + /** ComputeRoutesRequest travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + + /** ComputeRoutesRequest routingPreference */ + routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); + + /** ComputeRoutesRequest polylineQuality */ + polylineQuality?: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality|null); + + /** ComputeRoutesRequest polylineEncoding */ + polylineEncoding?: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding|null); + + /** ComputeRoutesRequest departureTime */ + departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest computeAlternativeRoutes */ + computeAlternativeRoutes?: (boolean|null); + + /** ComputeRoutesRequest routeModifiers */ + routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** ComputeRoutesRequest languageCode */ + languageCode?: (string|null); + + /** ComputeRoutesRequest units */ + units?: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units|null); + } + + /** Represents a ComputeRoutesRequest. */ + class ComputeRoutesRequest implements IComputeRoutesRequest { + + /** + * Constructs a new ComputeRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRoutesRequest); + + /** ComputeRoutesRequest origin. */ + public origin?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest destination. */ + public destination?: (google.maps.routing.v2.IWaypoint|null); + + /** ComputeRoutesRequest intermediates. */ + public intermediates: google.maps.routing.v2.IWaypoint[]; + + /** ComputeRoutesRequest travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** ComputeRoutesRequest routingPreference. */ + public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); + + /** ComputeRoutesRequest polylineQuality. */ + public polylineQuality: (google.maps.routing.v2.PolylineQuality|keyof typeof google.maps.routing.v2.PolylineQuality); + + /** ComputeRoutesRequest polylineEncoding. */ + public polylineEncoding: (google.maps.routing.v2.PolylineEncoding|keyof typeof google.maps.routing.v2.PolylineEncoding); + + /** ComputeRoutesRequest departureTime. */ + public departureTime?: (google.protobuf.ITimestamp|null); + + /** ComputeRoutesRequest computeAlternativeRoutes. */ + public computeAlternativeRoutes: boolean; + + /** ComputeRoutesRequest routeModifiers. */ + public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** ComputeRoutesRequest languageCode. */ + public languageCode: string; + + /** ComputeRoutesRequest units. */ + public units: (google.maps.routing.v2.Units|keyof typeof google.maps.routing.v2.Units); + + /** + * Creates a new ComputeRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRoutesRequest instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRoutesRequest): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @param message ComputeRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @param message ComputeRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Verifies a ComputeRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesRequest; + + /** + * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. + * @param message ComputeRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeRoutesResponse. */ + interface IComputeRoutesResponse { + + /** ComputeRoutesResponse routes */ + routes?: (google.maps.routing.v2.IRoute[]|null); + + /** ComputeRoutesResponse fallbackInfo */ + fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + } + + /** Represents a ComputeRoutesResponse. */ + class ComputeRoutesResponse implements IComputeRoutesResponse { + + /** + * Constructs a new ComputeRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRoutesResponse); + + /** ComputeRoutesResponse routes. */ + public routes: google.maps.routing.v2.IRoute[]; + + /** ComputeRoutesResponse fallbackInfo. */ + public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** + * Creates a new ComputeRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRoutesResponse instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRoutesResponse): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @param message ComputeRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @param message ComputeRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Verifies a ComputeRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRoutesResponse; + + /** + * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. + * @param message ComputeRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeRouteMatrixRequest. */ + interface IComputeRouteMatrixRequest { + + /** ComputeRouteMatrixRequest origins */ + origins?: (google.maps.routing.v2.IRouteMatrixOrigin[]|null); + + /** ComputeRouteMatrixRequest destinations */ + destinations?: (google.maps.routing.v2.IRouteMatrixDestination[]|null); + + /** ComputeRouteMatrixRequest travelMode */ + travelMode?: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode|null); + + /** ComputeRouteMatrixRequest routingPreference */ + routingPreference?: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference|null); + + /** ComputeRouteMatrixRequest departureTime */ + departureTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ComputeRouteMatrixRequest. */ + class ComputeRouteMatrixRequest implements IComputeRouteMatrixRequest { + + /** + * Constructs a new ComputeRouteMatrixRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest); + + /** ComputeRouteMatrixRequest origins. */ + public origins: google.maps.routing.v2.IRouteMatrixOrigin[]; + + /** ComputeRouteMatrixRequest destinations. */ + public destinations: google.maps.routing.v2.IRouteMatrixDestination[]; + + /** ComputeRouteMatrixRequest travelMode. */ + public travelMode: (google.maps.routing.v2.RouteTravelMode|keyof typeof google.maps.routing.v2.RouteTravelMode); + + /** ComputeRouteMatrixRequest routingPreference. */ + public routingPreference: (google.maps.routing.v2.RoutingPreference|keyof typeof google.maps.routing.v2.RoutingPreference); + + /** ComputeRouteMatrixRequest departureTime. */ + public departureTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ComputeRouteMatrixRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeRouteMatrixRequest instance + */ + public static create(properties?: google.maps.routing.v2.IComputeRouteMatrixRequest): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @param message ComputeRouteMatrixRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @param message ComputeRouteMatrixRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IComputeRouteMatrixRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Verifies a ComputeRouteMatrixRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeRouteMatrixRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.ComputeRouteMatrixRequest; + + /** + * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. + * @param message ComputeRouteMatrixRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.ComputeRouteMatrixRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeRouteMatrixRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeRouteMatrixRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatrixOrigin. */ + interface IRouteMatrixOrigin { + + /** RouteMatrixOrigin waypoint */ + waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** RouteMatrixOrigin routeModifiers */ + routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + } + + /** Represents a RouteMatrixOrigin. */ + class RouteMatrixOrigin implements IRouteMatrixOrigin { + + /** + * Constructs a new RouteMatrixOrigin. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixOrigin); + + /** RouteMatrixOrigin waypoint. */ + public waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** RouteMatrixOrigin routeModifiers. */ + public routeModifiers?: (google.maps.routing.v2.IRouteModifiers|null); + + /** + * Creates a new RouteMatrixOrigin instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixOrigin instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixOrigin): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @param message RouteMatrixOrigin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @param message RouteMatrixOrigin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixOrigin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Verifies a RouteMatrixOrigin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixOrigin + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixOrigin; + + /** + * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. + * @param message RouteMatrixOrigin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixOrigin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixOrigin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixOrigin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatrixDestination. */ + interface IRouteMatrixDestination { + + /** RouteMatrixDestination waypoint */ + waypoint?: (google.maps.routing.v2.IWaypoint|null); + } + + /** Represents a RouteMatrixDestination. */ + class RouteMatrixDestination implements IRouteMatrixDestination { + + /** + * Constructs a new RouteMatrixDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixDestination); + + /** RouteMatrixDestination waypoint. */ + public waypoint?: (google.maps.routing.v2.IWaypoint|null); + + /** + * Creates a new RouteMatrixDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixDestination instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixDestination): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @param message RouteMatrixDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @param message RouteMatrixDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Verifies a RouteMatrixDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixDestination + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixDestination; + + /** + * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. + * @param message RouteMatrixDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatrixElement. */ + interface IRouteMatrixElement { + + /** RouteMatrixElement originIndex */ + originIndex?: (number|null); + + /** RouteMatrixElement destinationIndex */ + destinationIndex?: (number|null); + + /** RouteMatrixElement status */ + status?: (google.rpc.IStatus|null); + + /** RouteMatrixElement condition */ + condition?: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition|null); + + /** RouteMatrixElement distanceMeters */ + distanceMeters?: (number|null); + + /** RouteMatrixElement duration */ + duration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement staticDuration */ + staticDuration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement travelAdvisory */ + travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** RouteMatrixElement fallbackInfo */ + fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + } + + /** Represents a RouteMatrixElement. */ + class RouteMatrixElement implements IRouteMatrixElement { + + /** + * Constructs a new RouteMatrixElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IRouteMatrixElement); + + /** RouteMatrixElement originIndex. */ + public originIndex?: (number|null); + + /** RouteMatrixElement destinationIndex. */ + public destinationIndex?: (number|null); + + /** RouteMatrixElement status. */ + public status?: (google.rpc.IStatus|null); + + /** RouteMatrixElement condition. */ + public condition: (google.maps.routing.v2.RouteMatrixElementCondition|keyof typeof google.maps.routing.v2.RouteMatrixElementCondition); + + /** RouteMatrixElement distanceMeters. */ + public distanceMeters: number; + + /** RouteMatrixElement duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement staticDuration. */ + public staticDuration?: (google.protobuf.IDuration|null); + + /** RouteMatrixElement travelAdvisory. */ + public travelAdvisory?: (google.maps.routing.v2.IRouteTravelAdvisory|null); + + /** RouteMatrixElement fallbackInfo. */ + public fallbackInfo?: (google.maps.routing.v2.IFallbackInfo|null); + + /** RouteMatrixElement _originIndex. */ + public _originIndex?: "originIndex"; + + /** RouteMatrixElement _destinationIndex. */ + public _destinationIndex?: "destinationIndex"; + + /** + * Creates a new RouteMatrixElement instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatrixElement instance + */ + public static create(properties?: google.maps.routing.v2.IRouteMatrixElement): google.maps.routing.v2.RouteMatrixElement; + + /** + * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @param message RouteMatrixElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @param message RouteMatrixElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IRouteMatrixElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.RouteMatrixElement; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.RouteMatrixElement; + + /** + * Verifies a RouteMatrixElement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatrixElement + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.RouteMatrixElement; + + /** + * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. + * @param message RouteMatrixElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.RouteMatrixElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatrixElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatrixElement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RouteMatrixElementCondition enum. */ + enum RouteMatrixElementCondition { + ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0, + ROUTE_EXISTS = 1, + ROUTE_NOT_FOUND = 2 + } + + /** RoutingPreference enum. */ + enum RoutingPreference { + ROUTING_PREFERENCE_UNSPECIFIED = 0, + TRAFFIC_UNAWARE = 1, + TRAFFIC_AWARE = 2, + TRAFFIC_AWARE_OPTIMAL = 3 + } + + /** Units enum. */ + enum Units { + UNITS_UNSPECIFIED = 0, + METRIC = 1, + IMPERIAL = 2 + } + + /** Properties of a Waypoint. */ + interface IWaypoint { + + /** Waypoint location */ + location?: (google.maps.routing.v2.ILocation|null); + + /** Waypoint placeId */ + placeId?: (string|null); + + /** Waypoint via */ + via?: (boolean|null); + + /** Waypoint vehicleStopover */ + vehicleStopover?: (boolean|null); + + /** Waypoint sideOfRoad */ + sideOfRoad?: (boolean|null); + } + + /** Represents a Waypoint. */ + class Waypoint implements IWaypoint { + + /** + * Constructs a new Waypoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.routing.v2.IWaypoint); + + /** Waypoint location. */ + public location?: (google.maps.routing.v2.ILocation|null); + + /** Waypoint placeId. */ + public placeId?: (string|null); + + /** Waypoint via. */ + public via: boolean; + + /** Waypoint vehicleStopover. */ + public vehicleStopover: boolean; + + /** Waypoint sideOfRoad. */ + public sideOfRoad: boolean; + + /** Waypoint locationType. */ + public locationType?: ("location"|"placeId"); + + /** + * Creates a new Waypoint instance using the specified properties. + * @param [properties] Properties to set + * @returns Waypoint instance + */ + public static create(properties?: google.maps.routing.v2.IWaypoint): google.maps.routing.v2.Waypoint; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @param message Waypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.routing.v2.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @param message Waypoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.routing.v2.IWaypoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Waypoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.routing.v2.Waypoint; + + /** + * Decodes a Waypoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.routing.v2.Waypoint; + + /** + * Verifies a Waypoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Waypoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Waypoint + */ + public static fromObject(object: { [k: string]: any }): google.maps.routing.v2.Waypoint; + + /** + * Creates a plain object from a Waypoint message. Also converts values to other types if specified. + * @param message Waypoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.routing.v2.Waypoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Waypoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Waypoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + + /** 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 + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-maps-routing/protos/protos.js b/packages/google-maps-routing/protos/protos.js new file mode 100644 index 000000000000..6a5769d6db48 --- /dev/null +++ b/packages/google-maps-routing/protos/protos.js @@ -0,0 +1,22442 @@ +// Copyright 2022 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._googlemaps_routing_protos || ($protobuf.roots._googlemaps_routing_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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.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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} 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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} 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; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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 {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + 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.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: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + 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) { + 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.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: + 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; + } + } + 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.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; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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.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; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + return protobuf; + })(); + + google.geo = (function() { + + /** + * Namespace geo. + * @memberof google + * @namespace + */ + var geo = {}; + + geo.type = (function() { + + /** + * Namespace type. + * @memberof google.geo + * @namespace + */ + var type = {}; + + type.Viewport = (function() { + + /** + * Properties of a Viewport. + * @memberof google.geo.type + * @interface IViewport + * @property {google.type.ILatLng|null} [low] Viewport low + * @property {google.type.ILatLng|null} [high] Viewport high + */ + + /** + * Constructs a new Viewport. + * @memberof google.geo.type + * @classdesc Represents a Viewport. + * @implements IViewport + * @constructor + * @param {google.geo.type.IViewport=} [properties] Properties to set + */ + function Viewport(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]]; + } + + /** + * Viewport low. + * @member {google.type.ILatLng|null|undefined} low + * @memberof google.geo.type.Viewport + * @instance + */ + Viewport.prototype.low = null; + + /** + * Viewport high. + * @member {google.type.ILatLng|null|undefined} high + * @memberof google.geo.type.Viewport + * @instance + */ + Viewport.prototype.high = null; + + /** + * Creates a new Viewport instance using the specified properties. + * @function create + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport=} [properties] Properties to set + * @returns {google.geo.type.Viewport} Viewport instance + */ + Viewport.create = function create(properties) { + return new Viewport(properties); + }; + + /** + * Encodes the specified Viewport message. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @function encode + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport} message Viewport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Viewport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.low != null && Object.hasOwnProperty.call(message, "low")) + $root.google.type.LatLng.encode(message.low, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.high != null && Object.hasOwnProperty.call(message, "high")) + $root.google.type.LatLng.encode(message.high, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Viewport message, length delimited. Does not implicitly {@link google.geo.type.Viewport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.IViewport} message Viewport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Viewport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Viewport message from the specified reader or buffer. + * @function decode + * @memberof google.geo.type.Viewport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.geo.type.Viewport} Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Viewport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.geo.type.Viewport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.low = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.high = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Viewport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.geo.type.Viewport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.geo.type.Viewport} Viewport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Viewport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Viewport message. + * @function verify + * @memberof google.geo.type.Viewport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Viewport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.low != null && message.hasOwnProperty("low")) { + var error = $root.google.type.LatLng.verify(message.low); + if (error) + return "low." + error; + } + if (message.high != null && message.hasOwnProperty("high")) { + var error = $root.google.type.LatLng.verify(message.high); + if (error) + return "high." + error; + } + return null; + }; + + /** + * Creates a Viewport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.geo.type.Viewport + * @static + * @param {Object.} object Plain object + * @returns {google.geo.type.Viewport} Viewport + */ + Viewport.fromObject = function fromObject(object) { + if (object instanceof $root.google.geo.type.Viewport) + return object; + var message = new $root.google.geo.type.Viewport(); + if (object.low != null) { + if (typeof object.low !== "object") + throw TypeError(".google.geo.type.Viewport.low: object expected"); + message.low = $root.google.type.LatLng.fromObject(object.low); + } + if (object.high != null) { + if (typeof object.high !== "object") + throw TypeError(".google.geo.type.Viewport.high: object expected"); + message.high = $root.google.type.LatLng.fromObject(object.high); + } + return message; + }; + + /** + * Creates a plain object from a Viewport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.geo.type.Viewport + * @static + * @param {google.geo.type.Viewport} message Viewport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Viewport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.low = null; + object.high = null; + } + if (message.low != null && message.hasOwnProperty("low")) + object.low = $root.google.type.LatLng.toObject(message.low, options); + if (message.high != null && message.hasOwnProperty("high")) + object.high = $root.google.type.LatLng.toObject(message.high, options); + return object; + }; + + /** + * Converts this Viewport to JSON. + * @function toJSON + * @memberof google.geo.type.Viewport + * @instance + * @returns {Object.} JSON object + */ + Viewport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Viewport + * @function getTypeUrl + * @memberof google.geo.type.Viewport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Viewport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.geo.type.Viewport"; + }; + + return Viewport; + })(); + + return type; + })(); + + return geo; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(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]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + return type; + })(); + + google.maps = (function() { + + /** + * Namespace maps. + * @memberof google + * @namespace + */ + var maps = {}; + + maps.routing = (function() { + + /** + * Namespace routing. + * @memberof google.maps + * @namespace + */ + var routing = {}; + + routing.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.maps.routing + * @namespace + */ + var v2 = {}; + + v2.FallbackInfo = (function() { + + /** + * Properties of a FallbackInfo. + * @memberof google.maps.routing.v2 + * @interface IFallbackInfo + * @property {google.maps.routing.v2.FallbackRoutingMode|null} [routingMode] FallbackInfo routingMode + * @property {google.maps.routing.v2.FallbackReason|null} [reason] FallbackInfo reason + */ + + /** + * Constructs a new FallbackInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a FallbackInfo. + * @implements IFallbackInfo + * @constructor + * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set + */ + function FallbackInfo(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]]; + } + + /** + * FallbackInfo routingMode. + * @member {google.maps.routing.v2.FallbackRoutingMode} routingMode + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + */ + FallbackInfo.prototype.routingMode = 0; + + /** + * FallbackInfo reason. + * @member {google.maps.routing.v2.FallbackReason} reason + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + */ + FallbackInfo.prototype.reason = 0; + + /** + * Creates a new FallbackInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo instance + */ + FallbackInfo.create = function create(properties) { + return new FallbackInfo(properties); + }; + + /** + * Encodes the specified FallbackInfo message. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingMode != null && Object.hasOwnProperty.call(message, "routingMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.routingMode); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason); + return writer; + }; + + /** + * Encodes the specified FallbackInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.FallbackInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.IFallbackInfo} message FallbackInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FallbackInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.FallbackInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.routingMode = reader.int32(); + break; + } + case 2: { + message.reason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FallbackInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FallbackInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FallbackInfo message. + * @function verify + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FallbackInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + switch (message.routingMode) { + default: + return "routingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FallbackInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.FallbackInfo} FallbackInfo + */ + FallbackInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.FallbackInfo) + return object; + var message = new $root.google.maps.routing.v2.FallbackInfo(); + switch (object.routingMode) { + case "FALLBACK_ROUTING_MODE_UNSPECIFIED": + case 0: + message.routingMode = 0; + break; + case "FALLBACK_TRAFFIC_UNAWARE": + case 1: + message.routingMode = 1; + break; + case "FALLBACK_TRAFFIC_AWARE": + case 2: + message.routingMode = 2; + break; + } + switch (object.reason) { + case "FALLBACK_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "SERVER_ERROR": + case 1: + message.reason = 1; + break; + case "LATENCY_EXCEEDED": + case 2: + message.reason = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FallbackInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {google.maps.routing.v2.FallbackInfo} message FallbackInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FallbackInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.routingMode = options.enums === String ? "FALLBACK_ROUTING_MODE_UNSPECIFIED" : 0; + object.reason = options.enums === String ? "FALLBACK_REASON_UNSPECIFIED" : 0; + } + if (message.routingMode != null && message.hasOwnProperty("routingMode")) + object.routingMode = options.enums === String ? $root.google.maps.routing.v2.FallbackRoutingMode[message.routingMode] : message.routingMode; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.maps.routing.v2.FallbackReason[message.reason] : message.reason; + return object; + }; + + /** + * Converts this FallbackInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.FallbackInfo + * @instance + * @returns {Object.} JSON object + */ + FallbackInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FallbackInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.FallbackInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FallbackInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.FallbackInfo"; + }; + + return FallbackInfo; + })(); + + /** + * FallbackReason enum. + * @name google.maps.routing.v2.FallbackReason + * @enum {number} + * @property {number} FALLBACK_REASON_UNSPECIFIED=0 FALLBACK_REASON_UNSPECIFIED value + * @property {number} SERVER_ERROR=1 SERVER_ERROR value + * @property {number} LATENCY_EXCEEDED=2 LATENCY_EXCEEDED value + */ + v2.FallbackReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FALLBACK_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVER_ERROR"] = 1; + values[valuesById[2] = "LATENCY_EXCEEDED"] = 2; + return values; + })(); + + /** + * FallbackRoutingMode enum. + * @name google.maps.routing.v2.FallbackRoutingMode + * @enum {number} + * @property {number} FALLBACK_ROUTING_MODE_UNSPECIFIED=0 FALLBACK_ROUTING_MODE_UNSPECIFIED value + * @property {number} FALLBACK_TRAFFIC_UNAWARE=1 FALLBACK_TRAFFIC_UNAWARE value + * @property {number} FALLBACK_TRAFFIC_AWARE=2 FALLBACK_TRAFFIC_AWARE value + */ + v2.FallbackRoutingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FALLBACK_ROUTING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FALLBACK_TRAFFIC_UNAWARE"] = 1; + values[valuesById[2] = "FALLBACK_TRAFFIC_AWARE"] = 2; + return values; + })(); + + v2.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.maps.routing.v2 + * @interface ILocation + * @property {google.type.ILatLng|null} [latLng] Location latLng + * @property {google.protobuf.IInt32Value|null} [heading] Location heading + */ + + /** + * Constructs a new Location. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.maps.routing.v2.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.maps.routing.v2.Location + * @instance + */ + Location.prototype.latLng = null; + + /** + * Location heading. + * @member {google.protobuf.IInt32Value|null|undefined} heading + * @memberof google.maps.routing.v2.Location + * @instance + */ + Location.prototype.heading = null; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.ILocation=} [properties] Properties to set + * @returns {google.maps.routing.v2.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.heading != null && Object.hasOwnProperty.call(message, "heading")) + $root.google.protobuf.Int32Value.encode(message.heading, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.maps.routing.v2.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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.maps.routing.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.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.maps.routing.v2.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.heading = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + 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.maps.routing.v2.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.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.maps.routing.v2.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.latLng != null && message.hasOwnProperty("latLng")) { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + if (message.heading != null && message.hasOwnProperty("heading")) { + var error = $root.google.protobuf.Int32Value.verify(message.heading); + if (error) + return "heading." + error; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Location + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Location) + return object; + var message = new $root.google.maps.routing.v2.Location(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.maps.routing.v2.Location.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.heading != null) { + if (typeof object.heading !== "object") + throw TypeError(".google.maps.routing.v2.Location.heading: object expected"); + message.heading = $root.google.protobuf.Int32Value.fromObject(object.heading); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Location + * @static + * @param {google.maps.routing.v2.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.defaults) { + object.latLng = null; + object.heading = null; + } + if (message.latLng != null && message.hasOwnProperty("latLng")) + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (message.heading != null && message.hasOwnProperty("heading")) + object.heading = $root.google.protobuf.Int32Value.toObject(message.heading, options); + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.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.maps.routing.v2.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.maps.routing.v2.Location"; + }; + + return Location; + })(); + + /** + * Maneuver enum. + * @name google.maps.routing.v2.Maneuver + * @enum {number} + * @property {number} MANEUVER_UNSPECIFIED=0 MANEUVER_UNSPECIFIED value + * @property {number} TURN_SLIGHT_LEFT=1 TURN_SLIGHT_LEFT value + * @property {number} TURN_SHARP_LEFT=2 TURN_SHARP_LEFT value + * @property {number} UTURN_LEFT=3 UTURN_LEFT value + * @property {number} TURN_LEFT=4 TURN_LEFT value + * @property {number} TURN_SLIGHT_RIGHT=5 TURN_SLIGHT_RIGHT value + * @property {number} TURN_SHARP_RIGHT=6 TURN_SHARP_RIGHT value + * @property {number} UTURN_RIGHT=7 UTURN_RIGHT value + * @property {number} TURN_RIGHT=8 TURN_RIGHT value + * @property {number} STRAIGHT=9 STRAIGHT value + * @property {number} RAMP_LEFT=10 RAMP_LEFT value + * @property {number} RAMP_RIGHT=11 RAMP_RIGHT value + * @property {number} MERGE=12 MERGE value + * @property {number} FORK_LEFT=13 FORK_LEFT value + * @property {number} FORK_RIGHT=14 FORK_RIGHT value + * @property {number} FERRY=15 FERRY value + * @property {number} FERRY_TRAIN=16 FERRY_TRAIN value + * @property {number} ROUNDABOUT_LEFT=17 ROUNDABOUT_LEFT value + * @property {number} ROUNDABOUT_RIGHT=18 ROUNDABOUT_RIGHT value + */ + v2.Maneuver = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANEUVER_UNSPECIFIED"] = 0; + values[valuesById[1] = "TURN_SLIGHT_LEFT"] = 1; + values[valuesById[2] = "TURN_SHARP_LEFT"] = 2; + values[valuesById[3] = "UTURN_LEFT"] = 3; + values[valuesById[4] = "TURN_LEFT"] = 4; + values[valuesById[5] = "TURN_SLIGHT_RIGHT"] = 5; + values[valuesById[6] = "TURN_SHARP_RIGHT"] = 6; + values[valuesById[7] = "UTURN_RIGHT"] = 7; + values[valuesById[8] = "TURN_RIGHT"] = 8; + values[valuesById[9] = "STRAIGHT"] = 9; + values[valuesById[10] = "RAMP_LEFT"] = 10; + values[valuesById[11] = "RAMP_RIGHT"] = 11; + values[valuesById[12] = "MERGE"] = 12; + values[valuesById[13] = "FORK_LEFT"] = 13; + values[valuesById[14] = "FORK_RIGHT"] = 14; + values[valuesById[15] = "FERRY"] = 15; + values[valuesById[16] = "FERRY_TRAIN"] = 16; + values[valuesById[17] = "ROUNDABOUT_LEFT"] = 17; + values[valuesById[18] = "ROUNDABOUT_RIGHT"] = 18; + return values; + })(); + + v2.NavigationInstruction = (function() { + + /** + * Properties of a NavigationInstruction. + * @memberof google.maps.routing.v2 + * @interface INavigationInstruction + * @property {google.maps.routing.v2.Maneuver|null} [maneuver] NavigationInstruction maneuver + * @property {string|null} [instructions] NavigationInstruction instructions + */ + + /** + * Constructs a new NavigationInstruction. + * @memberof google.maps.routing.v2 + * @classdesc Represents a NavigationInstruction. + * @implements INavigationInstruction + * @constructor + * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set + */ + function NavigationInstruction(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]]; + } + + /** + * NavigationInstruction maneuver. + * @member {google.maps.routing.v2.Maneuver} maneuver + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + */ + NavigationInstruction.prototype.maneuver = 0; + + /** + * NavigationInstruction instructions. + * @member {string} instructions + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + */ + NavigationInstruction.prototype.instructions = ""; + + /** + * Creates a new NavigationInstruction instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction=} [properties] Properties to set + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction instance + */ + NavigationInstruction.create = function create(properties) { + return new NavigationInstruction(properties); + }; + + /** + * Encodes the specified NavigationInstruction message. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NavigationInstruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maneuver != null && Object.hasOwnProperty.call(message, "maneuver")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maneuver); + if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instructions); + return writer; + }; + + /** + * Encodes the specified NavigationInstruction message, length delimited. Does not implicitly {@link google.maps.routing.v2.NavigationInstruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.INavigationInstruction} message NavigationInstruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NavigationInstruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NavigationInstruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.NavigationInstruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maneuver = reader.int32(); + break; + } + case 2: { + message.instructions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NavigationInstruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NavigationInstruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NavigationInstruction message. + * @function verify + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NavigationInstruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maneuver != null && message.hasOwnProperty("maneuver")) + switch (message.maneuver) { + default: + return "maneuver: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.instructions != null && message.hasOwnProperty("instructions")) + if (!$util.isString(message.instructions)) + return "instructions: string expected"; + return null; + }; + + /** + * Creates a NavigationInstruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.NavigationInstruction} NavigationInstruction + */ + NavigationInstruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.NavigationInstruction) + return object; + var message = new $root.google.maps.routing.v2.NavigationInstruction(); + switch (object.maneuver) { + case "MANEUVER_UNSPECIFIED": + case 0: + message.maneuver = 0; + break; + case "TURN_SLIGHT_LEFT": + case 1: + message.maneuver = 1; + break; + case "TURN_SHARP_LEFT": + case 2: + message.maneuver = 2; + break; + case "UTURN_LEFT": + case 3: + message.maneuver = 3; + break; + case "TURN_LEFT": + case 4: + message.maneuver = 4; + break; + case "TURN_SLIGHT_RIGHT": + case 5: + message.maneuver = 5; + break; + case "TURN_SHARP_RIGHT": + case 6: + message.maneuver = 6; + break; + case "UTURN_RIGHT": + case 7: + message.maneuver = 7; + break; + case "TURN_RIGHT": + case 8: + message.maneuver = 8; + break; + case "STRAIGHT": + case 9: + message.maneuver = 9; + break; + case "RAMP_LEFT": + case 10: + message.maneuver = 10; + break; + case "RAMP_RIGHT": + case 11: + message.maneuver = 11; + break; + case "MERGE": + case 12: + message.maneuver = 12; + break; + case "FORK_LEFT": + case 13: + message.maneuver = 13; + break; + case "FORK_RIGHT": + case 14: + message.maneuver = 14; + break; + case "FERRY": + case 15: + message.maneuver = 15; + break; + case "FERRY_TRAIN": + case 16: + message.maneuver = 16; + break; + case "ROUNDABOUT_LEFT": + case 17: + message.maneuver = 17; + break; + case "ROUNDABOUT_RIGHT": + case 18: + message.maneuver = 18; + break; + } + if (object.instructions != null) + message.instructions = String(object.instructions); + return message; + }; + + /** + * Creates a plain object from a NavigationInstruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {google.maps.routing.v2.NavigationInstruction} message NavigationInstruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NavigationInstruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maneuver = options.enums === String ? "MANEUVER_UNSPECIFIED" : 0; + object.instructions = ""; + } + if (message.maneuver != null && message.hasOwnProperty("maneuver")) + object.maneuver = options.enums === String ? $root.google.maps.routing.v2.Maneuver[message.maneuver] : message.maneuver; + if (message.instructions != null && message.hasOwnProperty("instructions")) + object.instructions = message.instructions; + return object; + }; + + /** + * Converts this NavigationInstruction to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.NavigationInstruction + * @instance + * @returns {Object.} JSON object + */ + NavigationInstruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NavigationInstruction + * @function getTypeUrl + * @memberof google.maps.routing.v2.NavigationInstruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NavigationInstruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.NavigationInstruction"; + }; + + return NavigationInstruction; + })(); + + v2.Polyline = (function() { + + /** + * Properties of a Polyline. + * @memberof google.maps.routing.v2 + * @interface IPolyline + * @property {string|null} [encodedPolyline] Polyline encodedPolyline + * @property {google.protobuf.IStruct|null} [geoJsonLinestring] Polyline geoJsonLinestring + */ + + /** + * Constructs a new Polyline. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Polyline. + * @implements IPolyline + * @constructor + * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set + */ + function Polyline(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]]; + } + + /** + * Polyline encodedPolyline. + * @member {string|null|undefined} encodedPolyline + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Polyline.prototype.encodedPolyline = null; + + /** + * Polyline geoJsonLinestring. + * @member {google.protobuf.IStruct|null|undefined} geoJsonLinestring + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Polyline.prototype.geoJsonLinestring = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Polyline polylineType. + * @member {"encodedPolyline"|"geoJsonLinestring"|undefined} polylineType + * @memberof google.maps.routing.v2.Polyline + * @instance + */ + Object.defineProperty(Polyline.prototype, "polylineType", { + get: $util.oneOfGetter($oneOfFields = ["encodedPolyline", "geoJsonLinestring"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Polyline instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline=} [properties] Properties to set + * @returns {google.maps.routing.v2.Polyline} Polyline instance + */ + Polyline.create = function create(properties) { + return new Polyline(properties); + }; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encodedPolyline != null && Object.hasOwnProperty.call(message, "encodedPolyline")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encodedPolyline); + if (message.geoJsonLinestring != null && Object.hasOwnProperty.call(message, "geoJsonLinestring")) + $root.google.protobuf.Struct.encode(message.geoJsonLinestring, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.routing.v2.Polyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Polyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encodedPolyline = reader.string(); + break; + } + case 2: { + message.geoJsonLinestring = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polyline message. + * @function verify + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polyline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + properties.polylineType = 1; + if (!$util.isString(message.encodedPolyline)) + return "encodedPolyline: string expected"; + } + if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { + if (properties.polylineType === 1) + return "polylineType: multiple values"; + properties.polylineType = 1; + { + var error = $root.google.protobuf.Struct.verify(message.geoJsonLinestring); + if (error) + return "geoJsonLinestring." + error; + } + } + return null; + }; + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Polyline} Polyline + */ + Polyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Polyline) + return object; + var message = new $root.google.maps.routing.v2.Polyline(); + if (object.encodedPolyline != null) + message.encodedPolyline = String(object.encodedPolyline); + if (object.geoJsonLinestring != null) { + if (typeof object.geoJsonLinestring !== "object") + throw TypeError(".google.maps.routing.v2.Polyline.geoJsonLinestring: object expected"); + message.geoJsonLinestring = $root.google.protobuf.Struct.fromObject(object.geoJsonLinestring); + } + return message; + }; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {google.maps.routing.v2.Polyline} message Polyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + object.encodedPolyline = message.encodedPolyline; + if (options.oneofs) + object.polylineType = "encodedPolyline"; + } + if (message.geoJsonLinestring != null && message.hasOwnProperty("geoJsonLinestring")) { + object.geoJsonLinestring = $root.google.protobuf.Struct.toObject(message.geoJsonLinestring, options); + if (options.oneofs) + object.polylineType = "geoJsonLinestring"; + } + return object; + }; + + /** + * Converts this Polyline to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Polyline + * @instance + * @returns {Object.} JSON object + */ + Polyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Polyline + * @function getTypeUrl + * @memberof google.maps.routing.v2.Polyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Polyline"; + }; + + return Polyline; + })(); + + /** + * PolylineQuality enum. + * @name google.maps.routing.v2.PolylineQuality + * @enum {number} + * @property {number} POLYLINE_QUALITY_UNSPECIFIED=0 POLYLINE_QUALITY_UNSPECIFIED value + * @property {number} HIGH_QUALITY=1 HIGH_QUALITY value + * @property {number} OVERVIEW=2 OVERVIEW value + */ + v2.PolylineQuality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLYLINE_QUALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH_QUALITY"] = 1; + values[valuesById[2] = "OVERVIEW"] = 2; + return values; + })(); + + /** + * PolylineEncoding enum. + * @name google.maps.routing.v2.PolylineEncoding + * @enum {number} + * @property {number} POLYLINE_ENCODING_UNSPECIFIED=0 POLYLINE_ENCODING_UNSPECIFIED value + * @property {number} ENCODED_POLYLINE=1 ENCODED_POLYLINE value + * @property {number} GEO_JSON_LINESTRING=2 GEO_JSON_LINESTRING value + */ + v2.PolylineEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLYLINE_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCODED_POLYLINE"] = 1; + values[valuesById[2] = "GEO_JSON_LINESTRING"] = 2; + return values; + })(); + + v2.Route = (function() { + + /** + * Properties of a Route. + * @memberof google.maps.routing.v2 + * @interface IRoute + * @property {Array.|null} [legs] Route legs + * @property {number|null} [distanceMeters] Route distanceMeters + * @property {google.protobuf.IDuration|null} [duration] Route duration + * @property {google.protobuf.IDuration|null} [staticDuration] Route staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] Route polyline + * @property {string|null} [description] Route description + * @property {Array.|null} [warnings] Route warnings + * @property {google.geo.type.IViewport|null} [viewport] Route viewport + * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] Route travelAdvisory + */ + + /** + * Constructs a new Route. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Route. + * @implements IRoute + * @constructor + * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set + */ + function Route(properties) { + this.legs = []; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Route legs. + * @member {Array.} legs + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.legs = $util.emptyArray; + + /** + * Route distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.distanceMeters = 0; + + /** + * Route duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.duration = null; + + /** + * Route staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.staticDuration = null; + + /** + * Route polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.polyline = null; + + /** + * Route description. + * @member {string} description + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.description = ""; + + /** + * Route warnings. + * @member {Array.} warnings + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.warnings = $util.emptyArray; + + /** + * Route viewport. + * @member {google.geo.type.IViewport|null|undefined} viewport + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.viewport = null; + + /** + * Route travelAdvisory. + * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.Route + * @instance + */ + Route.prototype.travelAdvisory = null; + + /** + * Creates a new Route instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute=} [properties] Properties to set + * @returns {google.maps.routing.v2.Route} Route instance + */ + Route.create = function create(properties) { + return new Route(properties); + }; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Route.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.legs != null && message.legs.length) + for (var i = 0; i < message.legs.length; ++i) + $root.google.maps.routing.v2.RouteLeg.encode(message.legs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.distanceMeters); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.warnings[i]); + if (message.viewport != null && Object.hasOwnProperty.call(message, "viewport")) + $root.google.geo.type.Viewport.encode(message.viewport, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.maps.routing.v2.Route.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.IRoute} message Route message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Route.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Route message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Route} Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Route.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Route(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.legs && message.legs.length)) + message.legs = []; + message.legs.push($root.google.maps.routing.v2.RouteLeg.decode(reader, reader.uint32())); + break; + } + case 2: { + message.distanceMeters = reader.int32(); + break; + } + case 3: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + case 8: { + message.viewport = $root.google.geo.type.Viewport.decode(reader, reader.uint32()); + break; + } + case 9: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Route message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Route} Route + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Route.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Route message. + * @function verify + * @memberof google.maps.routing.v2.Route + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Route.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.legs != null && message.hasOwnProperty("legs")) { + if (!Array.isArray(message.legs)) + return "legs: array expected"; + for (var i = 0; i < message.legs.length; ++i) { + var error = $root.google.maps.routing.v2.RouteLeg.verify(message.legs[i]); + if (error) + return "legs." + error; + } + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + if (message.viewport != null && message.hasOwnProperty("viewport")) { + var error = $root.google.geo.type.Viewport.verify(message.viewport); + if (error) + return "viewport." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + return null; + }; + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Route + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Route} Route + */ + Route.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Route) + return object; + var message = new $root.google.maps.routing.v2.Route(); + if (object.legs) { + if (!Array.isArray(object.legs)) + throw TypeError(".google.maps.routing.v2.Route.legs: array expected"); + message.legs = []; + for (var i = 0; i < object.legs.length; ++i) { + if (typeof object.legs[i] !== "object") + throw TypeError(".google.maps.routing.v2.Route.legs: object expected"); + message.legs[i] = $root.google.maps.routing.v2.RouteLeg.fromObject(object.legs[i]); + } + } + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.Route.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.Route.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.Route.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.description != null) + message.description = String(object.description); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.maps.routing.v2.Route.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + if (object.viewport != null) { + if (typeof object.viewport !== "object") + throw TypeError(".google.maps.routing.v2.Route.viewport: object expected"); + message.viewport = $root.google.geo.type.Viewport.fromObject(object.viewport); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.Route.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); + } + return message; + }; + + /** + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Route + * @static + * @param {google.maps.routing.v2.Route} message Route + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Route.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.legs = []; + object.warnings = []; + } + if (options.defaults) { + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.polyline = null; + object.description = ""; + object.viewport = null; + object.travelAdvisory = null; + } + if (message.legs && message.legs.length) { + object.legs = []; + for (var j = 0; j < message.legs.length; ++j) + object.legs[j] = $root.google.maps.routing.v2.RouteLeg.toObject(message.legs[j], options); + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + if (message.viewport != null && message.hasOwnProperty("viewport")) + object.viewport = $root.google.geo.type.Viewport.toObject(message.viewport, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); + return object; + }; + + /** + * Converts this Route to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Route + * @instance + * @returns {Object.} JSON object + */ + Route.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Route + * @function getTypeUrl + * @memberof google.maps.routing.v2.Route + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Route.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Route"; + }; + + return Route; + })(); + + v2.RouteTravelAdvisory = (function() { + + /** + * Properties of a RouteTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteTravelAdvisory + * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteTravelAdvisory tollInfo + * @property {Array.|null} [speedReadingIntervals] RouteTravelAdvisory speedReadingIntervals + */ + + /** + * Constructs a new RouteTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteTravelAdvisory. + * @implements IRouteTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set + */ + function RouteTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteTravelAdvisory tollInfo. + * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.tollInfo = null; + + /** + * RouteTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + */ + RouteTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * Creates a new RouteTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory instance + */ + RouteTravelAdvisory.create = function create(properties) { + return new RouteTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) + $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteTravelAdvisory} message RouteTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteTravelAdvisory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { + var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); + if (error) + return "tollInfo." + error; + } + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + return null; + }; + + /** + * Creates a RouteTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteTravelAdvisory} RouteTravelAdvisory + */ + RouteTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteTravelAdvisory(); + if (object.tollInfo != null) { + if (typeof object.tollInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.tollInfo: object expected"); + message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); + } + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteTravelAdvisory} message RouteTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (options.defaults) + object.tollInfo = null; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) + object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + return object; + }; + + /** + * Converts this RouteTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteTravelAdvisory"; + }; + + return RouteTravelAdvisory; + })(); + + v2.RouteLegTravelAdvisory = (function() { + + /** + * Properties of a RouteLegTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteLegTravelAdvisory + * @property {google.maps.routing.v2.ITollInfo|null} [tollInfo] RouteLegTravelAdvisory tollInfo + * @property {Array.|null} [speedReadingIntervals] RouteLegTravelAdvisory speedReadingIntervals + */ + + /** + * Constructs a new RouteLegTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegTravelAdvisory. + * @implements IRouteLegTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set + */ + function RouteLegTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegTravelAdvisory tollInfo. + * @member {google.maps.routing.v2.ITollInfo|null|undefined} tollInfo + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + */ + RouteLegTravelAdvisory.prototype.tollInfo = null; + + /** + * RouteLegTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + */ + RouteLegTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * Creates a new RouteLegTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory instance + */ + RouteLegTravelAdvisory.create = function create(properties) { + return new RouteLegTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteLegTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tollInfo != null && Object.hasOwnProperty.call(message, "tollInfo")) + $root.google.maps.routing.v2.TollInfo.encode(message.tollInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegTravelAdvisory} message RouteLegTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegTravelAdvisory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tollInfo = $root.google.maps.routing.v2.TollInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) { + var error = $root.google.maps.routing.v2.TollInfo.verify(message.tollInfo); + if (error) + return "tollInfo." + error; + } + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + return null; + }; + + /** + * Creates a RouteLegTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegTravelAdvisory} RouteLegTravelAdvisory + */ + RouteLegTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteLegTravelAdvisory(); + if (object.tollInfo != null) { + if (typeof object.tollInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.tollInfo: object expected"); + message.tollInfo = $root.google.maps.routing.v2.TollInfo.fromObject(object.tollInfo); + } + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteLegTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteLegTravelAdvisory} message RouteLegTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (options.defaults) + object.tollInfo = null; + if (message.tollInfo != null && message.hasOwnProperty("tollInfo")) + object.tollInfo = $root.google.maps.routing.v2.TollInfo.toObject(message.tollInfo, options); + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + return object; + }; + + /** + * Converts this RouteLegTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteLegTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegTravelAdvisory"; + }; + + return RouteLegTravelAdvisory; + })(); + + v2.RouteLegStepTravelAdvisory = (function() { + + /** + * Properties of a RouteLegStepTravelAdvisory. + * @memberof google.maps.routing.v2 + * @interface IRouteLegStepTravelAdvisory + * @property {Array.|null} [speedReadingIntervals] RouteLegStepTravelAdvisory speedReadingIntervals + */ + + /** + * Constructs a new RouteLegStepTravelAdvisory. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegStepTravelAdvisory. + * @implements IRouteLegStepTravelAdvisory + * @constructor + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set + */ + function RouteLegStepTravelAdvisory(properties) { + this.speedReadingIntervals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLegStepTravelAdvisory speedReadingIntervals. + * @member {Array.} speedReadingIntervals + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @instance + */ + RouteLegStepTravelAdvisory.prototype.speedReadingIntervals = $util.emptyArray; + + /** + * Creates a new RouteLegStepTravelAdvisory instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory instance + */ + RouteLegStepTravelAdvisory.create = function create(properties) { + return new RouteLegStepTravelAdvisory(properties); + }; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTravelAdvisory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speedReadingIntervals != null && message.speedReadingIntervals.length) + for (var i = 0; i < message.speedReadingIntervals.length; ++i) + $root.google.maps.routing.v2.SpeedReadingInterval.encode(message.speedReadingIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegStepTravelAdvisory message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStepTravelAdvisory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.IRouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStepTravelAdvisory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTravelAdvisory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.speedReadingIntervals && message.speedReadingIntervals.length)) + message.speedReadingIntervals = []; + message.speedReadingIntervals.push($root.google.maps.routing.v2.SpeedReadingInterval.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStepTravelAdvisory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStepTravelAdvisory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStepTravelAdvisory message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStepTravelAdvisory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speedReadingIntervals != null && message.hasOwnProperty("speedReadingIntervals")) { + if (!Array.isArray(message.speedReadingIntervals)) + return "speedReadingIntervals: array expected"; + for (var i = 0; i < message.speedReadingIntervals.length; ++i) { + var error = $root.google.maps.routing.v2.SpeedReadingInterval.verify(message.speedReadingIntervals[i]); + if (error) + return "speedReadingIntervals." + error; + } + } + return null; + }; + + /** + * Creates a RouteLegStepTravelAdvisory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStepTravelAdvisory} RouteLegStepTravelAdvisory + */ + RouteLegStepTravelAdvisory.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStepTravelAdvisory) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStepTravelAdvisory(); + if (object.speedReadingIntervals) { + if (!Array.isArray(object.speedReadingIntervals)) + throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: array expected"); + message.speedReadingIntervals = []; + for (var i = 0; i < object.speedReadingIntervals.length; ++i) { + if (typeof object.speedReadingIntervals[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStepTravelAdvisory.speedReadingIntervals: object expected"); + message.speedReadingIntervals[i] = $root.google.maps.routing.v2.SpeedReadingInterval.fromObject(object.speedReadingIntervals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteLegStepTravelAdvisory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {google.maps.routing.v2.RouteLegStepTravelAdvisory} message RouteLegStepTravelAdvisory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStepTravelAdvisory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speedReadingIntervals = []; + if (message.speedReadingIntervals && message.speedReadingIntervals.length) { + object.speedReadingIntervals = []; + for (var j = 0; j < message.speedReadingIntervals.length; ++j) + object.speedReadingIntervals[j] = $root.google.maps.routing.v2.SpeedReadingInterval.toObject(message.speedReadingIntervals[j], options); + } + return object; + }; + + /** + * Converts this RouteLegStepTravelAdvisory to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @instance + * @returns {Object.} JSON object + */ + RouteLegStepTravelAdvisory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStepTravelAdvisory + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStepTravelAdvisory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStepTravelAdvisory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStepTravelAdvisory"; + }; + + return RouteLegStepTravelAdvisory; + })(); + + v2.RouteLeg = (function() { + + /** + * Properties of a RouteLeg. + * @memberof google.maps.routing.v2 + * @interface IRouteLeg + * @property {number|null} [distanceMeters] RouteLeg distanceMeters + * @property {google.protobuf.IDuration|null} [duration] RouteLeg duration + * @property {google.protobuf.IDuration|null} [staticDuration] RouteLeg staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLeg polyline + * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLeg startLocation + * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLeg endLocation + * @property {Array.|null} [steps] RouteLeg steps + * @property {google.maps.routing.v2.IRouteLegTravelAdvisory|null} [travelAdvisory] RouteLeg travelAdvisory + */ + + /** + * Constructs a new RouteLeg. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLeg. + * @implements IRouteLeg + * @constructor + * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set + */ + function RouteLeg(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteLeg distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.distanceMeters = 0; + + /** + * RouteLeg duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.duration = null; + + /** + * RouteLeg staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.staticDuration = null; + + /** + * RouteLeg polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.polyline = null; + + /** + * RouteLeg startLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.startLocation = null; + + /** + * RouteLeg endLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.endLocation = null; + + /** + * RouteLeg steps. + * @member {Array.} steps + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.steps = $util.emptyArray; + + /** + * RouteLeg travelAdvisory. + * @member {google.maps.routing.v2.IRouteLegTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteLeg + * @instance + */ + RouteLeg.prototype.travelAdvisory = null; + + /** + * Creates a new RouteLeg instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg instance + */ + RouteLeg.create = function create(properties) { + return new RouteLeg(properties); + }; + + /** + * Encodes the specified RouteLeg message. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLeg.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) + $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) + $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.maps.routing.v2.RouteLegStep.encode(message.steps[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteLegTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLeg message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLeg.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.IRouteLeg} message RouteLeg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLeg.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLeg message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLeg.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLeg(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.distanceMeters = reader.int32(); + break; + } + case 2: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 5: { + message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.maps.routing.v2.RouteLegStep.decode(reader, reader.uint32())); + break; + } + case 8: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLeg message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLeg.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLeg message. + * @function verify + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLeg.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.startLocation != null && message.hasOwnProperty("startLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); + if (error) + return "startLocation." + error; + } + if (message.endLocation != null && message.hasOwnProperty("endLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); + if (error) + return "endLocation." + error; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.maps.routing.v2.RouteLegStep.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteLegTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + return null; + }; + + /** + * Creates a RouteLeg message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLeg} RouteLeg + */ + RouteLeg.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLeg) + return object; + var message = new $root.google.maps.routing.v2.RouteLeg(); + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.startLocation != null) { + if (typeof object.startLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.startLocation: object expected"); + message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); + } + if (object.endLocation != null) { + if (typeof object.endLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.endLocation: object expected"); + message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.maps.routing.v2.RouteLeg.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.steps: object expected"); + message.steps[i] = $root.google.maps.routing.v2.RouteLegStep.fromObject(object.steps[i]); + } + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteLeg.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.fromObject(object.travelAdvisory); + } + return message; + }; + + /** + * Creates a plain object from a RouteLeg message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {google.maps.routing.v2.RouteLeg} message RouteLeg + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLeg.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (options.defaults) { + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.polyline = null; + object.startLocation = null; + object.endLocation = null; + object.travelAdvisory = null; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.startLocation != null && message.hasOwnProperty("startLocation")) + object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); + if (message.endLocation != null && message.hasOwnProperty("endLocation")) + object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.maps.routing.v2.RouteLegStep.toObject(message.steps[j], options); + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteLegTravelAdvisory.toObject(message.travelAdvisory, options); + return object; + }; + + /** + * Converts this RouteLeg to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLeg + * @instance + * @returns {Object.} JSON object + */ + RouteLeg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLeg + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLeg + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLeg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLeg"; + }; + + return RouteLeg; + })(); + + v2.RouteLegStep = (function() { + + /** + * Properties of a RouteLegStep. + * @memberof google.maps.routing.v2 + * @interface IRouteLegStep + * @property {number|null} [distanceMeters] RouteLegStep distanceMeters + * @property {google.protobuf.IDuration|null} [staticDuration] RouteLegStep staticDuration + * @property {google.maps.routing.v2.IPolyline|null} [polyline] RouteLegStep polyline + * @property {google.maps.routing.v2.ILocation|null} [startLocation] RouteLegStep startLocation + * @property {google.maps.routing.v2.ILocation|null} [endLocation] RouteLegStep endLocation + * @property {google.maps.routing.v2.INavigationInstruction|null} [navigationInstruction] RouteLegStep navigationInstruction + * @property {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null} [travelAdvisory] RouteLegStep travelAdvisory + */ + + /** + * Constructs a new RouteLegStep. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteLegStep. + * @implements IRouteLegStep + * @constructor + * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set + */ + function RouteLegStep(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]]; + } + + /** + * RouteLegStep distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.distanceMeters = 0; + + /** + * RouteLegStep staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.staticDuration = null; + + /** + * RouteLegStep polyline. + * @member {google.maps.routing.v2.IPolyline|null|undefined} polyline + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.polyline = null; + + /** + * RouteLegStep startLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} startLocation + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.startLocation = null; + + /** + * RouteLegStep endLocation. + * @member {google.maps.routing.v2.ILocation|null|undefined} endLocation + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.endLocation = null; + + /** + * RouteLegStep navigationInstruction. + * @member {google.maps.routing.v2.INavigationInstruction|null|undefined} navigationInstruction + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.navigationInstruction = null; + + /** + * RouteLegStep travelAdvisory. + * @member {google.maps.routing.v2.IRouteLegStepTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + */ + RouteLegStep.prototype.travelAdvisory = null; + + /** + * Creates a new RouteLegStep instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep instance + */ + RouteLegStep.create = function create(properties) { + return new RouteLegStep(properties); + }; + + /** + * Encodes the specified RouteLegStep message. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStep.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.distanceMeters); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.routing.v2.Polyline.encode(message.polyline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startLocation != null && Object.hasOwnProperty.call(message, "startLocation")) + $root.google.maps.routing.v2.Location.encode(message.startLocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endLocation != null && Object.hasOwnProperty.call(message, "endLocation")) + $root.google.maps.routing.v2.Location.encode(message.endLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.navigationInstruction != null && Object.hasOwnProperty.call(message, "navigationInstruction")) + $root.google.maps.routing.v2.NavigationInstruction.encode(message.navigationInstruction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteLegStep message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteLegStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.IRouteLegStep} message RouteLegStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteLegStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteLegStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.distanceMeters = reader.int32(); + break; + } + case 2: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.polyline = $root.google.maps.routing.v2.Polyline.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endLocation = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 6: { + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.decode(reader, reader.uint32()); + break; + } + case 7: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteLegStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteLegStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteLegStep message. + * @function verify + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteLegStep.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.routing.v2.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + if (message.startLocation != null && message.hasOwnProperty("startLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.startLocation); + if (error) + return "startLocation." + error; + } + if (message.endLocation != null && message.hasOwnProperty("endLocation")) { + var error = $root.google.maps.routing.v2.Location.verify(message.endLocation); + if (error) + return "endLocation." + error; + } + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) { + var error = $root.google.maps.routing.v2.NavigationInstruction.verify(message.navigationInstruction); + if (error) + return "navigationInstruction." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + return null; + }; + + /** + * Creates a RouteLegStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteLegStep} RouteLegStep + */ + RouteLegStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteLegStep) + return object; + var message = new $root.google.maps.routing.v2.RouteLegStep(); + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.polyline: object expected"); + message.polyline = $root.google.maps.routing.v2.Polyline.fromObject(object.polyline); + } + if (object.startLocation != null) { + if (typeof object.startLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.startLocation: object expected"); + message.startLocation = $root.google.maps.routing.v2.Location.fromObject(object.startLocation); + } + if (object.endLocation != null) { + if (typeof object.endLocation !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.endLocation: object expected"); + message.endLocation = $root.google.maps.routing.v2.Location.fromObject(object.endLocation); + } + if (object.navigationInstruction != null) { + if (typeof object.navigationInstruction !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.navigationInstruction: object expected"); + message.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.fromObject(object.navigationInstruction); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteLegStep.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.fromObject(object.travelAdvisory); + } + return message; + }; + + /** + * Creates a plain object from a RouteLegStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {google.maps.routing.v2.RouteLegStep} message RouteLegStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteLegStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distanceMeters = 0; + object.staticDuration = null; + object.polyline = null; + object.startLocation = null; + object.endLocation = null; + object.navigationInstruction = null; + object.travelAdvisory = null; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.routing.v2.Polyline.toObject(message.polyline, options); + if (message.startLocation != null && message.hasOwnProperty("startLocation")) + object.startLocation = $root.google.maps.routing.v2.Location.toObject(message.startLocation, options); + if (message.endLocation != null && message.hasOwnProperty("endLocation")) + object.endLocation = $root.google.maps.routing.v2.Location.toObject(message.endLocation, options); + if (message.navigationInstruction != null && message.hasOwnProperty("navigationInstruction")) + object.navigationInstruction = $root.google.maps.routing.v2.NavigationInstruction.toObject(message.navigationInstruction, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteLegStepTravelAdvisory.toObject(message.travelAdvisory, options); + return object; + }; + + /** + * Converts this RouteLegStep to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteLegStep + * @instance + * @returns {Object.} JSON object + */ + RouteLegStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteLegStep + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteLegStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteLegStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteLegStep"; + }; + + return RouteLegStep; + })(); + + v2.SpeedReadingInterval = (function() { + + /** + * Properties of a SpeedReadingInterval. + * @memberof google.maps.routing.v2 + * @interface ISpeedReadingInterval + * @property {number|null} [startPolylinePointIndex] SpeedReadingInterval startPolylinePointIndex + * @property {number|null} [endPolylinePointIndex] SpeedReadingInterval endPolylinePointIndex + * @property {google.maps.routing.v2.SpeedReadingInterval.Speed|null} [speed] SpeedReadingInterval speed + */ + + /** + * Constructs a new SpeedReadingInterval. + * @memberof google.maps.routing.v2 + * @classdesc Represents a SpeedReadingInterval. + * @implements ISpeedReadingInterval + * @constructor + * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set + */ + function SpeedReadingInterval(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]]; + } + + /** + * SpeedReadingInterval startPolylinePointIndex. + * @member {number|null|undefined} startPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.startPolylinePointIndex = null; + + /** + * SpeedReadingInterval endPolylinePointIndex. + * @member {number|null|undefined} endPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.endPolylinePointIndex = null; + + /** + * SpeedReadingInterval speed. + * @member {google.maps.routing.v2.SpeedReadingInterval.Speed} speed + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + SpeedReadingInterval.prototype.speed = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpeedReadingInterval _startPolylinePointIndex. + * @member {"startPolylinePointIndex"|undefined} _startPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + Object.defineProperty(SpeedReadingInterval.prototype, "_startPolylinePointIndex", { + get: $util.oneOfGetter($oneOfFields = ["startPolylinePointIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SpeedReadingInterval _endPolylinePointIndex. + * @member {"endPolylinePointIndex"|undefined} _endPolylinePointIndex + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + */ + Object.defineProperty(SpeedReadingInterval.prototype, "_endPolylinePointIndex", { + get: $util.oneOfGetter($oneOfFields = ["endPolylinePointIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpeedReadingInterval instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval=} [properties] Properties to set + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval instance + */ + SpeedReadingInterval.create = function create(properties) { + return new SpeedReadingInterval(properties); + }; + + /** + * Encodes the specified SpeedReadingInterval message. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeedReadingInterval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startPolylinePointIndex != null && Object.hasOwnProperty.call(message, "startPolylinePointIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startPolylinePointIndex); + if (message.endPolylinePointIndex != null && Object.hasOwnProperty.call(message, "endPolylinePointIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endPolylinePointIndex); + if (message.speed != null && Object.hasOwnProperty.call(message, "speed")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.speed); + return writer; + }; + + /** + * Encodes the specified SpeedReadingInterval message, length delimited. Does not implicitly {@link google.maps.routing.v2.SpeedReadingInterval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.ISpeedReadingInterval} message SpeedReadingInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeedReadingInterval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeedReadingInterval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.SpeedReadingInterval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startPolylinePointIndex = reader.int32(); + break; + } + case 2: { + message.endPolylinePointIndex = reader.int32(); + break; + } + case 3: { + message.speed = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeedReadingInterval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeedReadingInterval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeedReadingInterval message. + * @function verify + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeedReadingInterval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { + properties._startPolylinePointIndex = 1; + if (!$util.isInteger(message.startPolylinePointIndex)) + return "startPolylinePointIndex: integer expected"; + } + if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { + properties._endPolylinePointIndex = 1; + if (!$util.isInteger(message.endPolylinePointIndex)) + return "endPolylinePointIndex: integer expected"; + } + if (message.speed != null && message.hasOwnProperty("speed")) + switch (message.speed) { + default: + return "speed: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SpeedReadingInterval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.SpeedReadingInterval} SpeedReadingInterval + */ + SpeedReadingInterval.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.SpeedReadingInterval) + return object; + var message = new $root.google.maps.routing.v2.SpeedReadingInterval(); + if (object.startPolylinePointIndex != null) + message.startPolylinePointIndex = object.startPolylinePointIndex | 0; + if (object.endPolylinePointIndex != null) + message.endPolylinePointIndex = object.endPolylinePointIndex | 0; + switch (object.speed) { + case "SPEED_UNSPECIFIED": + case 0: + message.speed = 0; + break; + case "NORMAL": + case 1: + message.speed = 1; + break; + case "SLOW": + case 2: + message.speed = 2; + break; + case "TRAFFIC_JAM": + case 3: + message.speed = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SpeedReadingInterval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {google.maps.routing.v2.SpeedReadingInterval} message SpeedReadingInterval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeedReadingInterval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.speed = options.enums === String ? "SPEED_UNSPECIFIED" : 0; + if (message.startPolylinePointIndex != null && message.hasOwnProperty("startPolylinePointIndex")) { + object.startPolylinePointIndex = message.startPolylinePointIndex; + if (options.oneofs) + object._startPolylinePointIndex = "startPolylinePointIndex"; + } + if (message.endPolylinePointIndex != null && message.hasOwnProperty("endPolylinePointIndex")) { + object.endPolylinePointIndex = message.endPolylinePointIndex; + if (options.oneofs) + object._endPolylinePointIndex = "endPolylinePointIndex"; + } + if (message.speed != null && message.hasOwnProperty("speed")) + object.speed = options.enums === String ? $root.google.maps.routing.v2.SpeedReadingInterval.Speed[message.speed] : message.speed; + return object; + }; + + /** + * Converts this SpeedReadingInterval to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @instance + * @returns {Object.} JSON object + */ + SpeedReadingInterval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeedReadingInterval + * @function getTypeUrl + * @memberof google.maps.routing.v2.SpeedReadingInterval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeedReadingInterval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.SpeedReadingInterval"; + }; + + /** + * Speed enum. + * @name google.maps.routing.v2.SpeedReadingInterval.Speed + * @enum {number} + * @property {number} SPEED_UNSPECIFIED=0 SPEED_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} SLOW=2 SLOW value + * @property {number} TRAFFIC_JAM=3 TRAFFIC_JAM value + */ + SpeedReadingInterval.Speed = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEED_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "SLOW"] = 2; + values[valuesById[3] = "TRAFFIC_JAM"] = 3; + return values; + })(); + + return SpeedReadingInterval; + })(); + + v2.TollInfo = (function() { + + /** + * Properties of a TollInfo. + * @memberof google.maps.routing.v2 + * @interface ITollInfo + * @property {Array.|null} [estimatedPrice] TollInfo estimatedPrice + */ + + /** + * Constructs a new TollInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a TollInfo. + * @implements ITollInfo + * @constructor + * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set + */ + function TollInfo(properties) { + this.estimatedPrice = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TollInfo estimatedPrice. + * @member {Array.} estimatedPrice + * @memberof google.maps.routing.v2.TollInfo + * @instance + */ + TollInfo.prototype.estimatedPrice = $util.emptyArray; + + /** + * Creates a new TollInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.TollInfo} TollInfo instance + */ + TollInfo.create = function create(properties) { + return new TollInfo(properties); + }; + + /** + * Encodes the specified TollInfo message. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TollInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedPrice != null && message.estimatedPrice.length) + for (var i = 0; i < message.estimatedPrice.length; ++i) + $root.google.type.Money.encode(message.estimatedPrice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TollInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.TollInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.ITollInfo} message TollInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TollInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TollInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.TollInfo} TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TollInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.TollInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.estimatedPrice && message.estimatedPrice.length)) + message.estimatedPrice = []; + message.estimatedPrice.push($root.google.type.Money.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TollInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.TollInfo} TollInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TollInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TollInfo message. + * @function verify + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TollInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedPrice != null && message.hasOwnProperty("estimatedPrice")) { + if (!Array.isArray(message.estimatedPrice)) + return "estimatedPrice: array expected"; + for (var i = 0; i < message.estimatedPrice.length; ++i) { + var error = $root.google.type.Money.verify(message.estimatedPrice[i]); + if (error) + return "estimatedPrice." + error; + } + } + return null; + }; + + /** + * Creates a TollInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.TollInfo} TollInfo + */ + TollInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.TollInfo) + return object; + var message = new $root.google.maps.routing.v2.TollInfo(); + if (object.estimatedPrice) { + if (!Array.isArray(object.estimatedPrice)) + throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: array expected"); + message.estimatedPrice = []; + for (var i = 0; i < object.estimatedPrice.length; ++i) { + if (typeof object.estimatedPrice[i] !== "object") + throw TypeError(".google.maps.routing.v2.TollInfo.estimatedPrice: object expected"); + message.estimatedPrice[i] = $root.google.type.Money.fromObject(object.estimatedPrice[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TollInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {google.maps.routing.v2.TollInfo} message TollInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TollInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.estimatedPrice = []; + if (message.estimatedPrice && message.estimatedPrice.length) { + object.estimatedPrice = []; + for (var j = 0; j < message.estimatedPrice.length; ++j) + object.estimatedPrice[j] = $root.google.type.Money.toObject(message.estimatedPrice[j], options); + } + return object; + }; + + /** + * Converts this TollInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.TollInfo + * @instance + * @returns {Object.} JSON object + */ + TollInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TollInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.TollInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TollInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.TollInfo"; + }; + + return TollInfo; + })(); + + v2.RouteModifiers = (function() { + + /** + * Properties of a RouteModifiers. + * @memberof google.maps.routing.v2 + * @interface IRouteModifiers + * @property {boolean|null} [avoidTolls] RouteModifiers avoidTolls + * @property {boolean|null} [avoidHighways] RouteModifiers avoidHighways + * @property {boolean|null} [avoidFerries] RouteModifiers avoidFerries + * @property {boolean|null} [avoidIndoor] RouteModifiers avoidIndoor + * @property {google.maps.routing.v2.IVehicleInfo|null} [vehicleInfo] RouteModifiers vehicleInfo + * @property {Array.|null} [tollPasses] RouteModifiers tollPasses + */ + + /** + * Constructs a new RouteModifiers. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteModifiers. + * @implements IRouteModifiers + * @constructor + * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set + */ + function RouteModifiers(properties) { + this.tollPasses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteModifiers avoidTolls. + * @member {boolean} avoidTolls + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidTolls = false; + + /** + * RouteModifiers avoidHighways. + * @member {boolean} avoidHighways + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidHighways = false; + + /** + * RouteModifiers avoidFerries. + * @member {boolean} avoidFerries + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidFerries = false; + + /** + * RouteModifiers avoidIndoor. + * @member {boolean} avoidIndoor + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidIndoor = false; + + /** + * RouteModifiers vehicleInfo. + * @member {google.maps.routing.v2.IVehicleInfo|null|undefined} vehicleInfo + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.vehicleInfo = null; + + /** + * RouteModifiers tollPasses. + * @member {Array.} tollPasses + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + */ + RouteModifiers.prototype.tollPasses = $util.emptyArray; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers instance + */ + RouteModifiers.create = function create(properties) { + return new RouteModifiers(properties); + }; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.avoidTolls != null && Object.hasOwnProperty.call(message, "avoidTolls")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.avoidTolls); + if (message.avoidHighways != null && Object.hasOwnProperty.call(message, "avoidHighways")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.avoidHighways); + if (message.avoidFerries != null && Object.hasOwnProperty.call(message, "avoidFerries")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.avoidFerries); + if (message.avoidIndoor != null && Object.hasOwnProperty.call(message, "avoidIndoor")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.avoidIndoor); + if (message.vehicleInfo != null && Object.hasOwnProperty.call(message, "vehicleInfo")) + $root.google.maps.routing.v2.VehicleInfo.encode(message.vehicleInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tollPasses != null && message.tollPasses.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.tollPasses.length; ++i) + writer.int32(message.tollPasses[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.avoidTolls = reader.bool(); + break; + } + case 2: { + message.avoidHighways = reader.bool(); + break; + } + case 3: { + message.avoidFerries = reader.bool(); + break; + } + case 4: { + message.avoidIndoor = reader.bool(); + break; + } + case 5: { + message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.tollPasses && message.tollPasses.length)) + message.tollPasses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.tollPasses.push(reader.int32()); + } else + message.tollPasses.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteModifiers message. + * @function verify + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + if (typeof message.avoidTolls !== "boolean") + return "avoidTolls: boolean expected"; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + if (typeof message.avoidHighways !== "boolean") + return "avoidHighways: boolean expected"; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + if (typeof message.avoidFerries !== "boolean") + return "avoidFerries: boolean expected"; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + if (typeof message.avoidIndoor !== "boolean") + return "avoidIndoor: boolean expected"; + if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) { + var error = $root.google.maps.routing.v2.VehicleInfo.verify(message.vehicleInfo); + if (error) + return "vehicleInfo." + error; + } + if (message.tollPasses != null && message.hasOwnProperty("tollPasses")) { + if (!Array.isArray(message.tollPasses)) + return "tollPasses: array expected"; + for (var i = 0; i < message.tollPasses.length; ++i) + switch (message.tollPasses[i]) { + default: + return "tollPasses: enum value[] expected"; + case 0: + case 82: + case 83: + case 2: + case 3: + case 81: + case 7: + case 8: + case 88: + case 9: + case 10: + case 11: + case 84: + case 85: + case 18: + case 19: + case 20: + case 16: + case 78: + case 79: + case 90: + case 91: + case 93: + case 89: + case 12: + case 13: + case 92: + case 14: + case 21: + case 22: + case 4: + case 86: + case 23: + case 24: + case 25: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 73: + case 72: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 6: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 87: + case 43: + case 80: + case 75: + case 74: + case 76: + case 77: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 17: + case 1: + case 62: + case 63: + case 64: + break; + } + } + return null; + }; + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteModifiers} RouteModifiers + */ + RouteModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteModifiers) + return object; + var message = new $root.google.maps.routing.v2.RouteModifiers(); + if (object.avoidTolls != null) + message.avoidTolls = Boolean(object.avoidTolls); + if (object.avoidHighways != null) + message.avoidHighways = Boolean(object.avoidHighways); + if (object.avoidFerries != null) + message.avoidFerries = Boolean(object.avoidFerries); + if (object.avoidIndoor != null) + message.avoidIndoor = Boolean(object.avoidIndoor); + if (object.vehicleInfo != null) { + if (typeof object.vehicleInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteModifiers.vehicleInfo: object expected"); + message.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.fromObject(object.vehicleInfo); + } + if (object.tollPasses) { + if (!Array.isArray(object.tollPasses)) + throw TypeError(".google.maps.routing.v2.RouteModifiers.tollPasses: array expected"); + message.tollPasses = []; + for (var i = 0; i < object.tollPasses.length; ++i) + switch (object.tollPasses[i]) { + default: + case "TOLL_PASS_UNSPECIFIED": + case 0: + message.tollPasses[i] = 0; + break; + case "AU_ETOLL_TAG": + case 82: + message.tollPasses[i] = 82; + break; + case "AU_EWAY_TAG": + case 83: + message.tollPasses[i] = 83; + break; + case "AU_LINKT": + case 2: + message.tollPasses[i] = 2; + break; + case "AR_TELEPASE": + case 3: + message.tollPasses[i] = 3; + break; + case "BR_AUTO_EXPRESO": + case 81: + message.tollPasses[i] = 81; + break; + case "BR_CONECTCAR": + case 7: + message.tollPasses[i] = 7; + break; + case "BR_MOVE_MAIS": + case 8: + message.tollPasses[i] = 8; + break; + case "BR_PASSA_RAPIDO": + case 88: + message.tollPasses[i] = 88; + break; + case "BR_SEM_PARAR": + case 9: + message.tollPasses[i] = 9; + break; + case "BR_TAGGY": + case 10: + message.tollPasses[i] = 10; + break; + case "BR_VELOE": + case 11: + message.tollPasses[i] = 11; + break; + case "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": + case 84: + message.tollPasses[i] = 84; + break; + case "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": + case 85: + message.tollPasses[i] = 85; + break; + case "CA_US_BLUE_WATER_EDGE_PASS": + case 18: + message.tollPasses[i] = 18; + break; + case "CA_US_CONNEXION": + case 19: + message.tollPasses[i] = 19; + break; + case "CA_US_NEXUS_CARD": + case 20: + message.tollPasses[i] = 20; + break; + case "ID_E_TOLL": + case 16: + message.tollPasses[i] = 16; + break; + case "IN_FASTAG": + case 78: + message.tollPasses[i] = 78; + break; + case "IN_LOCAL_HP_PLATE_EXEMPT": + case 79: + message.tollPasses[i] = 79; + break; + case "MX_IAVE": + case 90: + message.tollPasses[i] = 90; + break; + case "MX_PASE": + case 91: + message.tollPasses[i] = 91; + break; + case "MX_QUICKPASS": + case 93: + message.tollPasses[i] = 93; + break; + case "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": + case 89: + message.tollPasses[i] = 89; + break; + case "MX_TAG_IAVE": + case 12: + message.tollPasses[i] = 12; + break; + case "MX_TAG_TELEVIA": + case 13: + message.tollPasses[i] = 13; + break; + case "MX_TELEVIA": + case 92: + message.tollPasses[i] = 92; + break; + case "MX_VIAPASS": + case 14: + message.tollPasses[i] = 14; + break; + case "US_AL_FREEDOM_PASS": + case 21: + message.tollPasses[i] = 21; + break; + case "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": + case 22: + message.tollPasses[i] = 22; + break; + case "US_CA_FASTRAK": + case 4: + message.tollPasses[i] = 4; + break; + case "US_CA_FASTRAK_CAV_STICKER": + case 86: + message.tollPasses[i] = 86; + break; + case "US_CO_EXPRESSTOLL": + case 23: + message.tollPasses[i] = 23; + break; + case "US_CO_GO_PASS": + case 24: + message.tollPasses[i] = 24; + break; + case "US_DE_EZPASSDE": + case 25: + message.tollPasses[i] = 25; + break; + case "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": + case 65: + message.tollPasses[i] = 65; + break; + case "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": + case 66: + message.tollPasses[i] = 66; + break; + case "US_FL_EPASS": + case 67: + message.tollPasses[i] = 67; + break; + case "US_FL_GIBA_TOLL_PASS": + case 68: + message.tollPasses[i] = 68; + break; + case "US_FL_LEEWAY": + case 69: + message.tollPasses[i] = 69; + break; + case "US_FL_SUNPASS": + case 70: + message.tollPasses[i] = 70; + break; + case "US_FL_SUNPASS_PRO": + case 71: + message.tollPasses[i] = 71; + break; + case "US_IL_EZPASSIL": + case 73: + message.tollPasses[i] = 73; + break; + case "US_IL_IPASS": + case 72: + message.tollPasses[i] = 72; + break; + case "US_IN_EZPASSIN": + case 26: + message.tollPasses[i] = 26; + break; + case "US_KS_BESTPASS_HORIZON": + case 27: + message.tollPasses[i] = 27; + break; + case "US_KS_KTAG": + case 28: + message.tollPasses[i] = 28; + break; + case "US_KS_NATIONALPASS": + case 29: + message.tollPasses[i] = 29; + break; + case "US_KS_PREPASS_ELITEPASS": + case 30: + message.tollPasses[i] = 30; + break; + case "US_KY_RIVERLINK": + case 31: + message.tollPasses[i] = 31; + break; + case "US_LA_GEAUXPASS": + case 32: + message.tollPasses[i] = 32; + break; + case "US_LA_TOLL_TAG": + case 33: + message.tollPasses[i] = 33; + break; + case "US_MA_EZPASSMA": + case 6: + message.tollPasses[i] = 6; + break; + case "US_MD_EZPASSMD": + case 34: + message.tollPasses[i] = 34; + break; + case "US_ME_EZPASSME": + case 35: + message.tollPasses[i] = 35; + break; + case "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": + case 36: + message.tollPasses[i] = 36; + break; + case "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": + case 37: + message.tollPasses[i] = 37; + break; + case "US_MI_IQ_PROX_CARD": + case 38: + message.tollPasses[i] = 38; + break; + case "US_MI_MACKINAC_BRIDGE_MAC_PASS": + case 39: + message.tollPasses[i] = 39; + break; + case "US_MI_NEXPRESS_TOLL": + case 40: + message.tollPasses[i] = 40; + break; + case "US_MN_EZPASSMN": + case 41: + message.tollPasses[i] = 41; + break; + case "US_NC_EZPASSNC": + case 42: + message.tollPasses[i] = 42; + break; + case "US_NC_PEACH_PASS": + case 87: + message.tollPasses[i] = 87; + break; + case "US_NC_QUICK_PASS": + case 43: + message.tollPasses[i] = 43; + break; + case "US_NH_EZPASSNH": + case 80: + message.tollPasses[i] = 80; + break; + case "US_NJ_DOWNBEACH_EXPRESS_PASS": + case 75: + message.tollPasses[i] = 75; + break; + case "US_NJ_EZPASSNJ": + case 74: + message.tollPasses[i] = 74; + break; + case "US_NY_EXPRESSPASS": + case 76: + message.tollPasses[i] = 76; + break; + case "US_NY_EZPASSNY": + case 77: + message.tollPasses[i] = 77; + break; + case "US_OH_EZPASSOH": + case 44: + message.tollPasses[i] = 44; + break; + case "US_PA_EZPASSPA": + case 45: + message.tollPasses[i] = 45; + break; + case "US_RI_EZPASSRI": + case 46: + message.tollPasses[i] = 46; + break; + case "US_SC_PALPASS": + case 47: + message.tollPasses[i] = 47; + break; + case "US_TX_BANCPASS": + case 48: + message.tollPasses[i] = 48; + break; + case "US_TX_DEL_RIO_PASS": + case 49: + message.tollPasses[i] = 49; + break; + case "US_TX_EFAST_PASS": + case 50: + message.tollPasses[i] = 50; + break; + case "US_TX_EAGLE_PASS_EXPRESS_CARD": + case 51: + message.tollPasses[i] = 51; + break; + case "US_TX_EPTOLL": + case 52: + message.tollPasses[i] = 52; + break; + case "US_TX_EZ_CROSS": + case 53: + message.tollPasses[i] = 53; + break; + case "US_TX_EZTAG": + case 54: + message.tollPasses[i] = 54; + break; + case "US_TX_LAREDO_TRADE_TAG": + case 55: + message.tollPasses[i] = 55; + break; + case "US_TX_PLUSPASS": + case 56: + message.tollPasses[i] = 56; + break; + case "US_TX_TOLLTAG": + case 57: + message.tollPasses[i] = 57; + break; + case "US_TX_TXTAG": + case 58: + message.tollPasses[i] = 58; + break; + case "US_TX_XPRESS_CARD": + case 59: + message.tollPasses[i] = 59; + break; + case "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": + case 60: + message.tollPasses[i] = 60; + break; + case "US_VA_EZPASSVA": + case 61: + message.tollPasses[i] = 61; + break; + case "US_WA_BREEZEBY": + case 17: + message.tollPasses[i] = 17; + break; + case "US_WA_GOOD_TO_GO": + case 1: + message.tollPasses[i] = 1; + break; + case "US_WV_EZPASSWV": + case 62: + message.tollPasses[i] = 62; + break; + case "US_WV_MEMORIAL_BRIDGE_TICKETS": + case 63: + message.tollPasses[i] = 63; + break; + case "US_WV_NEWELL_TOLL_BRIDGE_TICKET": + case 64: + message.tollPasses[i] = 64; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {google.maps.routing.v2.RouteModifiers} message RouteModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tollPasses = []; + if (options.defaults) { + object.avoidTolls = false; + object.avoidHighways = false; + object.avoidFerries = false; + object.avoidIndoor = false; + object.vehicleInfo = null; + } + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + object.avoidTolls = message.avoidTolls; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + object.avoidHighways = message.avoidHighways; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + object.avoidFerries = message.avoidFerries; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + object.avoidIndoor = message.avoidIndoor; + if (message.vehicleInfo != null && message.hasOwnProperty("vehicleInfo")) + object.vehicleInfo = $root.google.maps.routing.v2.VehicleInfo.toObject(message.vehicleInfo, options); + if (message.tollPasses && message.tollPasses.length) { + object.tollPasses = []; + for (var j = 0; j < message.tollPasses.length; ++j) + object.tollPasses[j] = options.enums === String ? $root.google.maps.routing.v2.TollPass[message.tollPasses[j]] : message.tollPasses[j]; + } + return object; + }; + + /** + * Converts this RouteModifiers to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteModifiers + * @instance + * @returns {Object.} JSON object + */ + RouteModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteModifiers + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteModifiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteModifiers"; + }; + + return RouteModifiers; + })(); + + /** + * TollPass enum. + * @name google.maps.routing.v2.TollPass + * @enum {number} + * @property {number} TOLL_PASS_UNSPECIFIED=0 TOLL_PASS_UNSPECIFIED value + * @property {number} AU_ETOLL_TAG=82 AU_ETOLL_TAG value + * @property {number} AU_EWAY_TAG=83 AU_EWAY_TAG value + * @property {number} AU_LINKT=2 AU_LINKT value + * @property {number} AR_TELEPASE=3 AR_TELEPASE value + * @property {number} BR_AUTO_EXPRESO=81 BR_AUTO_EXPRESO value + * @property {number} BR_CONECTCAR=7 BR_CONECTCAR value + * @property {number} BR_MOVE_MAIS=8 BR_MOVE_MAIS value + * @property {number} BR_PASSA_RAPIDO=88 BR_PASSA_RAPIDO value + * @property {number} BR_SEM_PARAR=9 BR_SEM_PARAR value + * @property {number} BR_TAGGY=10 BR_TAGGY value + * @property {number} BR_VELOE=11 BR_VELOE value + * @property {number} CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD=84 CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD value + * @property {number} CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD=85 CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD value + * @property {number} CA_US_BLUE_WATER_EDGE_PASS=18 CA_US_BLUE_WATER_EDGE_PASS value + * @property {number} CA_US_CONNEXION=19 CA_US_CONNEXION value + * @property {number} CA_US_NEXUS_CARD=20 CA_US_NEXUS_CARD value + * @property {number} ID_E_TOLL=16 ID_E_TOLL value + * @property {number} IN_FASTAG=78 IN_FASTAG value + * @property {number} IN_LOCAL_HP_PLATE_EXEMPT=79 IN_LOCAL_HP_PLATE_EXEMPT value + * @property {number} MX_IAVE=90 MX_IAVE value + * @property {number} MX_PASE=91 MX_PASE value + * @property {number} MX_QUICKPASS=93 MX_QUICKPASS value + * @property {number} MX_SISTEMA_TELEPEAJE_CHIHUAHUA=89 MX_SISTEMA_TELEPEAJE_CHIHUAHUA value + * @property {number} MX_TAG_IAVE=12 MX_TAG_IAVE value + * @property {number} MX_TAG_TELEVIA=13 MX_TAG_TELEVIA value + * @property {number} MX_TELEVIA=92 MX_TELEVIA value + * @property {number} MX_VIAPASS=14 MX_VIAPASS value + * @property {number} US_AL_FREEDOM_PASS=21 US_AL_FREEDOM_PASS value + * @property {number} US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS=22 US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS value + * @property {number} US_CA_FASTRAK=4 US_CA_FASTRAK value + * @property {number} US_CA_FASTRAK_CAV_STICKER=86 US_CA_FASTRAK_CAV_STICKER value + * @property {number} US_CO_EXPRESSTOLL=23 US_CO_EXPRESSTOLL value + * @property {number} US_CO_GO_PASS=24 US_CO_GO_PASS value + * @property {number} US_DE_EZPASSDE=25 US_DE_EZPASSDE value + * @property {number} US_FL_BOB_SIKES_TOLL_BRIDGE_PASS=65 US_FL_BOB_SIKES_TOLL_BRIDGE_PASS value + * @property {number} US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD=66 US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD value + * @property {number} US_FL_EPASS=67 US_FL_EPASS value + * @property {number} US_FL_GIBA_TOLL_PASS=68 US_FL_GIBA_TOLL_PASS value + * @property {number} US_FL_LEEWAY=69 US_FL_LEEWAY value + * @property {number} US_FL_SUNPASS=70 US_FL_SUNPASS value + * @property {number} US_FL_SUNPASS_PRO=71 US_FL_SUNPASS_PRO value + * @property {number} US_IL_EZPASSIL=73 US_IL_EZPASSIL value + * @property {number} US_IL_IPASS=72 US_IL_IPASS value + * @property {number} US_IN_EZPASSIN=26 US_IN_EZPASSIN value + * @property {number} US_KS_BESTPASS_HORIZON=27 US_KS_BESTPASS_HORIZON value + * @property {number} US_KS_KTAG=28 US_KS_KTAG value + * @property {number} US_KS_NATIONALPASS=29 US_KS_NATIONALPASS value + * @property {number} US_KS_PREPASS_ELITEPASS=30 US_KS_PREPASS_ELITEPASS value + * @property {number} US_KY_RIVERLINK=31 US_KY_RIVERLINK value + * @property {number} US_LA_GEAUXPASS=32 US_LA_GEAUXPASS value + * @property {number} US_LA_TOLL_TAG=33 US_LA_TOLL_TAG value + * @property {number} US_MA_EZPASSMA=6 US_MA_EZPASSMA value + * @property {number} US_MD_EZPASSMD=34 US_MD_EZPASSMD value + * @property {number} US_ME_EZPASSME=35 US_ME_EZPASSME value + * @property {number} US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD=36 US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD value + * @property {number} US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG=37 US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG value + * @property {number} US_MI_IQ_PROX_CARD=38 US_MI_IQ_PROX_CARD value + * @property {number} US_MI_MACKINAC_BRIDGE_MAC_PASS=39 US_MI_MACKINAC_BRIDGE_MAC_PASS value + * @property {number} US_MI_NEXPRESS_TOLL=40 US_MI_NEXPRESS_TOLL value + * @property {number} US_MN_EZPASSMN=41 US_MN_EZPASSMN value + * @property {number} US_NC_EZPASSNC=42 US_NC_EZPASSNC value + * @property {number} US_NC_PEACH_PASS=87 US_NC_PEACH_PASS value + * @property {number} US_NC_QUICK_PASS=43 US_NC_QUICK_PASS value + * @property {number} US_NH_EZPASSNH=80 US_NH_EZPASSNH value + * @property {number} US_NJ_DOWNBEACH_EXPRESS_PASS=75 US_NJ_DOWNBEACH_EXPRESS_PASS value + * @property {number} US_NJ_EZPASSNJ=74 US_NJ_EZPASSNJ value + * @property {number} US_NY_EXPRESSPASS=76 US_NY_EXPRESSPASS value + * @property {number} US_NY_EZPASSNY=77 US_NY_EZPASSNY value + * @property {number} US_OH_EZPASSOH=44 US_OH_EZPASSOH value + * @property {number} US_PA_EZPASSPA=45 US_PA_EZPASSPA value + * @property {number} US_RI_EZPASSRI=46 US_RI_EZPASSRI value + * @property {number} US_SC_PALPASS=47 US_SC_PALPASS value + * @property {number} US_TX_BANCPASS=48 US_TX_BANCPASS value + * @property {number} US_TX_DEL_RIO_PASS=49 US_TX_DEL_RIO_PASS value + * @property {number} US_TX_EFAST_PASS=50 US_TX_EFAST_PASS value + * @property {number} US_TX_EAGLE_PASS_EXPRESS_CARD=51 US_TX_EAGLE_PASS_EXPRESS_CARD value + * @property {number} US_TX_EPTOLL=52 US_TX_EPTOLL value + * @property {number} US_TX_EZ_CROSS=53 US_TX_EZ_CROSS value + * @property {number} US_TX_EZTAG=54 US_TX_EZTAG value + * @property {number} US_TX_LAREDO_TRADE_TAG=55 US_TX_LAREDO_TRADE_TAG value + * @property {number} US_TX_PLUSPASS=56 US_TX_PLUSPASS value + * @property {number} US_TX_TOLLTAG=57 US_TX_TOLLTAG value + * @property {number} US_TX_TXTAG=58 US_TX_TXTAG value + * @property {number} US_TX_XPRESS_CARD=59 US_TX_XPRESS_CARD value + * @property {number} US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD=60 US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD value + * @property {number} US_VA_EZPASSVA=61 US_VA_EZPASSVA value + * @property {number} US_WA_BREEZEBY=17 US_WA_BREEZEBY value + * @property {number} US_WA_GOOD_TO_GO=1 US_WA_GOOD_TO_GO value + * @property {number} US_WV_EZPASSWV=62 US_WV_EZPASSWV value + * @property {number} US_WV_MEMORIAL_BRIDGE_TICKETS=63 US_WV_MEMORIAL_BRIDGE_TICKETS value + * @property {number} US_WV_NEWELL_TOLL_BRIDGE_TICKET=64 US_WV_NEWELL_TOLL_BRIDGE_TICKET value + */ + v2.TollPass = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TOLL_PASS_UNSPECIFIED"] = 0; + values[valuesById[82] = "AU_ETOLL_TAG"] = 82; + values[valuesById[83] = "AU_EWAY_TAG"] = 83; + values[valuesById[2] = "AU_LINKT"] = 2; + values[valuesById[3] = "AR_TELEPASE"] = 3; + values[valuesById[81] = "BR_AUTO_EXPRESO"] = 81; + values[valuesById[7] = "BR_CONECTCAR"] = 7; + values[valuesById[8] = "BR_MOVE_MAIS"] = 8; + values[valuesById[88] = "BR_PASSA_RAPIDO"] = 88; + values[valuesById[9] = "BR_SEM_PARAR"] = 9; + values[valuesById[10] = "BR_TAGGY"] = 10; + values[valuesById[11] = "BR_VELOE"] = 11; + values[valuesById[84] = "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD"] = 84; + values[valuesById[85] = "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD"] = 85; + values[valuesById[18] = "CA_US_BLUE_WATER_EDGE_PASS"] = 18; + values[valuesById[19] = "CA_US_CONNEXION"] = 19; + values[valuesById[20] = "CA_US_NEXUS_CARD"] = 20; + values[valuesById[16] = "ID_E_TOLL"] = 16; + values[valuesById[78] = "IN_FASTAG"] = 78; + values[valuesById[79] = "IN_LOCAL_HP_PLATE_EXEMPT"] = 79; + values[valuesById[90] = "MX_IAVE"] = 90; + values[valuesById[91] = "MX_PASE"] = 91; + values[valuesById[93] = "MX_QUICKPASS"] = 93; + values[valuesById[89] = "MX_SISTEMA_TELEPEAJE_CHIHUAHUA"] = 89; + values[valuesById[12] = "MX_TAG_IAVE"] = 12; + values[valuesById[13] = "MX_TAG_TELEVIA"] = 13; + values[valuesById[92] = "MX_TELEVIA"] = 92; + values[valuesById[14] = "MX_VIAPASS"] = 14; + values[valuesById[21] = "US_AL_FREEDOM_PASS"] = 21; + values[valuesById[22] = "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS"] = 22; + values[valuesById[4] = "US_CA_FASTRAK"] = 4; + values[valuesById[86] = "US_CA_FASTRAK_CAV_STICKER"] = 86; + values[valuesById[23] = "US_CO_EXPRESSTOLL"] = 23; + values[valuesById[24] = "US_CO_GO_PASS"] = 24; + values[valuesById[25] = "US_DE_EZPASSDE"] = 25; + values[valuesById[65] = "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS"] = 65; + values[valuesById[66] = "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD"] = 66; + values[valuesById[67] = "US_FL_EPASS"] = 67; + values[valuesById[68] = "US_FL_GIBA_TOLL_PASS"] = 68; + values[valuesById[69] = "US_FL_LEEWAY"] = 69; + values[valuesById[70] = "US_FL_SUNPASS"] = 70; + values[valuesById[71] = "US_FL_SUNPASS_PRO"] = 71; + values[valuesById[73] = "US_IL_EZPASSIL"] = 73; + values[valuesById[72] = "US_IL_IPASS"] = 72; + values[valuesById[26] = "US_IN_EZPASSIN"] = 26; + values[valuesById[27] = "US_KS_BESTPASS_HORIZON"] = 27; + values[valuesById[28] = "US_KS_KTAG"] = 28; + values[valuesById[29] = "US_KS_NATIONALPASS"] = 29; + values[valuesById[30] = "US_KS_PREPASS_ELITEPASS"] = 30; + values[valuesById[31] = "US_KY_RIVERLINK"] = 31; + values[valuesById[32] = "US_LA_GEAUXPASS"] = 32; + values[valuesById[33] = "US_LA_TOLL_TAG"] = 33; + values[valuesById[6] = "US_MA_EZPASSMA"] = 6; + values[valuesById[34] = "US_MD_EZPASSMD"] = 34; + values[valuesById[35] = "US_ME_EZPASSME"] = 35; + values[valuesById[36] = "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD"] = 36; + values[valuesById[37] = "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG"] = 37; + values[valuesById[38] = "US_MI_IQ_PROX_CARD"] = 38; + values[valuesById[39] = "US_MI_MACKINAC_BRIDGE_MAC_PASS"] = 39; + values[valuesById[40] = "US_MI_NEXPRESS_TOLL"] = 40; + values[valuesById[41] = "US_MN_EZPASSMN"] = 41; + values[valuesById[42] = "US_NC_EZPASSNC"] = 42; + values[valuesById[87] = "US_NC_PEACH_PASS"] = 87; + values[valuesById[43] = "US_NC_QUICK_PASS"] = 43; + values[valuesById[80] = "US_NH_EZPASSNH"] = 80; + values[valuesById[75] = "US_NJ_DOWNBEACH_EXPRESS_PASS"] = 75; + values[valuesById[74] = "US_NJ_EZPASSNJ"] = 74; + values[valuesById[76] = "US_NY_EXPRESSPASS"] = 76; + values[valuesById[77] = "US_NY_EZPASSNY"] = 77; + values[valuesById[44] = "US_OH_EZPASSOH"] = 44; + values[valuesById[45] = "US_PA_EZPASSPA"] = 45; + values[valuesById[46] = "US_RI_EZPASSRI"] = 46; + values[valuesById[47] = "US_SC_PALPASS"] = 47; + values[valuesById[48] = "US_TX_BANCPASS"] = 48; + values[valuesById[49] = "US_TX_DEL_RIO_PASS"] = 49; + values[valuesById[50] = "US_TX_EFAST_PASS"] = 50; + values[valuesById[51] = "US_TX_EAGLE_PASS_EXPRESS_CARD"] = 51; + values[valuesById[52] = "US_TX_EPTOLL"] = 52; + values[valuesById[53] = "US_TX_EZ_CROSS"] = 53; + values[valuesById[54] = "US_TX_EZTAG"] = 54; + values[valuesById[55] = "US_TX_LAREDO_TRADE_TAG"] = 55; + values[valuesById[56] = "US_TX_PLUSPASS"] = 56; + values[valuesById[57] = "US_TX_TOLLTAG"] = 57; + values[valuesById[58] = "US_TX_TXTAG"] = 58; + values[valuesById[59] = "US_TX_XPRESS_CARD"] = 59; + values[valuesById[60] = "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD"] = 60; + values[valuesById[61] = "US_VA_EZPASSVA"] = 61; + values[valuesById[17] = "US_WA_BREEZEBY"] = 17; + values[valuesById[1] = "US_WA_GOOD_TO_GO"] = 1; + values[valuesById[62] = "US_WV_EZPASSWV"] = 62; + values[valuesById[63] = "US_WV_MEMORIAL_BRIDGE_TICKETS"] = 63; + values[valuesById[64] = "US_WV_NEWELL_TOLL_BRIDGE_TICKET"] = 64; + return values; + })(); + + v2.VehicleInfo = (function() { + + /** + * Properties of a VehicleInfo. + * @memberof google.maps.routing.v2 + * @interface IVehicleInfo + * @property {google.maps.routing.v2.VehicleEmissionType|null} [emissionType] VehicleInfo emissionType + */ + + /** + * Constructs a new VehicleInfo. + * @memberof google.maps.routing.v2 + * @classdesc Represents a VehicleInfo. + * @implements IVehicleInfo + * @constructor + * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set + */ + function VehicleInfo(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]]; + } + + /** + * VehicleInfo emissionType. + * @member {google.maps.routing.v2.VehicleEmissionType} emissionType + * @memberof google.maps.routing.v2.VehicleInfo + * @instance + */ + VehicleInfo.prototype.emissionType = 0; + + /** + * Creates a new VehicleInfo instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo=} [properties] Properties to set + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo instance + */ + VehicleInfo.create = function create(properties) { + return new VehicleInfo(properties); + }; + + /** + * Encodes the specified VehicleInfo message. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emissionType != null && Object.hasOwnProperty.call(message, "emissionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.emissionType); + return writer; + }; + + /** + * Encodes the specified VehicleInfo message, length delimited. Does not implicitly {@link google.maps.routing.v2.VehicleInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.IVehicleInfo} message VehicleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VehicleInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.VehicleInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.emissionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VehicleInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VehicleInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VehicleInfo message. + * @function verify + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VehicleInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emissionType != null && message.hasOwnProperty("emissionType")) + switch (message.emissionType) { + default: + return "emissionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a VehicleInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.VehicleInfo} VehicleInfo + */ + VehicleInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.VehicleInfo) + return object; + var message = new $root.google.maps.routing.v2.VehicleInfo(); + switch (object.emissionType) { + case "VEHICLE_EMISSION_TYPE_UNSPECIFIED": + case 0: + message.emissionType = 0; + break; + case "GASOLINE": + case 1: + message.emissionType = 1; + break; + case "ELECTRIC": + case 2: + message.emissionType = 2; + break; + case "HYBRID": + case 3: + message.emissionType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a VehicleInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {google.maps.routing.v2.VehicleInfo} message VehicleInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VehicleInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.emissionType = options.enums === String ? "VEHICLE_EMISSION_TYPE_UNSPECIFIED" : 0; + if (message.emissionType != null && message.hasOwnProperty("emissionType")) + object.emissionType = options.enums === String ? $root.google.maps.routing.v2.VehicleEmissionType[message.emissionType] : message.emissionType; + return object; + }; + + /** + * Converts this VehicleInfo to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.VehicleInfo + * @instance + * @returns {Object.} JSON object + */ + VehicleInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VehicleInfo + * @function getTypeUrl + * @memberof google.maps.routing.v2.VehicleInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VehicleInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.VehicleInfo"; + }; + + return VehicleInfo; + })(); + + /** + * VehicleEmissionType enum. + * @name google.maps.routing.v2.VehicleEmissionType + * @enum {number} + * @property {number} VEHICLE_EMISSION_TYPE_UNSPECIFIED=0 VEHICLE_EMISSION_TYPE_UNSPECIFIED value + * @property {number} GASOLINE=1 GASOLINE value + * @property {number} ELECTRIC=2 ELECTRIC value + * @property {number} HYBRID=3 HYBRID value + */ + v2.VehicleEmissionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VEHICLE_EMISSION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GASOLINE"] = 1; + values[valuesById[2] = "ELECTRIC"] = 2; + values[valuesById[3] = "HYBRID"] = 3; + return values; + })(); + + /** + * RouteTravelMode enum. + * @name google.maps.routing.v2.RouteTravelMode + * @enum {number} + * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value + * @property {number} DRIVE=1 DRIVE value + * @property {number} BICYCLE=2 BICYCLE value + * @property {number} WALK=3 WALK value + * @property {number} TWO_WHEELER=4 TWO_WHEELER value + */ + v2.RouteTravelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVE"] = 1; + values[valuesById[2] = "BICYCLE"] = 2; + values[valuesById[3] = "WALK"] = 3; + values[valuesById[4] = "TWO_WHEELER"] = 4; + return values; + })(); + + v2.Routes = (function() { + + /** + * Constructs a new Routes service. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Routes + * @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 Routes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Routes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Routes; + + /** + * Creates new Routes service using the specified rpc implementation. + * @function create + * @memberof google.maps.routing.v2.Routes + * @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 {Routes} RPC service. Useful where requests and/or responses are streamed. + */ + Routes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRoutes}. + * @memberof google.maps.routing.v2.Routes + * @typedef ComputeRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.routing.v2.ComputeRoutesResponse} [response] ComputeRoutesResponse + */ + + /** + * Calls ComputeRoutes. + * @function computeRoutes + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object + * @param {google.maps.routing.v2.Routes.ComputeRoutesCallback} callback Node-style callback called with the error, if any, and ComputeRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.computeRoutes = function computeRoutes(request, callback) { + return this.rpcCall(computeRoutes, $root.google.maps.routing.v2.ComputeRoutesRequest, $root.google.maps.routing.v2.ComputeRoutesResponse, request, callback); + }, "name", { value: "ComputeRoutes" }); + + /** + * Calls ComputeRoutes. + * @function computeRoutes + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRoutesRequest} request ComputeRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.maps.routing.v2.Routes|computeRouteMatrix}. + * @memberof google.maps.routing.v2.Routes + * @typedef ComputeRouteMatrixCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.routing.v2.RouteMatrixElement} [response] RouteMatrixElement + */ + + /** + * Calls ComputeRouteMatrix. + * @function computeRouteMatrix + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object + * @param {google.maps.routing.v2.Routes.ComputeRouteMatrixCallback} callback Node-style callback called with the error, if any, and RouteMatrixElement + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.computeRouteMatrix = function computeRouteMatrix(request, callback) { + return this.rpcCall(computeRouteMatrix, $root.google.maps.routing.v2.ComputeRouteMatrixRequest, $root.google.maps.routing.v2.RouteMatrixElement, request, callback); + }, "name", { value: "ComputeRouteMatrix" }); + + /** + * Calls ComputeRouteMatrix. + * @function computeRouteMatrix + * @memberof google.maps.routing.v2.Routes + * @instance + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} request ComputeRouteMatrixRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Routes; + })(); + + v2.ComputeRoutesRequest = (function() { + + /** + * Properties of a ComputeRoutesRequest. + * @memberof google.maps.routing.v2 + * @interface IComputeRoutesRequest + * @property {google.maps.routing.v2.IWaypoint|null} [origin] ComputeRoutesRequest origin + * @property {google.maps.routing.v2.IWaypoint|null} [destination] ComputeRoutesRequest destination + * @property {Array.|null} [intermediates] ComputeRoutesRequest intermediates + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRoutesRequest travelMode + * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRoutesRequest routingPreference + * @property {google.maps.routing.v2.PolylineQuality|null} [polylineQuality] ComputeRoutesRequest polylineQuality + * @property {google.maps.routing.v2.PolylineEncoding|null} [polylineEncoding] ComputeRoutesRequest polylineEncoding + * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRoutesRequest departureTime + * @property {boolean|null} [computeAlternativeRoutes] ComputeRoutesRequest computeAlternativeRoutes + * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] ComputeRoutesRequest routeModifiers + * @property {string|null} [languageCode] ComputeRoutesRequest languageCode + * @property {google.maps.routing.v2.Units|null} [units] ComputeRoutesRequest units + */ + + /** + * Constructs a new ComputeRoutesRequest. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRoutesRequest. + * @implements IComputeRoutesRequest + * @constructor + * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set + */ + function ComputeRoutesRequest(properties) { + this.intermediates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeRoutesRequest origin. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} origin + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.origin = null; + + /** + * ComputeRoutesRequest destination. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} destination + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.destination = null; + + /** + * ComputeRoutesRequest intermediates. + * @member {Array.} intermediates + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.intermediates = $util.emptyArray; + + /** + * ComputeRoutesRequest travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.travelMode = 0; + + /** + * ComputeRoutesRequest routingPreference. + * @member {google.maps.routing.v2.RoutingPreference} routingPreference + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.routingPreference = 0; + + /** + * ComputeRoutesRequest polylineQuality. + * @member {google.maps.routing.v2.PolylineQuality} polylineQuality + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.polylineQuality = 0; + + /** + * ComputeRoutesRequest polylineEncoding. + * @member {google.maps.routing.v2.PolylineEncoding} polylineEncoding + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.polylineEncoding = 0; + + /** + * ComputeRoutesRequest departureTime. + * @member {google.protobuf.ITimestamp|null|undefined} departureTime + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.departureTime = null; + + /** + * ComputeRoutesRequest computeAlternativeRoutes. + * @member {boolean} computeAlternativeRoutes + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.computeAlternativeRoutes = false; + + /** + * ComputeRoutesRequest routeModifiers. + * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.routeModifiers = null; + + /** + * ComputeRoutesRequest languageCode. + * @member {string} languageCode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.languageCode = ""; + + /** + * ComputeRoutesRequest units. + * @member {google.maps.routing.v2.Units} units + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + */ + ComputeRoutesRequest.prototype.units = 0; + + /** + * Creates a new ComputeRoutesRequest instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest instance + */ + ComputeRoutesRequest.create = function create(properties) { + return new ComputeRoutesRequest(properties); + }; + + /** + * Encodes the specified ComputeRoutesRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) + $root.google.maps.routing.v2.Waypoint.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.maps.routing.v2.Waypoint.encode(message.destination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.intermediates != null && message.intermediates.length) + for (var i = 0; i < message.intermediates.length; ++i) + $root.google.maps.routing.v2.Waypoint.encode(message.intermediates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.travelMode); + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.routingPreference); + if (message.polylineQuality != null && Object.hasOwnProperty.call(message, "polylineQuality")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.polylineQuality); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.computeAlternativeRoutes != null && Object.hasOwnProperty.call(message, "computeAlternativeRoutes")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeAlternativeRoutes); + if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) + $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.units); + if (message.polylineEncoding != null && Object.hasOwnProperty.call(message, "polylineEncoding")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.polylineEncoding); + return writer; + }; + + /** + * Encodes the specified ComputeRoutesRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.IComputeRoutesRequest} message ComputeRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.origin = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.destination = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.intermediates && message.intermediates.length)) + message.intermediates = []; + message.intermediates.push($root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32())); + break; + } + case 4: { + message.travelMode = reader.int32(); + break; + } + case 5: { + message.routingPreference = reader.int32(); + break; + } + case 6: { + message.polylineQuality = reader.int32(); + break; + } + case 12: { + message.polylineEncoding = reader.int32(); + break; + } + case 7: { + message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.computeAlternativeRoutes = reader.bool(); + break; + } + case 9: { + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); + break; + } + case 10: { + message.languageCode = reader.string(); + break; + } + case 11: { + message.units = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRoutesRequest message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRoutesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.origin); + if (error) + return "origin." + error; + } + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.intermediates != null && message.hasOwnProperty("intermediates")) { + if (!Array.isArray(message.intermediates)) + return "intermediates: array expected"; + for (var i = 0; i < message.intermediates.length; ++i) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.intermediates[i]); + if (error) + return "intermediates." + error; + } + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) + switch (message.polylineQuality) { + default: + return "polylineQuality: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) + switch (message.polylineEncoding) { + default: + return "polylineEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) + if (typeof message.computeAlternativeRoutes !== "boolean") + return "computeAlternativeRoutes: boolean expected"; + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { + var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); + if (error) + return "routeModifiers." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + switch (message.units) { + default: + return "units: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ComputeRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRoutesRequest} ComputeRoutesRequest + */ + ComputeRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRoutesRequest) + return object; + var message = new $root.google.maps.routing.v2.ComputeRoutesRequest(); + if (object.origin != null) { + if (typeof object.origin !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.origin: object expected"); + message.origin = $root.google.maps.routing.v2.Waypoint.fromObject(object.origin); + } + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.destination: object expected"); + message.destination = $root.google.maps.routing.v2.Waypoint.fromObject(object.destination); + } + if (object.intermediates) { + if (!Array.isArray(object.intermediates)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: array expected"); + message.intermediates = []; + for (var i = 0; i < object.intermediates.length; ++i) { + if (typeof object.intermediates[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.intermediates: object expected"); + message.intermediates[i] = $root.google.maps.routing.v2.Waypoint.fromObject(object.intermediates[i]); + } + } + switch (object.travelMode) { + case "TRAVEL_MODE_UNSPECIFIED": + case 0: + message.travelMode = 0; + break; + case "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + } + switch (object.routingPreference) { + case "ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "TRAFFIC_UNAWARE": + case 1: + message.routingPreference = 1; + break; + case "TRAFFIC_AWARE": + case 2: + message.routingPreference = 2; + break; + case "TRAFFIC_AWARE_OPTIMAL": + case 3: + message.routingPreference = 3; + break; + } + switch (object.polylineQuality) { + case "POLYLINE_QUALITY_UNSPECIFIED": + case 0: + message.polylineQuality = 0; + break; + case "HIGH_QUALITY": + case 1: + message.polylineQuality = 1; + break; + case "OVERVIEW": + case 2: + message.polylineQuality = 2; + break; + } + switch (object.polylineEncoding) { + case "POLYLINE_ENCODING_UNSPECIFIED": + case 0: + message.polylineEncoding = 0; + break; + case "ENCODED_POLYLINE": + case 1: + message.polylineEncoding = 1; + break; + case "GEO_JSON_LINESTRING": + case 2: + message.polylineEncoding = 2; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.departureTime: object expected"); + message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); + } + if (object.computeAlternativeRoutes != null) + message.computeAlternativeRoutes = Boolean(object.computeAlternativeRoutes); + if (object.routeModifiers != null) { + if (typeof object.routeModifiers !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesRequest.routeModifiers: object expected"); + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.units) { + case "UNITS_UNSPECIFIED": + case 0: + message.units = 0; + break; + case "METRIC": + case 1: + message.units = 1; + break; + case "IMPERIAL": + case 2: + message.units = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ComputeRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {google.maps.routing.v2.ComputeRoutesRequest} message ComputeRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intermediates = []; + if (options.defaults) { + object.origin = null; + object.destination = null; + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; + object.polylineQuality = options.enums === String ? "POLYLINE_QUALITY_UNSPECIFIED" : 0; + object.departureTime = null; + object.computeAlternativeRoutes = false; + object.routeModifiers = null; + object.languageCode = ""; + object.units = options.enums === String ? "UNITS_UNSPECIFIED" : 0; + object.polylineEncoding = options.enums === String ? "POLYLINE_ENCODING_UNSPECIFIED" : 0; + } + if (message.origin != null && message.hasOwnProperty("origin")) + object.origin = $root.google.maps.routing.v2.Waypoint.toObject(message.origin, options); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.maps.routing.v2.Waypoint.toObject(message.destination, options); + if (message.intermediates && message.intermediates.length) { + object.intermediates = []; + for (var j = 0; j < message.intermediates.length; ++j) + object.intermediates[j] = $root.google.maps.routing.v2.Waypoint.toObject(message.intermediates[j], options); + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; + if (message.polylineQuality != null && message.hasOwnProperty("polylineQuality")) + object.polylineQuality = options.enums === String ? $root.google.maps.routing.v2.PolylineQuality[message.polylineQuality] : message.polylineQuality; + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); + if (message.computeAlternativeRoutes != null && message.hasOwnProperty("computeAlternativeRoutes")) + object.computeAlternativeRoutes = message.computeAlternativeRoutes; + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) + object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.units != null && message.hasOwnProperty("units")) + object.units = options.enums === String ? $root.google.maps.routing.v2.Units[message.units] : message.units; + if (message.polylineEncoding != null && message.hasOwnProperty("polylineEncoding")) + object.polylineEncoding = options.enums === String ? $root.google.maps.routing.v2.PolylineEncoding[message.polylineEncoding] : message.polylineEncoding; + return object; + }; + + /** + * Converts this ComputeRoutesRequest to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRoutesRequest + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesRequest"; + }; + + return ComputeRoutesRequest; + })(); + + v2.ComputeRoutesResponse = (function() { + + /** + * Properties of a ComputeRoutesResponse. + * @memberof google.maps.routing.v2 + * @interface IComputeRoutesResponse + * @property {Array.|null} [routes] ComputeRoutesResponse routes + * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] ComputeRoutesResponse fallbackInfo + */ + + /** + * Constructs a new ComputeRoutesResponse. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRoutesResponse. + * @implements IComputeRoutesResponse + * @constructor + * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set + */ + function ComputeRoutesResponse(properties) { + this.routes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeRoutesResponse routes. + * @member {Array.} routes + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + */ + ComputeRoutesResponse.prototype.routes = $util.emptyArray; + + /** + * ComputeRoutesResponse fallbackInfo. + * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + */ + ComputeRoutesResponse.prototype.fallbackInfo = null; + + /** + * Creates a new ComputeRoutesResponse instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse instance + */ + ComputeRoutesResponse.create = function create(properties) { + return new ComputeRoutesResponse(properties); + }; + + /** + * Encodes the specified ComputeRoutesResponse message. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routes != null && message.routes.length) + for (var i = 0; i < message.routes.length; ++i) + $root.google.maps.routing.v2.Route.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) + $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeRoutesResponse message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.IComputeRoutesResponse} message ComputeRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.routes && message.routes.length)) + message.routes = []; + message.routes.push($root.google.maps.routing.v2.Route.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRoutesResponse message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routes != null && message.hasOwnProperty("routes")) { + if (!Array.isArray(message.routes)) + return "routes: array expected"; + for (var i = 0; i < message.routes.length; ++i) { + var error = $root.google.maps.routing.v2.Route.verify(message.routes[i]); + if (error) + return "routes." + error; + } + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { + var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); + if (error) + return "fallbackInfo." + error; + } + return null; + }; + + /** + * Creates a ComputeRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRoutesResponse} ComputeRoutesResponse + */ + ComputeRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRoutesResponse) + return object; + var message = new $root.google.maps.routing.v2.ComputeRoutesResponse(); + if (object.routes) { + if (!Array.isArray(object.routes)) + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: array expected"); + message.routes = []; + for (var i = 0; i < object.routes.length; ++i) { + if (typeof object.routes[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.routes: object expected"); + message.routes[i] = $root.google.maps.routing.v2.Route.fromObject(object.routes[i]); + } + } + if (object.fallbackInfo != null) { + if (typeof object.fallbackInfo !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRoutesResponse.fallbackInfo: object expected"); + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); + } + return message; + }; + + /** + * Creates a plain object from a ComputeRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {google.maps.routing.v2.ComputeRoutesResponse} message ComputeRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routes = []; + if (options.defaults) + object.fallbackInfo = null; + if (message.routes && message.routes.length) { + object.routes = []; + for (var j = 0; j < message.routes.length; ++j) + object.routes[j] = $root.google.maps.routing.v2.Route.toObject(message.routes[j], options); + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) + object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); + return object; + }; + + /** + * Converts this ComputeRoutesResponse to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ComputeRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRoutesResponse + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRoutesResponse"; + }; + + return ComputeRoutesResponse; + })(); + + v2.ComputeRouteMatrixRequest = (function() { + + /** + * Properties of a ComputeRouteMatrixRequest. + * @memberof google.maps.routing.v2 + * @interface IComputeRouteMatrixRequest + * @property {Array.|null} [origins] ComputeRouteMatrixRequest origins + * @property {Array.|null} [destinations] ComputeRouteMatrixRequest destinations + * @property {google.maps.routing.v2.RouteTravelMode|null} [travelMode] ComputeRouteMatrixRequest travelMode + * @property {google.maps.routing.v2.RoutingPreference|null} [routingPreference] ComputeRouteMatrixRequest routingPreference + * @property {google.protobuf.ITimestamp|null} [departureTime] ComputeRouteMatrixRequest departureTime + */ + + /** + * Constructs a new ComputeRouteMatrixRequest. + * @memberof google.maps.routing.v2 + * @classdesc Represents a ComputeRouteMatrixRequest. + * @implements IComputeRouteMatrixRequest + * @constructor + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set + */ + function ComputeRouteMatrixRequest(properties) { + this.origins = []; + 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]]; + } + + /** + * ComputeRouteMatrixRequest origins. + * @member {Array.} origins + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.origins = $util.emptyArray; + + /** + * ComputeRouteMatrixRequest destinations. + * @member {Array.} destinations + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.destinations = $util.emptyArray; + + /** + * ComputeRouteMatrixRequest travelMode. + * @member {google.maps.routing.v2.RouteTravelMode} travelMode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.travelMode = 0; + + /** + * ComputeRouteMatrixRequest routingPreference. + * @member {google.maps.routing.v2.RoutingPreference} routingPreference + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.routingPreference = 0; + + /** + * ComputeRouteMatrixRequest departureTime. + * @member {google.protobuf.ITimestamp|null|undefined} departureTime + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + */ + ComputeRouteMatrixRequest.prototype.departureTime = null; + + /** + * Creates a new ComputeRouteMatrixRequest instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest=} [properties] Properties to set + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest instance + */ + ComputeRouteMatrixRequest.create = function create(properties) { + return new ComputeRouteMatrixRequest(properties); + }; + + /** + * Encodes the specified ComputeRouteMatrixRequest message. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRouteMatrixRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origins != null && message.origins.length) + for (var i = 0; i < message.origins.length; ++i) + $root.google.maps.routing.v2.RouteMatrixOrigin.encode(message.origins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.maps.routing.v2.RouteMatrixDestination.encode(message.destinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.travelMode); + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.routingPreference); + if (message.departureTime != null && Object.hasOwnProperty.call(message, "departureTime")) + $root.google.protobuf.Timestamp.encode(message.departureTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeRouteMatrixRequest message, length delimited. Does not implicitly {@link google.maps.routing.v2.ComputeRouteMatrixRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.IComputeRouteMatrixRequest} message ComputeRouteMatrixRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeRouteMatrixRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRouteMatrixRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.origins && message.origins.length)) + message.origins = []; + message.origins.push($root.google.maps.routing.v2.RouteMatrixOrigin.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.maps.routing.v2.RouteMatrixDestination.decode(reader, reader.uint32())); + break; + } + case 3: { + message.travelMode = reader.int32(); + break; + } + case 4: { + message.routingPreference = reader.int32(); + break; + } + case 5: { + message.departureTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeRouteMatrixRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeRouteMatrixRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeRouteMatrixRequest message. + * @function verify + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeRouteMatrixRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origins != null && message.hasOwnProperty("origins")) { + if (!Array.isArray(message.origins)) + return "origins: array expected"; + for (var i = 0; i < message.origins.length; ++i) { + var error = $root.google.maps.routing.v2.RouteMatrixOrigin.verify(message.origins[i]); + if (error) + return "origins." + error; + } + } + 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) { + var error = $root.google.maps.routing.v2.RouteMatrixDestination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.departureTime != null && message.hasOwnProperty("departureTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.departureTime); + if (error) + return "departureTime." + error; + } + return null; + }; + + /** + * Creates a ComputeRouteMatrixRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.ComputeRouteMatrixRequest} ComputeRouteMatrixRequest + */ + ComputeRouteMatrixRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.ComputeRouteMatrixRequest) + return object; + var message = new $root.google.maps.routing.v2.ComputeRouteMatrixRequest(); + if (object.origins) { + if (!Array.isArray(object.origins)) + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: array expected"); + message.origins = []; + for (var i = 0; i < object.origins.length; ++i) { + if (typeof object.origins[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.origins: object expected"); + message.origins[i] = $root.google.maps.routing.v2.RouteMatrixOrigin.fromObject(object.origins[i]); + } + } + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.destinations: object expected"); + message.destinations[i] = $root.google.maps.routing.v2.RouteMatrixDestination.fromObject(object.destinations[i]); + } + } + switch (object.travelMode) { + case "TRAVEL_MODE_UNSPECIFIED": + case 0: + message.travelMode = 0; + break; + case "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + } + switch (object.routingPreference) { + case "ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "TRAFFIC_UNAWARE": + case 1: + message.routingPreference = 1; + break; + case "TRAFFIC_AWARE": + case 2: + message.routingPreference = 2; + break; + case "TRAFFIC_AWARE_OPTIMAL": + case 3: + message.routingPreference = 3; + break; + } + if (object.departureTime != null) { + if (typeof object.departureTime !== "object") + throw TypeError(".google.maps.routing.v2.ComputeRouteMatrixRequest.departureTime: object expected"); + message.departureTime = $root.google.protobuf.Timestamp.fromObject(object.departureTime); + } + return message; + }; + + /** + * Creates a plain object from a ComputeRouteMatrixRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {google.maps.routing.v2.ComputeRouteMatrixRequest} message ComputeRouteMatrixRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeRouteMatrixRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.origins = []; + object.destinations = []; + } + if (options.defaults) { + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; + object.departureTime = null; + } + if (message.origins && message.origins.length) { + object.origins = []; + for (var j = 0; j < message.origins.length; ++j) + object.origins[j] = $root.google.maps.routing.v2.RouteMatrixOrigin.toObject(message.origins[j], options); + } + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.maps.routing.v2.RouteMatrixDestination.toObject(message.destinations[j], options); + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.routing.v2.RouteTravelMode[message.travelMode] : message.travelMode; + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.routing.v2.RoutingPreference[message.routingPreference] : message.routingPreference; + if (message.departureTime != null && message.hasOwnProperty("departureTime")) + object.departureTime = $root.google.protobuf.Timestamp.toObject(message.departureTime, options); + return object; + }; + + /** + * Converts this ComputeRouteMatrixRequest to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @instance + * @returns {Object.} JSON object + */ + ComputeRouteMatrixRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeRouteMatrixRequest + * @function getTypeUrl + * @memberof google.maps.routing.v2.ComputeRouteMatrixRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeRouteMatrixRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.ComputeRouteMatrixRequest"; + }; + + return ComputeRouteMatrixRequest; + })(); + + v2.RouteMatrixOrigin = (function() { + + /** + * Properties of a RouteMatrixOrigin. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixOrigin + * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixOrigin waypoint + * @property {google.maps.routing.v2.IRouteModifiers|null} [routeModifiers] RouteMatrixOrigin routeModifiers + */ + + /** + * Constructs a new RouteMatrixOrigin. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixOrigin. + * @implements IRouteMatrixOrigin + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set + */ + function RouteMatrixOrigin(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]]; + } + + /** + * RouteMatrixOrigin waypoint. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + */ + RouteMatrixOrigin.prototype.waypoint = null; + + /** + * RouteMatrixOrigin routeModifiers. + * @member {google.maps.routing.v2.IRouteModifiers|null|undefined} routeModifiers + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + */ + RouteMatrixOrigin.prototype.routeModifiers = null; + + /** + * Creates a new RouteMatrixOrigin instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin instance + */ + RouteMatrixOrigin.create = function create(properties) { + return new RouteMatrixOrigin(properties); + }; + + /** + * Encodes the specified RouteMatrixOrigin message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixOrigin.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) + $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) + $root.google.maps.routing.v2.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatrixOrigin message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixOrigin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.IRouteMatrixOrigin} message RouteMatrixOrigin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixOrigin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixOrigin.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixOrigin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixOrigin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixOrigin message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixOrigin.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); + if (error) + return "waypoint." + error; + } + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { + var error = $root.google.maps.routing.v2.RouteModifiers.verify(message.routeModifiers); + if (error) + return "routeModifiers." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixOrigin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixOrigin} RouteMatrixOrigin + */ + RouteMatrixOrigin.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixOrigin) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixOrigin(); + if (object.waypoint != null) { + if (typeof object.waypoint !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.waypoint: object expected"); + message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); + } + if (object.routeModifiers != null) { + if (typeof object.routeModifiers !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixOrigin.routeModifiers: object expected"); + message.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.fromObject(object.routeModifiers); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixOrigin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {google.maps.routing.v2.RouteMatrixOrigin} message RouteMatrixOrigin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixOrigin.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.waypoint = null; + object.routeModifiers = null; + } + if (message.waypoint != null && message.hasOwnProperty("waypoint")) + object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) + object.routeModifiers = $root.google.maps.routing.v2.RouteModifiers.toObject(message.routeModifiers, options); + return object; + }; + + /** + * Converts this RouteMatrixOrigin to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixOrigin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixOrigin + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixOrigin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixOrigin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixOrigin"; + }; + + return RouteMatrixOrigin; + })(); + + v2.RouteMatrixDestination = (function() { + + /** + * Properties of a RouteMatrixDestination. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixDestination + * @property {google.maps.routing.v2.IWaypoint|null} [waypoint] RouteMatrixDestination waypoint + */ + + /** + * Constructs a new RouteMatrixDestination. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixDestination. + * @implements IRouteMatrixDestination + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set + */ + function RouteMatrixDestination(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]]; + } + + /** + * RouteMatrixDestination waypoint. + * @member {google.maps.routing.v2.IWaypoint|null|undefined} waypoint + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @instance + */ + RouteMatrixDestination.prototype.waypoint = null; + + /** + * Creates a new RouteMatrixDestination instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination instance + */ + RouteMatrixDestination.create = function create(properties) { + return new RouteMatrixDestination(properties); + }; + + /** + * Encodes the specified RouteMatrixDestination message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.waypoint != null && Object.hasOwnProperty.call(message, "waypoint")) + $root.google.maps.routing.v2.Waypoint.encode(message.waypoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatrixDestination message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.IRouteMatrixDestination} message RouteMatrixDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.waypoint = $root.google.maps.routing.v2.Waypoint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixDestination message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) { + var error = $root.google.maps.routing.v2.Waypoint.verify(message.waypoint); + if (error) + return "waypoint." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixDestination} RouteMatrixDestination + */ + RouteMatrixDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixDestination) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixDestination(); + if (object.waypoint != null) { + if (typeof object.waypoint !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixDestination.waypoint: object expected"); + message.waypoint = $root.google.maps.routing.v2.Waypoint.fromObject(object.waypoint); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {google.maps.routing.v2.RouteMatrixDestination} message RouteMatrixDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.waypoint = null; + if (message.waypoint != null && message.hasOwnProperty("waypoint")) + object.waypoint = $root.google.maps.routing.v2.Waypoint.toObject(message.waypoint, options); + return object; + }; + + /** + * Converts this RouteMatrixDestination to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixDestination + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixDestination"; + }; + + return RouteMatrixDestination; + })(); + + v2.RouteMatrixElement = (function() { + + /** + * Properties of a RouteMatrixElement. + * @memberof google.maps.routing.v2 + * @interface IRouteMatrixElement + * @property {number|null} [originIndex] RouteMatrixElement originIndex + * @property {number|null} [destinationIndex] RouteMatrixElement destinationIndex + * @property {google.rpc.IStatus|null} [status] RouteMatrixElement status + * @property {google.maps.routing.v2.RouteMatrixElementCondition|null} [condition] RouteMatrixElement condition + * @property {number|null} [distanceMeters] RouteMatrixElement distanceMeters + * @property {google.protobuf.IDuration|null} [duration] RouteMatrixElement duration + * @property {google.protobuf.IDuration|null} [staticDuration] RouteMatrixElement staticDuration + * @property {google.maps.routing.v2.IRouteTravelAdvisory|null} [travelAdvisory] RouteMatrixElement travelAdvisory + * @property {google.maps.routing.v2.IFallbackInfo|null} [fallbackInfo] RouteMatrixElement fallbackInfo + */ + + /** + * Constructs a new RouteMatrixElement. + * @memberof google.maps.routing.v2 + * @classdesc Represents a RouteMatrixElement. + * @implements IRouteMatrixElement + * @constructor + * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set + */ + function RouteMatrixElement(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]]; + } + + /** + * RouteMatrixElement originIndex. + * @member {number|null|undefined} originIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.originIndex = null; + + /** + * RouteMatrixElement destinationIndex. + * @member {number|null|undefined} destinationIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.destinationIndex = null; + + /** + * RouteMatrixElement status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.status = null; + + /** + * RouteMatrixElement condition. + * @member {google.maps.routing.v2.RouteMatrixElementCondition} condition + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.condition = 0; + + /** + * RouteMatrixElement distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.distanceMeters = 0; + + /** + * RouteMatrixElement duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.duration = null; + + /** + * RouteMatrixElement staticDuration. + * @member {google.protobuf.IDuration|null|undefined} staticDuration + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.staticDuration = null; + + /** + * RouteMatrixElement travelAdvisory. + * @member {google.maps.routing.v2.IRouteTravelAdvisory|null|undefined} travelAdvisory + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.travelAdvisory = null; + + /** + * RouteMatrixElement fallbackInfo. + * @member {google.maps.routing.v2.IFallbackInfo|null|undefined} fallbackInfo + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + RouteMatrixElement.prototype.fallbackInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouteMatrixElement _originIndex. + * @member {"originIndex"|undefined} _originIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + Object.defineProperty(RouteMatrixElement.prototype, "_originIndex", { + get: $util.oneOfGetter($oneOfFields = ["originIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouteMatrixElement _destinationIndex. + * @member {"destinationIndex"|undefined} _destinationIndex + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + */ + Object.defineProperty(RouteMatrixElement.prototype, "_destinationIndex", { + get: $util.oneOfGetter($oneOfFields = ["destinationIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteMatrixElement instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement=} [properties] Properties to set + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement instance + */ + RouteMatrixElement.create = function create(properties) { + return new RouteMatrixElement(properties); + }; + + /** + * Encodes the specified RouteMatrixElement message. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixElement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originIndex != null && Object.hasOwnProperty.call(message, "originIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.originIndex); + if (message.destinationIndex != null && Object.hasOwnProperty.call(message, "destinationIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.destinationIndex); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.distanceMeters); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.staticDuration != null && Object.hasOwnProperty.call(message, "staticDuration")) + $root.google.protobuf.Duration.encode(message.staticDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.travelAdvisory != null && Object.hasOwnProperty.call(message, "travelAdvisory")) + $root.google.maps.routing.v2.RouteTravelAdvisory.encode(message.travelAdvisory, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fallbackInfo != null && Object.hasOwnProperty.call(message, "fallbackInfo")) + $root.google.maps.routing.v2.FallbackInfo.encode(message.fallbackInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.condition); + return writer; + }; + + /** + * Encodes the specified RouteMatrixElement message, length delimited. Does not implicitly {@link google.maps.routing.v2.RouteMatrixElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.IRouteMatrixElement} message RouteMatrixElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatrixElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixElement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.RouteMatrixElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.originIndex = reader.int32(); + break; + } + case 2: { + message.destinationIndex = reader.int32(); + break; + } + case 3: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 9: { + message.condition = reader.int32(); + break; + } + case 4: { + message.distanceMeters = reader.int32(); + break; + } + case 5: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.staticDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.decode(reader, reader.uint32()); + break; + } + case 8: { + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatrixElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatrixElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatrixElement message. + * @function verify + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatrixElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.originIndex != null && message.hasOwnProperty("originIndex")) { + properties._originIndex = 1; + if (!$util.isInteger(message.originIndex)) + return "originIndex: integer expected"; + } + if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { + properties._destinationIndex = 1; + if (!$util.isInteger(message.destinationIndex)) + return "destinationIndex: integer expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) { + var error = $root.google.protobuf.Duration.verify(message.staticDuration); + if (error) + return "staticDuration." + error; + } + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) { + var error = $root.google.maps.routing.v2.RouteTravelAdvisory.verify(message.travelAdvisory); + if (error) + return "travelAdvisory." + error; + } + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) { + var error = $root.google.maps.routing.v2.FallbackInfo.verify(message.fallbackInfo); + if (error) + return "fallbackInfo." + error; + } + return null; + }; + + /** + * Creates a RouteMatrixElement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.RouteMatrixElement} RouteMatrixElement + */ + RouteMatrixElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.RouteMatrixElement) + return object; + var message = new $root.google.maps.routing.v2.RouteMatrixElement(); + if (object.originIndex != null) + message.originIndex = object.originIndex | 0; + if (object.destinationIndex != null) + message.destinationIndex = object.destinationIndex | 0; + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + switch (object.condition) { + case "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "ROUTE_EXISTS": + case 1: + message.condition = 1; + break; + case "ROUTE_NOT_FOUND": + case 2: + message.condition = 2; + break; + } + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.staticDuration != null) { + if (typeof object.staticDuration !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.staticDuration: object expected"); + message.staticDuration = $root.google.protobuf.Duration.fromObject(object.staticDuration); + } + if (object.travelAdvisory != null) { + if (typeof object.travelAdvisory !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.travelAdvisory: object expected"); + message.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.fromObject(object.travelAdvisory); + } + if (object.fallbackInfo != null) { + if (typeof object.fallbackInfo !== "object") + throw TypeError(".google.maps.routing.v2.RouteMatrixElement.fallbackInfo: object expected"); + message.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.fromObject(object.fallbackInfo); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatrixElement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {google.maps.routing.v2.RouteMatrixElement} message RouteMatrixElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatrixElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.distanceMeters = 0; + object.duration = null; + object.staticDuration = null; + object.travelAdvisory = null; + object.fallbackInfo = null; + object.condition = options.enums === String ? "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED" : 0; + } + if (message.originIndex != null && message.hasOwnProperty("originIndex")) { + object.originIndex = message.originIndex; + if (options.oneofs) + object._originIndex = "originIndex"; + } + if (message.destinationIndex != null && message.hasOwnProperty("destinationIndex")) { + object.destinationIndex = message.destinationIndex; + if (options.oneofs) + object._destinationIndex = "destinationIndex"; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.staticDuration != null && message.hasOwnProperty("staticDuration")) + object.staticDuration = $root.google.protobuf.Duration.toObject(message.staticDuration, options); + if (message.travelAdvisory != null && message.hasOwnProperty("travelAdvisory")) + object.travelAdvisory = $root.google.maps.routing.v2.RouteTravelAdvisory.toObject(message.travelAdvisory, options); + if (message.fallbackInfo != null && message.hasOwnProperty("fallbackInfo")) + object.fallbackInfo = $root.google.maps.routing.v2.FallbackInfo.toObject(message.fallbackInfo, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.maps.routing.v2.RouteMatrixElementCondition[message.condition] : message.condition; + return object; + }; + + /** + * Converts this RouteMatrixElement to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.RouteMatrixElement + * @instance + * @returns {Object.} JSON object + */ + RouteMatrixElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatrixElement + * @function getTypeUrl + * @memberof google.maps.routing.v2.RouteMatrixElement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatrixElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.RouteMatrixElement"; + }; + + return RouteMatrixElement; + })(); + + /** + * RouteMatrixElementCondition enum. + * @name google.maps.routing.v2.RouteMatrixElementCondition + * @enum {number} + * @property {number} ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED=0 ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED value + * @property {number} ROUTE_EXISTS=1 ROUTE_EXISTS value + * @property {number} ROUTE_NOT_FOUND=2 ROUTE_NOT_FOUND value + */ + v2.RouteMatrixElementCondition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROUTE_EXISTS"] = 1; + values[valuesById[2] = "ROUTE_NOT_FOUND"] = 2; + return values; + })(); + + /** + * RoutingPreference enum. + * @name google.maps.routing.v2.RoutingPreference + * @enum {number} + * @property {number} ROUTING_PREFERENCE_UNSPECIFIED=0 ROUTING_PREFERENCE_UNSPECIFIED value + * @property {number} TRAFFIC_UNAWARE=1 TRAFFIC_UNAWARE value + * @property {number} TRAFFIC_AWARE=2 TRAFFIC_AWARE value + * @property {number} TRAFFIC_AWARE_OPTIMAL=3 TRAFFIC_AWARE_OPTIMAL value + */ + v2.RoutingPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTING_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_UNAWARE"] = 1; + values[valuesById[2] = "TRAFFIC_AWARE"] = 2; + values[valuesById[3] = "TRAFFIC_AWARE_OPTIMAL"] = 3; + return values; + })(); + + /** + * Units enum. + * @name google.maps.routing.v2.Units + * @enum {number} + * @property {number} UNITS_UNSPECIFIED=0 UNITS_UNSPECIFIED value + * @property {number} METRIC=1 METRIC value + * @property {number} IMPERIAL=2 IMPERIAL value + */ + v2.Units = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNITS_UNSPECIFIED"] = 0; + values[valuesById[1] = "METRIC"] = 1; + values[valuesById[2] = "IMPERIAL"] = 2; + return values; + })(); + + v2.Waypoint = (function() { + + /** + * Properties of a Waypoint. + * @memberof google.maps.routing.v2 + * @interface IWaypoint + * @property {google.maps.routing.v2.ILocation|null} [location] Waypoint location + * @property {string|null} [placeId] Waypoint placeId + * @property {boolean|null} [via] Waypoint via + * @property {boolean|null} [vehicleStopover] Waypoint vehicleStopover + * @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad + */ + + /** + * Constructs a new Waypoint. + * @memberof google.maps.routing.v2 + * @classdesc Represents a Waypoint. + * @implements IWaypoint + * @constructor + * @param {google.maps.routing.v2.IWaypoint=} [properties] Properties to set + */ + function Waypoint(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]]; + } + + /** + * Waypoint location. + * @member {google.maps.routing.v2.ILocation|null|undefined} location + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.location = null; + + /** + * Waypoint placeId. + * @member {string|null|undefined} placeId + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.placeId = null; + + /** + * Waypoint via. + * @member {boolean} via + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.via = false; + + /** + * Waypoint vehicleStopover. + * @member {boolean} vehicleStopover + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.vehicleStopover = false; + + /** + * Waypoint sideOfRoad. + * @member {boolean} sideOfRoad + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Waypoint.prototype.sideOfRoad = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Waypoint locationType. + * @member {"location"|"placeId"|undefined} locationType + * @memberof google.maps.routing.v2.Waypoint + * @instance + */ + Object.defineProperty(Waypoint.prototype, "locationType", { + get: $util.oneOfGetter($oneOfFields = ["location", "placeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Waypoint instance using the specified properties. + * @function create + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.IWaypoint=} [properties] Properties to set + * @returns {google.maps.routing.v2.Waypoint} Waypoint instance + */ + Waypoint.create = function create(properties) { + return new Waypoint(properties); + }; + + /** + * Encodes the specified Waypoint message. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @function encode + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.IWaypoint} message Waypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Waypoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.maps.routing.v2.Location.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.placeId != null && Object.hasOwnProperty.call(message, "placeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeId); + if (message.via != null && Object.hasOwnProperty.call(message, "via")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.via); + if (message.vehicleStopover != null && Object.hasOwnProperty.call(message, "vehicleStopover")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.vehicleStopover); + if (message.sideOfRoad != null && Object.hasOwnProperty.call(message, "sideOfRoad")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sideOfRoad); + return writer; + }; + + /** + * Encodes the specified Waypoint message, length delimited. Does not implicitly {@link google.maps.routing.v2.Waypoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.IWaypoint} message Waypoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Waypoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Waypoint message from the specified reader or buffer. + * @function decode + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.routing.v2.Waypoint} Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Waypoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.routing.v2.Waypoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.maps.routing.v2.Location.decode(reader, reader.uint32()); + break; + } + case 2: { + message.placeId = reader.string(); + break; + } + case 3: { + message.via = reader.bool(); + break; + } + case 4: { + message.vehicleStopover = reader.bool(); + break; + } + case 5: { + message.sideOfRoad = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Waypoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.routing.v2.Waypoint} Waypoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Waypoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Waypoint message. + * @function verify + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Waypoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.location != null && message.hasOwnProperty("location")) { + properties.locationType = 1; + { + var error = $root.google.maps.routing.v2.Location.verify(message.location); + if (error) + return "location." + error; + } + } + if (message.placeId != null && message.hasOwnProperty("placeId")) { + if (properties.locationType === 1) + return "locationType: multiple values"; + properties.locationType = 1; + if (!$util.isString(message.placeId)) + return "placeId: string expected"; + } + if (message.via != null && message.hasOwnProperty("via")) + if (typeof message.via !== "boolean") + return "via: boolean expected"; + if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) + if (typeof message.vehicleStopover !== "boolean") + return "vehicleStopover: boolean expected"; + if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) + if (typeof message.sideOfRoad !== "boolean") + return "sideOfRoad: boolean expected"; + return null; + }; + + /** + * Creates a Waypoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {Object.} object Plain object + * @returns {google.maps.routing.v2.Waypoint} Waypoint + */ + Waypoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.routing.v2.Waypoint) + return object; + var message = new $root.google.maps.routing.v2.Waypoint(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.maps.routing.v2.Waypoint.location: object expected"); + message.location = $root.google.maps.routing.v2.Location.fromObject(object.location); + } + if (object.placeId != null) + message.placeId = String(object.placeId); + if (object.via != null) + message.via = Boolean(object.via); + if (object.vehicleStopover != null) + message.vehicleStopover = Boolean(object.vehicleStopover); + if (object.sideOfRoad != null) + message.sideOfRoad = Boolean(object.sideOfRoad); + return message; + }; + + /** + * Creates a plain object from a Waypoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {google.maps.routing.v2.Waypoint} message Waypoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Waypoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.via = false; + object.vehicleStopover = false; + object.sideOfRoad = false; + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = $root.google.maps.routing.v2.Location.toObject(message.location, options); + if (options.oneofs) + object.locationType = "location"; + } + if (message.placeId != null && message.hasOwnProperty("placeId")) { + object.placeId = message.placeId; + if (options.oneofs) + object.locationType = "placeId"; + } + if (message.via != null && message.hasOwnProperty("via")) + object.via = message.via; + if (message.vehicleStopover != null && message.hasOwnProperty("vehicleStopover")) + object.vehicleStopover = message.vehicleStopover; + if (message.sideOfRoad != null && message.hasOwnProperty("sideOfRoad")) + object.sideOfRoad = message.sideOfRoad; + return object; + }; + + /** + * Converts this Waypoint to JSON. + * @function toJSON + * @memberof google.maps.routing.v2.Waypoint + * @instance + * @returns {Object.} JSON object + */ + Waypoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Waypoint + * @function getTypeUrl + * @memberof google.maps.routing.v2.Waypoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Waypoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.routing.v2.Waypoint"; + }; + + return Waypoint; + })(); + + return v2; + })(); + + return routing; + })(); + + return maps; + })(); + + 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; + })(); + + /** + * 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 + */ + 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; + return values; + })(); + + return api; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-maps-routing/protos/protos.json b/packages/google-maps-routing/protos/protos.json new file mode 100644 index 000000000000..b7ec7bbf3216 --- /dev/null +++ b/packages/google-maps-routing/protos/protos.json @@ -0,0 +1,2144 @@ +{ + "nested": { + "google": { + "nested": { + "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": { + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "geo": { + "nested": { + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/geo/type/viewport;viewport", + "java_multiple_files": true, + "java_outer_classname": "ViewportProto", + "java_package": "com.google.geo.type", + "objc_class_prefix": "GGTP" + }, + "nested": { + "Viewport": { + "fields": { + "low": { + "type": "google.type.LatLng", + "id": 1 + }, + "high": { + "type": "google.type.LatLng", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/money;money", + "java_multiple_files": true, + "java_outer_classname": "MoneyProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + }, + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "maps": { + "nested": { + "routing": { + "nested": { + "v2": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Maps.Routing.V2", + "go_package": "google.golang.org/genproto/googleapis/maps/routing/v2;routing", + "java_multiple_files": true, + "java_outer_classname": "WaypointProto", + "java_package": "com.google.maps.routing.v2", + "objc_class_prefix": "GMRV2", + "php_namespace": "Google\\Maps\\Routing\\V2", + "ruby_package": "Google::Maps::Routing::V2" + }, + "nested": { + "FallbackInfo": { + "fields": { + "routingMode": { + "type": "FallbackRoutingMode", + "id": 1 + }, + "reason": { + "type": "FallbackReason", + "id": 2 + } + } + }, + "FallbackReason": { + "values": { + "FALLBACK_REASON_UNSPECIFIED": 0, + "SERVER_ERROR": 1, + "LATENCY_EXCEEDED": 2 + } + }, + "FallbackRoutingMode": { + "values": { + "FALLBACK_ROUTING_MODE_UNSPECIFIED": 0, + "FALLBACK_TRAFFIC_UNAWARE": 1, + "FALLBACK_TRAFFIC_AWARE": 2 + } + }, + "Location": { + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1 + }, + "heading": { + "type": "google.protobuf.Int32Value", + "id": 2 + } + } + }, + "Maneuver": { + "values": { + "MANEUVER_UNSPECIFIED": 0, + "TURN_SLIGHT_LEFT": 1, + "TURN_SHARP_LEFT": 2, + "UTURN_LEFT": 3, + "TURN_LEFT": 4, + "TURN_SLIGHT_RIGHT": 5, + "TURN_SHARP_RIGHT": 6, + "UTURN_RIGHT": 7, + "TURN_RIGHT": 8, + "STRAIGHT": 9, + "RAMP_LEFT": 10, + "RAMP_RIGHT": 11, + "MERGE": 12, + "FORK_LEFT": 13, + "FORK_RIGHT": 14, + "FERRY": 15, + "FERRY_TRAIN": 16, + "ROUNDABOUT_LEFT": 17, + "ROUNDABOUT_RIGHT": 18 + } + }, + "NavigationInstruction": { + "fields": { + "maneuver": { + "type": "Maneuver", + "id": 1 + }, + "instructions": { + "type": "string", + "id": 2 + } + } + }, + "Polyline": { + "oneofs": { + "polylineType": { + "oneof": [ + "encodedPolyline", + "geoJsonLinestring" + ] + } + }, + "fields": { + "encodedPolyline": { + "type": "string", + "id": 1 + }, + "geoJsonLinestring": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, + "PolylineQuality": { + "values": { + "POLYLINE_QUALITY_UNSPECIFIED": 0, + "HIGH_QUALITY": 1, + "OVERVIEW": 2 + } + }, + "PolylineEncoding": { + "values": { + "POLYLINE_ENCODING_UNSPECIFIED": 0, + "ENCODED_POLYLINE": 1, + "GEO_JSON_LINESTRING": 2 + } + }, + "Route": { + "fields": { + "legs": { + "rule": "repeated", + "type": "RouteLeg", + "id": 1 + }, + "distanceMeters": { + "type": "int32", + "id": 2 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "polyline": { + "type": "Polyline", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "viewport": { + "type": "google.geo.type.Viewport", + "id": 8 + }, + "travelAdvisory": { + "type": "RouteTravelAdvisory", + "id": 9 + } + } + }, + "RouteTravelAdvisory": { + "fields": { + "tollInfo": { + "type": "TollInfo", + "id": 2 + }, + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 3 + } + } + }, + "RouteLegTravelAdvisory": { + "fields": { + "tollInfo": { + "type": "TollInfo", + "id": 1 + }, + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 2 + } + } + }, + "RouteLegStepTravelAdvisory": { + "fields": { + "speedReadingIntervals": { + "rule": "repeated", + "type": "SpeedReadingInterval", + "id": 1 + } + } + }, + "RouteLeg": { + "fields": { + "distanceMeters": { + "type": "int32", + "id": 1 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "polyline": { + "type": "Polyline", + "id": 4 + }, + "startLocation": { + "type": "Location", + "id": 5 + }, + "endLocation": { + "type": "Location", + "id": 6 + }, + "steps": { + "rule": "repeated", + "type": "RouteLegStep", + "id": 7 + }, + "travelAdvisory": { + "type": "RouteLegTravelAdvisory", + "id": 8 + } + } + }, + "RouteLegStep": { + "fields": { + "distanceMeters": { + "type": "int32", + "id": 1 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "polyline": { + "type": "Polyline", + "id": 3 + }, + "startLocation": { + "type": "Location", + "id": 4 + }, + "endLocation": { + "type": "Location", + "id": 5 + }, + "navigationInstruction": { + "type": "NavigationInstruction", + "id": 6 + }, + "travelAdvisory": { + "type": "RouteLegStepTravelAdvisory", + "id": 7 + } + } + }, + "SpeedReadingInterval": { + "oneofs": { + "_startPolylinePointIndex": { + "oneof": [ + "startPolylinePointIndex" + ] + }, + "_endPolylinePointIndex": { + "oneof": [ + "endPolylinePointIndex" + ] + } + }, + "fields": { + "startPolylinePointIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endPolylinePointIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "speed": { + "type": "Speed", + "id": 3 + } + }, + "nested": { + "Speed": { + "values": { + "SPEED_UNSPECIFIED": 0, + "NORMAL": 1, + "SLOW": 2, + "TRAFFIC_JAM": 3 + } + } + } + }, + "TollInfo": { + "fields": { + "estimatedPrice": { + "rule": "repeated", + "type": "google.type.Money", + "id": 1 + } + } + }, + "RouteModifiers": { + "fields": { + "avoidTolls": { + "type": "bool", + "id": 1 + }, + "avoidHighways": { + "type": "bool", + "id": 2 + }, + "avoidFerries": { + "type": "bool", + "id": 3 + }, + "avoidIndoor": { + "type": "bool", + "id": 4 + }, + "vehicleInfo": { + "type": "VehicleInfo", + "id": 5 + }, + "tollPasses": { + "rule": "repeated", + "type": "TollPass", + "id": 6 + } + } + }, + "TollPass": { + "values": { + "TOLL_PASS_UNSPECIFIED": 0, + "AU_ETOLL_TAG": 82, + "AU_EWAY_TAG": 83, + "AU_LINKT": 2, + "AR_TELEPASE": 3, + "BR_AUTO_EXPRESO": 81, + "BR_CONECTCAR": 7, + "BR_MOVE_MAIS": 8, + "BR_PASSA_RAPIDO": 88, + "BR_SEM_PARAR": 9, + "BR_TAGGY": 10, + "BR_VELOE": 11, + "CA_US_AKWASASNE_SEAWAY_CORPORATE_CARD": 84, + "CA_US_AKWASASNE_SEAWAY_TRANSIT_CARD": 85, + "CA_US_BLUE_WATER_EDGE_PASS": 18, + "CA_US_CONNEXION": 19, + "CA_US_NEXUS_CARD": 20, + "ID_E_TOLL": 16, + "IN_FASTAG": 78, + "IN_LOCAL_HP_PLATE_EXEMPT": 79, + "MX_IAVE": 90, + "MX_PASE": 91, + "MX_QUICKPASS": 93, + "MX_SISTEMA_TELEPEAJE_CHIHUAHUA": 89, + "MX_TAG_IAVE": 12, + "MX_TAG_TELEVIA": 13, + "MX_TELEVIA": 92, + "MX_VIAPASS": 14, + "US_AL_FREEDOM_PASS": 21, + "US_AK_ANTON_ANDERSON_TUNNEL_BOOK_OF_10_TICKETS": 22, + "US_CA_FASTRAK": 4, + "US_CA_FASTRAK_CAV_STICKER": 86, + "US_CO_EXPRESSTOLL": 23, + "US_CO_GO_PASS": 24, + "US_DE_EZPASSDE": 25, + "US_FL_BOB_SIKES_TOLL_BRIDGE_PASS": 65, + "US_FL_DUNES_COMMUNITY_DEVELOPMENT_DISTRICT_EXPRESSCARD": 66, + "US_FL_EPASS": 67, + "US_FL_GIBA_TOLL_PASS": 68, + "US_FL_LEEWAY": 69, + "US_FL_SUNPASS": 70, + "US_FL_SUNPASS_PRO": 71, + "US_IL_EZPASSIL": 73, + "US_IL_IPASS": 72, + "US_IN_EZPASSIN": 26, + "US_KS_BESTPASS_HORIZON": 27, + "US_KS_KTAG": 28, + "US_KS_NATIONALPASS": 29, + "US_KS_PREPASS_ELITEPASS": 30, + "US_KY_RIVERLINK": 31, + "US_LA_GEAUXPASS": 32, + "US_LA_TOLL_TAG": 33, + "US_MA_EZPASSMA": 6, + "US_MD_EZPASSMD": 34, + "US_ME_EZPASSME": 35, + "US_MI_AMBASSADOR_BRIDGE_PREMIER_COMMUTER_CARD": 36, + "US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG": 37, + "US_MI_IQ_PROX_CARD": 38, + "US_MI_MACKINAC_BRIDGE_MAC_PASS": 39, + "US_MI_NEXPRESS_TOLL": 40, + "US_MN_EZPASSMN": 41, + "US_NC_EZPASSNC": 42, + "US_NC_PEACH_PASS": 87, + "US_NC_QUICK_PASS": 43, + "US_NH_EZPASSNH": 80, + "US_NJ_DOWNBEACH_EXPRESS_PASS": 75, + "US_NJ_EZPASSNJ": 74, + "US_NY_EXPRESSPASS": 76, + "US_NY_EZPASSNY": 77, + "US_OH_EZPASSOH": 44, + "US_PA_EZPASSPA": 45, + "US_RI_EZPASSRI": 46, + "US_SC_PALPASS": 47, + "US_TX_BANCPASS": 48, + "US_TX_DEL_RIO_PASS": 49, + "US_TX_EFAST_PASS": 50, + "US_TX_EAGLE_PASS_EXPRESS_CARD": 51, + "US_TX_EPTOLL": 52, + "US_TX_EZ_CROSS": 53, + "US_TX_EZTAG": 54, + "US_TX_LAREDO_TRADE_TAG": 55, + "US_TX_PLUSPASS": 56, + "US_TX_TOLLTAG": 57, + "US_TX_TXTAG": 58, + "US_TX_XPRESS_CARD": 59, + "US_UT_ADAMS_AVE_PARKWAY_EXPRESSCARD": 60, + "US_VA_EZPASSVA": 61, + "US_WA_BREEZEBY": 17, + "US_WA_GOOD_TO_GO": 1, + "US_WV_EZPASSWV": 62, + "US_WV_MEMORIAL_BRIDGE_TICKETS": 63, + "US_WV_NEWELL_TOLL_BRIDGE_TICKET": 64 + } + }, + "VehicleInfo": { + "fields": { + "emissionType": { + "type": "VehicleEmissionType", + "id": 2 + } + } + }, + "VehicleEmissionType": { + "values": { + "VEHICLE_EMISSION_TYPE_UNSPECIFIED": 0, + "GASOLINE": 1, + "ELECTRIC": 2, + "HYBRID": 3 + } + }, + "RouteTravelMode": { + "values": { + "TRAVEL_MODE_UNSPECIFIED": 0, + "DRIVE": 1, + "BICYCLE": 2, + "WALK": 3, + "TWO_WHEELER": 4 + } + }, + "Routes": { + "options": { + "(google.api.default_host)": "routes.googleapis.com" + }, + "methods": { + "ComputeRoutes": { + "requestType": "ComputeRoutesRequest", + "responseType": "ComputeRoutesResponse", + "options": { + "(google.api.http).post": "/directions/v2:computeRoutes", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/directions/v2:computeRoutes", + "body": "*" + } + } + ] + }, + "ComputeRouteMatrix": { + "requestType": "ComputeRouteMatrixRequest", + "responseType": "RouteMatrixElement", + "responseStream": true, + "options": { + "(google.api.http).post": "/distanceMatrix/v2:computeRouteMatrix", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/distanceMatrix/v2:computeRouteMatrix", + "body": "*" + } + } + ] + } + } + }, + "ComputeRoutesRequest": { + "fields": { + "origin": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destination": { + "type": "Waypoint", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "intermediates": { + "rule": "repeated", + "type": "Waypoint", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingPreference": { + "type": "RoutingPreference", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "polylineQuality": { + "type": "PolylineQuality", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "polylineEncoding": { + "type": "PolylineEncoding", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "departureTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeAlternativeRoutes": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routeModifiers": { + "type": "RouteModifiers", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "units": { + "type": "Units", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ComputeRoutesResponse": { + "fields": { + "routes": { + "rule": "repeated", + "type": "Route", + "id": 1 + }, + "fallbackInfo": { + "type": "FallbackInfo", + "id": 2 + } + } + }, + "ComputeRouteMatrixRequest": { + "fields": { + "origins": { + "rule": "repeated", + "type": "RouteMatrixOrigin", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destinations": { + "rule": "repeated", + "type": "RouteMatrixDestination", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "travelMode": { + "type": "RouteTravelMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingPreference": { + "type": "RoutingPreference", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "departureTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteMatrixOrigin": { + "fields": { + "waypoint": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routeModifiers": { + "type": "RouteModifiers", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteMatrixDestination": { + "fields": { + "waypoint": { + "type": "Waypoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteMatrixElement": { + "oneofs": { + "_originIndex": { + "oneof": [ + "originIndex" + ] + }, + "_destinationIndex": { + "oneof": [ + "destinationIndex" + ] + } + }, + "fields": { + "originIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "destinationIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "google.rpc.Status", + "id": 3 + }, + "condition": { + "type": "RouteMatrixElementCondition", + "id": 9 + }, + "distanceMeters": { + "type": "int32", + "id": 4 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "staticDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "travelAdvisory": { + "type": "RouteTravelAdvisory", + "id": 7 + }, + "fallbackInfo": { + "type": "FallbackInfo", + "id": 8 + } + } + }, + "RouteMatrixElementCondition": { + "values": { + "ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED": 0, + "ROUTE_EXISTS": 1, + "ROUTE_NOT_FOUND": 2 + } + }, + "RoutingPreference": { + "values": { + "ROUTING_PREFERENCE_UNSPECIFIED": 0, + "TRAFFIC_UNAWARE": 1, + "TRAFFIC_AWARE": 2, + "TRAFFIC_AWARE_OPTIMAL": 3 + } + }, + "Units": { + "values": { + "UNITS_UNSPECIFIED": 0, + "METRIC": 1, + "IMPERIAL": 2 + } + }, + "Waypoint": { + "oneofs": { + "locationType": { + "oneof": [ + "location", + "placeId" + ] + } + }, + "fields": { + "location": { + "type": "Location", + "id": 1 + }, + "placeId": { + "type": "string", + "id": 2 + }, + "via": { + "type": "bool", + "id": 3 + }, + "vehicleStopover": { + "type": "bool", + "id": 4 + }, + "sideOfRoad": { + "type": "bool", + "id": 5 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-maps-routing/samples/README.md b/packages/google-maps-routing/samples/README.md new file mode 100644 index 000000000000..b1828cba7d7e --- /dev/null +++ b/packages/google-maps-routing/samples/README.md @@ -0,0 +1,104 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Maps Routing: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Routes.compute_route_matrix](#routes.compute_route_matrix) + * [Routes.compute_routes](#routes.compute_routes) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Routes.compute_route_matrix + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js` + + +----- + + + + +### Routes.compute_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routing/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-routing/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: diff --git a/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js b/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js new file mode 100644 index 000000000000..dc7a71a62db7 --- /dev/null +++ b/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js @@ -0,0 +1,96 @@ +// Copyright 2022 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'; + +function main(origins, destinations) { + // [START routes_v2_generated_Routes_ComputeRouteMatrix_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Array of origins, which determines the rows of the response matrix. + * Several size restrictions apply to the cardinality of origins and + * destinations: + * * The number of elements (origins × destinations) must be no greater than + * 625 in any case. + * * The number of elements (origins × destinations) must be no greater than + * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + * * The number of waypoints (origins + destinations) specified as `place_id` + * must be no greater than 50. + */ + // const origins = 1234 + /** + * Required. Array of destinations, which determines the columns of the response matrix. + */ + // const destinations = 1234 + /** + * Optional. Specifies the mode of transportation. + */ + // const travelMode = {} + /** + * Optional. Specifies how to compute the route. The server attempts to use the selected + * routing preference to compute the route. If the routing preference results + * in an error or an extra long latency, an error is returned. In the future, + * we might implement a fallback mechanism to use a different option when the + * preferred option does not give a valid result. You can specify this option + * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the + * request fails. + */ + // const routingPreference = {} + /** + * Optional. The departure time. If you don't set this value, this defaults to the time + * that you made the request. If you set this value to a time that has already + * occurred, the request fails. + */ + // const departureTime = {} + + // Imports the Routing library + const {RoutesClient} = require('@googlemaps/routing').v2; + + // Instantiates a client + const routingClient = new RoutesClient(); + + async function callComputeRouteMatrix() { + // Construct request + const request = { + origins, + destinations, + }; + + // Run request + const stream = await routingClient.computeRouteMatrix(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callComputeRouteMatrix(); + // [END routes_v2_generated_Routes_ComputeRouteMatrix_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js new file mode 100644 index 000000000000..94391b8630e1 --- /dev/null +++ b/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js @@ -0,0 +1,126 @@ +// Copyright 2022 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'; + +function main(origin, destination) { + // [START routes_v2_generated_Routes_ComputeRoutes_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Origin waypoint. + */ + // const origin = {} + /** + * Required. Destination waypoint. + */ + // const destination = {} + /** + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + */ + // const intermediates = 1234 + /** + * Optional. Specifies the mode of transportation. + */ + // const travelMode = {} + /** + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. In the future, we might implement a fallback + * mechanism to use a different option when the preferred option does not give + * a valid result. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + */ + // const routingPreference = {} + /** + * Optional. Specifies your preference for the quality of the polyline. + */ + // const polylineQuality = {} + /** + * Optional. Specifies the preferred encoding for the polyline. + */ + // const polylineEncoding = {} + /** + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. If you set this value to a + * time that has already occurred, then the request fails. + */ + // const departureTime = {} + /** + * Optional. Specifies whether to calculate alternate routes in addition to the route. + */ + // const computeAlternativeRoutes = true + /** + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + */ + // const routeModifiers = {} + /** + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + * Language Support (https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + */ + // const languageCode = 'abc123' + /** + * Optional. Specifies the units of measure for the display fields. This + * includes the `instruction` field in `NavigationInstruction`. The units of + * measure used for the route, leg, step distance, and duration are not + * affected by this value. If you don't provide this value, then the display + * units are inferred from the location of the request. + */ + // const units = {} + + // Imports the Routing library + const {RoutesClient} = require('@googlemaps/routing').v2; + + // Instantiates a client + const routingClient = new RoutesClient(); + + async function callComputeRoutes() { + // Construct request + const request = { + origin, + destination, + }; + + // Run request + const response = await routingClient.computeRoutes(request); + console.log(response); + } + + callComputeRoutes(); + // [END routes_v2_generated_Routes_ComputeRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routing/samples/generated/v2/snippet_metadata.google.maps.routing.v2.json b/packages/google-maps-routing/samples/generated/v2/snippet_metadata.google.maps.routing.v2.json new file mode 100644 index 000000000000..b521e340c2f4 --- /dev/null +++ b/packages/google-maps-routing/samples/generated/v2/snippet_metadata.google.maps.routing.v2.json @@ -0,0 +1,155 @@ +{ + "clientLibrary": { + "name": "nodejs-routing", + "version": "0.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.maps.routing.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "routes_v2_generated_Routes_ComputeRoutes_async", + "title": "Routes computeRoutes Sample", + "origin": "API_DEFINITION", + "description": " Returns the primary route along with optional alternate routes, given a set of terminal and intermediate waypoints. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using URL parameter `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters). The value is a comma separated list of field paths. See detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of Route-level duration, distance, and polyline (an example production setup): `X-Goog-FieldMask: routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` Google discourage the use of the wildcard (`*`) response field mask, or specifying the field mask at the top level (`routes`), because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", + "canonical": true, + "file": "routes.compute_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 118, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeRoutes", + "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", + "async": true, + "parameters": [ + { + "name": "origin", + "type": ".google.maps.routing.v2.Waypoint" + }, + { + "name": "destination", + "type": ".google.maps.routing.v2.Waypoint" + }, + { + "name": "intermediates", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "travel_mode", + "type": ".google.maps.routing.v2.RouteTravelMode" + }, + { + "name": "routing_preference", + "type": ".google.maps.routing.v2.RoutingPreference" + }, + { + "name": "polyline_quality", + "type": ".google.maps.routing.v2.PolylineQuality" + }, + { + "name": "polyline_encoding", + "type": ".google.maps.routing.v2.PolylineEncoding" + }, + { + "name": "departure_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "compute_alternative_routes", + "type": "TYPE_BOOL" + }, + { + "name": "route_modifiers", + "type": ".google.maps.routing.v2.RouteModifiers" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "units", + "type": ".google.maps.routing.v2.Units" + } + ], + "resultType": ".google.maps.routing.v2.ComputeRoutesResponse", + "client": { + "shortName": "RoutesClient", + "fullName": "google.maps.routing.v2.RoutesClient" + }, + "method": { + "shortName": "ComputeRoutes", + "fullName": "google.maps.routing.v2.Routes.ComputeRoutes", + "service": { + "shortName": "Routes", + "fullName": "google.maps.routing.v2.Routes" + } + } + } + }, + { + "regionTag": "routes_v2_generated_Routes_ComputeRouteMatrix_async", + "title": "Routes computeRouteMatrix Sample", + "origin": "API_DEFINITION", + "description": " Takes in a list of origins and destinations and returns a stream containing route information for each combination of origin and destination. **NOTE:** This method requires that you specify a response field mask in the input. You can provide the response field mask by using the URL parameter `$fields` or `fields`, or by using the HTTP/gRPC header `X-Goog-FieldMask` (see the [available URL parameters and headers](https://cloud.google.com/apis/docs/system-parameters). The value is a comma separated list of field paths. See this detailed documentation about [how to construct the field paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). For example, in this method: * Field mask of all available fields (for manual inspection): `X-Goog-FieldMask: *` * Field mask of route durations, distances, element status, condition, and element indices (an example production setup): `X-Goog-FieldMask: originIndex,destinationIndex,status,condition,distanceMeters,duration` It is critical that you include `status` in your field mask as otherwise all messages will appear to be OK. Google discourages the use of the wildcard (`*`) response field mask, because: * Selecting only the fields that you need helps our server save computation cycles, allowing us to return the result to you with a lower latency. * Selecting only the fields that you need in your production job ensures stable latency performance. We might add more response fields in the future, and those new fields might require extra computation time. If you select all fields, or if you select all fields at the top level, then you might experience performance degradation because any new field we add will be automatically included in the response. * Selecting only the fields that you need results in a smaller response size, and thus higher network throughput.", + "canonical": true, + "file": "routes.compute_route_matrix.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ComputeRouteMatrix", + "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", + "async": true, + "parameters": [ + { + "name": "origins", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "destinations", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "travel_mode", + "type": ".google.maps.routing.v2.RouteTravelMode" + }, + { + "name": "routing_preference", + "type": ".google.maps.routing.v2.RoutingPreference" + }, + { + "name": "departure_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.maps.routing.v2.RouteMatrixElement", + "client": { + "shortName": "RoutesClient", + "fullName": "google.maps.routing.v2.RoutesClient" + }, + "method": { + "shortName": "ComputeRouteMatrix", + "fullName": "google.maps.routing.v2.Routes.ComputeRouteMatrix", + "service": { + "shortName": "Routes", + "fullName": "google.maps.routing.v2.Routes" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-maps-routing/samples/package.json b/packages/google-maps-routing/samples/package.json new file mode 100644 index 000000000000..485c73986cad --- /dev/null +++ b/packages/google-maps-routing/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "routing-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@googlemaps/routing": "^0.1.1" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-maps-routing/samples/quickstart.js b/packages/google-maps-routing/samples/quickstart.js new file mode 100644 index 000000000000..7ead5dbb6fca --- /dev/null +++ b/packages/google-maps-routing/samples/quickstart.js @@ -0,0 +1,124 @@ +// Copyright 2022 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'; + +function main(origin, destination) { + // [START routes_quickstart] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Origin waypoint. + */ + // const origin = {} + /** + * Required. Destination waypoint. + */ + // const destination = {} + /** + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + */ + // const intermediates = 1234 + /** + * Optional. Specifies the mode of transportation. + */ + // const travelMode = {} + /** + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. In the future, we might implement a fallback + * mechanism to use a different option when the preferred option does not give + * a valid result. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + */ + // const routingPreference = {} + /** + * Optional. Specifies your preference for the quality of the polyline. + */ + // const polylineQuality = {} + /** + * Optional. Specifies the preferred encoding for the polyline. + */ + // const polylineEncoding = {} + /** + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. If you set this value to a + * time that has already occurred, then the request fails. + */ + // const departureTime = {} + /** + * Optional. Specifies whether to calculate alternate routes in addition to the route. + */ + // const computeAlternativeRoutes = true + /** + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + */ + // const routeModifiers = {} + /** + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + * Language Support (https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + */ + // const languageCode = 'abc123' + /** + * Optional. Specifies the units of measure for the display fields. This + * includes the `instruction` field in `NavigationInstruction`. The units of + * measure used for the route, leg, step distance, and duration are not + * affected by this value. If you don't provide this value, then the display + * units are inferred from the location of the request. + */ + // const units = {} + + // Imports the Routing library + const {RoutesClient} = require('@googlemaps/routing').v2; + + // Instantiates a client + const routingClient = new RoutesClient(); + + async function callComputeRoutes() { + // Construct request + const request = { + origin, + destination, + }; + + // Run request + const response = await routingClient.computeRoutes(request); + console.log(response); + } + + callComputeRoutes(); + // [END routes_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-routing/samples/test/quickstart.js b/packages/google-maps-routing/samples/test/quickstart.js new file mode 100644 index 000000000000..a07f464bf061 --- /dev/null +++ b/packages/google-maps-routing/samples/test/quickstart.js @@ -0,0 +1,43 @@ +// Copyright 2022 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. + +'use strict'; + +// const assert = require('assert'); +// const path = require('path'); +// const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +// const {RoutesClient} = require('@googlemaps/routing').v2; +// const routingClient = new RoutesClient(); + +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +// const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + // let projectId; + + before(async () => { + // projectId = await routingClient.getProjectId(); + }); + + it('should run quickstart', async () => { + // TODO(#3380) we should have a test for our quickstart sample. + // const output = execSync( + // `node ./quickstart.js projects/${projectId}/locations/us-central1`, + // {cwd} + // ); + // assert(output !== null); + }); +}); diff --git a/packages/google-maps-routing/src/index.ts b/packages/google-maps-routing/src/index.ts new file mode 100644 index 000000000000..744060c94fce --- /dev/null +++ b/packages/google-maps-routing/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const RoutesClient = v2.RoutesClient; +type RoutesClient = v2.RoutesClient; + +export {v2, RoutesClient}; +export default {v2, RoutesClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-maps-routing/src/v2/gapic_metadata.json b/packages/google-maps-routing/src/v2/gapic_metadata.json new file mode 100644 index 000000000000..46b4f4a8b5a0 --- /dev/null +++ b/packages/google-maps-routing/src/v2/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.maps.routing.v2", + "libraryPackage": "@googlemaps/routing", + "services": { + "Routes": { + "clients": { + "grpc": { + "libraryClient": "RoutesClient", + "rpcs": { + "ComputeRoutes": { + "methods": [ + "computeRoutes" + ] + }, + "ComputeRouteMatrix": { + "methods": [ + "computeRouteMatrix" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RoutesClient", + "rpcs": { + "ComputeRoutes": { + "methods": [ + "computeRoutes" + ] + } + } + } + } + } + } +} diff --git a/packages/google-maps-routing/src/v2/index.ts b/packages/google-maps-routing/src/v2/index.ts new file mode 100644 index 000000000000..4bc5284efb95 --- /dev/null +++ b/packages/google-maps-routing/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {RoutesClient} from './routes_client'; diff --git a/packages/google-maps-routing/src/v2/routes_client.ts b/packages/google-maps-routing/src/v2/routes_client.ts new file mode 100644 index 000000000000..47e17027d11c --- /dev/null +++ b/packages/google-maps-routing/src/v2/routes_client.ts @@ -0,0 +1,585 @@ +// Copyright 2022 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, +} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v2/routes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './routes_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Routes API. + * @class + * @memberof v2 + */ +export class RoutesClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + routesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RoutesClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 RoutesClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RoutesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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); + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + computeRouteMatrix: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.maps.routing.v2.Routes', + 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.routesStub) { + return this.routesStub; + } + + // Put together the "service stub" for + // google.maps.routing.v2.Routes. + this.routesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.maps.routing.v2.Routes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.maps.routing.v2.Routes, + 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 routesStubMethods = ['computeRoutes', 'computeRouteMatrix']; + for (const methodName of routesStubMethods) { + const callPromise = this.routesStub.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.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.routesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'routes.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'routes.googleapis.com'; + } + + /** + * 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 []; + } + + 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 -- + // ------------------- + /** + * Returns the primary route along with optional alternate routes, given a set + * of terminal and intermediate waypoints. + * + * **NOTE:** This method requires that you specify a response field mask in + * the input. You can provide the response field mask by using URL parameter + * `$fields` or `fields`, or by using an HTTP/gRPC header `X-Goog-FieldMask` + * (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters). The value + * is a comma separated list of field paths. See detailed documentation about + * [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + * For example, in this method: + * + * * Field mask of all available fields (for manual inspection): + * `X-Goog-FieldMask: *` + * * Field mask of Route-level duration, distance, and polyline (an example + * production setup): + * `X-Goog-FieldMask: + * routes.duration,routes.distanceMeters,routes.polyline.encodedPolyline` + * + * Google discourage the use of the wildcard (`*`) response field mask, or + * specifying the field mask at the top level (`routes`), because: + * + * * Selecting only the fields that you need helps our server save computation + * cycles, allowing us to return the result to you with a lower latency. + * * Selecting only the fields that you need + * in your production job ensures stable latency performance. We might add + * more response fields in the future, and those new fields might require + * extra computation time. If you select all fields, or if you select all + * fields at the top level, then you might experience performance degradation + * because any new field we add will be automatically included in the + * response. + * * Selecting only the fields that you need results in a smaller response + * size, and thus higher network throughput. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.maps.routing.v2.Waypoint} request.origin + * Required. Origin waypoint. + * @param {google.maps.routing.v2.Waypoint} request.destination + * Required. Destination waypoint. + * @param {number[]} [request.intermediates] + * Optional. A set of waypoints along the route (excluding terminal points), + * for either stopping at or passing by. Up to 25 intermediate waypoints are + * supported. + * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] + * Optional. Specifies the mode of transportation. + * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] + * Optional. Specifies how to compute the route. The server + * attempts to use the selected routing preference to compute the route. If + * the routing preference results in an error or an extra long latency, then + * an error is returned. In the future, we might implement a fallback + * mechanism to use a different option when the preferred option does not give + * a valid result. You can specify this option only when the `travel_mode` is + * `DRIVE` or `TWO_WHEELER`, otherwise the request fails. + * @param {google.maps.routing.v2.PolylineQuality} [request.polylineQuality] + * Optional. Specifies your preference for the quality of the polyline. + * @param {google.maps.routing.v2.PolylineEncoding} [request.polylineEncoding] + * Optional. Specifies the preferred encoding for the polyline. + * @param {google.protobuf.Timestamp} [request.departureTime] + * Optional. The departure time. If you don't set this value, then this value + * defaults to the time that you made the request. If you set this value to a + * time that has already occurred, then the request fails. + * @param {boolean} [request.computeAlternativeRoutes] + * Optional. Specifies whether to calculate alternate routes in addition to the route. + * @param {google.maps.routing.v2.RouteModifiers} [request.routeModifiers] + * Optional. A set of conditions to satisfy that affect the way routes are + * calculated. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + * information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See + * [Language Support](https://developers.google.com/maps/faq#languagesupport) + * for the list of supported languages. When you don't provide this value, the + * display language is inferred from the location of the route request. + * @param {google.maps.routing.v2.Units} [request.units] + * Optional. Specifies the units of measure for the display fields. This + * includes the `instruction` field in `NavigationInstruction`. The units of + * measure used for the route, leg, step distance, and duration are not + * affected by this value. If you don't provide this value, then the display + * units are inferred from the location of the request. + * @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 [ComputeRoutesResponse]{@link google.maps.routing.v2.ComputeRoutesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/routes.compute_routes.js + * region_tag:routes_v2_generated_Routes_ComputeRoutes_async + */ + computeRoutes( + request?: protos.google.maps.routing.v2.IComputeRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest | undefined, + {} | undefined + ] + >; + computeRoutes( + request: protos.google.maps.routing.v2.IComputeRoutesRequest, + options: CallOptions, + callback: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest | null | undefined, + {} | null | undefined + > + ): void; + computeRoutes( + request: protos.google.maps.routing.v2.IComputeRoutesRequest, + callback: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest | null | undefined, + {} | null | undefined + > + ): void; + computeRoutes( + request?: protos.google.maps.routing.v2.IComputeRoutesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + | protos.google.maps.routing.v2.IComputeRoutesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.maps.routing.v2.IComputeRoutesResponse, + protos.google.maps.routing.v2.IComputeRoutesRequest | 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 || {}; + this.initialize(); + return this.innerApiCalls.computeRoutes(request, options, callback); + } + + /** + * Takes in a list of origins and destinations and returns a stream containing + * route information for each combination of origin and destination. + * + * **NOTE:** This method requires that you specify a response field mask in + * the input. You can provide the response field mask by using the URL + * parameter `$fields` or `fields`, or by using the HTTP/gRPC header + * `X-Goog-FieldMask` (see the [available URL parameters and + * headers](https://cloud.google.com/apis/docs/system-parameters). The value + * is a comma separated list of field paths. See this detailed documentation + * about [how to construct the field + * paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + * + * For example, in this method: + * + * * Field mask of all available fields (for manual inspection): + * `X-Goog-FieldMask: *` + * * Field mask of route durations, distances, element status, condition, and + * element indices (an example production setup): + * `X-Goog-FieldMask: + * originIndex,destinationIndex,status,condition,distanceMeters,duration` + * + * It is critical that you include `status` in your field mask as otherwise + * all messages will appear to be OK. Google discourages the use of the + * wildcard (`*`) response field mask, because: + * + * * Selecting only the fields that you need helps our server save computation + * cycles, allowing us to return the result to you with a lower latency. + * * Selecting only the fields that you need in your production job ensures + * stable latency performance. We might add more response fields in the + * future, and those new fields might require extra computation time. If you + * select all fields, or if you select all fields at the top level, then you + * might experience performance degradation because any new field we add will + * be automatically included in the response. + * * Selecting only the fields that you need results in a smaller response + * size, and thus higher network throughput. + * + * @param {Object} request + * The request object that will be sent. + * @param {number[]} request.origins + * Required. Array of origins, which determines the rows of the response matrix. + * Several size restrictions apply to the cardinality of origins and + * destinations: + * + * * The number of elements (origins × destinations) must be no greater than + * 625 in any case. + * * The number of elements (origins × destinations) must be no greater than + * 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + * * The number of waypoints (origins + destinations) specified as `place_id` + * must be no greater than 50. + * @param {number[]} request.destinations + * Required. Array of destinations, which determines the columns of the response matrix. + * @param {google.maps.routing.v2.RouteTravelMode} [request.travelMode] + * Optional. Specifies the mode of transportation. + * @param {google.maps.routing.v2.RoutingPreference} [request.routingPreference] + * Optional. Specifies how to compute the route. The server attempts to use the selected + * routing preference to compute the route. If the routing preference results + * in an error or an extra long latency, an error is returned. In the future, + * we might implement a fallback mechanism to use a different option when the + * preferred option does not give a valid result. You can specify this option + * only when the `travel_mode` is `DRIVE` or `TWO_WHEELER`, otherwise the + * request fails. + * @param {google.protobuf.Timestamp} [request.departureTime] + * Optional. The departure time. If you don't set this value, this defaults to the time + * that you made the request. If you set this value to a time that has already + * occurred, the request fails. + * @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 [RouteMatrixElement]{@link google.maps.routing.v2.RouteMatrixElement} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example include:samples/generated/v2/routes.compute_route_matrix.js + * region_tag:routes_v2_generated_Routes_ComputeRouteMatrix_async + */ + computeRouteMatrix( + request?: protos.google.maps.routing.v2.IComputeRouteMatrixRequest, + options?: CallOptions + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.computeRouteMatrix(request, options); + } + + /** + * 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.routesStub && !this._terminated) { + return this.routesStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-maps-routing/src/v2/routes_client_config.json b/packages/google-maps-routing/src/v2/routes_client_config.json new file mode 100644 index 000000000000..c69ed299a73f --- /dev/null +++ b/packages/google-maps-routing/src/v2/routes_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.maps.routing.v2.Routes": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "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": { + "ComputeRoutes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ComputeRouteMatrix": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-maps-routing/src/v2/routes_proto_list.json b/packages/google-maps-routing/src/v2/routes_proto_list.json new file mode 100644 index 000000000000..a480547486b9 --- /dev/null +++ b/packages/google-maps-routing/src/v2/routes_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/geo/type/viewport.proto", + "../../protos/google/maps/routing/v2/fallback_info.proto", + "../../protos/google/maps/routing/v2/location.proto", + "../../protos/google/maps/routing/v2/maneuver.proto", + "../../protos/google/maps/routing/v2/navigation_instruction.proto", + "../../protos/google/maps/routing/v2/polyline.proto", + "../../protos/google/maps/routing/v2/route.proto", + "../../protos/google/maps/routing/v2/route_modifiers.proto", + "../../protos/google/maps/routing/v2/route_travel_mode.proto", + "../../protos/google/maps/routing/v2/routes_service.proto", + "../../protos/google/maps/routing/v2/routing_preference.proto", + "../../protos/google/maps/routing/v2/speed_reading_interval.proto", + "../../protos/google/maps/routing/v2/toll_info.proto", + "../../protos/google/maps/routing/v2/toll_passes.proto", + "../../protos/google/maps/routing/v2/units.proto", + "../../protos/google/maps/routing/v2/vehicle_emission_type.proto", + "../../protos/google/maps/routing/v2/vehicle_info.proto", + "../../protos/google/maps/routing/v2/waypoint.proto" +] diff --git a/packages/google-maps-routing/system-test/fixtures/sample/src/index.js b/packages/google-maps-routing/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..c879feff2d85 --- /dev/null +++ b/packages/google-maps-routing/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const routing = require('@googlemaps/routing'); + +function main() { + const routesClient = new routing.RoutesClient(); +} + +main(); diff --git a/packages/google-maps-routing/system-test/fixtures/sample/src/index.ts b/packages/google-maps-routing/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..1370ad4de08f --- /dev/null +++ b/packages/google-maps-routing/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {RoutesClient} from '@googlemaps/routing'; + +// check that the client class type name can be used +function doStuffWithRoutesClient(client: RoutesClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const routesClient = new RoutesClient(); + doStuffWithRoutesClient(routesClient); +} + +main(); diff --git a/packages/google-maps-routing/system-test/install.ts b/packages/google-maps-routing/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-maps-routing/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-maps-routing/test/gapic_routes_v2.ts b/packages/google-maps-routing/test/gapic_routes_v2.ts new file mode 100644 index 000000000000..c18e253f9e90 --- /dev/null +++ b/packages/google-maps-routing/test/gapic_routes_v2.ts @@ -0,0 +1,357 @@ +// Copyright 2022 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 routesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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 stubServerStreamingCall( + 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, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +describe('v2.RoutesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = routesModule.v2.RoutesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = routesModule.v2.RoutesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = routesModule.v2.RoutesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routesModule.v2.RoutesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routesModule.v2.RoutesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routesStub, undefined); + await client.initialize(); + assert(client.routesStub); + }); + + it('has close method for the initialized client', done => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.routesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.routesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routesModule.v2.RoutesClient({ + 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 routesModule.v2.RoutesClient({ + 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('computeRoutes', () => { + it('invokes computeRoutes without error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesResponse() + ); + client.innerApiCalls.computeRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.computeRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRoutes without error using callback', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesResponse() + ); + client.innerApiCalls.computeRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.computeRoutes( + request, + ( + err?: Error | null, + result?: protos.google.maps.routing.v2.IComputeRoutesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRoutes with error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.computeRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.computeRoutes(request), expectedError); + }); + + it('invokes computeRoutes with closed client', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRoutesRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.computeRoutes(request), expectedError); + }); + }); + + describe('computeRouteMatrix', () => { + it('invokes computeRouteMatrix without error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.maps.routing.v2.RouteMatrixElement() + ); + client.innerApiCalls.computeRouteMatrix = + stubServerStreamingCall(expectedResponse); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes computeRouteMatrix with error', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.computeRouteMatrix = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + + it('invokes computeRouteMatrix with closed client', async () => { + const client = new routesModule.v2.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.routing.v2.ComputeRouteMatrixRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.computeRouteMatrix(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.maps.routing.v2.RouteMatrixElement) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + }); +}); diff --git a/packages/google-maps-routing/tsconfig.json b/packages/google-maps-routing/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-maps-routing/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/packages/google-maps-routing/webpack.config.js b/packages/google-maps-routing/webpack.config.js new file mode 100644 index 000000000000..95325c25ce2e --- /dev/null +++ b/packages/google-maps-routing/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: 'Routes', + filename: './routes.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/packages/google-monitoring-dashboard/.OwlBot.yaml b/packages/google-monitoring-dashboard/.OwlBot.yaml new file mode 100644 index 000000000000..682d2532caf0 --- /dev/null +++ b/packages/google-monitoring-dashboard/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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 +# +# 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. + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/monitoring/dashboard/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-monitoring-dashboard/$1 + +begin-after-commit-hash: dea0fe87a4015bc79a036811aafe13c8f9aa8528 + diff --git a/packages/google-monitoring-dashboard/.eslintignore b/packages/google-monitoring-dashboard/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-monitoring-dashboard/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-monitoring-dashboard/.eslintrc.json b/packages/google-monitoring-dashboard/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-monitoring-dashboard/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-monitoring-dashboard/.gitattributes b/packages/google-monitoring-dashboard/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-monitoring-dashboard/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-monitoring-dashboard/.gitignore b/packages/google-monitoring-dashboard/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-monitoring-dashboard/.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/packages/google-monitoring-dashboard/.jsdoc.js b/packages/google-monitoring-dashboard/.jsdoc.js new file mode 100644 index 000000000000..babd5974934f --- /dev/null +++ b/packages/google-monitoring-dashboard/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 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 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/monitoring-dashboards', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-monitoring-dashboard/.mocharc.js b/packages/google-monitoring-dashboard/.mocharc.js new file mode 100644 index 000000000000..cdb7b7521602 --- /dev/null +++ b/packages/google-monitoring-dashboard/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/packages/google-monitoring-dashboard/.nycrc b/packages/google-monitoring-dashboard/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-monitoring-dashboard/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-monitoring-dashboard/.prettierignore b/packages/google-monitoring-dashboard/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-monitoring-dashboard/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-monitoring-dashboard/.prettierrc.js b/packages/google-monitoring-dashboard/.prettierrc.js new file mode 100644 index 000000000000..d546a4ad5460 --- /dev/null +++ b/packages/google-monitoring-dashboard/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-monitoring-dashboard/.repo-metadata.json b/packages/google-monitoring-dashboard/.repo-metadata.json new file mode 100644 index 000000000000..62c9073942e7 --- /dev/null +++ b/packages/google-monitoring-dashboard/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_id": "monitoring.googleapis.com", + "name": "monitoring-dashboards", + "language": "nodejs", + "product_documentation": "https://cloud.google.com/monitoring/docs", + "distribution_name": "@google-cloud/monitoring-dashboards", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559785", + "name_pretty": "Monitoring Dashboards", + "default_version": "v1", + "release_level": "stable", + "repo": "googleapis/google-cloud-node", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/monitoring-dashboards/latest", + "requires_billing": true, + "api_shortname": "monitoring", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-monitoring-dashboard/CHANGELOG.md b/packages/google-monitoring-dashboard/CHANGELOG.md new file mode 100644 index 000000000000..6cd80afacf9d --- /dev/null +++ b/packages/google-monitoring-dashboard/CHANGELOG.md @@ -0,0 +1,211 @@ +# Changelog + +## [2.7.1](https://github.com/googleapis/google-cloud-node/compare/monitoring-dashboards-v2.7.0...monitoring-dashboards-v2.7.1) (2022-10-13) + + +### Bug Fixes + +* Samples test ([8311347](https://github.com/googleapis/google-cloud-node/commit/83113476faf791e74411419f8d4e0772df30fbf0)) + +## [2.7.0](https://github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.6.1...v2.7.0) (2022-04-08) + + +### Features + +* Sync public protos with latests public api state. This adds support for collapsible groups, filters, labels, drilldowns, logs panels and tables ([#257](https://github.com/googleapis/nodejs-monitoring-dashboards/issues/257)) ([5f539c1](https://github.com/googleapis/nodejs-monitoring-dashboards/commit/5f539c1957a448bf475e568f2b4fe76fa5d4c3a8)) + +### [2.6.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.6.0...v2.6.1) (2021-09-08) + + +### Bug Fixes + +* **build:** update branch to main ([#215](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/215)) ([9506380](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/950638076cec0320fa886e25b025844f58fce97e)) + +## [2.6.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.5.1...v2.6.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#212](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/212)) ([395b00a](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/395b00a9f531432eb38cb7f10967a30ed8b4f66a)) + +### [2.5.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.5.0...v2.5.1) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#210](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/210)) ([f9d54b4](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/f9d54b4ed75ee569499553e1e8a2193459c735aa)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.4.2...v2.5.0) (2021-08-05) + + +### ⚠ BREAKING CHANGES + +* Specify a C# namespace option to be consistent with other Cloud APIs (#205) + +### Bug Fixes + +* **build:** c# change is not breaking for Node.js ([#207](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/207)) ([5402d8d](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/5402d8d81c0336544afabbb818f7aa085bfd8917)) +* Specify a C# namespace option to be consistent with other Cloud APIs ([#205](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/205)) ([8eee840](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/8eee8403fe71ec18f41cc47afc41620b470d3323)) + +### [2.4.2](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.4.1...v2.4.2) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#199](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/199)) ([273c85d](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/273c85d6d33d54e1ff880dad1127cf4c8f69fbbc)) + +### [2.4.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.4.0...v2.4.1) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#196](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/196)) ([c6c2ae0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/c6c2ae00ea49c80da7668f8383b62cfd17258159)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.3.4...v2.4.0) (2021-07-07) + + +### Features + +* added validation only mode when writing dashboards feat: added alert chart widget ([#194](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/194)) ([867a08c](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/867a08cabca0f96701f5f8975c6f6e5d0522189f)) + +### [2.3.4](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.3.3...v2.3.4) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#191](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/191)) ([88b6413](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/88b6413a83bb2594f1f7371073940e37118fdcbb)) + +### [2.3.3](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.3.2...v2.3.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#185](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/185)) ([898bf5c](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/898bf5c5259cab24d64326d7b0ddf37d6a7e7571)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.3.1...v2.3.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#177](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/177)) ([5e89c98](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/5e89c9890ce5f2762398f46105be44301d4d6aa2)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.3.0...v2.3.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#167](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/167)) ([3316b86](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/3316b8619dafe3dde4dbba355907cdf804974ef8)) +* use require() to load JSON protos ([#170](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/170)) ([af92ed3](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/af92ed3942a3889a3567514b3614e04a2955dc17)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.2.0...v2.3.0) (2021-03-19) + + +### Features + +* added mosaic layout docs:clarified alignment_period max value and updated IAM docs link ([#152](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/152)) ([7ccce5a](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/7ccce5a57f0d927fa33a87cad94bf05d6fcb80da)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.1.3...v2.2.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#143](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/143)) ([4a90ce9](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/4a90ce9fa7722fde537868ae8aa8f47e45c7789c)) + +### [2.1.3](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.1.2...v2.1.3) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([23f9595](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/23f9595ba7622f3f6eb4d705506996e1e34fc107)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.1.1...v2.1.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#134](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/134)) ([a95ac89](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/a95ac893c9f5d06205244b6b48e5db39a8c4b1e3)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.1.0...v2.1.1) (2020-07-24) + + +### Bug Fixes + +* move gitattributes files to node templates ([#107](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/107)) ([7e7a729](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/7e7a729686b59354a255ca4da86b34c0e06523df)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v2.0.0...v2.1.0) (2020-06-28) + + +### Features + +* Add support for secondary_aggregation and Monitoring Query Language ([#92](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/92)) ([af186dc](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/af186dc51be796e8c8ce83cfdc75e8b7f8017694)) +* move ts target to es2018 from es2016 ([#87](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/87)) ([846ff12](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/846ff12d5a3858cd4c91cb4fcf835b40d5f9b03e)) + + +### Bug Fixes + +* proper fallback option handling ([33c441c](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/33c441c0484cdc0e09203ad033e220ac57324607)) +* update node issue template ([#93](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/93)) ([e561059](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/e561059ddba9b46cec6ae14fe3d522a83ef231ca)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.3.0...v2.0.0) (2020-05-08) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* drop node8 support, support for async iterators ([#58](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/58)) ([0891dab](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/0891dab8f977cdb8825e12b3faf8d45caeea4ba4)) + + +### Bug Fixes + +* export explicit version from protos.js ([#63](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/63)) ([a1ef68f](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/a1ef68f0f3f6366d41ac4de23e31cca67d232c50)) +* regen protos and tests, formatting ([#81](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/81)) ([61314fe](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/61314fe1099dfeab00d1392ffe1757880d398497)) +* remove eslint, update gax, fix generated protos, run the generator ([#68](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/68)) ([8c33d58](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/8c33d5811fbf60adc7c9dd15be4e64e59630e058)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.2.0...v1.3.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#43](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/43)) ([63a9eaa](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/63a9eaa8cc7d3afc9cb203027a4d7076e1c1c970)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.1.0...v1.2.0) (2020-02-27) + + +### Features + +* export protos in src/index.ts ([7a601bd](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/7a601bd1165e8be3e6f4beaea53c6e285d20942e)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.0.2...v1.1.0) (2020-02-13) + + +### Features + +* bump the release level to ga ([#30](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/30)) ([c4080f7](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/c4080f7e2dbbcb5e42c928c4dfd5174d892975a2)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.0.1...v1.0.2) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([beecd33](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/beecd3387117e9d52b845f938000a8284ed8212f)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/compare/v1.0.0...v1.0.1) (2020-01-09) + + +### Bug Fixes + +* **build:** autorelease should handle tagging ([#7](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/7)) ([000aed2](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/000aed25e186f6e174ca49aa90dd0d4d6f651644)) + +## 1.0.0 (2020-01-04) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#1) + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-monitoring-dashboards/issues/1)) ([b513f47](https://www.github.com/googleapis/nodejs-monitoring-dashboards/commit/b513f47f8d6d34380ea8ebedb0e9b41f360630ab)) diff --git a/packages/google-monitoring-dashboard/CODE_OF_CONDUCT.md b/packages/google-monitoring-dashboard/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-monitoring-dashboard/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-monitoring-dashboard/CONTRIBUTING.md b/packages/google-monitoring-dashboard/CONTRIBUTING.md new file mode 100644 index 000000000000..53bbf08ab2b0 --- /dev/null +++ b/packages/google-monitoring-dashboard/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Monitoring Dashboards API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-monitoring-dashboard/LICENSE b/packages/google-monitoring-dashboard/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-monitoring-dashboard/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-monitoring-dashboard/README.md b/packages/google-monitoring-dashboard/README.md new file mode 100644 index 000000000000..f788d26887c8 --- /dev/null +++ b/packages/google-monitoring-dashboard/README.md @@ -0,0 +1,167 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Monitoring Dashboards: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/monitoring-dashboards.svg)](https://www.npmjs.org/package/@google-cloud/monitoring-dashboards) + + + + +interact with dashboards for viewing and analyzing metric data + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). + +* [Monitoring Dashboards Node.js Client API Reference][client-docs] +* [Monitoring Dashboards Documentation][product-docs] +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Monitoring Dashboards API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/monitoring-dashboards +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const { + DashboardsServiceClient, +} = require('@google-cloud/monitoring-dashboards'); + +// Creates a client +const ds = new DashboardsServiceClient(); + +// parent = 'projects/my-project', // Project to list dashboards for. + +async function listDashboards() { + const [dashboards] = await ds.listDashboards({ + parent, + }); + console.info('Listing Dashboards:'); + for (const dashboard of dashboards) { + console.info(`\t${dashboard.displayName}`); + } +} +listDashboards(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Dashboards_service.create_dashboard | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js,samples/README.md) | +| Dashboards_service.delete_dashboard | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js,samples/README.md) | +| Dashboards_service.get_dashboard | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js,samples/README.md) | +| Dashboards_service.list_dashboards | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js,samples/README.md) | +| Dashboards_service.update_dashboard | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/test/quickstart.js,samples/README.md) | + + + +The [Monitoring Dashboards Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/monitoring-dashboards@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/monitoring-dashboards/latest +[product-docs]: https://cloud.google.com/monitoring/docs +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-monitoring-dashboard/linkinator.config.json b/packages/google-monitoring-dashboard/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-monitoring-dashboard/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-monitoring-dashboard/owlbot.py b/packages/google-monitoring-dashboard/owlbot.py new file mode 100644 index 000000000000..2246ed0501f3 --- /dev/null +++ b/packages/google-monitoring-dashboard/owlbot.py @@ -0,0 +1,21 @@ +# Copyright 2019 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. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool.languages.node as node + +node.owlbot_main( + staging_excludes=['README.md', 'package.json'], + templates_excludes=['.github/release-please.yml'] +) diff --git a/packages/google-monitoring-dashboard/package.json b/packages/google-monitoring-dashboard/package.json new file mode 100644 index 000000000000..2ac61a2856e1 --- /dev/null +++ b/packages/google-monitoring-dashboard/package.json @@ -0,0 +1,54 @@ +{ + "name": "@google-cloud/monitoring-dashboards", + "version": "2.7.1", + "description": "interact with dashboards for viewing and analyzing metric data", + "repository": "googleapis/nodejs-monitoring-dashboards", + "license": "Apache-2.0", + "author": "Google LLC", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.3.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^16.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/alertchart.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/alertchart.proto new file mode 100644 index 000000000000..2a92423b8f77 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/alertchart.proto @@ -0,0 +1,41 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "AlertChartProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A chart that displays alert policy data. +message AlertChart { + option (google.api.resource) = { + type: "monitoring.googleapis.com/AlertPolicy" + pattern: "projects/{project}/alertPolicies/{alert_policy}" + }; + + // Required. The resource name of the alert policy. The format is: + // + // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/collapsible_group.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/collapsible_group.proto new file mode 100644 index 000000000000..513560eb169c --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/collapsible_group.proto @@ -0,0 +1,32 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "CollapsibleGroupProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget that groups the other widgets. All widgets that are within +// the area spanned by the grouping widget are considered member widgets. +message CollapsibleGroup { + // The collapsed state of the widget on first page load. + bool collapsed = 1; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/common.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/common.proto new file mode 100644 index 000000000000..6b8e6b3d5499 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/common.proto @@ -0,0 +1,452 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// Describes how to combine multiple time series to provide a different view of +// the data. Aggregation of time series is done in two steps. First, each time +// series in the set is _aligned_ to the same time interval boundaries, then the +// set of time series is optionally _reduced_ in number. +// +// Alignment consists of applying the `per_series_aligner` operation +// to each time series after its data has been divided into regular +// `alignment_period` time intervals. This process takes _all_ of the data +// points in an alignment period, applies a mathematical transformation such as +// averaging, minimum, maximum, delta, etc., and converts them into a single +// data point per period. +// +// Reduction is when the aligned and transformed time series can optionally be +// combined, reducing the number of time series through similar mathematical +// transformations. Reduction involves applying a `cross_series_reducer` to +// all the time series, optionally sorting the time series into subsets with +// `group_by_fields`, and applying the reducer to each subset. +// +// The raw time series data can contain a huge amount of information from +// multiple sources. Alignment and reduction transforms this mass of data into +// a more manageable and representative collection of data, for example "the +// 95% latency across the average of all tasks in a cluster". This +// representative data can be more easily graphed and comprehended, and the +// individual time series data is still available for later drilldown. For more +// details, see [Filtering and +// aggregation](https://cloud.google.com/monitoring/api/v3/aggregation). +message Aggregation { + // The `Aligner` specifies the operation that will be applied to the data + // points in each alignment period in a time series. Except for + // `ALIGN_NONE`, which specifies that no operation be applied, each alignment + // operation replaces the set of data values in each alignment period with + // a single value: the result of applying the operation to the data values. + // An aligned time series has a single data value at the end of each + // `alignment_period`. + // + // An alignment operation can change the data type of the values, too. For + // example, if you apply a counting operation to boolean values, the data + // `value_type` in the original time series is `BOOLEAN`, but the `value_type` + // in the aligned result is `INT64`. + enum Aligner { + // No alignment. Raw data is returned. Not valid if cross-series reduction + // is requested. The `value_type` of the result is the same as the + // `value_type` of the input. + ALIGN_NONE = 0; + + // Align and convert to + // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA]. + // The output is `delta = y1 - y0`. + // + // This alignment is valid for + // [CUMULATIVE][google.api.MetricDescriptor.MetricKind.CUMULATIVE] and + // `DELTA` metrics. If the selected alignment period results in periods + // with no data, then the aligned value for such a period is created by + // interpolation. The `value_type` of the aligned result is the same as + // the `value_type` of the input. + ALIGN_DELTA = 1; + + // Align and convert to a rate. The result is computed as + // `rate = (y1 - y0)/(t1 - t0)`, or "delta over time". + // Think of this aligner as providing the slope of the line that passes + // through the value at the start and at the end of the `alignment_period`. + // + // This aligner is valid for `CUMULATIVE` + // and `DELTA` metrics with numeric values. If the selected alignment + // period results in periods with no data, then the aligned value for + // such a period is created by interpolation. The output is a `GAUGE` + // metric with `value_type` `DOUBLE`. + // + // If, by "rate", you mean "percentage change", see the + // `ALIGN_PERCENT_CHANGE` aligner instead. + ALIGN_RATE = 2; + + // Align by interpolating between adjacent points around the alignment + // period boundary. This aligner is valid for `GAUGE` metrics with + // numeric values. The `value_type` of the aligned result is the same as the + // `value_type` of the input. + ALIGN_INTERPOLATE = 3; + + // Align by moving the most recent data point before the end of the + // alignment period to the boundary at the end of the alignment + // period. This aligner is valid for `GAUGE` metrics. The `value_type` of + // the aligned result is the same as the `value_type` of the input. + ALIGN_NEXT_OLDER = 4; + + // Align the time series by returning the minimum value in each alignment + // period. This aligner is valid for `GAUGE` and `DELTA` metrics with + // numeric values. The `value_type` of the aligned result is the same as + // the `value_type` of the input. + ALIGN_MIN = 10; + + // Align the time series by returning the maximum value in each alignment + // period. This aligner is valid for `GAUGE` and `DELTA` metrics with + // numeric values. The `value_type` of the aligned result is the same as + // the `value_type` of the input. + ALIGN_MAX = 11; + + // Align the time series by returning the mean value in each alignment + // period. This aligner is valid for `GAUGE` and `DELTA` metrics with + // numeric values. The `value_type` of the aligned result is `DOUBLE`. + ALIGN_MEAN = 12; + + // Align the time series by returning the number of values in each alignment + // period. This aligner is valid for `GAUGE` and `DELTA` metrics with + // numeric or Boolean values. The `value_type` of the aligned result is + // `INT64`. + ALIGN_COUNT = 13; + + // Align the time series by returning the sum of the values in each + // alignment period. This aligner is valid for `GAUGE` and `DELTA` + // metrics with numeric and distribution values. The `value_type` of the + // aligned result is the same as the `value_type` of the input. + ALIGN_SUM = 14; + + // Align the time series by returning the standard deviation of the values + // in each alignment period. This aligner is valid for `GAUGE` and + // `DELTA` metrics with numeric values. The `value_type` of the output is + // `DOUBLE`. + ALIGN_STDDEV = 15; + + // Align the time series by returning the number of `True` values in + // each alignment period. This aligner is valid for `GAUGE` metrics with + // Boolean values. The `value_type` of the output is `INT64`. + ALIGN_COUNT_TRUE = 16; + + // Align the time series by returning the number of `False` values in + // each alignment period. This aligner is valid for `GAUGE` metrics with + // Boolean values. The `value_type` of the output is `INT64`. + ALIGN_COUNT_FALSE = 24; + + // Align the time series by returning the ratio of the number of `True` + // values to the total number of values in each alignment period. This + // aligner is valid for `GAUGE` metrics with Boolean values. The output + // value is in the range [0.0, 1.0] and has `value_type` `DOUBLE`. + ALIGN_FRACTION_TRUE = 17; + + // Align the time series by using [percentile + // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + // data point in each alignment period is the 99th percentile of all data + // points in the period. This aligner is valid for `GAUGE` and `DELTA` + // metrics with distribution values. The output is a `GAUGE` metric with + // `value_type` `DOUBLE`. + ALIGN_PERCENTILE_99 = 18; + + // Align the time series by using [percentile + // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + // data point in each alignment period is the 95th percentile of all data + // points in the period. This aligner is valid for `GAUGE` and `DELTA` + // metrics with distribution values. The output is a `GAUGE` metric with + // `value_type` `DOUBLE`. + ALIGN_PERCENTILE_95 = 19; + + // Align the time series by using [percentile + // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + // data point in each alignment period is the 50th percentile of all data + // points in the period. This aligner is valid for `GAUGE` and `DELTA` + // metrics with distribution values. The output is a `GAUGE` metric with + // `value_type` `DOUBLE`. + ALIGN_PERCENTILE_50 = 20; + + // Align the time series by using [percentile + // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting + // data point in each alignment period is the 5th percentile of all data + // points in the period. This aligner is valid for `GAUGE` and `DELTA` + // metrics with distribution values. The output is a `GAUGE` metric with + // `value_type` `DOUBLE`. + ALIGN_PERCENTILE_05 = 21; + + // Align and convert to a percentage change. This aligner is valid for + // `GAUGE` and `DELTA` metrics with numeric values. This alignment returns + // `((current - previous)/previous) * 100`, where the value of `previous` is + // determined based on the `alignment_period`. + // + // If the values of `current` and `previous` are both 0, then the returned + // value is 0. If only `previous` is 0, the returned value is infinity. + // + // A 10-minute moving mean is computed at each point of the alignment period + // prior to the above calculation to smooth the metric and prevent false + // positives from very short-lived spikes. The moving mean is only + // applicable for data whose values are `>= 0`. Any values `< 0` are + // treated as a missing datapoint, and are ignored. While `DELTA` + // metrics are accepted by this alignment, special care should be taken that + // the values for the metric will always be positive. The output is a + // `GAUGE` metric with `value_type` `DOUBLE`. + ALIGN_PERCENT_CHANGE = 23; + } + + // A Reducer operation describes how to aggregate data points from multiple + // time series into a single time series, where the value of each data point + // in the resulting series is a function of all the already aligned values in + // the input time series. + enum Reducer { + // No cross-time series reduction. The output of the `Aligner` is + // returned. + REDUCE_NONE = 0; + + // Reduce by computing the mean value across time series for each + // alignment period. This reducer is valid for + // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA] and + // [GAUGE][google.api.MetricDescriptor.MetricKind.GAUGE] metrics with + // numeric or distribution values. The `value_type` of the output is + // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE]. + REDUCE_MEAN = 1; + + // Reduce by computing the minimum value across time series for each + // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + // with numeric values. The `value_type` of the output is the same as the + // `value_type` of the input. + REDUCE_MIN = 2; + + // Reduce by computing the maximum value across time series for each + // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + // with numeric values. The `value_type` of the output is the same as the + // `value_type` of the input. + REDUCE_MAX = 3; + + // Reduce by computing the sum across time series for each + // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics + // with numeric and distribution values. The `value_type` of the output is + // the same as the `value_type` of the input. + REDUCE_SUM = 4; + + // Reduce by computing the standard deviation across time series + // for each alignment period. This reducer is valid for `DELTA` and + // `GAUGE` metrics with numeric or distribution values. The `value_type` + // of the output is `DOUBLE`. + REDUCE_STDDEV = 5; + + // Reduce by computing the number of data points across time series + // for each alignment period. This reducer is valid for `DELTA` and + // `GAUGE` metrics of numeric, Boolean, distribution, and string + // `value_type`. The `value_type` of the output is `INT64`. + REDUCE_COUNT = 6; + + // Reduce by computing the number of `True`-valued data points across time + // series for each alignment period. This reducer is valid for `DELTA` and + // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output + // is `INT64`. + REDUCE_COUNT_TRUE = 7; + + // Reduce by computing the number of `False`-valued data points across time + // series for each alignment period. This reducer is valid for `DELTA` and + // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output + // is `INT64`. + REDUCE_COUNT_FALSE = 15; + + // Reduce by computing the ratio of the number of `True`-valued data points + // to the total number of data points for each alignment period. This + // reducer is valid for `DELTA` and `GAUGE` metrics of Boolean `value_type`. + // The output value is in the range [0.0, 1.0] and has `value_type` + // `DOUBLE`. + REDUCE_FRACTION_TRUE = 8; + + // Reduce by computing the [99th + // percentile](https://en.wikipedia.org/wiki/Percentile) of data points + // across time series for each alignment period. This reducer is valid for + // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + // of the output is `DOUBLE`. + REDUCE_PERCENTILE_99 = 9; + + // Reduce by computing the [95th + // percentile](https://en.wikipedia.org/wiki/Percentile) of data points + // across time series for each alignment period. This reducer is valid for + // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + // of the output is `DOUBLE`. + REDUCE_PERCENTILE_95 = 10; + + // Reduce by computing the [50th + // percentile](https://en.wikipedia.org/wiki/Percentile) of data points + // across time series for each alignment period. This reducer is valid for + // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + // of the output is `DOUBLE`. + REDUCE_PERCENTILE_50 = 11; + + // Reduce by computing the [5th + // percentile](https://en.wikipedia.org/wiki/Percentile) of data points + // across time series for each alignment period. This reducer is valid for + // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value + // of the output is `DOUBLE`. + REDUCE_PERCENTILE_05 = 12; + } + + // The `alignment_period` specifies a time interval, in seconds, that is used + // to divide the data in all the + // [time series][google.monitoring.v3.TimeSeries] into consistent blocks of + // time. This will be done before the per-series aligner can be applied to + // the data. + // + // The value must be at least 60 seconds. If a per-series aligner other than + // `ALIGN_NONE` is specified, this field is required or an error is returned. + // If no per-series aligner is specified, or the aligner `ALIGN_NONE` is + // specified, then this field is ignored. + // + // The maximum value of the `alignment_period` is 2 years, or 104 weeks. + google.protobuf.Duration alignment_period = 1; + + // An `Aligner` describes how to bring the data points in a single + // time series into temporal alignment. Except for `ALIGN_NONE`, all + // alignments cause all the data points in an `alignment_period` to be + // mathematically grouped together, resulting in a single data point for + // each `alignment_period` with end timestamp at the end of the period. + // + // Not all alignment operations may be applied to all time series. The valid + // choices depend on the `metric_kind` and `value_type` of the original time + // series. Alignment can change the `metric_kind` or the `value_type` of + // the time series. + // + // Time series data must be aligned in order to perform cross-time + // series reduction. If `cross_series_reducer` is specified, then + // `per_series_aligner` must be specified and not equal to `ALIGN_NONE` + // and `alignment_period` must be specified; otherwise, an error is + // returned. + Aligner per_series_aligner = 2; + + // The reduction operation to be used to combine time series into a single + // time series, where the value of each data point in the resulting series is + // a function of all the already aligned values in the input time series. + // + // Not all reducer operations can be applied to all time series. The valid + // choices depend on the `metric_kind` and the `value_type` of the original + // time series. Reduction can yield a time series with a different + // `metric_kind` or `value_type` than the input time series. + // + // Time series data must first be aligned (see `per_series_aligner`) in order + // to perform cross-time series reduction. If `cross_series_reducer` is + // specified, then `per_series_aligner` must be specified, and must not be + // `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an + // error is returned. + Reducer cross_series_reducer = 4; + + // The set of fields to preserve when `cross_series_reducer` is + // specified. The `group_by_fields` determine how the time series are + // partitioned into subsets prior to applying the aggregation + // operation. Each subset contains time series that have the same + // value for each of the grouping fields. Each individual time + // series is a member of exactly one subset. The + // `cross_series_reducer` is applied to each subset of time series. + // It is not possible to reduce across different resource types, so + // this field implicitly contains `resource.type`. Fields not + // specified in `group_by_fields` are aggregated away. If + // `group_by_fields` is not specified and all the time series have + // the same resource type, then the time series are aggregated into + // a single output time series. If `cross_series_reducer` is not + // defined, this field is ignored. + repeated string group_by_fields = 5; +} + +// Describes a ranking-based time series filter. Each input time series is +// ranked with an aligner. The filter will allow up to `num_time_series` time +// series to pass through it, selecting them based on the relative ranking. +// +// For example, if `ranking_method` is `METHOD_MEAN`,`direction` is `BOTTOM`, +// and `num_time_series` is 3, then the 3 times series with the lowest mean +// values will pass through the filter. +message PickTimeSeriesFilter { + // The value reducers that can be applied to a `PickTimeSeriesFilter`. + enum Method { + // Not allowed. You must specify a different `Method` if you specify a + // `PickTimeSeriesFilter`. + METHOD_UNSPECIFIED = 0; + + // Select the mean of all values. + METHOD_MEAN = 1; + + // Select the maximum value. + METHOD_MAX = 2; + + // Select the minimum value. + METHOD_MIN = 3; + + // Compute the sum of all values. + METHOD_SUM = 4; + + // Select the most recent value. + METHOD_LATEST = 5; + } + + // Describes the ranking directions. + enum Direction { + // Not allowed. You must specify a different `Direction` if you specify a + // `PickTimeSeriesFilter`. + DIRECTION_UNSPECIFIED = 0; + + // Pass the highest `num_time_series` ranking inputs. + TOP = 1; + + // Pass the lowest `num_time_series` ranking inputs. + BOTTOM = 2; + } + + // `ranking_method` is applied to each time series independently to produce + // the value which will be used to compare the time series to other time + // series. + Method ranking_method = 1; + + // How many time series to allow to pass through the filter. + int32 num_time_series = 2; + + // How to use the ranking to select time series that pass through the filter. + Direction direction = 3; +} + +// A filter that ranks streams based on their statistical relation to other +// streams in a request. +// Note: This field is deprecated and completely ignored by the API. +message StatisticalTimeSeriesFilter { + // The filter methods that can be applied to a stream. + enum Method { + // Not allowed in well-formed requests. + METHOD_UNSPECIFIED = 0; + + // Compute the outlier score of each stream. + METHOD_CLUSTER_OUTLIER = 1; + } + + // `rankingMethod` is applied to a set of time series, and then the produced + // value for each individual time series is used to compare a given time + // series to others. + // These are methods that cannot be applied stream-by-stream, but rather + // require the full context of a request to evaluate time series. + Method ranking_method = 1; + + // How many time series to output. + int32 num_time_series = 2; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard.proto new file mode 100644 index 000000000000..66f4c5300815 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard.proto @@ -0,0 +1,79 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/monitoring/dashboard/v1/dashboard_filter.proto"; +import "google/monitoring/dashboard/v1/layouts.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A Google Stackdriver dashboard. Dashboards define the content and layout +// of pages in the Stackdriver web application. +message Dashboard { + option (google.api.resource) = { + type: "monitoring.googleapis.com/Dashboard" + pattern: "projects/{project}/dashboards/{dashboard}" + }; + + // Immutable. The resource name of the dashboard. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. The mutable, human-readable name. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a policy from overwriting each other. + // An `etag` is returned in the response to `GetDashboard`, and + // users are expected to put that etag in the request to `UpdateDashboard` to + // ensure that their change will be applied to the same version of the + // Dashboard configuration. The field should not be passed during + // dashboard creation. + string etag = 4; + + // A dashboard's root container element that defines the layout style. + oneof layout { + // Content is arranged with a basic layout that re-flows a simple list of + // informational elements like widgets or tiles. + GridLayout grid_layout = 5; + + // The content is arranged as a grid of tiles, with each content widget + // occupying one or more grid blocks. + MosaicLayout mosaic_layout = 6; + + // The content is divided into equally spaced rows and the widgets are + // arranged horizontally. + RowLayout row_layout = 8; + + // The content is divided into equally spaced columns and the widgets are + // arranged vertically. + ColumnLayout column_layout = 9; + } + + // Filters to reduce the amount of data charted based on the filter criteria. + repeated DashboardFilter dashboard_filters = 11; + + // Labels applied to the dashboard + map labels = 12; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard_filter.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard_filter.proto new file mode 100644 index 000000000000..fba5cf63e887 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboard_filter.proto @@ -0,0 +1,68 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardFilterProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A filter to reduce the amount of data charted in relevant widgets. +message DashboardFilter { + // The type for the dashboard filter + enum FilterType { + // Filter type is unspecified. This is not valid in a well-formed request. + FILTER_TYPE_UNSPECIFIED = 0; + + // Filter on a resource label value + RESOURCE_LABEL = 1; + + // Filter on a metrics label value + METRIC_LABEL = 2; + + // Filter on a user metadata label value + USER_METADATA_LABEL = 3; + + // Filter on a system metadata label value + SYSTEM_METADATA_LABEL = 4; + + // Filter on a group id + GROUP = 5; + } + + // Required. The key for the label + string label_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // The placeholder text that can be referenced in a filter string or MQL + // query. If omitted, the dashboard filter will be applied to all relevant + // widgets in the dashboard. + string template_variable = 3; + + // The default value used in the filter comparison + oneof default_value { + // A variable-length string value. + string string_value = 4; + } + + // The specified filter type + FilterType filter_type = 5; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto new file mode 100644 index 000000000000..4e99c4f7e4d2 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/dashboards_service.proto @@ -0,0 +1,185 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/monitoring/dashboard/v1/dashboard.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardsServiceProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// Manages Stackdriver dashboards. A dashboard is an arrangement of data display +// widgets in a specific layout. +service DashboardsService { + option (google.api.default_host) = "monitoring.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/monitoring," + "https://www.googleapis.com/auth/monitoring.read," + "https://www.googleapis.com/auth/monitoring.write"; + + // Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard). + // This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam). + rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/dashboards" + body: "dashboard" + }; + } + + // Lists the existing dashboards. + // + // This method requires the `monitoring.dashboards.list` permission + // on the specified project. For more information, see + // [Cloud Identity and Access Management](https://cloud.google.com/iam). + rpc ListDashboards(ListDashboardsRequest) returns (ListDashboardsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/dashboards" + }; + } + + // Fetches a specific dashboard. + // + // This method requires the `monitoring.dashboards.get` permission + // on the specified dashboard. For more information, see + // [Cloud Identity and Access Management](https://cloud.google.com/iam). + rpc GetDashboard(GetDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + get: "/v1/{name=projects/*/dashboards/*}" + }; + } + + // Deletes an existing custom dashboard. + // + // This method requires the `monitoring.dashboards.delete` permission + // on the specified dashboard. For more information, see + // [Cloud Identity and Access Management](https://cloud.google.com/iam). + rpc DeleteDashboard(DeleteDashboardRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/dashboards/*}" + }; + } + + // Replaces an existing custom dashboard with a new definition. + // + // This method requires the `monitoring.dashboards.update` permission + // on the specified dashboard. For more information, see + // [Cloud Identity and Access Management](https://cloud.google.com/iam). + rpc UpdateDashboard(UpdateDashboardRequest) returns (Dashboard) { + option (google.api.http) = { + patch: "/v1/{dashboard.name=projects/*/dashboards/*}" + body: "dashboard" + }; + } +} + +// The `CreateDashboard` request. +message CreateDashboardRequest { + // Required. The project on which to execute the request. The format is: + // + // projects/[PROJECT_ID_OR_NUMBER] + // + // The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial dashboard specification. + Dashboard dashboard = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // save it. + bool validate_only = 3; +} + +// The `ListDashboards` request. +message ListDashboardsRequest { + // Required. The scope of the dashboards to list. The format is: + // + // projects/[PROJECT_ID_OR_NUMBER] + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // A positive number that is the maximum number of results to return. + // If unspecified, a default of 1000 is used. + int32 page_size = 2; + + // If this field is not empty then it must contain the `nextPageToken` value + // returned by a previous call to this method. Using this field causes the + // method to return additional results from the previous method call. + string page_token = 3; +} + +// The `ListDashboards` request. +message ListDashboardsResponse { + // The list of requested dashboards. + repeated Dashboard dashboards = 1; + + // If there are more results than have been returned, then this field is set + // to a non-empty value. To see the additional results, + // use that value as `page_token` in the next call to this method. + string next_page_token = 2; +} + +// The `GetDashboard` request. +message GetDashboardRequest { + // Required. The resource name of the Dashboard. The format is one of: + // + // - `dashboards/[DASHBOARD_ID]` (for system dashboards) + // - `projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]` + // (for custom dashboards). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "monitoring.googleapis.com/Dashboard" + } + ]; +} + +// The `DeleteDashboard` request. +message DeleteDashboardRequest { + // Required. The resource name of the Dashboard. The format is: + // + // projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "monitoring.googleapis.com/Dashboard" + } + ]; +} + +// The `UpdateDashboard` request. +message UpdateDashboardRequest { + // Required. The dashboard that will replace the existing dashboard. + Dashboard dashboard = 1 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // save it. + bool validate_only = 3; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/drilldowns.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/drilldowns.proto new file mode 100644 index 000000000000..b0a11e0a342e --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/drilldowns.proto @@ -0,0 +1,25 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DrilldownsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/layouts.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/layouts.proto new file mode 100644 index 000000000000..94be37aa519a --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/layouts.proto @@ -0,0 +1,112 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/monitoring/dashboard/v1/widget.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "LayoutsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A basic layout divides the available space into vertical columns of equal +// width and arranges a list of widgets using a row-first strategy. +message GridLayout { + // The number of columns into which the view's width is divided. If omitted + // or set to zero, a system default will be used while rendering. + int64 columns = 1; + + // The informational elements that are arranged into the columns row-first. + repeated Widget widgets = 2; +} + +// A mosaic layout divides the available space into a grid of blocks, and +// overlays the grid with tiles. Unlike `GridLayout`, tiles may span multiple +// grid blocks and can be placed at arbitrary locations in the grid. +message MosaicLayout { + // A single tile in the mosaic. The placement and size of the tile are + // configurable. + message Tile { + // The zero-indexed position of the tile in grid blocks relative to the + // left edge of the grid. Tiles must be contained within the specified + // number of columns. `x_pos` cannot be negative. + int32 x_pos = 1; + + // The zero-indexed position of the tile in grid blocks relative to the + // top edge of the grid. `y_pos` cannot be negative. + int32 y_pos = 2; + + // The width of the tile, measured in grid blocks. Tiles must have a + // minimum width of 1. + int32 width = 3; + + // The height of the tile, measured in grid blocks. Tiles must have a + // minimum height of 1. + int32 height = 4; + + // The informational widget contained in the tile. For example an `XyChart`. + Widget widget = 5; + } + + // The number of columns in the mosaic grid. The number of columns must be + // between 1 and 12, inclusive. + int32 columns = 1; + + // The tiles to display. + repeated Tile tiles = 3; +} + +// A simplified layout that divides the available space into rows +// and arranges a set of widgets horizontally in each row. +message RowLayout { + // Defines the layout properties and content for a row. + message Row { + // The relative weight of this row. The row weight is used to adjust the + // height of rows on the screen (relative to peers). Greater the weight, + // greater the height of the row on the screen. If omitted, a value + // of 1 is used while rendering. + int64 weight = 1; + + // The display widgets arranged horizontally in this row. + repeated Widget widgets = 2; + } + + // The rows of content to display. + repeated Row rows = 1; +} + +// A simplified layout that divides the available space into vertical columns +// and arranges a set of widgets vertically in each column. +message ColumnLayout { + // Defines the layout properties and content for a column. + message Column { + // The relative weight of this column. The column weight is used to adjust + // the width of columns on the screen (relative to peers). + // Greater the weight, greater the width of the column on the screen. + // If omitted, a value of 1 is used while rendering. + int64 weight = 1; + + // The display widgets arranged vertically in this column. + repeated Widget widgets = 2; + } + + // The columns of content to display. + repeated Column columns = 1; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/logs_panel.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/logs_panel.proto new file mode 100644 index 000000000000..a5fb66c7d6cc --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/logs_panel.proto @@ -0,0 +1,38 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "LogsPanelProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget that displays a stream of log. +message LogsPanel { + // A filter that chooses which log entries to return. See [Advanced Logs + // Queries](https://cloud.google.com/logging/docs/view/advanced-queries). + // Only log entries that match the filter are returned. An empty filter + // matches all log entries. + string filter = 1; + + // The names of logging resources to collect logs for. Currently only projects + // are supported. If empty, the widget will default to the host project. + repeated string resource_names = 2; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto new file mode 100644 index 000000000000..c5ae8f718c26 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/metrics.proto @@ -0,0 +1,192 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/common.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "MetricsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// TimeSeriesQuery collects the set of supported methods for querying time +// series data from the Stackdriver metrics API. +message TimeSeriesQuery { + // Parameters needed to obtain data for the chart. + oneof source { + // Filter parameters to fetch time series. + TimeSeriesFilter time_series_filter = 1; + + // Parameters to fetch a ratio between two time series filters. + TimeSeriesFilterRatio time_series_filter_ratio = 2; + + // A query used to fetch time series. + string time_series_query_language = 3; + } + + // The unit of data contained in fetched time series. If non-empty, this + // unit will override any unit that accompanies fetched data. The format is + // the same as the + // [`unit`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors) + // field in `MetricDescriptor`. + string unit_override = 5; +} + +// A filter that defines a subset of time series data that is displayed in a +// widget. Time series data is fetched using the +// [`ListTimeSeries`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) +// method. +message TimeSeriesFilter { + // Required. The [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) + // that identifies the metric types, resources, and projects to query. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // By default, the raw time series data is returned. + // Use this field to combine multiple time series for different views of the + // data. + Aggregation aggregation = 2; + + // Apply a second aggregation after `aggregation` is applied. + Aggregation secondary_aggregation = 3; + + // Selects an optional time series filter. + oneof output_filter { + // Ranking based time series filter. + PickTimeSeriesFilter pick_time_series_filter = 4; + + // Statistics based time series filter. + // Note: This field is deprecated and completely ignored by the API. + StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true]; + } +} + +// A pair of time series filters that define a ratio computation. The output +// time series is the pair-wise division of each aligned element from the +// numerator and denominator time series. +message TimeSeriesFilterRatio { + // Describes a query to build the numerator or denominator of a + // TimeSeriesFilterRatio. + message RatioPart { + // Required. The [monitoring + // filter](https://cloud.google.com/monitoring/api/v3/filters) that + // identifies the metric types, resources, and projects to query. + string filter = 1 [(google.api.field_behavior) = REQUIRED]; + + // By default, the raw time series data is returned. + // Use this field to combine multiple time series for different views of the + // data. + Aggregation aggregation = 2; + } + + // The numerator of the ratio. + RatioPart numerator = 1; + + // The denominator of the ratio. + RatioPart denominator = 2; + + // Apply a second aggregation after the ratio is computed. + Aggregation secondary_aggregation = 3; + + // Selects an optional filter that is applied to the time series after + // computing the ratio. + oneof output_filter { + // Ranking based time series filter. + PickTimeSeriesFilter pick_time_series_filter = 4; + + // Statistics based time series filter. + // Note: This field is deprecated and completely ignored by the API. + StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true]; + } +} + +// Defines a threshold for categorizing time series values. +message Threshold { + // The color suggests an interpretation to the viewer when actual values cross + // the threshold. Comments on each color provide UX guidance on how users can + // be expected to interpret a given state color. + enum Color { + // Color is unspecified. Not allowed in well-formed requests. + COLOR_UNSPECIFIED = 0; + + // Crossing the threshold is "concerning" behavior. + YELLOW = 4; + + // Crossing the threshold is "emergency" behavior. + RED = 6; + } + + // Whether the threshold is considered crossed by an actual value above or + // below its threshold value. + enum Direction { + // Not allowed in well-formed requests. + DIRECTION_UNSPECIFIED = 0; + + // The threshold will be considered crossed if the actual value is above + // the threshold value. + ABOVE = 1; + + // The threshold will be considered crossed if the actual value is below + // the threshold value. + BELOW = 2; + } + + // An axis identifier. + enum TargetAxis { + // The target axis was not specified. Defaults to Y1. + TARGET_AXIS_UNSPECIFIED = 0; + + // The y_axis (the right axis of chart). + Y1 = 1; + + // The y2_axis (the left axis of chart). + Y2 = 2; + } + + // A label for the threshold. + string label = 1; + + // The value of the threshold. The value should be defined in the native scale + // of the metric. + double value = 2; + + // The state color for this threshold. Color is not allowed in a XyChart. + Color color = 3; + + // The direction for the current threshold. Direction is not allowed in a + // XyChart. + Direction direction = 4; + + // The target axis to use for plotting the threshold. Target axis is not + // allowed in a Scorecard. + TargetAxis target_axis = 5; +} + +// Defines the possible types of spark chart supported by the `Scorecard`. +enum SparkChartType { + // Not allowed in well-formed requests. + SPARK_CHART_TYPE_UNSPECIFIED = 0; + + // The sparkline will be rendered as a small line chart. + SPARK_LINE = 1; + + // The sparkbar will be rendered as a small bar chart. + SPARK_BAR = 2; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/scorecard.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/scorecard.proto new file mode 100644 index 000000000000..2cb2e4b2eb00 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/scorecard.proto @@ -0,0 +1,113 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "ScorecardProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget showing the latest value of a metric, and how this value relates to +// one or more thresholds. +message Scorecard { + // A gauge chart shows where the current value sits within a pre-defined + // range. The upper and lower bounds should define the possible range of + // values for the scorecard's query (inclusive). + message GaugeView { + // The lower bound for this gauge chart. The value of the chart should + // always be greater than or equal to this. + double lower_bound = 1; + + // The upper bound for this gauge chart. The value of the chart should + // always be less than or equal to this. + double upper_bound = 2; + } + + // A sparkChart is a small chart suitable for inclusion in a table-cell or + // inline in text. This message contains the configuration for a sparkChart + // to show up on a Scorecard, showing recent trends of the scorecard's + // timeseries. + message SparkChartView { + // Required. The type of sparkchart to show in this chartView. + SparkChartType spark_chart_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The lower bound on data point frequency in the chart implemented by + // specifying the minimum alignment period to use in a time series query. + // For example, if the data is published once every 10 minutes it would not + // make sense to fetch and align data at one minute intervals. This field is + // optional and exists only as a hint. + google.protobuf.Duration min_alignment_period = 2; + } + + // Required. Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Defines the optional additional chart shown on the scorecard. If + // neither is included - then a default scorecard is shown. + oneof data_view { + // Will cause the scorecard to show a gauge chart. + GaugeView gauge_view = 4; + + // Will cause the scorecard to show a spark chart. + SparkChartView spark_chart_view = 5; + } + + // The thresholds used to determine the state of the scorecard given the + // time series' current value. For an actual value x, the scorecard is in a + // danger state if x is less than or equal to a danger threshold that triggers + // below, or greater than or equal to a danger threshold that triggers above. + // Similarly, if x is above/below a warning threshold that triggers + // above/below, then the scorecard is in a warning state - unless x also puts + // it in a danger state. (Danger trumps warning.) + // + // As an example, consider a scorecard with the following four thresholds: + // { + // value: 90, + // category: 'DANGER', + // trigger: 'ABOVE', + // }, + // { + // value: 70, + // category: 'WARNING', + // trigger: 'ABOVE', + // }, + // { + // value: 10, + // category: 'DANGER', + // trigger: 'BELOW', + // }, + // { + // value: 20, + // category: 'WARNING', + // trigger: 'BELOW', + // } + // + // Then: values less than or equal to 10 would put the scorecard in a DANGER + // state, values greater than 10 but less than or equal to 20 a WARNING state, + // values strictly between 20 and 70 an OK state, values greater than or equal + // to 70 but less than 90 a WARNING state, and values greater than or equal to + // 90 a DANGER state. + repeated Threshold thresholds = 6; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/service.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/service.proto new file mode 100644 index 000000000000..f7e5e44aef17 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/service.proto @@ -0,0 +1,25 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "ServiceMonitoringProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto new file mode 100644 index 000000000000..8165c3a9b79a --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table.proto @@ -0,0 +1,59 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/monitoring/dashboard/v1/table_display_options.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TableProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A table that displays time series data. +message TimeSeriesTable { + // Groups a time series query definition with table options. + message TableDataSet { + // Required. Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A template string for naming `TimeSeries` in the resulting data set. + // This should be a string with interpolations of the form `${label_name}`, + // which will resolve to the label's value i.e. + // "${resource.labels.project_id}." + string table_template = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The lower bound on data point frequency for this data set, implemented by + // specifying the minimum alignment period to use in a time series query + // For example, if the data is published once every 10 minutes, the + // `min_alignment_period` should be at least 10 minutes. It would not + // make sense to fetch and align data at one minute intervals. + google.protobuf.Duration min_alignment_period = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Table display options for configuring how the table is rendered. + TableDisplayOptions table_display_options = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The data displayed in this table. + repeated TableDataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto new file mode 100644 index 000000000000..b94b20b11bc5 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/table_display_options.proto @@ -0,0 +1,34 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TableDisplayOptionsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// Table display options that can be reused. +message TableDisplayOptions { + // Optional. Columns to display in the table. Leave empty to display all available + // columns. Note: This field is for future features and is not currently used. + repeated string shown_columns = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/text.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/text.proto new file mode 100644 index 000000000000..ed75a19f2c61 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/text.proto @@ -0,0 +1,46 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget that displays textual content. +message Text { + // The format type of the text content. + enum Format { + // Format is unspecified. Defaults to MARKDOWN. + FORMAT_UNSPECIFIED = 0; + + // The text contains Markdown formatting. + MARKDOWN = 1; + + // The text contains no special formatting. + RAW = 2; + } + + // The text content to be displayed. + string content = 1; + + // How the text content is formatted. + Format format = 2; +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/widget.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/widget.proto new file mode 100644 index 000000000000..bb50eec8ed32 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/widget.proto @@ -0,0 +1,70 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/alertchart.proto"; +import "google/monitoring/dashboard/v1/collapsible_group.proto"; +import "google/monitoring/dashboard/v1/logs_panel.proto"; +import "google/monitoring/dashboard/v1/scorecard.proto"; +import "google/monitoring/dashboard/v1/table.proto"; +import "google/monitoring/dashboard/v1/text.proto"; +import "google/monitoring/dashboard/v1/xychart.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "WidgetProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// Widget contains a single dashboard component and configuration of how to +// present the component in the dashboard. +message Widget { + // Optional. The title of the widget. + string title = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Content defines the component used to populate the widget. + oneof content { + // A chart of time series data. + XyChart xy_chart = 2; + + // A scorecard summarizing time series data. + Scorecard scorecard = 3; + + // A raw string or markdown displaying textual content. + Text text = 4; + + // A blank space. + google.protobuf.Empty blank = 5; + + // A chart of alert policy data. + AlertChart alert_chart = 7; + + // A widget that displays time series data in a tabular format. + TimeSeriesTable time_series_table = 8; + + // A widget that groups the other widgets. All widgets that are within + // the area spanned by the grouping widget are considered member widgets. + CollapsibleGroup collapsible_group = 9; + + // A widget that shows a stream of logs. + LogsPanel logs_panel = 10; + } +} diff --git a/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto new file mode 100644 index 000000000000..11a26a49c3a2 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/google/monitoring/dashboard/v1/xychart.proto @@ -0,0 +1,166 @@ +// Copyright 2022 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.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "XyChartProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A chart that displays data on a 2D (X and Y axes) plane. +message XyChart { + // Groups a time series query definition with charting options. + message DataSet { + // The types of plotting strategies for data sets. + enum PlotType { + // Plot type is unspecified. The view will default to `LINE`. + PLOT_TYPE_UNSPECIFIED = 0; + + // The data is plotted as a set of lines (one line per series). + LINE = 1; + + // The data is plotted as a set of filled areas (one area per series), + // with the areas stacked vertically (the base of each area is the top of + // its predecessor, and the base of the first area is the X axis). Since + // the areas do not overlap, each is filled with a different opaque color. + STACKED_AREA = 2; + + // The data is plotted as a set of rectangular boxes (one box per series), + // with the boxes stacked vertically (the base of each box is the top of + // its predecessor, and the base of the first box is the X axis). Since + // the boxes do not overlap, each is filled with a different opaque color. + STACKED_BAR = 3; + + // The data is plotted as a heatmap. The series being plotted must have a + // `DISTRIBUTION` value type. The value of each bucket in the distribution + // is displayed as a color. This type is not currently available in the + // Stackdriver Monitoring application. + HEATMAP = 4; + } + + // An axis identifier. + enum TargetAxis { + // The target axis was not specified. Defaults to Y1. + TARGET_AXIS_UNSPECIFIED = 0; + + // The y_axis (the right axis of chart). + Y1 = 1; + + // The y2_axis (the left axis of chart). + Y2 = 2; + } + + // Required. Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // How this data should be plotted on the chart. + PlotType plot_type = 2; + + // A template string for naming `TimeSeries` in the resulting data set. + // This should be a string with interpolations of the form `${label_name}`, + // which will resolve to the label's value. + string legend_template = 3; + + // Optional. The lower bound on data point frequency for this data set, implemented by + // specifying the minimum alignment period to use in a time series query + // For example, if the data is published once every 10 minutes, the + // `min_alignment_period` should be at least 10 minutes. It would not + // make sense to fetch and align data at one minute intervals. + google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target axis to use for plotting the metric. + TargetAxis target_axis = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // A chart axis. + message Axis { + // Types of scales used in axes. + enum Scale { + // Scale is unspecified. The view will default to `LINEAR`. + SCALE_UNSPECIFIED = 0; + + // Linear scale. + LINEAR = 1; + + // Logarithmic scale (base 10). + LOG10 = 2; + } + + // The label of the axis. + string label = 1; + + // The axis scale. By default, a linear scale is used. + Scale scale = 2; + } + + // Required. The data displayed in this chart. + repeated DataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED]; + + // The duration used to display a comparison chart. A comparison chart + // simultaneously shows values from two similar-length time periods + // (e.g., week-over-week metrics). + // The duration must be positive, and it can only be applied to charts with + // data sets of LINE plot type. + google.protobuf.Duration timeshift_duration = 4; + + // Threshold lines drawn horizontally across the chart. + repeated Threshold thresholds = 5; + + // The properties applied to the X axis. + Axis x_axis = 6; + + // The properties applied to the Y axis. + Axis y_axis = 7; + + // The properties applied to the Y2 axis. + Axis y2_axis = 9; + + // Display options for the chart. + ChartOptions chart_options = 8; +} + +// Options to control visual rendering of a chart. +message ChartOptions { + // Chart mode options. + enum Mode { + // Mode is unspecified. The view will default to `COLOR`. + MODE_UNSPECIFIED = 0; + + // The chart distinguishes data series using different color. Line + // colors may get reused when there are many lines in the chart. + COLOR = 1; + + // The chart uses the Stackdriver x-ray mode, in which each + // data set is plotted using the same semi-transparent color. + X_RAY = 2; + + // The chart displays statistics such as average, median, 95th percentile, + // and more. + STATS = 3; + } + + // The chart mode. + Mode mode = 1; +} diff --git a/packages/google-monitoring-dashboard/protos/protos.d.ts b/packages/google-monitoring-dashboard/protos/protos.d.ts new file mode 100644 index 000000000000..a2cec527d8f5 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/protos.d.ts @@ -0,0 +1,8680 @@ +// Copyright 2022 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 Long = require("long"); +import type {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace monitoring. */ + namespace monitoring { + + /** Namespace dashboard. */ + namespace dashboard { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AlertChart. */ + interface IAlertChart { + + /** AlertChart name */ + name?: (string|null); + } + + /** Represents an AlertChart. */ + class AlertChart implements IAlertChart { + + /** + * Constructs a new AlertChart. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IAlertChart); + + /** AlertChart name. */ + public name: string; + + /** + * Creates a new AlertChart instance using the specified properties. + * @param [properties] Properties to set + * @returns AlertChart instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IAlertChart): google.monitoring.dashboard.v1.AlertChart; + + /** + * Encodes the specified AlertChart message. Does not implicitly {@link google.monitoring.dashboard.v1.AlertChart.verify|verify} messages. + * @param message AlertChart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IAlertChart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AlertChart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.AlertChart.verify|verify} messages. + * @param message AlertChart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IAlertChart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AlertChart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AlertChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.AlertChart; + + /** + * Decodes an AlertChart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AlertChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.AlertChart; + + /** + * Verifies an AlertChart message. + * @param message Plain 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 AlertChart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AlertChart + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.AlertChart; + + /** + * Creates a plain object from an AlertChart message. Also converts values to other types if specified. + * @param message AlertChart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.AlertChart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AlertChart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AlertChart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CollapsibleGroup. */ + interface ICollapsibleGroup { + + /** CollapsibleGroup collapsed */ + collapsed?: (boolean|null); + } + + /** Represents a CollapsibleGroup. */ + class CollapsibleGroup implements ICollapsibleGroup { + + /** + * Constructs a new CollapsibleGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ICollapsibleGroup); + + /** CollapsibleGroup collapsed. */ + public collapsed: boolean; + + /** + * Creates a new CollapsibleGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns CollapsibleGroup instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ICollapsibleGroup): google.monitoring.dashboard.v1.CollapsibleGroup; + + /** + * Encodes the specified CollapsibleGroup message. Does not implicitly {@link google.monitoring.dashboard.v1.CollapsibleGroup.verify|verify} messages. + * @param message CollapsibleGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ICollapsibleGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CollapsibleGroup message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.CollapsibleGroup.verify|verify} messages. + * @param message CollapsibleGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ICollapsibleGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CollapsibleGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CollapsibleGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.CollapsibleGroup; + + /** + * Decodes a CollapsibleGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CollapsibleGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.CollapsibleGroup; + + /** + * Verifies a CollapsibleGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CollapsibleGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CollapsibleGroup + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.CollapsibleGroup; + + /** + * Creates a plain object from a CollapsibleGroup message. Also converts values to other types if specified. + * @param message CollapsibleGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.CollapsibleGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CollapsibleGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CollapsibleGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Aggregation. */ + interface IAggregation { + + /** Aggregation alignmentPeriod */ + alignmentPeriod?: (google.protobuf.IDuration|null); + + /** Aggregation perSeriesAligner */ + perSeriesAligner?: (google.monitoring.dashboard.v1.Aggregation.Aligner|keyof typeof google.monitoring.dashboard.v1.Aggregation.Aligner|null); + + /** Aggregation crossSeriesReducer */ + crossSeriesReducer?: (google.monitoring.dashboard.v1.Aggregation.Reducer|keyof typeof google.monitoring.dashboard.v1.Aggregation.Reducer|null); + + /** Aggregation groupByFields */ + groupByFields?: (string[]|null); + } + + /** Represents an Aggregation. */ + class Aggregation implements IAggregation { + + /** + * Constructs a new Aggregation. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IAggregation); + + /** Aggregation alignmentPeriod. */ + public alignmentPeriod?: (google.protobuf.IDuration|null); + + /** Aggregation perSeriesAligner. */ + public perSeriesAligner: (google.monitoring.dashboard.v1.Aggregation.Aligner|keyof typeof google.monitoring.dashboard.v1.Aggregation.Aligner); + + /** Aggregation crossSeriesReducer. */ + public crossSeriesReducer: (google.monitoring.dashboard.v1.Aggregation.Reducer|keyof typeof google.monitoring.dashboard.v1.Aggregation.Reducer); + + /** Aggregation groupByFields. */ + public groupByFields: string[]; + + /** + * Creates a new Aggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregation instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IAggregation): google.monitoring.dashboard.v1.Aggregation; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.dashboard.v1.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Aggregation; + + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Aggregation; + + /** + * Verifies an Aggregation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregation + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Aggregation; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @param message Aggregation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregation { + + /** Aligner enum. */ + enum Aligner { + ALIGN_NONE = 0, + ALIGN_DELTA = 1, + ALIGN_RATE = 2, + ALIGN_INTERPOLATE = 3, + ALIGN_NEXT_OLDER = 4, + ALIGN_MIN = 10, + ALIGN_MAX = 11, + ALIGN_MEAN = 12, + ALIGN_COUNT = 13, + ALIGN_SUM = 14, + ALIGN_STDDEV = 15, + ALIGN_COUNT_TRUE = 16, + ALIGN_COUNT_FALSE = 24, + ALIGN_FRACTION_TRUE = 17, + ALIGN_PERCENTILE_99 = 18, + ALIGN_PERCENTILE_95 = 19, + ALIGN_PERCENTILE_50 = 20, + ALIGN_PERCENTILE_05 = 21, + ALIGN_PERCENT_CHANGE = 23 + } + + /** Reducer enum. */ + enum Reducer { + REDUCE_NONE = 0, + REDUCE_MEAN = 1, + REDUCE_MIN = 2, + REDUCE_MAX = 3, + REDUCE_SUM = 4, + REDUCE_STDDEV = 5, + REDUCE_COUNT = 6, + REDUCE_COUNT_TRUE = 7, + REDUCE_COUNT_FALSE = 15, + REDUCE_FRACTION_TRUE = 8, + REDUCE_PERCENTILE_99 = 9, + REDUCE_PERCENTILE_95 = 10, + REDUCE_PERCENTILE_50 = 11, + REDUCE_PERCENTILE_05 = 12 + } + } + + /** Properties of a PickTimeSeriesFilter. */ + interface IPickTimeSeriesFilter { + + /** PickTimeSeriesFilter rankingMethod */ + rankingMethod?: (google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method|keyof typeof google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method|null); + + /** PickTimeSeriesFilter numTimeSeries */ + numTimeSeries?: (number|null); + + /** PickTimeSeriesFilter direction */ + direction?: (google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction|keyof typeof google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction|null); + } + + /** Represents a PickTimeSeriesFilter. */ + class PickTimeSeriesFilter implements IPickTimeSeriesFilter { + + /** + * Constructs a new PickTimeSeriesFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IPickTimeSeriesFilter); + + /** PickTimeSeriesFilter rankingMethod. */ + public rankingMethod: (google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method|keyof typeof google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method); + + /** PickTimeSeriesFilter numTimeSeries. */ + public numTimeSeries: number; + + /** PickTimeSeriesFilter direction. */ + public direction: (google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction|keyof typeof google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction); + + /** + * Creates a new PickTimeSeriesFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PickTimeSeriesFilter instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IPickTimeSeriesFilter): google.monitoring.dashboard.v1.PickTimeSeriesFilter; + + /** + * Encodes the specified PickTimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify|verify} messages. + * @param message PickTimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IPickTimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PickTimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify|verify} messages. + * @param message PickTimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IPickTimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PickTimeSeriesFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PickTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.PickTimeSeriesFilter; + + /** + * Decodes a PickTimeSeriesFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PickTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.PickTimeSeriesFilter; + + /** + * Verifies a PickTimeSeriesFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PickTimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PickTimeSeriesFilter + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.PickTimeSeriesFilter; + + /** + * Creates a plain object from a PickTimeSeriesFilter message. Also converts values to other types if specified. + * @param message PickTimeSeriesFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.PickTimeSeriesFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PickTimeSeriesFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PickTimeSeriesFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PickTimeSeriesFilter { + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + METHOD_MEAN = 1, + METHOD_MAX = 2, + METHOD_MIN = 3, + METHOD_SUM = 4, + METHOD_LATEST = 5 + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + TOP = 1, + BOTTOM = 2 + } + } + + /** Properties of a StatisticalTimeSeriesFilter. */ + interface IStatisticalTimeSeriesFilter { + + /** StatisticalTimeSeriesFilter rankingMethod */ + rankingMethod?: (google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method|keyof typeof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method|null); + + /** StatisticalTimeSeriesFilter numTimeSeries */ + numTimeSeries?: (number|null); + } + + /** Represents a StatisticalTimeSeriesFilter. */ + class StatisticalTimeSeriesFilter implements IStatisticalTimeSeriesFilter { + + /** + * Constructs a new StatisticalTimeSeriesFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter); + + /** StatisticalTimeSeriesFilter rankingMethod. */ + public rankingMethod: (google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method|keyof typeof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method); + + /** StatisticalTimeSeriesFilter numTimeSeries. */ + public numTimeSeries: number; + + /** + * Creates a new StatisticalTimeSeriesFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns StatisticalTimeSeriesFilter instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter): google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter; + + /** + * Encodes the specified StatisticalTimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify|verify} messages. + * @param message StatisticalTimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatisticalTimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify|verify} messages. + * @param message StatisticalTimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatisticalTimeSeriesFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatisticalTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter; + + /** + * Decodes a StatisticalTimeSeriesFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatisticalTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter; + + /** + * Verifies a StatisticalTimeSeriesFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatisticalTimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatisticalTimeSeriesFilter + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter; + + /** + * Creates a plain object from a StatisticalTimeSeriesFilter message. Also converts values to other types if specified. + * @param message StatisticalTimeSeriesFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatisticalTimeSeriesFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StatisticalTimeSeriesFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StatisticalTimeSeriesFilter { + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + METHOD_CLUSTER_OUTLIER = 1 + } + } + + /** Properties of a Dashboard. */ + interface IDashboard { + + /** Dashboard name */ + name?: (string|null); + + /** Dashboard displayName */ + displayName?: (string|null); + + /** Dashboard etag */ + etag?: (string|null); + + /** Dashboard gridLayout */ + gridLayout?: (google.monitoring.dashboard.v1.IGridLayout|null); + + /** Dashboard mosaicLayout */ + mosaicLayout?: (google.monitoring.dashboard.v1.IMosaicLayout|null); + + /** Dashboard rowLayout */ + rowLayout?: (google.monitoring.dashboard.v1.IRowLayout|null); + + /** Dashboard columnLayout */ + columnLayout?: (google.monitoring.dashboard.v1.IColumnLayout|null); + + /** Dashboard dashboardFilters */ + dashboardFilters?: (google.monitoring.dashboard.v1.IDashboardFilter[]|null); + + /** Dashboard labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Dashboard. */ + class Dashboard implements IDashboard { + + /** + * Constructs a new Dashboard. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IDashboard); + + /** Dashboard name. */ + public name: string; + + /** Dashboard displayName. */ + public displayName: string; + + /** Dashboard etag. */ + public etag: string; + + /** Dashboard gridLayout. */ + public gridLayout?: (google.monitoring.dashboard.v1.IGridLayout|null); + + /** Dashboard mosaicLayout. */ + public mosaicLayout?: (google.monitoring.dashboard.v1.IMosaicLayout|null); + + /** Dashboard rowLayout. */ + public rowLayout?: (google.monitoring.dashboard.v1.IRowLayout|null); + + /** Dashboard columnLayout. */ + public columnLayout?: (google.monitoring.dashboard.v1.IColumnLayout|null); + + /** Dashboard dashboardFilters. */ + public dashboardFilters: google.monitoring.dashboard.v1.IDashboardFilter[]; + + /** Dashboard labels. */ + public labels: { [k: string]: string }; + + /** Dashboard layout. */ + public layout?: ("gridLayout"|"mosaicLayout"|"rowLayout"|"columnLayout"); + + /** + * Creates a new Dashboard instance using the specified properties. + * @param [properties] Properties to set + * @returns Dashboard instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IDashboard): google.monitoring.dashboard.v1.Dashboard; + + /** + * Encodes the specified Dashboard message. Does not implicitly {@link google.monitoring.dashboard.v1.Dashboard.verify|verify} messages. + * @param message Dashboard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IDashboard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dashboard message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Dashboard.verify|verify} messages. + * @param message Dashboard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IDashboard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dashboard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dashboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Dashboard; + + /** + * Decodes a Dashboard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dashboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Dashboard; + + /** + * Verifies a Dashboard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dashboard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dashboard + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Dashboard; + + /** + * Creates a plain object from a Dashboard message. Also converts values to other types if specified. + * @param message Dashboard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Dashboard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dashboard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dashboard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DashboardFilter. */ + interface IDashboardFilter { + + /** DashboardFilter labelKey */ + labelKey?: (string|null); + + /** DashboardFilter templateVariable */ + templateVariable?: (string|null); + + /** DashboardFilter stringValue */ + stringValue?: (string|null); + + /** DashboardFilter filterType */ + filterType?: (google.monitoring.dashboard.v1.DashboardFilter.FilterType|keyof typeof google.monitoring.dashboard.v1.DashboardFilter.FilterType|null); + } + + /** Represents a DashboardFilter. */ + class DashboardFilter implements IDashboardFilter { + + /** + * Constructs a new DashboardFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IDashboardFilter); + + /** DashboardFilter labelKey. */ + public labelKey: string; + + /** DashboardFilter templateVariable. */ + public templateVariable: string; + + /** DashboardFilter stringValue. */ + public stringValue?: (string|null); + + /** DashboardFilter filterType. */ + public filterType: (google.monitoring.dashboard.v1.DashboardFilter.FilterType|keyof typeof google.monitoring.dashboard.v1.DashboardFilter.FilterType); + + /** DashboardFilter defaultValue. */ + public defaultValue?: "stringValue"; + + /** + * Creates a new DashboardFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns DashboardFilter instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IDashboardFilter): google.monitoring.dashboard.v1.DashboardFilter; + + /** + * Encodes the specified DashboardFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.DashboardFilter.verify|verify} messages. + * @param message DashboardFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IDashboardFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DashboardFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.DashboardFilter.verify|verify} messages. + * @param message DashboardFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IDashboardFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DashboardFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DashboardFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.DashboardFilter; + + /** + * Decodes a DashboardFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DashboardFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.DashboardFilter; + + /** + * Verifies a DashboardFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DashboardFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DashboardFilter + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.DashboardFilter; + + /** + * Creates a plain object from a DashboardFilter message. Also converts values to other types if specified. + * @param message DashboardFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.DashboardFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DashboardFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DashboardFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DashboardFilter { + + /** FilterType enum. */ + enum FilterType { + FILTER_TYPE_UNSPECIFIED = 0, + RESOURCE_LABEL = 1, + METRIC_LABEL = 2, + USER_METADATA_LABEL = 3, + SYSTEM_METADATA_LABEL = 4, + GROUP = 5 + } + } + + /** Properties of a GridLayout. */ + interface IGridLayout { + + /** GridLayout columns */ + columns?: (number|Long|string|null); + + /** GridLayout widgets */ + widgets?: (google.monitoring.dashboard.v1.IWidget[]|null); + } + + /** Represents a GridLayout. */ + class GridLayout implements IGridLayout { + + /** + * Constructs a new GridLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IGridLayout); + + /** GridLayout columns. */ + public columns: (number|Long|string); + + /** GridLayout widgets. */ + public widgets: google.monitoring.dashboard.v1.IWidget[]; + + /** + * Creates a new GridLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns GridLayout instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IGridLayout): google.monitoring.dashboard.v1.GridLayout; + + /** + * Encodes the specified GridLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.GridLayout.verify|verify} messages. + * @param message GridLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IGridLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GridLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.GridLayout.verify|verify} messages. + * @param message GridLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IGridLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GridLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GridLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.GridLayout; + + /** + * Decodes a GridLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GridLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.GridLayout; + + /** + * Verifies a GridLayout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GridLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GridLayout + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.GridLayout; + + /** + * Creates a plain object from a GridLayout message. Also converts values to other types if specified. + * @param message GridLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.GridLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GridLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GridLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MosaicLayout. */ + interface IMosaicLayout { + + /** MosaicLayout columns */ + columns?: (number|null); + + /** MosaicLayout tiles */ + tiles?: (google.monitoring.dashboard.v1.MosaicLayout.ITile[]|null); + } + + /** Represents a MosaicLayout. */ + class MosaicLayout implements IMosaicLayout { + + /** + * Constructs a new MosaicLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IMosaicLayout); + + /** MosaicLayout columns. */ + public columns: number; + + /** MosaicLayout tiles. */ + public tiles: google.monitoring.dashboard.v1.MosaicLayout.ITile[]; + + /** + * Creates a new MosaicLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns MosaicLayout instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IMosaicLayout): google.monitoring.dashboard.v1.MosaicLayout; + + /** + * Encodes the specified MosaicLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.verify|verify} messages. + * @param message MosaicLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IMosaicLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MosaicLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.verify|verify} messages. + * @param message MosaicLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IMosaicLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MosaicLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MosaicLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.MosaicLayout; + + /** + * Decodes a MosaicLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MosaicLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.MosaicLayout; + + /** + * Verifies a MosaicLayout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MosaicLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MosaicLayout + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.MosaicLayout; + + /** + * Creates a plain object from a MosaicLayout message. Also converts values to other types if specified. + * @param message MosaicLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.MosaicLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MosaicLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MosaicLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MosaicLayout { + + /** Properties of a Tile. */ + interface ITile { + + /** Tile xPos */ + xPos?: (number|null); + + /** Tile yPos */ + yPos?: (number|null); + + /** Tile width */ + width?: (number|null); + + /** Tile height */ + height?: (number|null); + + /** Tile widget */ + widget?: (google.monitoring.dashboard.v1.IWidget|null); + } + + /** Represents a Tile. */ + class Tile implements ITile { + + /** + * Constructs a new Tile. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.MosaicLayout.ITile); + + /** Tile xPos. */ + public xPos: number; + + /** Tile yPos. */ + public yPos: number; + + /** Tile width. */ + public width: number; + + /** Tile height. */ + public height: number; + + /** Tile widget. */ + public widget?: (google.monitoring.dashboard.v1.IWidget|null); + + /** + * Creates a new Tile instance using the specified properties. + * @param [properties] Properties to set + * @returns Tile instance + */ + public static create(properties?: google.monitoring.dashboard.v1.MosaicLayout.ITile): google.monitoring.dashboard.v1.MosaicLayout.Tile; + + /** + * Encodes the specified Tile message. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.Tile.verify|verify} messages. + * @param message Tile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.MosaicLayout.ITile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tile message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.Tile.verify|verify} messages. + * @param message Tile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.MosaicLayout.ITile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.MosaicLayout.Tile; + + /** + * Decodes a Tile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.MosaicLayout.Tile; + + /** + * Verifies a Tile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tile + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.MosaicLayout.Tile; + + /** + * Creates a plain object from a Tile message. Also converts values to other types if specified. + * @param message Tile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.MosaicLayout.Tile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RowLayout. */ + interface IRowLayout { + + /** RowLayout rows */ + rows?: (google.monitoring.dashboard.v1.RowLayout.IRow[]|null); + } + + /** Represents a RowLayout. */ + class RowLayout implements IRowLayout { + + /** + * Constructs a new RowLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IRowLayout); + + /** RowLayout rows. */ + public rows: google.monitoring.dashboard.v1.RowLayout.IRow[]; + + /** + * Creates a new RowLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns RowLayout instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IRowLayout): google.monitoring.dashboard.v1.RowLayout; + + /** + * Encodes the specified RowLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.verify|verify} messages. + * @param message RowLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IRowLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.verify|verify} messages. + * @param message RowLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IRowLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.RowLayout; + + /** + * Decodes a RowLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.RowLayout; + + /** + * Verifies a RowLayout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowLayout + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.RowLayout; + + /** + * Creates a plain object from a RowLayout message. Also converts values to other types if specified. + * @param message RowLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.RowLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RowLayout { + + /** Properties of a Row. */ + interface IRow { + + /** Row weight */ + weight?: (number|Long|string|null); + + /** Row widgets */ + widgets?: (google.monitoring.dashboard.v1.IWidget[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.RowLayout.IRow); + + /** Row weight. */ + public weight: (number|Long|string); + + /** Row widgets. */ + public widgets: google.monitoring.dashboard.v1.IWidget[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.monitoring.dashboard.v1.RowLayout.IRow): google.monitoring.dashboard.v1.RowLayout.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.RowLayout.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.RowLayout.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.RowLayout.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.RowLayout.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.RowLayout.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.RowLayout.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ColumnLayout. */ + interface IColumnLayout { + + /** ColumnLayout columns */ + columns?: (google.monitoring.dashboard.v1.ColumnLayout.IColumn[]|null); + } + + /** Represents a ColumnLayout. */ + class ColumnLayout implements IColumnLayout { + + /** + * Constructs a new ColumnLayout. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IColumnLayout); + + /** ColumnLayout columns. */ + public columns: google.monitoring.dashboard.v1.ColumnLayout.IColumn[]; + + /** + * Creates a new ColumnLayout instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnLayout instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IColumnLayout): google.monitoring.dashboard.v1.ColumnLayout; + + /** + * Encodes the specified ColumnLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.verify|verify} messages. + * @param message ColumnLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IColumnLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.verify|verify} messages. + * @param message ColumnLayout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IColumnLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnLayout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.ColumnLayout; + + /** + * Decodes a ColumnLayout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.ColumnLayout; + + /** + * Verifies a ColumnLayout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnLayout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnLayout + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.ColumnLayout; + + /** + * Creates a plain object from a ColumnLayout message. Also converts values to other types if specified. + * @param message ColumnLayout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.ColumnLayout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnLayout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnLayout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ColumnLayout { + + /** Properties of a Column. */ + interface IColumn { + + /** Column weight */ + weight?: (number|Long|string|null); + + /** Column widgets */ + widgets?: (google.monitoring.dashboard.v1.IWidget[]|null); + } + + /** Represents a Column. */ + class Column implements IColumn { + + /** + * Constructs a new Column. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ColumnLayout.IColumn); + + /** Column weight. */ + public weight: (number|Long|string); + + /** Column widgets. */ + public widgets: google.monitoring.dashboard.v1.IWidget[]; + + /** + * Creates a new Column instance using the specified properties. + * @param [properties] Properties to set + * @returns Column instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ColumnLayout.IColumn): google.monitoring.dashboard.v1.ColumnLayout.Column; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ColumnLayout.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ColumnLayout.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Column message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.ColumnLayout.Column; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.ColumnLayout.Column; + + /** + * Verifies a Column message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Column + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.ColumnLayout.Column; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @param message Column + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.ColumnLayout.Column, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Column to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Column + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Widget. */ + interface IWidget { + + /** Widget title */ + title?: (string|null); + + /** Widget xyChart */ + xyChart?: (google.monitoring.dashboard.v1.IXyChart|null); + + /** Widget scorecard */ + scorecard?: (google.monitoring.dashboard.v1.IScorecard|null); + + /** Widget text */ + text?: (google.monitoring.dashboard.v1.IText|null); + + /** Widget blank */ + blank?: (google.protobuf.IEmpty|null); + + /** Widget alertChart */ + alertChart?: (google.monitoring.dashboard.v1.IAlertChart|null); + + /** Widget timeSeriesTable */ + timeSeriesTable?: (google.monitoring.dashboard.v1.ITimeSeriesTable|null); + + /** Widget collapsibleGroup */ + collapsibleGroup?: (google.monitoring.dashboard.v1.ICollapsibleGroup|null); + + /** Widget logsPanel */ + logsPanel?: (google.monitoring.dashboard.v1.ILogsPanel|null); + } + + /** Represents a Widget. */ + class Widget implements IWidget { + + /** + * Constructs a new Widget. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IWidget); + + /** Widget title. */ + public title: string; + + /** Widget xyChart. */ + public xyChart?: (google.monitoring.dashboard.v1.IXyChart|null); + + /** Widget scorecard. */ + public scorecard?: (google.monitoring.dashboard.v1.IScorecard|null); + + /** Widget text. */ + public text?: (google.monitoring.dashboard.v1.IText|null); + + /** Widget blank. */ + public blank?: (google.protobuf.IEmpty|null); + + /** Widget alertChart. */ + public alertChart?: (google.monitoring.dashboard.v1.IAlertChart|null); + + /** Widget timeSeriesTable. */ + public timeSeriesTable?: (google.monitoring.dashboard.v1.ITimeSeriesTable|null); + + /** Widget collapsibleGroup. */ + public collapsibleGroup?: (google.monitoring.dashboard.v1.ICollapsibleGroup|null); + + /** Widget logsPanel. */ + public logsPanel?: (google.monitoring.dashboard.v1.ILogsPanel|null); + + /** Widget content. */ + public content?: ("xyChart"|"scorecard"|"text"|"blank"|"alertChart"|"timeSeriesTable"|"collapsibleGroup"|"logsPanel"); + + /** + * Creates a new Widget instance using the specified properties. + * @param [properties] Properties to set + * @returns Widget instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IWidget): google.monitoring.dashboard.v1.Widget; + + /** + * Encodes the specified Widget message. Does not implicitly {@link google.monitoring.dashboard.v1.Widget.verify|verify} messages. + * @param message Widget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Widget message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Widget.verify|verify} messages. + * @param message Widget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Widget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Widget; + + /** + * Decodes a Widget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Widget; + + /** + * Verifies a Widget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Widget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Widget + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Widget; + + /** + * Creates a plain object from a Widget message. Also converts values to other types if specified. + * @param message Widget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Widget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Widget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Widget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogsPanel. */ + interface ILogsPanel { + + /** LogsPanel filter */ + filter?: (string|null); + + /** LogsPanel resourceNames */ + resourceNames?: (string[]|null); + } + + /** Represents a LogsPanel. */ + class LogsPanel implements ILogsPanel { + + /** + * Constructs a new LogsPanel. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ILogsPanel); + + /** LogsPanel filter. */ + public filter: string; + + /** LogsPanel resourceNames. */ + public resourceNames: string[]; + + /** + * Creates a new LogsPanel instance using the specified properties. + * @param [properties] Properties to set + * @returns LogsPanel instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ILogsPanel): google.monitoring.dashboard.v1.LogsPanel; + + /** + * Encodes the specified LogsPanel message. Does not implicitly {@link google.monitoring.dashboard.v1.LogsPanel.verify|verify} messages. + * @param message LogsPanel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ILogsPanel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogsPanel message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.LogsPanel.verify|verify} messages. + * @param message LogsPanel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ILogsPanel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogsPanel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogsPanel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.LogsPanel; + + /** + * Decodes a LogsPanel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogsPanel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.LogsPanel; + + /** + * Verifies a LogsPanel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogsPanel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogsPanel + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.LogsPanel; + + /** + * Creates a plain object from a LogsPanel message. Also converts values to other types if specified. + * @param message LogsPanel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.LogsPanel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogsPanel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogsPanel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Scorecard. */ + interface IScorecard { + + /** Scorecard timeSeriesQuery */ + timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** Scorecard gaugeView */ + gaugeView?: (google.monitoring.dashboard.v1.Scorecard.IGaugeView|null); + + /** Scorecard sparkChartView */ + sparkChartView?: (google.monitoring.dashboard.v1.Scorecard.ISparkChartView|null); + + /** Scorecard thresholds */ + thresholds?: (google.monitoring.dashboard.v1.IThreshold[]|null); + } + + /** Represents a Scorecard. */ + class Scorecard implements IScorecard { + + /** + * Constructs a new Scorecard. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IScorecard); + + /** Scorecard timeSeriesQuery. */ + public timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** Scorecard gaugeView. */ + public gaugeView?: (google.monitoring.dashboard.v1.Scorecard.IGaugeView|null); + + /** Scorecard sparkChartView. */ + public sparkChartView?: (google.monitoring.dashboard.v1.Scorecard.ISparkChartView|null); + + /** Scorecard thresholds. */ + public thresholds: google.monitoring.dashboard.v1.IThreshold[]; + + /** Scorecard dataView. */ + public dataView?: ("gaugeView"|"sparkChartView"); + + /** + * Creates a new Scorecard instance using the specified properties. + * @param [properties] Properties to set + * @returns Scorecard instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IScorecard): google.monitoring.dashboard.v1.Scorecard; + + /** + * Encodes the specified Scorecard message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.verify|verify} messages. + * @param message Scorecard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IScorecard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scorecard message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.verify|verify} messages. + * @param message Scorecard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IScorecard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scorecard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scorecard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Scorecard; + + /** + * Decodes a Scorecard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scorecard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Scorecard; + + /** + * Verifies a Scorecard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scorecard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scorecard + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Scorecard; + + /** + * Creates a plain object from a Scorecard message. Also converts values to other types if specified. + * @param message Scorecard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Scorecard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scorecard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Scorecard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Scorecard { + + /** Properties of a GaugeView. */ + interface IGaugeView { + + /** GaugeView lowerBound */ + lowerBound?: (number|null); + + /** GaugeView upperBound */ + upperBound?: (number|null); + } + + /** Represents a GaugeView. */ + class GaugeView implements IGaugeView { + + /** + * Constructs a new GaugeView. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.Scorecard.IGaugeView); + + /** GaugeView lowerBound. */ + public lowerBound: number; + + /** GaugeView upperBound. */ + public upperBound: number; + + /** + * Creates a new GaugeView instance using the specified properties. + * @param [properties] Properties to set + * @returns GaugeView instance + */ + public static create(properties?: google.monitoring.dashboard.v1.Scorecard.IGaugeView): google.monitoring.dashboard.v1.Scorecard.GaugeView; + + /** + * Encodes the specified GaugeView message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.GaugeView.verify|verify} messages. + * @param message GaugeView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.Scorecard.IGaugeView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GaugeView message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.GaugeView.verify|verify} messages. + * @param message GaugeView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.Scorecard.IGaugeView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GaugeView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GaugeView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Scorecard.GaugeView; + + /** + * Decodes a GaugeView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GaugeView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Scorecard.GaugeView; + + /** + * Verifies a GaugeView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GaugeView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GaugeView + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Scorecard.GaugeView; + + /** + * Creates a plain object from a GaugeView message. Also converts values to other types if specified. + * @param message GaugeView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Scorecard.GaugeView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GaugeView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GaugeView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkChartView. */ + interface ISparkChartView { + + /** SparkChartView sparkChartType */ + sparkChartType?: (google.monitoring.dashboard.v1.SparkChartType|keyof typeof google.monitoring.dashboard.v1.SparkChartType|null); + + /** SparkChartView minAlignmentPeriod */ + minAlignmentPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a SparkChartView. */ + class SparkChartView implements ISparkChartView { + + /** + * Constructs a new SparkChartView. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.Scorecard.ISparkChartView); + + /** SparkChartView sparkChartType. */ + public sparkChartType: (google.monitoring.dashboard.v1.SparkChartType|keyof typeof google.monitoring.dashboard.v1.SparkChartType); + + /** SparkChartView minAlignmentPeriod. */ + public minAlignmentPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new SparkChartView instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkChartView instance + */ + public static create(properties?: google.monitoring.dashboard.v1.Scorecard.ISparkChartView): google.monitoring.dashboard.v1.Scorecard.SparkChartView; + + /** + * Encodes the specified SparkChartView message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.SparkChartView.verify|verify} messages. + * @param message SparkChartView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.Scorecard.ISparkChartView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkChartView message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.SparkChartView.verify|verify} messages. + * @param message SparkChartView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.Scorecard.ISparkChartView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkChartView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkChartView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Scorecard.SparkChartView; + + /** + * Decodes a SparkChartView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkChartView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Scorecard.SparkChartView; + + /** + * Verifies a SparkChartView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkChartView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkChartView + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Scorecard.SparkChartView; + + /** + * Creates a plain object from a SparkChartView message. Also converts values to other types if specified. + * @param message SparkChartView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Scorecard.SparkChartView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkChartView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkChartView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TimeSeriesQuery. */ + interface ITimeSeriesQuery { + + /** TimeSeriesQuery timeSeriesFilter */ + timeSeriesFilter?: (google.monitoring.dashboard.v1.ITimeSeriesFilter|null); + + /** TimeSeriesQuery timeSeriesFilterRatio */ + timeSeriesFilterRatio?: (google.monitoring.dashboard.v1.ITimeSeriesFilterRatio|null); + + /** TimeSeriesQuery timeSeriesQueryLanguage */ + timeSeriesQueryLanguage?: (string|null); + + /** TimeSeriesQuery unitOverride */ + unitOverride?: (string|null); + } + + /** Represents a TimeSeriesQuery. */ + class TimeSeriesQuery implements ITimeSeriesQuery { + + /** + * Constructs a new TimeSeriesQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ITimeSeriesQuery); + + /** TimeSeriesQuery timeSeriesFilter. */ + public timeSeriesFilter?: (google.monitoring.dashboard.v1.ITimeSeriesFilter|null); + + /** TimeSeriesQuery timeSeriesFilterRatio. */ + public timeSeriesFilterRatio?: (google.monitoring.dashboard.v1.ITimeSeriesFilterRatio|null); + + /** TimeSeriesQuery timeSeriesQueryLanguage. */ + public timeSeriesQueryLanguage?: (string|null); + + /** TimeSeriesQuery unitOverride. */ + public unitOverride: string; + + /** TimeSeriesQuery source. */ + public source?: ("timeSeriesFilter"|"timeSeriesFilterRatio"|"timeSeriesQueryLanguage"); + + /** + * Creates a new TimeSeriesQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesQuery instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ITimeSeriesQuery): google.monitoring.dashboard.v1.TimeSeriesQuery; + + /** + * Encodes the specified TimeSeriesQuery message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesQuery.verify|verify} messages. + * @param message TimeSeriesQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ITimeSeriesQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesQuery message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesQuery.verify|verify} messages. + * @param message TimeSeriesQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ITimeSeriesQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesQuery; + + /** + * Decodes a TimeSeriesQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesQuery; + + /** + * Verifies a TimeSeriesQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesQuery + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesQuery; + + /** + * Creates a plain object from a TimeSeriesQuery message. Also converts values to other types if specified. + * @param message TimeSeriesQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeSeriesFilter. */ + interface ITimeSeriesFilter { + + /** TimeSeriesFilter filter */ + filter?: (string|null); + + /** TimeSeriesFilter aggregation */ + aggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilter secondaryAggregation */ + secondaryAggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilter pickTimeSeriesFilter */ + pickTimeSeriesFilter?: (google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null); + + /** TimeSeriesFilter statisticalTimeSeriesFilter */ + statisticalTimeSeriesFilter?: (google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null); + } + + /** Represents a TimeSeriesFilter. */ + class TimeSeriesFilter implements ITimeSeriesFilter { + + /** + * Constructs a new TimeSeriesFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ITimeSeriesFilter); + + /** TimeSeriesFilter filter. */ + public filter: string; + + /** TimeSeriesFilter aggregation. */ + public aggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilter secondaryAggregation. */ + public secondaryAggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilter pickTimeSeriesFilter. */ + public pickTimeSeriesFilter?: (google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null); + + /** TimeSeriesFilter statisticalTimeSeriesFilter. */ + public statisticalTimeSeriesFilter?: (google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null); + + /** TimeSeriesFilter outputFilter. */ + public outputFilter?: ("pickTimeSeriesFilter"|"statisticalTimeSeriesFilter"); + + /** + * Creates a new TimeSeriesFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesFilter instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ITimeSeriesFilter): google.monitoring.dashboard.v1.TimeSeriesFilter; + + /** + * Encodes the specified TimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilter.verify|verify} messages. + * @param message TimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ITimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilter.verify|verify} messages. + * @param message TimeSeriesFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ITimeSeriesFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesFilter; + + /** + * Decodes a TimeSeriesFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesFilter; + + /** + * Verifies a TimeSeriesFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesFilter + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesFilter; + + /** + * Creates a plain object from a TimeSeriesFilter message. Also converts values to other types if specified. + * @param message TimeSeriesFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeSeriesFilterRatio. */ + interface ITimeSeriesFilterRatio { + + /** TimeSeriesFilterRatio numerator */ + numerator?: (google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null); + + /** TimeSeriesFilterRatio denominator */ + denominator?: (google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null); + + /** TimeSeriesFilterRatio secondaryAggregation */ + secondaryAggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilterRatio pickTimeSeriesFilter */ + pickTimeSeriesFilter?: (google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null); + + /** TimeSeriesFilterRatio statisticalTimeSeriesFilter */ + statisticalTimeSeriesFilter?: (google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null); + } + + /** Represents a TimeSeriesFilterRatio. */ + class TimeSeriesFilterRatio implements ITimeSeriesFilterRatio { + + /** + * Constructs a new TimeSeriesFilterRatio. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ITimeSeriesFilterRatio); + + /** TimeSeriesFilterRatio numerator. */ + public numerator?: (google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null); + + /** TimeSeriesFilterRatio denominator. */ + public denominator?: (google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null); + + /** TimeSeriesFilterRatio secondaryAggregation. */ + public secondaryAggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** TimeSeriesFilterRatio pickTimeSeriesFilter. */ + public pickTimeSeriesFilter?: (google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null); + + /** TimeSeriesFilterRatio statisticalTimeSeriesFilter. */ + public statisticalTimeSeriesFilter?: (google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null); + + /** TimeSeriesFilterRatio outputFilter. */ + public outputFilter?: ("pickTimeSeriesFilter"|"statisticalTimeSeriesFilter"); + + /** + * Creates a new TimeSeriesFilterRatio instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesFilterRatio instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ITimeSeriesFilterRatio): google.monitoring.dashboard.v1.TimeSeriesFilterRatio; + + /** + * Encodes the specified TimeSeriesFilterRatio message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.verify|verify} messages. + * @param message TimeSeriesFilterRatio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ITimeSeriesFilterRatio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesFilterRatio message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.verify|verify} messages. + * @param message TimeSeriesFilterRatio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ITimeSeriesFilterRatio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesFilterRatio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesFilterRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesFilterRatio; + + /** + * Decodes a TimeSeriesFilterRatio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesFilterRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesFilterRatio; + + /** + * Verifies a TimeSeriesFilterRatio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesFilterRatio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesFilterRatio + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesFilterRatio; + + /** + * Creates a plain object from a TimeSeriesFilterRatio message. Also converts values to other types if specified. + * @param message TimeSeriesFilterRatio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesFilterRatio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesFilterRatio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesFilterRatio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimeSeriesFilterRatio { + + /** Properties of a RatioPart. */ + interface IRatioPart { + + /** RatioPart filter */ + filter?: (string|null); + + /** RatioPart aggregation */ + aggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + } + + /** Represents a RatioPart. */ + class RatioPart implements IRatioPart { + + /** + * Constructs a new RatioPart. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart); + + /** RatioPart filter. */ + public filter: string; + + /** RatioPart aggregation. */ + public aggregation?: (google.monitoring.dashboard.v1.IAggregation|null); + + /** + * Creates a new RatioPart instance using the specified properties. + * @param [properties] Properties to set + * @returns RatioPart instance + */ + public static create(properties?: google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart): google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart; + + /** + * Encodes the specified RatioPart message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify|verify} messages. + * @param message RatioPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RatioPart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify|verify} messages. + * @param message RatioPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RatioPart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RatioPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart; + + /** + * Decodes a RatioPart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RatioPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart; + + /** + * Verifies a RatioPart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RatioPart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RatioPart + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart; + + /** + * Creates a plain object from a RatioPart message. Also converts values to other types if specified. + * @param message RatioPart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RatioPart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RatioPart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Threshold. */ + interface IThreshold { + + /** Threshold label */ + label?: (string|null); + + /** Threshold value */ + value?: (number|null); + + /** Threshold color */ + color?: (google.monitoring.dashboard.v1.Threshold.Color|keyof typeof google.monitoring.dashboard.v1.Threshold.Color|null); + + /** Threshold direction */ + direction?: (google.monitoring.dashboard.v1.Threshold.Direction|keyof typeof google.monitoring.dashboard.v1.Threshold.Direction|null); + + /** Threshold targetAxis */ + targetAxis?: (google.monitoring.dashboard.v1.Threshold.TargetAxis|keyof typeof google.monitoring.dashboard.v1.Threshold.TargetAxis|null); + } + + /** Represents a Threshold. */ + class Threshold implements IThreshold { + + /** + * Constructs a new Threshold. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IThreshold); + + /** Threshold label. */ + public label: string; + + /** Threshold value. */ + public value: number; + + /** Threshold color. */ + public color: (google.monitoring.dashboard.v1.Threshold.Color|keyof typeof google.monitoring.dashboard.v1.Threshold.Color); + + /** Threshold direction. */ + public direction: (google.monitoring.dashboard.v1.Threshold.Direction|keyof typeof google.monitoring.dashboard.v1.Threshold.Direction); + + /** Threshold targetAxis. */ + public targetAxis: (google.monitoring.dashboard.v1.Threshold.TargetAxis|keyof typeof google.monitoring.dashboard.v1.Threshold.TargetAxis); + + /** + * Creates a new Threshold instance using the specified properties. + * @param [properties] Properties to set + * @returns Threshold instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IThreshold): google.monitoring.dashboard.v1.Threshold; + + /** + * Encodes the specified Threshold message. Does not implicitly {@link google.monitoring.dashboard.v1.Threshold.verify|verify} messages. + * @param message Threshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IThreshold, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Threshold message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Threshold.verify|verify} messages. + * @param message Threshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IThreshold, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Threshold message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Threshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Threshold; + + /** + * Decodes a Threshold message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Threshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Threshold; + + /** + * Verifies a Threshold message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Threshold message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Threshold + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Threshold; + + /** + * Creates a plain object from a Threshold message. Also converts values to other types if specified. + * @param message Threshold + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Threshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Threshold to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Threshold + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Threshold { + + /** Color enum. */ + enum Color { + COLOR_UNSPECIFIED = 0, + YELLOW = 4, + RED = 6 + } + + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + ABOVE = 1, + BELOW = 2 + } + + /** TargetAxis enum. */ + enum TargetAxis { + TARGET_AXIS_UNSPECIFIED = 0, + Y1 = 1, + Y2 = 2 + } + } + + /** SparkChartType enum. */ + enum SparkChartType { + SPARK_CHART_TYPE_UNSPECIFIED = 0, + SPARK_LINE = 1, + SPARK_BAR = 2 + } + + /** Properties of a TimeSeriesTable. */ + interface ITimeSeriesTable { + + /** TimeSeriesTable dataSets */ + dataSets?: (google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet[]|null); + } + + /** Represents a TimeSeriesTable. */ + class TimeSeriesTable implements ITimeSeriesTable { + + /** + * Constructs a new TimeSeriesTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ITimeSeriesTable); + + /** TimeSeriesTable dataSets. */ + public dataSets: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet[]; + + /** + * Creates a new TimeSeriesTable instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesTable instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ITimeSeriesTable): google.monitoring.dashboard.v1.TimeSeriesTable; + + /** + * Encodes the specified TimeSeriesTable message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.verify|verify} messages. + * @param message TimeSeriesTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ITimeSeriesTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesTable message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.verify|verify} messages. + * @param message TimeSeriesTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ITimeSeriesTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesTable; + + /** + * Decodes a TimeSeriesTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesTable; + + /** + * Verifies a TimeSeriesTable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesTable + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesTable; + + /** + * Creates a plain object from a TimeSeriesTable message. Also converts values to other types if specified. + * @param message TimeSeriesTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesTable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimeSeriesTable { + + /** Properties of a TableDataSet. */ + interface ITableDataSet { + + /** TableDataSet timeSeriesQuery */ + timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** TableDataSet tableTemplate */ + tableTemplate?: (string|null); + + /** TableDataSet minAlignmentPeriod */ + minAlignmentPeriod?: (google.protobuf.IDuration|null); + + /** TableDataSet tableDisplayOptions */ + tableDisplayOptions?: (google.monitoring.dashboard.v1.ITableDisplayOptions|null); + } + + /** Represents a TableDataSet. */ + class TableDataSet implements ITableDataSet { + + /** + * Constructs a new TableDataSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet); + + /** TableDataSet timeSeriesQuery. */ + public timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** TableDataSet tableTemplate. */ + public tableTemplate: string; + + /** TableDataSet minAlignmentPeriod. */ + public minAlignmentPeriod?: (google.protobuf.IDuration|null); + + /** TableDataSet tableDisplayOptions. */ + public tableDisplayOptions?: (google.monitoring.dashboard.v1.ITableDisplayOptions|null); + + /** + * Creates a new TableDataSet instance using the specified properties. + * @param [properties] Properties to set + * @returns TableDataSet instance + */ + public static create(properties?: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet): google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet; + + /** + * Encodes the specified TableDataSet message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.verify|verify} messages. + * @param message TableDataSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableDataSet message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.verify|verify} messages. + * @param message TableDataSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableDataSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableDataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet; + + /** + * Decodes a TableDataSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableDataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet; + + /** + * Verifies a TableDataSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableDataSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableDataSet + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet; + + /** + * Creates a plain object from a TableDataSet message. Also converts values to other types if specified. + * @param message TableDataSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableDataSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableDataSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TableDisplayOptions. */ + interface ITableDisplayOptions { + + /** TableDisplayOptions shownColumns */ + shownColumns?: (string[]|null); + } + + /** Represents a TableDisplayOptions. */ + class TableDisplayOptions implements ITableDisplayOptions { + + /** + * Constructs a new TableDisplayOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ITableDisplayOptions); + + /** TableDisplayOptions shownColumns. */ + public shownColumns: string[]; + + /** + * Creates a new TableDisplayOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TableDisplayOptions instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ITableDisplayOptions): google.monitoring.dashboard.v1.TableDisplayOptions; + + /** + * Encodes the specified TableDisplayOptions message. Does not implicitly {@link google.monitoring.dashboard.v1.TableDisplayOptions.verify|verify} messages. + * @param message TableDisplayOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ITableDisplayOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableDisplayOptions message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TableDisplayOptions.verify|verify} messages. + * @param message TableDisplayOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ITableDisplayOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableDisplayOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableDisplayOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.TableDisplayOptions; + + /** + * Decodes a TableDisplayOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableDisplayOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.TableDisplayOptions; + + /** + * Verifies a TableDisplayOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableDisplayOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableDisplayOptions + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.TableDisplayOptions; + + /** + * Creates a plain object from a TableDisplayOptions message. Also converts values to other types if specified. + * @param message TableDisplayOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.TableDisplayOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableDisplayOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableDisplayOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Text. */ + interface IText { + + /** Text content */ + content?: (string|null); + + /** Text format */ + format?: (google.monitoring.dashboard.v1.Text.Format|keyof typeof google.monitoring.dashboard.v1.Text.Format|null); + } + + /** Represents a Text. */ + class Text implements IText { + + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IText); + + /** Text content. */ + public content: string; + + /** Text format. */ + public format: (google.monitoring.dashboard.v1.Text.Format|keyof typeof google.monitoring.dashboard.v1.Text.Format); + + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IText): google.monitoring.dashboard.v1.Text; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.monitoring.dashboard.v1.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.Text; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.Text; + + /** + * Verifies a Text message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.Text; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Text + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Text { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + MARKDOWN = 1, + RAW = 2 + } + } + + /** Properties of a XyChart. */ + interface IXyChart { + + /** XyChart dataSets */ + dataSets?: (google.monitoring.dashboard.v1.XyChart.IDataSet[]|null); + + /** XyChart timeshiftDuration */ + timeshiftDuration?: (google.protobuf.IDuration|null); + + /** XyChart thresholds */ + thresholds?: (google.monitoring.dashboard.v1.IThreshold[]|null); + + /** XyChart xAxis */ + xAxis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart yAxis */ + yAxis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart y2Axis */ + y2Axis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart chartOptions */ + chartOptions?: (google.monitoring.dashboard.v1.IChartOptions|null); + } + + /** Represents a XyChart. */ + class XyChart implements IXyChart { + + /** + * Constructs a new XyChart. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IXyChart); + + /** XyChart dataSets. */ + public dataSets: google.monitoring.dashboard.v1.XyChart.IDataSet[]; + + /** XyChart timeshiftDuration. */ + public timeshiftDuration?: (google.protobuf.IDuration|null); + + /** XyChart thresholds. */ + public thresholds: google.monitoring.dashboard.v1.IThreshold[]; + + /** XyChart xAxis. */ + public xAxis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart yAxis. */ + public yAxis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart y2Axis. */ + public y2Axis?: (google.monitoring.dashboard.v1.XyChart.IAxis|null); + + /** XyChart chartOptions. */ + public chartOptions?: (google.monitoring.dashboard.v1.IChartOptions|null); + + /** + * Creates a new XyChart instance using the specified properties. + * @param [properties] Properties to set + * @returns XyChart instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IXyChart): google.monitoring.dashboard.v1.XyChart; + + /** + * Encodes the specified XyChart message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.verify|verify} messages. + * @param message XyChart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IXyChart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified XyChart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.verify|verify} messages. + * @param message XyChart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IXyChart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a XyChart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns XyChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.XyChart; + + /** + * Decodes a XyChart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns XyChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.XyChart; + + /** + * Verifies a XyChart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a XyChart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns XyChart + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.XyChart; + + /** + * Creates a plain object from a XyChart message. Also converts values to other types if specified. + * @param message XyChart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.XyChart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this XyChart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for XyChart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace XyChart { + + /** Properties of a DataSet. */ + interface IDataSet { + + /** DataSet timeSeriesQuery */ + timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** DataSet plotType */ + plotType?: (google.monitoring.dashboard.v1.XyChart.DataSet.PlotType|keyof typeof google.monitoring.dashboard.v1.XyChart.DataSet.PlotType|null); + + /** DataSet legendTemplate */ + legendTemplate?: (string|null); + + /** DataSet minAlignmentPeriod */ + minAlignmentPeriod?: (google.protobuf.IDuration|null); + + /** DataSet targetAxis */ + targetAxis?: (google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis|keyof typeof google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis|null); + } + + /** Represents a DataSet. */ + class DataSet implements IDataSet { + + /** + * Constructs a new DataSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.XyChart.IDataSet); + + /** DataSet timeSeriesQuery. */ + public timeSeriesQuery?: (google.monitoring.dashboard.v1.ITimeSeriesQuery|null); + + /** DataSet plotType. */ + public plotType: (google.monitoring.dashboard.v1.XyChart.DataSet.PlotType|keyof typeof google.monitoring.dashboard.v1.XyChart.DataSet.PlotType); + + /** DataSet legendTemplate. */ + public legendTemplate: string; + + /** DataSet minAlignmentPeriod. */ + public minAlignmentPeriod?: (google.protobuf.IDuration|null); + + /** DataSet targetAxis. */ + public targetAxis: (google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis|keyof typeof google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis); + + /** + * Creates a new DataSet instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSet instance + */ + public static create(properties?: google.monitoring.dashboard.v1.XyChart.IDataSet): google.monitoring.dashboard.v1.XyChart.DataSet; + + /** + * Encodes the specified DataSet message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.DataSet.verify|verify} messages. + * @param message DataSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.XyChart.IDataSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSet message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.DataSet.verify|verify} messages. + * @param message DataSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.XyChart.IDataSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.XyChart.DataSet; + + /** + * Decodes a DataSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.XyChart.DataSet; + + /** + * Verifies a DataSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSet + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.XyChart.DataSet; + + /** + * Creates a plain object from a DataSet message. Also converts values to other types if specified. + * @param message DataSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.XyChart.DataSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSet { + + /** PlotType enum. */ + enum PlotType { + PLOT_TYPE_UNSPECIFIED = 0, + LINE = 1, + STACKED_AREA = 2, + STACKED_BAR = 3, + HEATMAP = 4 + } + + /** TargetAxis enum. */ + enum TargetAxis { + TARGET_AXIS_UNSPECIFIED = 0, + Y1 = 1, + Y2 = 2 + } + } + + /** Properties of an Axis. */ + interface IAxis { + + /** Axis label */ + label?: (string|null); + + /** Axis scale */ + scale?: (google.monitoring.dashboard.v1.XyChart.Axis.Scale|keyof typeof google.monitoring.dashboard.v1.XyChart.Axis.Scale|null); + } + + /** Represents an Axis. */ + class Axis implements IAxis { + + /** + * Constructs a new Axis. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.XyChart.IAxis); + + /** Axis label. */ + public label: string; + + /** Axis scale. */ + public scale: (google.monitoring.dashboard.v1.XyChart.Axis.Scale|keyof typeof google.monitoring.dashboard.v1.XyChart.Axis.Scale); + + /** + * Creates a new Axis instance using the specified properties. + * @param [properties] Properties to set + * @returns Axis instance + */ + public static create(properties?: google.monitoring.dashboard.v1.XyChart.IAxis): google.monitoring.dashboard.v1.XyChart.Axis; + + /** + * Encodes the specified Axis message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.Axis.verify|verify} messages. + * @param message Axis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.XyChart.IAxis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Axis message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.Axis.verify|verify} messages. + * @param message Axis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.XyChart.IAxis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Axis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Axis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.XyChart.Axis; + + /** + * Decodes an Axis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Axis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.XyChart.Axis; + + /** + * Verifies an Axis message. + * @param message Plain 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 Axis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Axis + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.XyChart.Axis; + + /** + * Creates a plain object from an Axis message. Also converts values to other types if specified. + * @param message Axis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.XyChart.Axis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Axis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Axis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Axis { + + /** Scale enum. */ + enum Scale { + SCALE_UNSPECIFIED = 0, + LINEAR = 1, + LOG10 = 2 + } + } + } + + /** Properties of a ChartOptions. */ + interface IChartOptions { + + /** ChartOptions mode */ + mode?: (google.monitoring.dashboard.v1.ChartOptions.Mode|keyof typeof google.monitoring.dashboard.v1.ChartOptions.Mode|null); + } + + /** Represents a ChartOptions. */ + class ChartOptions implements IChartOptions { + + /** + * Constructs a new ChartOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IChartOptions); + + /** ChartOptions mode. */ + public mode: (google.monitoring.dashboard.v1.ChartOptions.Mode|keyof typeof google.monitoring.dashboard.v1.ChartOptions.Mode); + + /** + * Creates a new ChartOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ChartOptions instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IChartOptions): google.monitoring.dashboard.v1.ChartOptions; + + /** + * Encodes the specified ChartOptions message. Does not implicitly {@link google.monitoring.dashboard.v1.ChartOptions.verify|verify} messages. + * @param message ChartOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IChartOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChartOptions message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ChartOptions.verify|verify} messages. + * @param message ChartOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IChartOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChartOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChartOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.ChartOptions; + + /** + * Decodes a ChartOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChartOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.ChartOptions; + + /** + * Verifies a ChartOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChartOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChartOptions + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.ChartOptions; + + /** + * Creates a plain object from a ChartOptions message. Also converts values to other types if specified. + * @param message ChartOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.ChartOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChartOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChartOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChartOptions { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + COLOR = 1, + X_RAY = 2, + STATS = 3 + } + } + + /** Represents a DashboardsService */ + class DashboardsService extends $protobuf.rpc.Service { + + /** + * Constructs a new DashboardsService 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 DashboardsService 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): DashboardsService; + + /** + * Calls CreateDashboard. + * @param request CreateDashboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dashboard + */ + public createDashboard(request: google.monitoring.dashboard.v1.ICreateDashboardRequest, callback: google.monitoring.dashboard.v1.DashboardsService.CreateDashboardCallback): void; + + /** + * Calls CreateDashboard. + * @param request CreateDashboardRequest message or plain object + * @returns Promise + */ + public createDashboard(request: google.monitoring.dashboard.v1.ICreateDashboardRequest): Promise; + + /** + * Calls ListDashboards. + * @param request ListDashboardsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDashboardsResponse + */ + public listDashboards(request: google.monitoring.dashboard.v1.IListDashboardsRequest, callback: google.monitoring.dashboard.v1.DashboardsService.ListDashboardsCallback): void; + + /** + * Calls ListDashboards. + * @param request ListDashboardsRequest message or plain object + * @returns Promise + */ + public listDashboards(request: google.monitoring.dashboard.v1.IListDashboardsRequest): Promise; + + /** + * Calls GetDashboard. + * @param request GetDashboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dashboard + */ + public getDashboard(request: google.monitoring.dashboard.v1.IGetDashboardRequest, callback: google.monitoring.dashboard.v1.DashboardsService.GetDashboardCallback): void; + + /** + * Calls GetDashboard. + * @param request GetDashboardRequest message or plain object + * @returns Promise + */ + public getDashboard(request: google.monitoring.dashboard.v1.IGetDashboardRequest): Promise; + + /** + * Calls DeleteDashboard. + * @param request DeleteDashboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDashboard(request: google.monitoring.dashboard.v1.IDeleteDashboardRequest, callback: google.monitoring.dashboard.v1.DashboardsService.DeleteDashboardCallback): void; + + /** + * Calls DeleteDashboard. + * @param request DeleteDashboardRequest message or plain object + * @returns Promise + */ + public deleteDashboard(request: google.monitoring.dashboard.v1.IDeleteDashboardRequest): Promise; + + /** + * Calls UpdateDashboard. + * @param request UpdateDashboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dashboard + */ + public updateDashboard(request: google.monitoring.dashboard.v1.IUpdateDashboardRequest, callback: google.monitoring.dashboard.v1.DashboardsService.UpdateDashboardCallback): void; + + /** + * Calls UpdateDashboard. + * @param request UpdateDashboardRequest message or plain object + * @returns Promise + */ + public updateDashboard(request: google.monitoring.dashboard.v1.IUpdateDashboardRequest): Promise; + } + + namespace DashboardsService { + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|createDashboard}. + * @param error Error, if any + * @param [response] Dashboard + */ + type CreateDashboardCallback = (error: (Error|null), response?: google.monitoring.dashboard.v1.Dashboard) => void; + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|listDashboards}. + * @param error Error, if any + * @param [response] ListDashboardsResponse + */ + type ListDashboardsCallback = (error: (Error|null), response?: google.monitoring.dashboard.v1.ListDashboardsResponse) => void; + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|getDashboard}. + * @param error Error, if any + * @param [response] Dashboard + */ + type GetDashboardCallback = (error: (Error|null), response?: google.monitoring.dashboard.v1.Dashboard) => void; + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|deleteDashboard}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDashboardCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|updateDashboard}. + * @param error Error, if any + * @param [response] Dashboard + */ + type UpdateDashboardCallback = (error: (Error|null), response?: google.monitoring.dashboard.v1.Dashboard) => void; + } + + /** Properties of a CreateDashboardRequest. */ + interface ICreateDashboardRequest { + + /** CreateDashboardRequest parent */ + parent?: (string|null); + + /** CreateDashboardRequest dashboard */ + dashboard?: (google.monitoring.dashboard.v1.IDashboard|null); + + /** CreateDashboardRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateDashboardRequest. */ + class CreateDashboardRequest implements ICreateDashboardRequest { + + /** + * Constructs a new CreateDashboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.ICreateDashboardRequest); + + /** CreateDashboardRequest parent. */ + public parent: string; + + /** CreateDashboardRequest dashboard. */ + public dashboard?: (google.monitoring.dashboard.v1.IDashboard|null); + + /** CreateDashboardRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateDashboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDashboardRequest instance + */ + public static create(properties?: google.monitoring.dashboard.v1.ICreateDashboardRequest): google.monitoring.dashboard.v1.CreateDashboardRequest; + + /** + * Encodes the specified CreateDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.CreateDashboardRequest.verify|verify} messages. + * @param message CreateDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.ICreateDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.CreateDashboardRequest.verify|verify} messages. + * @param message CreateDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.ICreateDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDashboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.CreateDashboardRequest; + + /** + * Decodes a CreateDashboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.CreateDashboardRequest; + + /** + * Verifies a CreateDashboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDashboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.CreateDashboardRequest; + + /** + * Creates a plain object from a CreateDashboardRequest message. Also converts values to other types if specified. + * @param message CreateDashboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.CreateDashboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDashboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDashboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDashboardsRequest. */ + interface IListDashboardsRequest { + + /** ListDashboardsRequest parent */ + parent?: (string|null); + + /** ListDashboardsRequest pageSize */ + pageSize?: (number|null); + + /** ListDashboardsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDashboardsRequest. */ + class ListDashboardsRequest implements IListDashboardsRequest { + + /** + * Constructs a new ListDashboardsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IListDashboardsRequest); + + /** ListDashboardsRequest parent. */ + public parent: string; + + /** ListDashboardsRequest pageSize. */ + public pageSize: number; + + /** ListDashboardsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDashboardsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDashboardsRequest instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IListDashboardsRequest): google.monitoring.dashboard.v1.ListDashboardsRequest; + + /** + * Encodes the specified ListDashboardsRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsRequest.verify|verify} messages. + * @param message ListDashboardsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IListDashboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDashboardsRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsRequest.verify|verify} messages. + * @param message ListDashboardsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IListDashboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDashboardsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDashboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.ListDashboardsRequest; + + /** + * Decodes a ListDashboardsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDashboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.ListDashboardsRequest; + + /** + * Verifies a ListDashboardsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDashboardsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDashboardsRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.ListDashboardsRequest; + + /** + * Creates a plain object from a ListDashboardsRequest message. Also converts values to other types if specified. + * @param message ListDashboardsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.ListDashboardsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDashboardsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDashboardsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDashboardsResponse. */ + interface IListDashboardsResponse { + + /** ListDashboardsResponse dashboards */ + dashboards?: (google.monitoring.dashboard.v1.IDashboard[]|null); + + /** ListDashboardsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDashboardsResponse. */ + class ListDashboardsResponse implements IListDashboardsResponse { + + /** + * Constructs a new ListDashboardsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IListDashboardsResponse); + + /** ListDashboardsResponse dashboards. */ + public dashboards: google.monitoring.dashboard.v1.IDashboard[]; + + /** ListDashboardsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDashboardsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDashboardsResponse instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IListDashboardsResponse): google.monitoring.dashboard.v1.ListDashboardsResponse; + + /** + * Encodes the specified ListDashboardsResponse message. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsResponse.verify|verify} messages. + * @param message ListDashboardsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IListDashboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDashboardsResponse message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsResponse.verify|verify} messages. + * @param message ListDashboardsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IListDashboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDashboardsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDashboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.ListDashboardsResponse; + + /** + * Decodes a ListDashboardsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDashboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.ListDashboardsResponse; + + /** + * Verifies a ListDashboardsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDashboardsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDashboardsResponse + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.ListDashboardsResponse; + + /** + * Creates a plain object from a ListDashboardsResponse message. Also converts values to other types if specified. + * @param message ListDashboardsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.ListDashboardsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDashboardsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDashboardsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDashboardRequest. */ + interface IGetDashboardRequest { + + /** GetDashboardRequest name */ + name?: (string|null); + } + + /** Represents a GetDashboardRequest. */ + class GetDashboardRequest implements IGetDashboardRequest { + + /** + * Constructs a new GetDashboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IGetDashboardRequest); + + /** GetDashboardRequest name. */ + public name: string; + + /** + * Creates a new GetDashboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDashboardRequest instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IGetDashboardRequest): google.monitoring.dashboard.v1.GetDashboardRequest; + + /** + * Encodes the specified GetDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.GetDashboardRequest.verify|verify} messages. + * @param message GetDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IGetDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.GetDashboardRequest.verify|verify} messages. + * @param message GetDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IGetDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDashboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.GetDashboardRequest; + + /** + * Decodes a GetDashboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.GetDashboardRequest; + + /** + * Verifies a GetDashboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDashboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.GetDashboardRequest; + + /** + * Creates a plain object from a GetDashboardRequest message. Also converts values to other types if specified. + * @param message GetDashboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.GetDashboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDashboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDashboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDashboardRequest. */ + interface IDeleteDashboardRequest { + + /** DeleteDashboardRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDashboardRequest. */ + class DeleteDashboardRequest implements IDeleteDashboardRequest { + + /** + * Constructs a new DeleteDashboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IDeleteDashboardRequest); + + /** DeleteDashboardRequest name. */ + public name: string; + + /** + * Creates a new DeleteDashboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDashboardRequest instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IDeleteDashboardRequest): google.monitoring.dashboard.v1.DeleteDashboardRequest; + + /** + * Encodes the specified DeleteDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.DeleteDashboardRequest.verify|verify} messages. + * @param message DeleteDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IDeleteDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.DeleteDashboardRequest.verify|verify} messages. + * @param message DeleteDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IDeleteDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDashboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.DeleteDashboardRequest; + + /** + * Decodes a DeleteDashboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.DeleteDashboardRequest; + + /** + * Verifies a DeleteDashboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDashboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.DeleteDashboardRequest; + + /** + * Creates a plain object from a DeleteDashboardRequest message. Also converts values to other types if specified. + * @param message DeleteDashboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.DeleteDashboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDashboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDashboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDashboardRequest. */ + interface IUpdateDashboardRequest { + + /** UpdateDashboardRequest dashboard */ + dashboard?: (google.monitoring.dashboard.v1.IDashboard|null); + + /** UpdateDashboardRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateDashboardRequest. */ + class UpdateDashboardRequest implements IUpdateDashboardRequest { + + /** + * Constructs a new UpdateDashboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.dashboard.v1.IUpdateDashboardRequest); + + /** UpdateDashboardRequest dashboard. */ + public dashboard?: (google.monitoring.dashboard.v1.IDashboard|null); + + /** UpdateDashboardRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateDashboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDashboardRequest instance + */ + public static create(properties?: google.monitoring.dashboard.v1.IUpdateDashboardRequest): google.monitoring.dashboard.v1.UpdateDashboardRequest; + + /** + * Encodes the specified UpdateDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.UpdateDashboardRequest.verify|verify} messages. + * @param message UpdateDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.dashboard.v1.IUpdateDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.UpdateDashboardRequest.verify|verify} messages. + * @param message UpdateDashboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.dashboard.v1.IUpdateDashboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDashboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.dashboard.v1.UpdateDashboardRequest; + + /** + * Decodes an UpdateDashboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.dashboard.v1.UpdateDashboardRequest; + + /** + * Verifies an UpdateDashboardRequest message. + * @param message Plain 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 UpdateDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDashboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.dashboard.v1.UpdateDashboardRequest; + + /** + * Creates a plain object from an UpdateDashboardRequest message. Also converts values to other types if specified. + * @param message UpdateDashboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.dashboard.v1.UpdateDashboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDashboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDashboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** 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 + } + + /** 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; + } + + /** 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; + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 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 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 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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 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; + } + } +} diff --git a/packages/google-monitoring-dashboard/protos/protos.js b/packages/google-monitoring-dashboard/protos/protos.js new file mode 100644 index 000000000000..2549aa08c3b7 --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/protos.js @@ -0,0 +1,22790 @@ +// Copyright 2022 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_monitoring_dashboards_protos || ($protobuf.roots._google_cloud_monitoring_dashboards_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.monitoring = (function() { + + /** + * Namespace monitoring. + * @memberof google + * @namespace + */ + var monitoring = {}; + + monitoring.dashboard = (function() { + + /** + * Namespace dashboard. + * @memberof google.monitoring + * @namespace + */ + var dashboard = {}; + + dashboard.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.monitoring.dashboard + * @namespace + */ + var v1 = {}; + + v1.AlertChart = (function() { + + /** + * Properties of an AlertChart. + * @memberof google.monitoring.dashboard.v1 + * @interface IAlertChart + * @property {string|null} [name] AlertChart name + */ + + /** + * Constructs a new AlertChart. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents an AlertChart. + * @implements IAlertChart + * @constructor + * @param {google.monitoring.dashboard.v1.IAlertChart=} [properties] Properties to set + */ + function AlertChart(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]]; + } + + /** + * AlertChart name. + * @member {string} name + * @memberof google.monitoring.dashboard.v1.AlertChart + * @instance + */ + AlertChart.prototype.name = ""; + + /** + * Creates a new AlertChart instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {google.monitoring.dashboard.v1.IAlertChart=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.AlertChart} AlertChart instance + */ + AlertChart.create = function create(properties) { + return new AlertChart(properties); + }; + + /** + * Encodes the specified AlertChart message. Does not implicitly {@link google.monitoring.dashboard.v1.AlertChart.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {google.monitoring.dashboard.v1.IAlertChart} message AlertChart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlertChart.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 AlertChart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.AlertChart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {google.monitoring.dashboard.v1.IAlertChart} message AlertChart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlertChart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlertChart message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.AlertChart} AlertChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlertChart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.AlertChart(); + 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 an AlertChart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.AlertChart} AlertChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlertChart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlertChart message. + * @function verify + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlertChart.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 an AlertChart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.AlertChart} AlertChart + */ + AlertChart.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.AlertChart) + return object; + var message = new $root.google.monitoring.dashboard.v1.AlertChart(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an AlertChart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {google.monitoring.dashboard.v1.AlertChart} message AlertChart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlertChart.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 AlertChart to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.AlertChart + * @instance + * @returns {Object.} JSON object + */ + AlertChart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlertChart + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.AlertChart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlertChart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.AlertChart"; + }; + + return AlertChart; + })(); + + v1.CollapsibleGroup = (function() { + + /** + * Properties of a CollapsibleGroup. + * @memberof google.monitoring.dashboard.v1 + * @interface ICollapsibleGroup + * @property {boolean|null} [collapsed] CollapsibleGroup collapsed + */ + + /** + * Constructs a new CollapsibleGroup. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a CollapsibleGroup. + * @implements ICollapsibleGroup + * @constructor + * @param {google.monitoring.dashboard.v1.ICollapsibleGroup=} [properties] Properties to set + */ + function CollapsibleGroup(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]]; + } + + /** + * CollapsibleGroup collapsed. + * @member {boolean} collapsed + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @instance + */ + CollapsibleGroup.prototype.collapsed = false; + + /** + * Creates a new CollapsibleGroup instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {google.monitoring.dashboard.v1.ICollapsibleGroup=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.CollapsibleGroup} CollapsibleGroup instance + */ + CollapsibleGroup.create = function create(properties) { + return new CollapsibleGroup(properties); + }; + + /** + * Encodes the specified CollapsibleGroup message. Does not implicitly {@link google.monitoring.dashboard.v1.CollapsibleGroup.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {google.monitoring.dashboard.v1.ICollapsibleGroup} message CollapsibleGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollapsibleGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collapsed != null && Object.hasOwnProperty.call(message, "collapsed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.collapsed); + return writer; + }; + + /** + * Encodes the specified CollapsibleGroup message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.CollapsibleGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {google.monitoring.dashboard.v1.ICollapsibleGroup} message CollapsibleGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollapsibleGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CollapsibleGroup message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.CollapsibleGroup} CollapsibleGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollapsibleGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.CollapsibleGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collapsed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CollapsibleGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.CollapsibleGroup} CollapsibleGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollapsibleGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CollapsibleGroup message. + * @function verify + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollapsibleGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collapsed != null && message.hasOwnProperty("collapsed")) + if (typeof message.collapsed !== "boolean") + return "collapsed: boolean expected"; + return null; + }; + + /** + * Creates a CollapsibleGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.CollapsibleGroup} CollapsibleGroup + */ + CollapsibleGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.CollapsibleGroup) + return object; + var message = new $root.google.monitoring.dashboard.v1.CollapsibleGroup(); + if (object.collapsed != null) + message.collapsed = Boolean(object.collapsed); + return message; + }; + + /** + * Creates a plain object from a CollapsibleGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {google.monitoring.dashboard.v1.CollapsibleGroup} message CollapsibleGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CollapsibleGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.collapsed = false; + if (message.collapsed != null && message.hasOwnProperty("collapsed")) + object.collapsed = message.collapsed; + return object; + }; + + /** + * Converts this CollapsibleGroup to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @instance + * @returns {Object.} JSON object + */ + CollapsibleGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CollapsibleGroup + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.CollapsibleGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CollapsibleGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.CollapsibleGroup"; + }; + + return CollapsibleGroup; + })(); + + v1.Aggregation = (function() { + + /** + * Properties of an Aggregation. + * @memberof google.monitoring.dashboard.v1 + * @interface IAggregation + * @property {google.protobuf.IDuration|null} [alignmentPeriod] Aggregation alignmentPeriod + * @property {google.monitoring.dashboard.v1.Aggregation.Aligner|null} [perSeriesAligner] Aggregation perSeriesAligner + * @property {google.monitoring.dashboard.v1.Aggregation.Reducer|null} [crossSeriesReducer] Aggregation crossSeriesReducer + * @property {Array.|null} [groupByFields] Aggregation groupByFields + */ + + /** + * Constructs a new Aggregation. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents an Aggregation. + * @implements IAggregation + * @constructor + * @param {google.monitoring.dashboard.v1.IAggregation=} [properties] Properties to set + */ + function Aggregation(properties) { + this.groupByFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregation alignmentPeriod. + * @member {google.protobuf.IDuration|null|undefined} alignmentPeriod + * @memberof google.monitoring.dashboard.v1.Aggregation + * @instance + */ + Aggregation.prototype.alignmentPeriod = null; + + /** + * Aggregation perSeriesAligner. + * @member {google.monitoring.dashboard.v1.Aggregation.Aligner} perSeriesAligner + * @memberof google.monitoring.dashboard.v1.Aggregation + * @instance + */ + Aggregation.prototype.perSeriesAligner = 0; + + /** + * Aggregation crossSeriesReducer. + * @member {google.monitoring.dashboard.v1.Aggregation.Reducer} crossSeriesReducer + * @memberof google.monitoring.dashboard.v1.Aggregation + * @instance + */ + Aggregation.prototype.crossSeriesReducer = 0; + + /** + * Aggregation groupByFields. + * @member {Array.} groupByFields + * @memberof google.monitoring.dashboard.v1.Aggregation + * @instance + */ + Aggregation.prototype.groupByFields = $util.emptyArray; + + /** + * Creates a new Aggregation instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {google.monitoring.dashboard.v1.IAggregation=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Aggregation} Aggregation instance + */ + Aggregation.create = function create(properties) { + return new Aggregation(properties); + }; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.dashboard.v1.Aggregation.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {google.monitoring.dashboard.v1.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alignmentPeriod != null && Object.hasOwnProperty.call(message, "alignmentPeriod")) + $root.google.protobuf.Duration.encode(message.alignmentPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.perSeriesAligner != null && Object.hasOwnProperty.call(message, "perSeriesAligner")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.perSeriesAligner); + if (message.crossSeriesReducer != null && Object.hasOwnProperty.call(message, "crossSeriesReducer")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.crossSeriesReducer); + if (message.groupByFields != null && message.groupByFields.length) + for (var i = 0; i < message.groupByFields.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.groupByFields[i]); + return writer; + }; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Aggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {google.monitoring.dashboard.v1.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Aggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.alignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.perSeriesAligner = reader.int32(); + break; + } + case 4: { + message.crossSeriesReducer = reader.int32(); + break; + } + case 5: { + if (!(message.groupByFields && message.groupByFields.length)) + message.groupByFields = []; + message.groupByFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregation message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.alignmentPeriod); + if (error) + return "alignmentPeriod." + error; + } + if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) + switch (message.perSeriesAligner) { + default: + return "perSeriesAligner: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 24: + case 17: + case 18: + case 19: + case 20: + case 21: + case 23: + break; + } + if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) + switch (message.crossSeriesReducer) { + default: + return "crossSeriesReducer: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 15: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.groupByFields != null && message.hasOwnProperty("groupByFields")) { + if (!Array.isArray(message.groupByFields)) + return "groupByFields: array expected"; + for (var i = 0; i < message.groupByFields.length; ++i) + if (!$util.isString(message.groupByFields[i])) + return "groupByFields: string[] expected"; + } + return null; + }; + + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Aggregation} Aggregation + */ + Aggregation.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Aggregation) + return object; + var message = new $root.google.monitoring.dashboard.v1.Aggregation(); + if (object.alignmentPeriod != null) { + if (typeof object.alignmentPeriod !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Aggregation.alignmentPeriod: object expected"); + message.alignmentPeriod = $root.google.protobuf.Duration.fromObject(object.alignmentPeriod); + } + switch (object.perSeriesAligner) { + case "ALIGN_NONE": + case 0: + message.perSeriesAligner = 0; + break; + case "ALIGN_DELTA": + case 1: + message.perSeriesAligner = 1; + break; + case "ALIGN_RATE": + case 2: + message.perSeriesAligner = 2; + break; + case "ALIGN_INTERPOLATE": + case 3: + message.perSeriesAligner = 3; + break; + case "ALIGN_NEXT_OLDER": + case 4: + message.perSeriesAligner = 4; + break; + case "ALIGN_MIN": + case 10: + message.perSeriesAligner = 10; + break; + case "ALIGN_MAX": + case 11: + message.perSeriesAligner = 11; + break; + case "ALIGN_MEAN": + case 12: + message.perSeriesAligner = 12; + break; + case "ALIGN_COUNT": + case 13: + message.perSeriesAligner = 13; + break; + case "ALIGN_SUM": + case 14: + message.perSeriesAligner = 14; + break; + case "ALIGN_STDDEV": + case 15: + message.perSeriesAligner = 15; + break; + case "ALIGN_COUNT_TRUE": + case 16: + message.perSeriesAligner = 16; + break; + case "ALIGN_COUNT_FALSE": + case 24: + message.perSeriesAligner = 24; + break; + case "ALIGN_FRACTION_TRUE": + case 17: + message.perSeriesAligner = 17; + break; + case "ALIGN_PERCENTILE_99": + case 18: + message.perSeriesAligner = 18; + break; + case "ALIGN_PERCENTILE_95": + case 19: + message.perSeriesAligner = 19; + break; + case "ALIGN_PERCENTILE_50": + case 20: + message.perSeriesAligner = 20; + break; + case "ALIGN_PERCENTILE_05": + case 21: + message.perSeriesAligner = 21; + break; + case "ALIGN_PERCENT_CHANGE": + case 23: + message.perSeriesAligner = 23; + break; + } + switch (object.crossSeriesReducer) { + case "REDUCE_NONE": + case 0: + message.crossSeriesReducer = 0; + break; + case "REDUCE_MEAN": + case 1: + message.crossSeriesReducer = 1; + break; + case "REDUCE_MIN": + case 2: + message.crossSeriesReducer = 2; + break; + case "REDUCE_MAX": + case 3: + message.crossSeriesReducer = 3; + break; + case "REDUCE_SUM": + case 4: + message.crossSeriesReducer = 4; + break; + case "REDUCE_STDDEV": + case 5: + message.crossSeriesReducer = 5; + break; + case "REDUCE_COUNT": + case 6: + message.crossSeriesReducer = 6; + break; + case "REDUCE_COUNT_TRUE": + case 7: + message.crossSeriesReducer = 7; + break; + case "REDUCE_COUNT_FALSE": + case 15: + message.crossSeriesReducer = 15; + break; + case "REDUCE_FRACTION_TRUE": + case 8: + message.crossSeriesReducer = 8; + break; + case "REDUCE_PERCENTILE_99": + case 9: + message.crossSeriesReducer = 9; + break; + case "REDUCE_PERCENTILE_95": + case 10: + message.crossSeriesReducer = 10; + break; + case "REDUCE_PERCENTILE_50": + case 11: + message.crossSeriesReducer = 11; + break; + case "REDUCE_PERCENTILE_05": + case 12: + message.crossSeriesReducer = 12; + break; + } + if (object.groupByFields) { + if (!Array.isArray(object.groupByFields)) + throw TypeError(".google.monitoring.dashboard.v1.Aggregation.groupByFields: array expected"); + message.groupByFields = []; + for (var i = 0; i < object.groupByFields.length; ++i) + message.groupByFields[i] = String(object.groupByFields[i]); + } + return message; + }; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {google.monitoring.dashboard.v1.Aggregation} message Aggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByFields = []; + if (options.defaults) { + object.alignmentPeriod = null; + object.perSeriesAligner = options.enums === String ? "ALIGN_NONE" : 0; + object.crossSeriesReducer = options.enums === String ? "REDUCE_NONE" : 0; + } + if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) + object.alignmentPeriod = $root.google.protobuf.Duration.toObject(message.alignmentPeriod, options); + if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) + object.perSeriesAligner = options.enums === String ? $root.google.monitoring.dashboard.v1.Aggregation.Aligner[message.perSeriesAligner] : message.perSeriesAligner; + if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) + object.crossSeriesReducer = options.enums === String ? $root.google.monitoring.dashboard.v1.Aggregation.Reducer[message.crossSeriesReducer] : message.crossSeriesReducer; + if (message.groupByFields && message.groupByFields.length) { + object.groupByFields = []; + for (var j = 0; j < message.groupByFields.length; ++j) + object.groupByFields[j] = message.groupByFields[j]; + } + return object; + }; + + /** + * Converts this Aggregation to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Aggregation + * @instance + * @returns {Object.} JSON object + */ + Aggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregation + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Aggregation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Aggregation"; + }; + + /** + * Aligner enum. + * @name google.monitoring.dashboard.v1.Aggregation.Aligner + * @enum {number} + * @property {number} ALIGN_NONE=0 ALIGN_NONE value + * @property {number} ALIGN_DELTA=1 ALIGN_DELTA value + * @property {number} ALIGN_RATE=2 ALIGN_RATE value + * @property {number} ALIGN_INTERPOLATE=3 ALIGN_INTERPOLATE value + * @property {number} ALIGN_NEXT_OLDER=4 ALIGN_NEXT_OLDER value + * @property {number} ALIGN_MIN=10 ALIGN_MIN value + * @property {number} ALIGN_MAX=11 ALIGN_MAX value + * @property {number} ALIGN_MEAN=12 ALIGN_MEAN value + * @property {number} ALIGN_COUNT=13 ALIGN_COUNT value + * @property {number} ALIGN_SUM=14 ALIGN_SUM value + * @property {number} ALIGN_STDDEV=15 ALIGN_STDDEV value + * @property {number} ALIGN_COUNT_TRUE=16 ALIGN_COUNT_TRUE value + * @property {number} ALIGN_COUNT_FALSE=24 ALIGN_COUNT_FALSE value + * @property {number} ALIGN_FRACTION_TRUE=17 ALIGN_FRACTION_TRUE value + * @property {number} ALIGN_PERCENTILE_99=18 ALIGN_PERCENTILE_99 value + * @property {number} ALIGN_PERCENTILE_95=19 ALIGN_PERCENTILE_95 value + * @property {number} ALIGN_PERCENTILE_50=20 ALIGN_PERCENTILE_50 value + * @property {number} ALIGN_PERCENTILE_05=21 ALIGN_PERCENTILE_05 value + * @property {number} ALIGN_PERCENT_CHANGE=23 ALIGN_PERCENT_CHANGE value + */ + Aggregation.Aligner = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALIGN_NONE"] = 0; + values[valuesById[1] = "ALIGN_DELTA"] = 1; + values[valuesById[2] = "ALIGN_RATE"] = 2; + values[valuesById[3] = "ALIGN_INTERPOLATE"] = 3; + values[valuesById[4] = "ALIGN_NEXT_OLDER"] = 4; + values[valuesById[10] = "ALIGN_MIN"] = 10; + values[valuesById[11] = "ALIGN_MAX"] = 11; + values[valuesById[12] = "ALIGN_MEAN"] = 12; + values[valuesById[13] = "ALIGN_COUNT"] = 13; + values[valuesById[14] = "ALIGN_SUM"] = 14; + values[valuesById[15] = "ALIGN_STDDEV"] = 15; + values[valuesById[16] = "ALIGN_COUNT_TRUE"] = 16; + values[valuesById[24] = "ALIGN_COUNT_FALSE"] = 24; + values[valuesById[17] = "ALIGN_FRACTION_TRUE"] = 17; + values[valuesById[18] = "ALIGN_PERCENTILE_99"] = 18; + values[valuesById[19] = "ALIGN_PERCENTILE_95"] = 19; + values[valuesById[20] = "ALIGN_PERCENTILE_50"] = 20; + values[valuesById[21] = "ALIGN_PERCENTILE_05"] = 21; + values[valuesById[23] = "ALIGN_PERCENT_CHANGE"] = 23; + return values; + })(); + + /** + * Reducer enum. + * @name google.monitoring.dashboard.v1.Aggregation.Reducer + * @enum {number} + * @property {number} REDUCE_NONE=0 REDUCE_NONE value + * @property {number} REDUCE_MEAN=1 REDUCE_MEAN value + * @property {number} REDUCE_MIN=2 REDUCE_MIN value + * @property {number} REDUCE_MAX=3 REDUCE_MAX value + * @property {number} REDUCE_SUM=4 REDUCE_SUM value + * @property {number} REDUCE_STDDEV=5 REDUCE_STDDEV value + * @property {number} REDUCE_COUNT=6 REDUCE_COUNT value + * @property {number} REDUCE_COUNT_TRUE=7 REDUCE_COUNT_TRUE value + * @property {number} REDUCE_COUNT_FALSE=15 REDUCE_COUNT_FALSE value + * @property {number} REDUCE_FRACTION_TRUE=8 REDUCE_FRACTION_TRUE value + * @property {number} REDUCE_PERCENTILE_99=9 REDUCE_PERCENTILE_99 value + * @property {number} REDUCE_PERCENTILE_95=10 REDUCE_PERCENTILE_95 value + * @property {number} REDUCE_PERCENTILE_50=11 REDUCE_PERCENTILE_50 value + * @property {number} REDUCE_PERCENTILE_05=12 REDUCE_PERCENTILE_05 value + */ + Aggregation.Reducer = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDUCE_NONE"] = 0; + values[valuesById[1] = "REDUCE_MEAN"] = 1; + values[valuesById[2] = "REDUCE_MIN"] = 2; + values[valuesById[3] = "REDUCE_MAX"] = 3; + values[valuesById[4] = "REDUCE_SUM"] = 4; + values[valuesById[5] = "REDUCE_STDDEV"] = 5; + values[valuesById[6] = "REDUCE_COUNT"] = 6; + values[valuesById[7] = "REDUCE_COUNT_TRUE"] = 7; + values[valuesById[15] = "REDUCE_COUNT_FALSE"] = 15; + values[valuesById[8] = "REDUCE_FRACTION_TRUE"] = 8; + values[valuesById[9] = "REDUCE_PERCENTILE_99"] = 9; + values[valuesById[10] = "REDUCE_PERCENTILE_95"] = 10; + values[valuesById[11] = "REDUCE_PERCENTILE_50"] = 11; + values[valuesById[12] = "REDUCE_PERCENTILE_05"] = 12; + return values; + })(); + + return Aggregation; + })(); + + v1.PickTimeSeriesFilter = (function() { + + /** + * Properties of a PickTimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @interface IPickTimeSeriesFilter + * @property {google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method|null} [rankingMethod] PickTimeSeriesFilter rankingMethod + * @property {number|null} [numTimeSeries] PickTimeSeriesFilter numTimeSeries + * @property {google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction|null} [direction] PickTimeSeriesFilter direction + */ + + /** + * Constructs a new PickTimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a PickTimeSeriesFilter. + * @implements IPickTimeSeriesFilter + * @constructor + * @param {google.monitoring.dashboard.v1.IPickTimeSeriesFilter=} [properties] Properties to set + */ + function PickTimeSeriesFilter(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]]; + } + + /** + * PickTimeSeriesFilter rankingMethod. + * @member {google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method} rankingMethod + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @instance + */ + PickTimeSeriesFilter.prototype.rankingMethod = 0; + + /** + * PickTimeSeriesFilter numTimeSeries. + * @member {number} numTimeSeries + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @instance + */ + PickTimeSeriesFilter.prototype.numTimeSeries = 0; + + /** + * PickTimeSeriesFilter direction. + * @member {google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction} direction + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @instance + */ + PickTimeSeriesFilter.prototype.direction = 0; + + /** + * Creates a new PickTimeSeriesFilter instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IPickTimeSeriesFilter=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.PickTimeSeriesFilter} PickTimeSeriesFilter instance + */ + PickTimeSeriesFilter.create = function create(properties) { + return new PickTimeSeriesFilter(properties); + }; + + /** + * Encodes the specified PickTimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IPickTimeSeriesFilter} message PickTimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PickTimeSeriesFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rankingMethod != null && Object.hasOwnProperty.call(message, "rankingMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rankingMethod); + if (message.numTimeSeries != null && Object.hasOwnProperty.call(message, "numTimeSeries")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numTimeSeries); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.direction); + return writer; + }; + + /** + * Encodes the specified PickTimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IPickTimeSeriesFilter} message PickTimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PickTimeSeriesFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PickTimeSeriesFilter message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.PickTimeSeriesFilter} PickTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PickTimeSeriesFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rankingMethod = reader.int32(); + break; + } + case 2: { + message.numTimeSeries = reader.int32(); + break; + } + case 3: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PickTimeSeriesFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.PickTimeSeriesFilter} PickTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PickTimeSeriesFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PickTimeSeriesFilter message. + * @function verify + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PickTimeSeriesFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rankingMethod != null && message.hasOwnProperty("rankingMethod")) + switch (message.rankingMethod) { + default: + return "rankingMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.numTimeSeries != null && message.hasOwnProperty("numTimeSeries")) + if (!$util.isInteger(message.numTimeSeries)) + return "numTimeSeries: integer expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PickTimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.PickTimeSeriesFilter} PickTimeSeriesFilter + */ + PickTimeSeriesFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter) + return object; + var message = new $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter(); + switch (object.rankingMethod) { + case "METHOD_UNSPECIFIED": + case 0: + message.rankingMethod = 0; + break; + case "METHOD_MEAN": + case 1: + message.rankingMethod = 1; + break; + case "METHOD_MAX": + case 2: + message.rankingMethod = 2; + break; + case "METHOD_MIN": + case 3: + message.rankingMethod = 3; + break; + case "METHOD_SUM": + case 4: + message.rankingMethod = 4; + break; + case "METHOD_LATEST": + case 5: + message.rankingMethod = 5; + break; + } + if (object.numTimeSeries != null) + message.numTimeSeries = object.numTimeSeries | 0; + switch (object.direction) { + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "TOP": + case 1: + message.direction = 1; + break; + case "BOTTOM": + case 2: + message.direction = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PickTimeSeriesFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.PickTimeSeriesFilter} message PickTimeSeriesFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PickTimeSeriesFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rankingMethod = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + object.numTimeSeries = 0; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.rankingMethod != null && message.hasOwnProperty("rankingMethod")) + object.rankingMethod = options.enums === String ? $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method[message.rankingMethod] : message.rankingMethod; + if (message.numTimeSeries != null && message.hasOwnProperty("numTimeSeries")) + object.numTimeSeries = message.numTimeSeries; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction[message.direction] : message.direction; + return object; + }; + + /** + * Converts this PickTimeSeriesFilter to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @instance + * @returns {Object.} JSON object + */ + PickTimeSeriesFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PickTimeSeriesFilter + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.PickTimeSeriesFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PickTimeSeriesFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.PickTimeSeriesFilter"; + }; + + /** + * Method enum. + * @name google.monitoring.dashboard.v1.PickTimeSeriesFilter.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} METHOD_MEAN=1 METHOD_MEAN value + * @property {number} METHOD_MAX=2 METHOD_MAX value + * @property {number} METHOD_MIN=3 METHOD_MIN value + * @property {number} METHOD_SUM=4 METHOD_SUM value + * @property {number} METHOD_LATEST=5 METHOD_LATEST value + */ + PickTimeSeriesFilter.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "METHOD_MEAN"] = 1; + values[valuesById[2] = "METHOD_MAX"] = 2; + values[valuesById[3] = "METHOD_MIN"] = 3; + values[valuesById[4] = "METHOD_SUM"] = 4; + values[valuesById[5] = "METHOD_LATEST"] = 5; + return values; + })(); + + /** + * Direction enum. + * @name google.monitoring.dashboard.v1.PickTimeSeriesFilter.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} TOP=1 TOP value + * @property {number} BOTTOM=2 BOTTOM value + */ + PickTimeSeriesFilter.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOP"] = 1; + values[valuesById[2] = "BOTTOM"] = 2; + return values; + })(); + + return PickTimeSeriesFilter; + })(); + + v1.StatisticalTimeSeriesFilter = (function() { + + /** + * Properties of a StatisticalTimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @interface IStatisticalTimeSeriesFilter + * @property {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method|null} [rankingMethod] StatisticalTimeSeriesFilter rankingMethod + * @property {number|null} [numTimeSeries] StatisticalTimeSeriesFilter numTimeSeries + */ + + /** + * Constructs a new StatisticalTimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a StatisticalTimeSeriesFilter. + * @implements IStatisticalTimeSeriesFilter + * @constructor + * @param {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter=} [properties] Properties to set + */ + function StatisticalTimeSeriesFilter(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]]; + } + + /** + * StatisticalTimeSeriesFilter rankingMethod. + * @member {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method} rankingMethod + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @instance + */ + StatisticalTimeSeriesFilter.prototype.rankingMethod = 0; + + /** + * StatisticalTimeSeriesFilter numTimeSeries. + * @member {number} numTimeSeries + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @instance + */ + StatisticalTimeSeriesFilter.prototype.numTimeSeries = 0; + + /** + * Creates a new StatisticalTimeSeriesFilter instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} StatisticalTimeSeriesFilter instance + */ + StatisticalTimeSeriesFilter.create = function create(properties) { + return new StatisticalTimeSeriesFilter(properties); + }; + + /** + * Encodes the specified StatisticalTimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter} message StatisticalTimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatisticalTimeSeriesFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rankingMethod != null && Object.hasOwnProperty.call(message, "rankingMethod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rankingMethod); + if (message.numTimeSeries != null && Object.hasOwnProperty.call(message, "numTimeSeries")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numTimeSeries); + return writer; + }; + + /** + * Encodes the specified StatisticalTimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter} message StatisticalTimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatisticalTimeSeriesFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatisticalTimeSeriesFilter message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} StatisticalTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatisticalTimeSeriesFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rankingMethod = reader.int32(); + break; + } + case 2: { + message.numTimeSeries = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatisticalTimeSeriesFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} StatisticalTimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatisticalTimeSeriesFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatisticalTimeSeriesFilter message. + * @function verify + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatisticalTimeSeriesFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rankingMethod != null && message.hasOwnProperty("rankingMethod")) + switch (message.rankingMethod) { + default: + return "rankingMethod: enum value expected"; + case 0: + case 1: + break; + } + if (message.numTimeSeries != null && message.hasOwnProperty("numTimeSeries")) + if (!$util.isInteger(message.numTimeSeries)) + return "numTimeSeries: integer expected"; + return null; + }; + + /** + * Creates a StatisticalTimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} StatisticalTimeSeriesFilter + */ + StatisticalTimeSeriesFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter) + return object; + var message = new $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter(); + switch (object.rankingMethod) { + case "METHOD_UNSPECIFIED": + case 0: + message.rankingMethod = 0; + break; + case "METHOD_CLUSTER_OUTLIER": + case 1: + message.rankingMethod = 1; + break; + } + if (object.numTimeSeries != null) + message.numTimeSeries = object.numTimeSeries | 0; + return message; + }; + + /** + * Creates a plain object from a StatisticalTimeSeriesFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter} message StatisticalTimeSeriesFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatisticalTimeSeriesFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rankingMethod = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + object.numTimeSeries = 0; + } + if (message.rankingMethod != null && message.hasOwnProperty("rankingMethod")) + object.rankingMethod = options.enums === String ? $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method[message.rankingMethod] : message.rankingMethod; + if (message.numTimeSeries != null && message.hasOwnProperty("numTimeSeries")) + object.numTimeSeries = message.numTimeSeries; + return object; + }; + + /** + * Converts this StatisticalTimeSeriesFilter to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @instance + * @returns {Object.} JSON object + */ + StatisticalTimeSeriesFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StatisticalTimeSeriesFilter + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StatisticalTimeSeriesFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter"; + }; + + /** + * Method enum. + * @name google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} METHOD_CLUSTER_OUTLIER=1 METHOD_CLUSTER_OUTLIER value + */ + StatisticalTimeSeriesFilter.Method = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "METHOD_CLUSTER_OUTLIER"] = 1; + return values; + })(); + + return StatisticalTimeSeriesFilter; + })(); + + v1.Dashboard = (function() { + + /** + * Properties of a Dashboard. + * @memberof google.monitoring.dashboard.v1 + * @interface IDashboard + * @property {string|null} [name] Dashboard name + * @property {string|null} [displayName] Dashboard displayName + * @property {string|null} [etag] Dashboard etag + * @property {google.monitoring.dashboard.v1.IGridLayout|null} [gridLayout] Dashboard gridLayout + * @property {google.monitoring.dashboard.v1.IMosaicLayout|null} [mosaicLayout] Dashboard mosaicLayout + * @property {google.monitoring.dashboard.v1.IRowLayout|null} [rowLayout] Dashboard rowLayout + * @property {google.monitoring.dashboard.v1.IColumnLayout|null} [columnLayout] Dashboard columnLayout + * @property {Array.|null} [dashboardFilters] Dashboard dashboardFilters + * @property {Object.|null} [labels] Dashboard labels + */ + + /** + * Constructs a new Dashboard. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a Dashboard. + * @implements IDashboard + * @constructor + * @param {google.monitoring.dashboard.v1.IDashboard=} [properties] Properties to set + */ + function Dashboard(properties) { + this.dashboardFilters = []; + 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]]; + } + + /** + * Dashboard name. + * @member {string} name + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.name = ""; + + /** + * Dashboard displayName. + * @member {string} displayName + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.displayName = ""; + + /** + * Dashboard etag. + * @member {string} etag + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.etag = ""; + + /** + * Dashboard gridLayout. + * @member {google.monitoring.dashboard.v1.IGridLayout|null|undefined} gridLayout + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.gridLayout = null; + + /** + * Dashboard mosaicLayout. + * @member {google.monitoring.dashboard.v1.IMosaicLayout|null|undefined} mosaicLayout + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.mosaicLayout = null; + + /** + * Dashboard rowLayout. + * @member {google.monitoring.dashboard.v1.IRowLayout|null|undefined} rowLayout + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.rowLayout = null; + + /** + * Dashboard columnLayout. + * @member {google.monitoring.dashboard.v1.IColumnLayout|null|undefined} columnLayout + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.columnLayout = null; + + /** + * Dashboard dashboardFilters. + * @member {Array.} dashboardFilters + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.dashboardFilters = $util.emptyArray; + + /** + * Dashboard labels. + * @member {Object.} labels + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Dashboard.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dashboard layout. + * @member {"gridLayout"|"mosaicLayout"|"rowLayout"|"columnLayout"|undefined} layout + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + */ + Object.defineProperty(Dashboard.prototype, "layout", { + get: $util.oneOfGetter($oneOfFields = ["gridLayout", "mosaicLayout", "rowLayout", "columnLayout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dashboard instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {google.monitoring.dashboard.v1.IDashboard=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Dashboard} Dashboard instance + */ + Dashboard.create = function create(properties) { + return new Dashboard(properties); + }; + + /** + * Encodes the specified Dashboard message. Does not implicitly {@link google.monitoring.dashboard.v1.Dashboard.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {google.monitoring.dashboard.v1.IDashboard} message Dashboard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dashboard.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.gridLayout != null && Object.hasOwnProperty.call(message, "gridLayout")) + $root.google.monitoring.dashboard.v1.GridLayout.encode(message.gridLayout, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mosaicLayout != null && Object.hasOwnProperty.call(message, "mosaicLayout")) + $root.google.monitoring.dashboard.v1.MosaicLayout.encode(message.mosaicLayout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.rowLayout != null && Object.hasOwnProperty.call(message, "rowLayout")) + $root.google.monitoring.dashboard.v1.RowLayout.encode(message.rowLayout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.columnLayout != null && Object.hasOwnProperty.call(message, "columnLayout")) + $root.google.monitoring.dashboard.v1.ColumnLayout.encode(message.columnLayout, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dashboardFilters != null && message.dashboardFilters.length) + for (var i = 0; i < message.dashboardFilters.length; ++i) + $root.google.monitoring.dashboard.v1.DashboardFilter.encode(message.dashboardFilters[i], writer.uint32(/* id 11, wireType 2 =*/90).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 12, wireType 2 =*/98).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 Dashboard message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Dashboard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {google.monitoring.dashboard.v1.IDashboard} message Dashboard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dashboard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dashboard message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Dashboard} Dashboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dashboard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Dashboard(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + case 5: { + message.gridLayout = $root.google.monitoring.dashboard.v1.GridLayout.decode(reader, reader.uint32()); + break; + } + case 6: { + message.mosaicLayout = $root.google.monitoring.dashboard.v1.MosaicLayout.decode(reader, reader.uint32()); + break; + } + case 8: { + message.rowLayout = $root.google.monitoring.dashboard.v1.RowLayout.decode(reader, reader.uint32()); + break; + } + case 9: { + message.columnLayout = $root.google.monitoring.dashboard.v1.ColumnLayout.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.dashboardFilters && message.dashboardFilters.length)) + message.dashboardFilters = []; + message.dashboardFilters.push($root.google.monitoring.dashboard.v1.DashboardFilter.decode(reader, reader.uint32())); + break; + } + case 12: { + 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 Dashboard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Dashboard} Dashboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dashboard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dashboard message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dashboard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.gridLayout != null && message.hasOwnProperty("gridLayout")) { + properties.layout = 1; + { + var error = $root.google.monitoring.dashboard.v1.GridLayout.verify(message.gridLayout); + if (error) + return "gridLayout." + error; + } + } + if (message.mosaicLayout != null && message.hasOwnProperty("mosaicLayout")) { + if (properties.layout === 1) + return "layout: multiple values"; + properties.layout = 1; + { + var error = $root.google.monitoring.dashboard.v1.MosaicLayout.verify(message.mosaicLayout); + if (error) + return "mosaicLayout." + error; + } + } + if (message.rowLayout != null && message.hasOwnProperty("rowLayout")) { + if (properties.layout === 1) + return "layout: multiple values"; + properties.layout = 1; + { + var error = $root.google.monitoring.dashboard.v1.RowLayout.verify(message.rowLayout); + if (error) + return "rowLayout." + error; + } + } + if (message.columnLayout != null && message.hasOwnProperty("columnLayout")) { + if (properties.layout === 1) + return "layout: multiple values"; + properties.layout = 1; + { + var error = $root.google.monitoring.dashboard.v1.ColumnLayout.verify(message.columnLayout); + if (error) + return "columnLayout." + error; + } + } + if (message.dashboardFilters != null && message.hasOwnProperty("dashboardFilters")) { + if (!Array.isArray(message.dashboardFilters)) + return "dashboardFilters: array expected"; + for (var i = 0; i < message.dashboardFilters.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.DashboardFilter.verify(message.dashboardFilters[i]); + if (error) + return "dashboardFilters." + 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 Dashboard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Dashboard} Dashboard + */ + Dashboard.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Dashboard) + return object; + var message = new $root.google.monitoring.dashboard.v1.Dashboard(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.etag != null) + message.etag = String(object.etag); + if (object.gridLayout != null) { + if (typeof object.gridLayout !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.gridLayout: object expected"); + message.gridLayout = $root.google.monitoring.dashboard.v1.GridLayout.fromObject(object.gridLayout); + } + if (object.mosaicLayout != null) { + if (typeof object.mosaicLayout !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.mosaicLayout: object expected"); + message.mosaicLayout = $root.google.monitoring.dashboard.v1.MosaicLayout.fromObject(object.mosaicLayout); + } + if (object.rowLayout != null) { + if (typeof object.rowLayout !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.rowLayout: object expected"); + message.rowLayout = $root.google.monitoring.dashboard.v1.RowLayout.fromObject(object.rowLayout); + } + if (object.columnLayout != null) { + if (typeof object.columnLayout !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.columnLayout: object expected"); + message.columnLayout = $root.google.monitoring.dashboard.v1.ColumnLayout.fromObject(object.columnLayout); + } + if (object.dashboardFilters) { + if (!Array.isArray(object.dashboardFilters)) + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.dashboardFilters: array expected"); + message.dashboardFilters = []; + for (var i = 0; i < object.dashboardFilters.length; ++i) { + if (typeof object.dashboardFilters[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.dashboardFilters: object expected"); + message.dashboardFilters[i] = $root.google.monitoring.dashboard.v1.DashboardFilter.fromObject(object.dashboardFilters[i]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Dashboard.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 Dashboard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {google.monitoring.dashboard.v1.Dashboard} message Dashboard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dashboard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dashboardFilters = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.gridLayout != null && message.hasOwnProperty("gridLayout")) { + object.gridLayout = $root.google.monitoring.dashboard.v1.GridLayout.toObject(message.gridLayout, options); + if (options.oneofs) + object.layout = "gridLayout"; + } + if (message.mosaicLayout != null && message.hasOwnProperty("mosaicLayout")) { + object.mosaicLayout = $root.google.monitoring.dashboard.v1.MosaicLayout.toObject(message.mosaicLayout, options); + if (options.oneofs) + object.layout = "mosaicLayout"; + } + if (message.rowLayout != null && message.hasOwnProperty("rowLayout")) { + object.rowLayout = $root.google.monitoring.dashboard.v1.RowLayout.toObject(message.rowLayout, options); + if (options.oneofs) + object.layout = "rowLayout"; + } + if (message.columnLayout != null && message.hasOwnProperty("columnLayout")) { + object.columnLayout = $root.google.monitoring.dashboard.v1.ColumnLayout.toObject(message.columnLayout, options); + if (options.oneofs) + object.layout = "columnLayout"; + } + if (message.dashboardFilters && message.dashboardFilters.length) { + object.dashboardFilters = []; + for (var j = 0; j < message.dashboardFilters.length; ++j) + object.dashboardFilters[j] = $root.google.monitoring.dashboard.v1.DashboardFilter.toObject(message.dashboardFilters[j], 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 Dashboard to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Dashboard + * @instance + * @returns {Object.} JSON object + */ + Dashboard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dashboard + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Dashboard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dashboard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Dashboard"; + }; + + return Dashboard; + })(); + + v1.DashboardFilter = (function() { + + /** + * Properties of a DashboardFilter. + * @memberof google.monitoring.dashboard.v1 + * @interface IDashboardFilter + * @property {string|null} [labelKey] DashboardFilter labelKey + * @property {string|null} [templateVariable] DashboardFilter templateVariable + * @property {string|null} [stringValue] DashboardFilter stringValue + * @property {google.monitoring.dashboard.v1.DashboardFilter.FilterType|null} [filterType] DashboardFilter filterType + */ + + /** + * Constructs a new DashboardFilter. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a DashboardFilter. + * @implements IDashboardFilter + * @constructor + * @param {google.monitoring.dashboard.v1.IDashboardFilter=} [properties] Properties to set + */ + function DashboardFilter(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]]; + } + + /** + * DashboardFilter labelKey. + * @member {string} labelKey + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + */ + DashboardFilter.prototype.labelKey = ""; + + /** + * DashboardFilter templateVariable. + * @member {string} templateVariable + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + */ + DashboardFilter.prototype.templateVariable = ""; + + /** + * DashboardFilter stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + */ + DashboardFilter.prototype.stringValue = null; + + /** + * DashboardFilter filterType. + * @member {google.monitoring.dashboard.v1.DashboardFilter.FilterType} filterType + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + */ + DashboardFilter.prototype.filterType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DashboardFilter defaultValue. + * @member {"stringValue"|undefined} defaultValue + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + */ + Object.defineProperty(DashboardFilter.prototype, "defaultValue", { + get: $util.oneOfGetter($oneOfFields = ["stringValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DashboardFilter instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {google.monitoring.dashboard.v1.IDashboardFilter=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.DashboardFilter} DashboardFilter instance + */ + DashboardFilter.create = function create(properties) { + return new DashboardFilter(properties); + }; + + /** + * Encodes the specified DashboardFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.DashboardFilter.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {google.monitoring.dashboard.v1.IDashboardFilter} message DashboardFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DashboardFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelKey != null && Object.hasOwnProperty.call(message, "labelKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.labelKey); + if (message.templateVariable != null && Object.hasOwnProperty.call(message, "templateVariable")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.templateVariable); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stringValue); + if (message.filterType != null && Object.hasOwnProperty.call(message, "filterType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.filterType); + return writer; + }; + + /** + * Encodes the specified DashboardFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.DashboardFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {google.monitoring.dashboard.v1.IDashboardFilter} message DashboardFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DashboardFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DashboardFilter message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.DashboardFilter} DashboardFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DashboardFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.DashboardFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelKey = reader.string(); + break; + } + case 3: { + message.templateVariable = reader.string(); + break; + } + case 4: { + message.stringValue = reader.string(); + break; + } + case 5: { + message.filterType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DashboardFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.DashboardFilter} DashboardFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DashboardFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DashboardFilter message. + * @function verify + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DashboardFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.labelKey != null && message.hasOwnProperty("labelKey")) + if (!$util.isString(message.labelKey)) + return "labelKey: string expected"; + if (message.templateVariable != null && message.hasOwnProperty("templateVariable")) + if (!$util.isString(message.templateVariable)) + return "templateVariable: string expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.defaultValue = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.filterType != null && message.hasOwnProperty("filterType")) + switch (message.filterType) { + default: + return "filterType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a DashboardFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.DashboardFilter} DashboardFilter + */ + DashboardFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.DashboardFilter) + return object; + var message = new $root.google.monitoring.dashboard.v1.DashboardFilter(); + if (object.labelKey != null) + message.labelKey = String(object.labelKey); + if (object.templateVariable != null) + message.templateVariable = String(object.templateVariable); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + switch (object.filterType) { + case "FILTER_TYPE_UNSPECIFIED": + case 0: + message.filterType = 0; + break; + case "RESOURCE_LABEL": + case 1: + message.filterType = 1; + break; + case "METRIC_LABEL": + case 2: + message.filterType = 2; + break; + case "USER_METADATA_LABEL": + case 3: + message.filterType = 3; + break; + case "SYSTEM_METADATA_LABEL": + case 4: + message.filterType = 4; + break; + case "GROUP": + case 5: + message.filterType = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a DashboardFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {google.monitoring.dashboard.v1.DashboardFilter} message DashboardFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DashboardFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelKey = ""; + object.templateVariable = ""; + object.filterType = options.enums === String ? "FILTER_TYPE_UNSPECIFIED" : 0; + } + if (message.labelKey != null && message.hasOwnProperty("labelKey")) + object.labelKey = message.labelKey; + if (message.templateVariable != null && message.hasOwnProperty("templateVariable")) + object.templateVariable = message.templateVariable; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.defaultValue = "stringValue"; + } + if (message.filterType != null && message.hasOwnProperty("filterType")) + object.filterType = options.enums === String ? $root.google.monitoring.dashboard.v1.DashboardFilter.FilterType[message.filterType] : message.filterType; + return object; + }; + + /** + * Converts this DashboardFilter to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @instance + * @returns {Object.} JSON object + */ + DashboardFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DashboardFilter + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.DashboardFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DashboardFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.DashboardFilter"; + }; + + /** + * FilterType enum. + * @name google.monitoring.dashboard.v1.DashboardFilter.FilterType + * @enum {number} + * @property {number} FILTER_TYPE_UNSPECIFIED=0 FILTER_TYPE_UNSPECIFIED value + * @property {number} RESOURCE_LABEL=1 RESOURCE_LABEL value + * @property {number} METRIC_LABEL=2 METRIC_LABEL value + * @property {number} USER_METADATA_LABEL=3 USER_METADATA_LABEL value + * @property {number} SYSTEM_METADATA_LABEL=4 SYSTEM_METADATA_LABEL value + * @property {number} GROUP=5 GROUP value + */ + DashboardFilter.FilterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_LABEL"] = 1; + values[valuesById[2] = "METRIC_LABEL"] = 2; + values[valuesById[3] = "USER_METADATA_LABEL"] = 3; + values[valuesById[4] = "SYSTEM_METADATA_LABEL"] = 4; + values[valuesById[5] = "GROUP"] = 5; + return values; + })(); + + return DashboardFilter; + })(); + + v1.GridLayout = (function() { + + /** + * Properties of a GridLayout. + * @memberof google.monitoring.dashboard.v1 + * @interface IGridLayout + * @property {number|Long|null} [columns] GridLayout columns + * @property {Array.|null} [widgets] GridLayout widgets + */ + + /** + * Constructs a new GridLayout. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a GridLayout. + * @implements IGridLayout + * @constructor + * @param {google.monitoring.dashboard.v1.IGridLayout=} [properties] Properties to set + */ + function GridLayout(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GridLayout columns. + * @member {number|Long} columns + * @memberof google.monitoring.dashboard.v1.GridLayout + * @instance + */ + GridLayout.prototype.columns = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GridLayout widgets. + * @member {Array.} widgets + * @memberof google.monitoring.dashboard.v1.GridLayout + * @instance + */ + GridLayout.prototype.widgets = $util.emptyArray; + + /** + * Creates a new GridLayout instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {google.monitoring.dashboard.v1.IGridLayout=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.GridLayout} GridLayout instance + */ + GridLayout.create = function create(properties) { + return new GridLayout(properties); + }; + + /** + * Encodes the specified GridLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.GridLayout.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {google.monitoring.dashboard.v1.IGridLayout} message GridLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GridLayout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.columns); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.monitoring.dashboard.v1.Widget.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GridLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.GridLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {google.monitoring.dashboard.v1.IGridLayout} message GridLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GridLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GridLayout message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.GridLayout} GridLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GridLayout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.GridLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columns = reader.int64(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.monitoring.dashboard.v1.Widget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GridLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.GridLayout} GridLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GridLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GridLayout message. + * @function verify + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GridLayout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) + if (!$util.isInteger(message.columns) && !(message.columns && $util.isInteger(message.columns.low) && $util.isInteger(message.columns.high))) + return "columns: integer|Long expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Widget.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a GridLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.GridLayout} GridLayout + */ + GridLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.GridLayout) + return object; + var message = new $root.google.monitoring.dashboard.v1.GridLayout(); + if (object.columns != null) + if ($util.Long) + (message.columns = $util.Long.fromValue(object.columns)).unsigned = false; + else if (typeof object.columns === "string") + message.columns = parseInt(object.columns, 10); + else if (typeof object.columns === "number") + message.columns = object.columns; + else if (typeof object.columns === "object") + message.columns = new $util.LongBits(object.columns.low >>> 0, object.columns.high >>> 0).toNumber(); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.monitoring.dashboard.v1.GridLayout.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.GridLayout.widgets: object expected"); + message.widgets[i] = $root.google.monitoring.dashboard.v1.Widget.fromObject(object.widgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GridLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {google.monitoring.dashboard.v1.GridLayout} message GridLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GridLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.columns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.columns = options.longs === String ? "0" : 0; + if (message.columns != null && message.hasOwnProperty("columns")) + if (typeof message.columns === "number") + object.columns = options.longs === String ? String(message.columns) : message.columns; + else + object.columns = options.longs === String ? $util.Long.prototype.toString.call(message.columns) : options.longs === Number ? new $util.LongBits(message.columns.low >>> 0, message.columns.high >>> 0).toNumber() : message.columns; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.monitoring.dashboard.v1.Widget.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this GridLayout to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.GridLayout + * @instance + * @returns {Object.} JSON object + */ + GridLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GridLayout + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.GridLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GridLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.GridLayout"; + }; + + return GridLayout; + })(); + + v1.MosaicLayout = (function() { + + /** + * Properties of a MosaicLayout. + * @memberof google.monitoring.dashboard.v1 + * @interface IMosaicLayout + * @property {number|null} [columns] MosaicLayout columns + * @property {Array.|null} [tiles] MosaicLayout tiles + */ + + /** + * Constructs a new MosaicLayout. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a MosaicLayout. + * @implements IMosaicLayout + * @constructor + * @param {google.monitoring.dashboard.v1.IMosaicLayout=} [properties] Properties to set + */ + function MosaicLayout(properties) { + this.tiles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MosaicLayout columns. + * @member {number} columns + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @instance + */ + MosaicLayout.prototype.columns = 0; + + /** + * MosaicLayout tiles. + * @member {Array.} tiles + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @instance + */ + MosaicLayout.prototype.tiles = $util.emptyArray; + + /** + * Creates a new MosaicLayout instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {google.monitoring.dashboard.v1.IMosaicLayout=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.MosaicLayout} MosaicLayout instance + */ + MosaicLayout.create = function create(properties) { + return new MosaicLayout(properties); + }; + + /** + * Encodes the specified MosaicLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {google.monitoring.dashboard.v1.IMosaicLayout} message MosaicLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MosaicLayout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.columns); + if (message.tiles != null && message.tiles.length) + for (var i = 0; i < message.tiles.length; ++i) + $root.google.monitoring.dashboard.v1.MosaicLayout.Tile.encode(message.tiles[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MosaicLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {google.monitoring.dashboard.v1.IMosaicLayout} message MosaicLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MosaicLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MosaicLayout message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.MosaicLayout} MosaicLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MosaicLayout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.MosaicLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columns = reader.int32(); + break; + } + case 3: { + if (!(message.tiles && message.tiles.length)) + message.tiles = []; + message.tiles.push($root.google.monitoring.dashboard.v1.MosaicLayout.Tile.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MosaicLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.MosaicLayout} MosaicLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MosaicLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MosaicLayout message. + * @function verify + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MosaicLayout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) + if (!$util.isInteger(message.columns)) + return "columns: integer expected"; + if (message.tiles != null && message.hasOwnProperty("tiles")) { + if (!Array.isArray(message.tiles)) + return "tiles: array expected"; + for (var i = 0; i < message.tiles.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.MosaicLayout.Tile.verify(message.tiles[i]); + if (error) + return "tiles." + error; + } + } + return null; + }; + + /** + * Creates a MosaicLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.MosaicLayout} MosaicLayout + */ + MosaicLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.MosaicLayout) + return object; + var message = new $root.google.monitoring.dashboard.v1.MosaicLayout(); + if (object.columns != null) + message.columns = object.columns | 0; + if (object.tiles) { + if (!Array.isArray(object.tiles)) + throw TypeError(".google.monitoring.dashboard.v1.MosaicLayout.tiles: array expected"); + message.tiles = []; + for (var i = 0; i < object.tiles.length; ++i) { + if (typeof object.tiles[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.MosaicLayout.tiles: object expected"); + message.tiles[i] = $root.google.monitoring.dashboard.v1.MosaicLayout.Tile.fromObject(object.tiles[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MosaicLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {google.monitoring.dashboard.v1.MosaicLayout} message MosaicLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MosaicLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tiles = []; + if (options.defaults) + object.columns = 0; + if (message.columns != null && message.hasOwnProperty("columns")) + object.columns = message.columns; + if (message.tiles && message.tiles.length) { + object.tiles = []; + for (var j = 0; j < message.tiles.length; ++j) + object.tiles[j] = $root.google.monitoring.dashboard.v1.MosaicLayout.Tile.toObject(message.tiles[j], options); + } + return object; + }; + + /** + * Converts this MosaicLayout to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @instance + * @returns {Object.} JSON object + */ + MosaicLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MosaicLayout + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MosaicLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.MosaicLayout"; + }; + + MosaicLayout.Tile = (function() { + + /** + * Properties of a Tile. + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @interface ITile + * @property {number|null} [xPos] Tile xPos + * @property {number|null} [yPos] Tile yPos + * @property {number|null} [width] Tile width + * @property {number|null} [height] Tile height + * @property {google.monitoring.dashboard.v1.IWidget|null} [widget] Tile widget + */ + + /** + * Constructs a new Tile. + * @memberof google.monitoring.dashboard.v1.MosaicLayout + * @classdesc Represents a Tile. + * @implements ITile + * @constructor + * @param {google.monitoring.dashboard.v1.MosaicLayout.ITile=} [properties] Properties to set + */ + function Tile(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]]; + } + + /** + * Tile xPos. + * @member {number} xPos + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + */ + Tile.prototype.xPos = 0; + + /** + * Tile yPos. + * @member {number} yPos + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + */ + Tile.prototype.yPos = 0; + + /** + * Tile width. + * @member {number} width + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + */ + Tile.prototype.width = 0; + + /** + * Tile height. + * @member {number} height + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + */ + Tile.prototype.height = 0; + + /** + * Tile widget. + * @member {google.monitoring.dashboard.v1.IWidget|null|undefined} widget + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + */ + Tile.prototype.widget = null; + + /** + * Creates a new Tile instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {google.monitoring.dashboard.v1.MosaicLayout.ITile=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.MosaicLayout.Tile} Tile instance + */ + Tile.create = function create(properties) { + return new Tile(properties); + }; + + /** + * Encodes the specified Tile message. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.Tile.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {google.monitoring.dashboard.v1.MosaicLayout.ITile} message Tile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xPos != null && Object.hasOwnProperty.call(message, "xPos")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.xPos); + if (message.yPos != null && Object.hasOwnProperty.call(message, "yPos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.yPos); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.height); + if (message.widget != null && Object.hasOwnProperty.call(message, "widget")) + $root.google.monitoring.dashboard.v1.Widget.encode(message.widget, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tile message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.MosaicLayout.Tile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {google.monitoring.dashboard.v1.MosaicLayout.ITile} message Tile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tile message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.MosaicLayout.Tile} Tile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.MosaicLayout.Tile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xPos = reader.int32(); + break; + } + case 2: { + message.yPos = reader.int32(); + break; + } + case 3: { + message.width = reader.int32(); + break; + } + case 4: { + message.height = reader.int32(); + break; + } + case 5: { + message.widget = $root.google.monitoring.dashboard.v1.Widget.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.MosaicLayout.Tile} Tile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tile message. + * @function verify + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xPos != null && message.hasOwnProperty("xPos")) + if (!$util.isInteger(message.xPos)) + return "xPos: integer expected"; + if (message.yPos != null && message.hasOwnProperty("yPos")) + if (!$util.isInteger(message.yPos)) + return "yPos: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.widget != null && message.hasOwnProperty("widget")) { + var error = $root.google.monitoring.dashboard.v1.Widget.verify(message.widget); + if (error) + return "widget." + error; + } + return null; + }; + + /** + * Creates a Tile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.MosaicLayout.Tile} Tile + */ + Tile.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.MosaicLayout.Tile) + return object; + var message = new $root.google.monitoring.dashboard.v1.MosaicLayout.Tile(); + if (object.xPos != null) + message.xPos = object.xPos | 0; + if (object.yPos != null) + message.yPos = object.yPos | 0; + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + if (object.widget != null) { + if (typeof object.widget !== "object") + throw TypeError(".google.monitoring.dashboard.v1.MosaicLayout.Tile.widget: object expected"); + message.widget = $root.google.monitoring.dashboard.v1.Widget.fromObject(object.widget); + } + return message; + }; + + /** + * Creates a plain object from a Tile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {google.monitoring.dashboard.v1.MosaicLayout.Tile} message Tile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xPos = 0; + object.yPos = 0; + object.width = 0; + object.height = 0; + object.widget = null; + } + if (message.xPos != null && message.hasOwnProperty("xPos")) + object.xPos = message.xPos; + if (message.yPos != null && message.hasOwnProperty("yPos")) + object.yPos = message.yPos; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.widget != null && message.hasOwnProperty("widget")) + object.widget = $root.google.monitoring.dashboard.v1.Widget.toObject(message.widget, options); + return object; + }; + + /** + * Converts this Tile to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @instance + * @returns {Object.} JSON object + */ + Tile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tile + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.MosaicLayout.Tile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.MosaicLayout.Tile"; + }; + + return Tile; + })(); + + return MosaicLayout; + })(); + + v1.RowLayout = (function() { + + /** + * Properties of a RowLayout. + * @memberof google.monitoring.dashboard.v1 + * @interface IRowLayout + * @property {Array.|null} [rows] RowLayout rows + */ + + /** + * Constructs a new RowLayout. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a RowLayout. + * @implements IRowLayout + * @constructor + * @param {google.monitoring.dashboard.v1.IRowLayout=} [properties] Properties to set + */ + function RowLayout(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowLayout rows. + * @member {Array.} rows + * @memberof google.monitoring.dashboard.v1.RowLayout + * @instance + */ + RowLayout.prototype.rows = $util.emptyArray; + + /** + * Creates a new RowLayout instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {google.monitoring.dashboard.v1.IRowLayout=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.RowLayout} RowLayout instance + */ + RowLayout.create = function create(properties) { + return new RowLayout(properties); + }; + + /** + * Encodes the specified RowLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {google.monitoring.dashboard.v1.IRowLayout} message RowLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowLayout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.monitoring.dashboard.v1.RowLayout.Row.encode(message.rows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {google.monitoring.dashboard.v1.IRowLayout} message RowLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowLayout message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.RowLayout} RowLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowLayout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.RowLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.monitoring.dashboard.v1.RowLayout.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.RowLayout} RowLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowLayout message. + * @function verify + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowLayout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.RowLayout.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a RowLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.RowLayout} RowLayout + */ + RowLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.RowLayout) + return object; + var message = new $root.google.monitoring.dashboard.v1.RowLayout(); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.monitoring.dashboard.v1.RowLayout.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.RowLayout.rows: object expected"); + message.rows[i] = $root.google.monitoring.dashboard.v1.RowLayout.Row.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RowLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {google.monitoring.dashboard.v1.RowLayout} message RowLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.monitoring.dashboard.v1.RowLayout.Row.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this RowLayout to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.RowLayout + * @instance + * @returns {Object.} JSON object + */ + RowLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowLayout + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.RowLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.RowLayout"; + }; + + RowLayout.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.monitoring.dashboard.v1.RowLayout + * @interface IRow + * @property {number|Long|null} [weight] Row weight + * @property {Array.|null} [widgets] Row widgets + */ + + /** + * Constructs a new Row. + * @memberof google.monitoring.dashboard.v1.RowLayout + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.monitoring.dashboard.v1.RowLayout.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row weight. + * @member {number|Long} weight + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @instance + */ + Row.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Row widgets. + * @member {Array.} widgets + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @instance + */ + Row.prototype.widgets = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {google.monitoring.dashboard.v1.RowLayout.IRow=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.RowLayout.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.Row.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {google.monitoring.dashboard.v1.RowLayout.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.weight); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.monitoring.dashboard.v1.Widget.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.RowLayout.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {google.monitoring.dashboard.v1.RowLayout.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.RowLayout.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.RowLayout.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weight = reader.int64(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.monitoring.dashboard.v1.Widget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.RowLayout.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) + return "weight: integer|Long expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Widget.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.RowLayout.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.RowLayout.Row) + return object; + var message = new $root.google.monitoring.dashboard.v1.RowLayout.Row(); + if (object.weight != null) + if ($util.Long) + (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; + else if (typeof object.weight === "string") + message.weight = parseInt(object.weight, 10); + else if (typeof object.weight === "number") + message.weight = object.weight; + else if (typeof object.weight === "object") + message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.monitoring.dashboard.v1.RowLayout.Row.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.RowLayout.Row.widgets: object expected"); + message.widgets[i] = $root.google.monitoring.dashboard.v1.Widget.fromObject(object.widgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {google.monitoring.dashboard.v1.RowLayout.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.weight = options.longs === String ? "0" : 0; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight === "number") + object.weight = options.longs === String ? String(message.weight) : message.weight; + else + object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.monitoring.dashboard.v1.Widget.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.RowLayout.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.RowLayout.Row"; + }; + + return Row; + })(); + + return RowLayout; + })(); + + v1.ColumnLayout = (function() { + + /** + * Properties of a ColumnLayout. + * @memberof google.monitoring.dashboard.v1 + * @interface IColumnLayout + * @property {Array.|null} [columns] ColumnLayout columns + */ + + /** + * Constructs a new ColumnLayout. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a ColumnLayout. + * @implements IColumnLayout + * @constructor + * @param {google.monitoring.dashboard.v1.IColumnLayout=} [properties] Properties to set + */ + function ColumnLayout(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnLayout columns. + * @member {Array.} columns + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @instance + */ + ColumnLayout.prototype.columns = $util.emptyArray; + + /** + * Creates a new ColumnLayout instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {google.monitoring.dashboard.v1.IColumnLayout=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.ColumnLayout} ColumnLayout instance + */ + ColumnLayout.create = function create(properties) { + return new ColumnLayout(properties); + }; + + /** + * Encodes the specified ColumnLayout message. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {google.monitoring.dashboard.v1.IColumnLayout} message ColumnLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnLayout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.monitoring.dashboard.v1.ColumnLayout.Column.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ColumnLayout message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {google.monitoring.dashboard.v1.IColumnLayout} message ColumnLayout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnLayout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnLayout message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.ColumnLayout} ColumnLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnLayout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.ColumnLayout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.monitoring.dashboard.v1.ColumnLayout.Column.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnLayout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.ColumnLayout} ColumnLayout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnLayout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnLayout message. + * @function verify + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnLayout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.ColumnLayout.Column.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a ColumnLayout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.ColumnLayout} ColumnLayout + */ + ColumnLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.ColumnLayout) + return object; + var message = new $root.google.monitoring.dashboard.v1.ColumnLayout(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.monitoring.dashboard.v1.ColumnLayout.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.ColumnLayout.columns: object expected"); + message.columns[i] = $root.google.monitoring.dashboard.v1.ColumnLayout.Column.fromObject(object.columns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ColumnLayout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {google.monitoring.dashboard.v1.ColumnLayout} message ColumnLayout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnLayout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.monitoring.dashboard.v1.ColumnLayout.Column.toObject(message.columns[j], options); + } + return object; + }; + + /** + * Converts this ColumnLayout to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @instance + * @returns {Object.} JSON object + */ + ColumnLayout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnLayout + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnLayout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.ColumnLayout"; + }; + + ColumnLayout.Column = (function() { + + /** + * Properties of a Column. + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @interface IColumn + * @property {number|Long|null} [weight] Column weight + * @property {Array.|null} [widgets] Column widgets + */ + + /** + * Constructs a new Column. + * @memberof google.monitoring.dashboard.v1.ColumnLayout + * @classdesc Represents a Column. + * @implements IColumn + * @constructor + * @param {google.monitoring.dashboard.v1.ColumnLayout.IColumn=} [properties] Properties to set + */ + function Column(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Column weight. + * @member {number|Long} weight + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @instance + */ + Column.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Column widgets. + * @member {Array.} widgets + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @instance + */ + Column.prototype.widgets = $util.emptyArray; + + /** + * Creates a new Column instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {google.monitoring.dashboard.v1.ColumnLayout.IColumn=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.ColumnLayout.Column} Column instance + */ + Column.create = function create(properties) { + return new Column(properties); + }; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.Column.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {google.monitoring.dashboard.v1.ColumnLayout.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.weight); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.monitoring.dashboard.v1.Widget.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ColumnLayout.Column.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {google.monitoring.dashboard.v1.ColumnLayout.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Column message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.ColumnLayout.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.ColumnLayout.Column(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weight = reader.int64(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.monitoring.dashboard.v1.Widget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.ColumnLayout.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Column message. + * @function verify + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Column.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) + return "weight: integer|Long expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Widget.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.ColumnLayout.Column} Column + */ + Column.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.ColumnLayout.Column) + return object; + var message = new $root.google.monitoring.dashboard.v1.ColumnLayout.Column(); + if (object.weight != null) + if ($util.Long) + (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; + else if (typeof object.weight === "string") + message.weight = parseInt(object.weight, 10); + else if (typeof object.weight === "number") + message.weight = object.weight; + else if (typeof object.weight === "object") + message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.monitoring.dashboard.v1.ColumnLayout.Column.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.ColumnLayout.Column.widgets: object expected"); + message.widgets[i] = $root.google.monitoring.dashboard.v1.Widget.fromObject(object.widgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {google.monitoring.dashboard.v1.ColumnLayout.Column} message Column + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Column.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.weight = options.longs === String ? "0" : 0; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight === "number") + object.weight = options.longs === String ? String(message.weight) : message.weight; + else + object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.monitoring.dashboard.v1.Widget.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this Column to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @instance + * @returns {Object.} JSON object + */ + Column.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Column + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.ColumnLayout.Column + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Column.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.ColumnLayout.Column"; + }; + + return Column; + })(); + + return ColumnLayout; + })(); + + v1.Widget = (function() { + + /** + * Properties of a Widget. + * @memberof google.monitoring.dashboard.v1 + * @interface IWidget + * @property {string|null} [title] Widget title + * @property {google.monitoring.dashboard.v1.IXyChart|null} [xyChart] Widget xyChart + * @property {google.monitoring.dashboard.v1.IScorecard|null} [scorecard] Widget scorecard + * @property {google.monitoring.dashboard.v1.IText|null} [text] Widget text + * @property {google.protobuf.IEmpty|null} [blank] Widget blank + * @property {google.monitoring.dashboard.v1.IAlertChart|null} [alertChart] Widget alertChart + * @property {google.monitoring.dashboard.v1.ITimeSeriesTable|null} [timeSeriesTable] Widget timeSeriesTable + * @property {google.monitoring.dashboard.v1.ICollapsibleGroup|null} [collapsibleGroup] Widget collapsibleGroup + * @property {google.monitoring.dashboard.v1.ILogsPanel|null} [logsPanel] Widget logsPanel + */ + + /** + * Constructs a new Widget. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a Widget. + * @implements IWidget + * @constructor + * @param {google.monitoring.dashboard.v1.IWidget=} [properties] Properties to set + */ + function Widget(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]]; + } + + /** + * Widget title. + * @member {string} title + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.title = ""; + + /** + * Widget xyChart. + * @member {google.monitoring.dashboard.v1.IXyChart|null|undefined} xyChart + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.xyChart = null; + + /** + * Widget scorecard. + * @member {google.monitoring.dashboard.v1.IScorecard|null|undefined} scorecard + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.scorecard = null; + + /** + * Widget text. + * @member {google.monitoring.dashboard.v1.IText|null|undefined} text + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.text = null; + + /** + * Widget blank. + * @member {google.protobuf.IEmpty|null|undefined} blank + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.blank = null; + + /** + * Widget alertChart. + * @member {google.monitoring.dashboard.v1.IAlertChart|null|undefined} alertChart + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.alertChart = null; + + /** + * Widget timeSeriesTable. + * @member {google.monitoring.dashboard.v1.ITimeSeriesTable|null|undefined} timeSeriesTable + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.timeSeriesTable = null; + + /** + * Widget collapsibleGroup. + * @member {google.monitoring.dashboard.v1.ICollapsibleGroup|null|undefined} collapsibleGroup + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.collapsibleGroup = null; + + /** + * Widget logsPanel. + * @member {google.monitoring.dashboard.v1.ILogsPanel|null|undefined} logsPanel + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Widget.prototype.logsPanel = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Widget content. + * @member {"xyChart"|"scorecard"|"text"|"blank"|"alertChart"|"timeSeriesTable"|"collapsibleGroup"|"logsPanel"|undefined} content + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + */ + Object.defineProperty(Widget.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["xyChart", "scorecard", "text", "blank", "alertChart", "timeSeriesTable", "collapsibleGroup", "logsPanel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Widget instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {google.monitoring.dashboard.v1.IWidget=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Widget} Widget instance + */ + Widget.create = function create(properties) { + return new Widget(properties); + }; + + /** + * Encodes the specified Widget message. Does not implicitly {@link google.monitoring.dashboard.v1.Widget.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {google.monitoring.dashboard.v1.IWidget} message Widget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.xyChart != null && Object.hasOwnProperty.call(message, "xyChart")) + $root.google.monitoring.dashboard.v1.XyChart.encode(message.xyChart, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.scorecard != null && Object.hasOwnProperty.call(message, "scorecard")) + $root.google.monitoring.dashboard.v1.Scorecard.encode(message.scorecard, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.monitoring.dashboard.v1.Text.encode(message.text, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.blank != null && Object.hasOwnProperty.call(message, "blank")) + $root.google.protobuf.Empty.encode(message.blank, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.alertChart != null && Object.hasOwnProperty.call(message, "alertChart")) + $root.google.monitoring.dashboard.v1.AlertChart.encode(message.alertChart, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeSeriesTable != null && Object.hasOwnProperty.call(message, "timeSeriesTable")) + $root.google.monitoring.dashboard.v1.TimeSeriesTable.encode(message.timeSeriesTable, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.collapsibleGroup != null && Object.hasOwnProperty.call(message, "collapsibleGroup")) + $root.google.monitoring.dashboard.v1.CollapsibleGroup.encode(message.collapsibleGroup, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.logsPanel != null && Object.hasOwnProperty.call(message, "logsPanel")) + $root.google.monitoring.dashboard.v1.LogsPanel.encode(message.logsPanel, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Widget message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Widget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {google.monitoring.dashboard.v1.IWidget} message Widget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Widget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Widget message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Widget} Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Widget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.xyChart = $root.google.monitoring.dashboard.v1.XyChart.decode(reader, reader.uint32()); + break; + } + case 3: { + message.scorecard = $root.google.monitoring.dashboard.v1.Scorecard.decode(reader, reader.uint32()); + break; + } + case 4: { + message.text = $root.google.monitoring.dashboard.v1.Text.decode(reader, reader.uint32()); + break; + } + case 5: { + message.blank = $root.google.protobuf.Empty.decode(reader, reader.uint32()); + break; + } + case 7: { + message.alertChart = $root.google.monitoring.dashboard.v1.AlertChart.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeSeriesTable = $root.google.monitoring.dashboard.v1.TimeSeriesTable.decode(reader, reader.uint32()); + break; + } + case 9: { + message.collapsibleGroup = $root.google.monitoring.dashboard.v1.CollapsibleGroup.decode(reader, reader.uint32()); + break; + } + case 10: { + message.logsPanel = $root.google.monitoring.dashboard.v1.LogsPanel.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Widget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Widget} Widget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Widget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Widget message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Widget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.xyChart != null && message.hasOwnProperty("xyChart")) { + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.XyChart.verify(message.xyChart); + if (error) + return "xyChart." + error; + } + } + if (message.scorecard != null && message.hasOwnProperty("scorecard")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.Scorecard.verify(message.scorecard); + if (error) + return "scorecard." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.Text.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.blank != null && message.hasOwnProperty("blank")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.protobuf.Empty.verify(message.blank); + if (error) + return "blank." + error; + } + } + if (message.alertChart != null && message.hasOwnProperty("alertChart")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.AlertChart.verify(message.alertChart); + if (error) + return "alertChart." + error; + } + } + if (message.timeSeriesTable != null && message.hasOwnProperty("timeSeriesTable")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesTable.verify(message.timeSeriesTable); + if (error) + return "timeSeriesTable." + error; + } + } + if (message.collapsibleGroup != null && message.hasOwnProperty("collapsibleGroup")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.CollapsibleGroup.verify(message.collapsibleGroup); + if (error) + return "collapsibleGroup." + error; + } + } + if (message.logsPanel != null && message.hasOwnProperty("logsPanel")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.monitoring.dashboard.v1.LogsPanel.verify(message.logsPanel); + if (error) + return "logsPanel." + error; + } + } + return null; + }; + + /** + * Creates a Widget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Widget} Widget + */ + Widget.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Widget) + return object; + var message = new $root.google.monitoring.dashboard.v1.Widget(); + if (object.title != null) + message.title = String(object.title); + if (object.xyChart != null) { + if (typeof object.xyChart !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.xyChart: object expected"); + message.xyChart = $root.google.monitoring.dashboard.v1.XyChart.fromObject(object.xyChart); + } + if (object.scorecard != null) { + if (typeof object.scorecard !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.scorecard: object expected"); + message.scorecard = $root.google.monitoring.dashboard.v1.Scorecard.fromObject(object.scorecard); + } + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.text: object expected"); + message.text = $root.google.monitoring.dashboard.v1.Text.fromObject(object.text); + } + if (object.blank != null) { + if (typeof object.blank !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.blank: object expected"); + message.blank = $root.google.protobuf.Empty.fromObject(object.blank); + } + if (object.alertChart != null) { + if (typeof object.alertChart !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.alertChart: object expected"); + message.alertChart = $root.google.monitoring.dashboard.v1.AlertChart.fromObject(object.alertChart); + } + if (object.timeSeriesTable != null) { + if (typeof object.timeSeriesTable !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.timeSeriesTable: object expected"); + message.timeSeriesTable = $root.google.monitoring.dashboard.v1.TimeSeriesTable.fromObject(object.timeSeriesTable); + } + if (object.collapsibleGroup != null) { + if (typeof object.collapsibleGroup !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.collapsibleGroup: object expected"); + message.collapsibleGroup = $root.google.monitoring.dashboard.v1.CollapsibleGroup.fromObject(object.collapsibleGroup); + } + if (object.logsPanel != null) { + if (typeof object.logsPanel !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Widget.logsPanel: object expected"); + message.logsPanel = $root.google.monitoring.dashboard.v1.LogsPanel.fromObject(object.logsPanel); + } + return message; + }; + + /** + * Creates a plain object from a Widget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {google.monitoring.dashboard.v1.Widget} message Widget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Widget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.xyChart != null && message.hasOwnProperty("xyChart")) { + object.xyChart = $root.google.monitoring.dashboard.v1.XyChart.toObject(message.xyChart, options); + if (options.oneofs) + object.content = "xyChart"; + } + if (message.scorecard != null && message.hasOwnProperty("scorecard")) { + object.scorecard = $root.google.monitoring.dashboard.v1.Scorecard.toObject(message.scorecard, options); + if (options.oneofs) + object.content = "scorecard"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.monitoring.dashboard.v1.Text.toObject(message.text, options); + if (options.oneofs) + object.content = "text"; + } + if (message.blank != null && message.hasOwnProperty("blank")) { + object.blank = $root.google.protobuf.Empty.toObject(message.blank, options); + if (options.oneofs) + object.content = "blank"; + } + if (message.alertChart != null && message.hasOwnProperty("alertChart")) { + object.alertChart = $root.google.monitoring.dashboard.v1.AlertChart.toObject(message.alertChart, options); + if (options.oneofs) + object.content = "alertChart"; + } + if (message.timeSeriesTable != null && message.hasOwnProperty("timeSeriesTable")) { + object.timeSeriesTable = $root.google.monitoring.dashboard.v1.TimeSeriesTable.toObject(message.timeSeriesTable, options); + if (options.oneofs) + object.content = "timeSeriesTable"; + } + if (message.collapsibleGroup != null && message.hasOwnProperty("collapsibleGroup")) { + object.collapsibleGroup = $root.google.monitoring.dashboard.v1.CollapsibleGroup.toObject(message.collapsibleGroup, options); + if (options.oneofs) + object.content = "collapsibleGroup"; + } + if (message.logsPanel != null && message.hasOwnProperty("logsPanel")) { + object.logsPanel = $root.google.monitoring.dashboard.v1.LogsPanel.toObject(message.logsPanel, options); + if (options.oneofs) + object.content = "logsPanel"; + } + return object; + }; + + /** + * Converts this Widget to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Widget + * @instance + * @returns {Object.} JSON object + */ + Widget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Widget + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Widget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Widget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Widget"; + }; + + return Widget; + })(); + + v1.LogsPanel = (function() { + + /** + * Properties of a LogsPanel. + * @memberof google.monitoring.dashboard.v1 + * @interface ILogsPanel + * @property {string|null} [filter] LogsPanel filter + * @property {Array.|null} [resourceNames] LogsPanel resourceNames + */ + + /** + * Constructs a new LogsPanel. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a LogsPanel. + * @implements ILogsPanel + * @constructor + * @param {google.monitoring.dashboard.v1.ILogsPanel=} [properties] Properties to set + */ + function LogsPanel(properties) { + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogsPanel filter. + * @member {string} filter + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @instance + */ + LogsPanel.prototype.filter = ""; + + /** + * LogsPanel resourceNames. + * @member {Array.} resourceNames + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @instance + */ + LogsPanel.prototype.resourceNames = $util.emptyArray; + + /** + * Creates a new LogsPanel instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {google.monitoring.dashboard.v1.ILogsPanel=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.LogsPanel} LogsPanel instance + */ + LogsPanel.create = function create(properties) { + return new LogsPanel(properties); + }; + + /** + * Encodes the specified LogsPanel message. Does not implicitly {@link google.monitoring.dashboard.v1.LogsPanel.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {google.monitoring.dashboard.v1.ILogsPanel} message LogsPanel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPanel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceNames[i]); + return writer; + }; + + /** + * Encodes the specified LogsPanel message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.LogsPanel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {google.monitoring.dashboard.v1.ILogsPanel} message LogsPanel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPanel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogsPanel message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.LogsPanel} LogsPanel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPanel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.LogsPanel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogsPanel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.LogsPanel} LogsPanel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPanel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogsPanel message. + * @function verify + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsPanel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) + if (!$util.isString(message.resourceNames[i])) + return "resourceNames: string[] expected"; + } + return null; + }; + + /** + * Creates a LogsPanel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.LogsPanel} LogsPanel + */ + LogsPanel.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.LogsPanel) + return object; + var message = new $root.google.monitoring.dashboard.v1.LogsPanel(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.monitoring.dashboard.v1.LogsPanel.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) + message.resourceNames[i] = String(object.resourceNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a LogsPanel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {google.monitoring.dashboard.v1.LogsPanel} message LogsPanel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsPanel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceNames = []; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = message.resourceNames[j]; + } + return object; + }; + + /** + * Converts this LogsPanel to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @instance + * @returns {Object.} JSON object + */ + LogsPanel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogsPanel + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.LogsPanel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsPanel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.LogsPanel"; + }; + + return LogsPanel; + })(); + + v1.Scorecard = (function() { + + /** + * Properties of a Scorecard. + * @memberof google.monitoring.dashboard.v1 + * @interface IScorecard + * @property {google.monitoring.dashboard.v1.ITimeSeriesQuery|null} [timeSeriesQuery] Scorecard timeSeriesQuery + * @property {google.monitoring.dashboard.v1.Scorecard.IGaugeView|null} [gaugeView] Scorecard gaugeView + * @property {google.monitoring.dashboard.v1.Scorecard.ISparkChartView|null} [sparkChartView] Scorecard sparkChartView + * @property {Array.|null} [thresholds] Scorecard thresholds + */ + + /** + * Constructs a new Scorecard. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a Scorecard. + * @implements IScorecard + * @constructor + * @param {google.monitoring.dashboard.v1.IScorecard=} [properties] Properties to set + */ + function Scorecard(properties) { + this.thresholds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scorecard timeSeriesQuery. + * @member {google.monitoring.dashboard.v1.ITimeSeriesQuery|null|undefined} timeSeriesQuery + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + */ + Scorecard.prototype.timeSeriesQuery = null; + + /** + * Scorecard gaugeView. + * @member {google.monitoring.dashboard.v1.Scorecard.IGaugeView|null|undefined} gaugeView + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + */ + Scorecard.prototype.gaugeView = null; + + /** + * Scorecard sparkChartView. + * @member {google.monitoring.dashboard.v1.Scorecard.ISparkChartView|null|undefined} sparkChartView + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + */ + Scorecard.prototype.sparkChartView = null; + + /** + * Scorecard thresholds. + * @member {Array.} thresholds + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + */ + Scorecard.prototype.thresholds = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Scorecard dataView. + * @member {"gaugeView"|"sparkChartView"|undefined} dataView + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + */ + Object.defineProperty(Scorecard.prototype, "dataView", { + get: $util.oneOfGetter($oneOfFields = ["gaugeView", "sparkChartView"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Scorecard instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {google.monitoring.dashboard.v1.IScorecard=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Scorecard} Scorecard instance + */ + Scorecard.create = function create(properties) { + return new Scorecard(properties); + }; + + /** + * Encodes the specified Scorecard message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {google.monitoring.dashboard.v1.IScorecard} message Scorecard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scorecard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSeriesQuery != null && Object.hasOwnProperty.call(message, "timeSeriesQuery")) + $root.google.monitoring.dashboard.v1.TimeSeriesQuery.encode(message.timeSeriesQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gaugeView != null && Object.hasOwnProperty.call(message, "gaugeView")) + $root.google.monitoring.dashboard.v1.Scorecard.GaugeView.encode(message.gaugeView, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sparkChartView != null && Object.hasOwnProperty.call(message, "sparkChartView")) + $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView.encode(message.sparkChartView, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.thresholds != null && message.thresholds.length) + for (var i = 0; i < message.thresholds.length; ++i) + $root.google.monitoring.dashboard.v1.Threshold.encode(message.thresholds[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Scorecard message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {google.monitoring.dashboard.v1.IScorecard} message Scorecard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scorecard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scorecard message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Scorecard} Scorecard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scorecard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Scorecard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.decode(reader, reader.uint32()); + break; + } + case 4: { + message.gaugeView = $root.google.monitoring.dashboard.v1.Scorecard.GaugeView.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sparkChartView = $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.thresholds && message.thresholds.length)) + message.thresholds = []; + message.thresholds.push($root.google.monitoring.dashboard.v1.Threshold.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scorecard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Scorecard} Scorecard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scorecard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scorecard message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scorecard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.verify(message.timeSeriesQuery); + if (error) + return "timeSeriesQuery." + error; + } + if (message.gaugeView != null && message.hasOwnProperty("gaugeView")) { + properties.dataView = 1; + { + var error = $root.google.monitoring.dashboard.v1.Scorecard.GaugeView.verify(message.gaugeView); + if (error) + return "gaugeView." + error; + } + } + if (message.sparkChartView != null && message.hasOwnProperty("sparkChartView")) { + if (properties.dataView === 1) + return "dataView: multiple values"; + properties.dataView = 1; + { + var error = $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView.verify(message.sparkChartView); + if (error) + return "sparkChartView." + error; + } + } + if (message.thresholds != null && message.hasOwnProperty("thresholds")) { + if (!Array.isArray(message.thresholds)) + return "thresholds: array expected"; + for (var i = 0; i < message.thresholds.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Threshold.verify(message.thresholds[i]); + if (error) + return "thresholds." + error; + } + } + return null; + }; + + /** + * Creates a Scorecard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Scorecard} Scorecard + */ + Scorecard.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Scorecard) + return object; + var message = new $root.google.monitoring.dashboard.v1.Scorecard(); + if (object.timeSeriesQuery != null) { + if (typeof object.timeSeriesQuery !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.timeSeriesQuery: object expected"); + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.fromObject(object.timeSeriesQuery); + } + if (object.gaugeView != null) { + if (typeof object.gaugeView !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.gaugeView: object expected"); + message.gaugeView = $root.google.monitoring.dashboard.v1.Scorecard.GaugeView.fromObject(object.gaugeView); + } + if (object.sparkChartView != null) { + if (typeof object.sparkChartView !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.sparkChartView: object expected"); + message.sparkChartView = $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView.fromObject(object.sparkChartView); + } + if (object.thresholds) { + if (!Array.isArray(object.thresholds)) + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.thresholds: array expected"); + message.thresholds = []; + for (var i = 0; i < object.thresholds.length; ++i) { + if (typeof object.thresholds[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.thresholds: object expected"); + message.thresholds[i] = $root.google.monitoring.dashboard.v1.Threshold.fromObject(object.thresholds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Scorecard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {google.monitoring.dashboard.v1.Scorecard} message Scorecard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scorecard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.thresholds = []; + if (options.defaults) + object.timeSeriesQuery = null; + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) + object.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.toObject(message.timeSeriesQuery, options); + if (message.gaugeView != null && message.hasOwnProperty("gaugeView")) { + object.gaugeView = $root.google.monitoring.dashboard.v1.Scorecard.GaugeView.toObject(message.gaugeView, options); + if (options.oneofs) + object.dataView = "gaugeView"; + } + if (message.sparkChartView != null && message.hasOwnProperty("sparkChartView")) { + object.sparkChartView = $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView.toObject(message.sparkChartView, options); + if (options.oneofs) + object.dataView = "sparkChartView"; + } + if (message.thresholds && message.thresholds.length) { + object.thresholds = []; + for (var j = 0; j < message.thresholds.length; ++j) + object.thresholds[j] = $root.google.monitoring.dashboard.v1.Threshold.toObject(message.thresholds[j], options); + } + return object; + }; + + /** + * Converts this Scorecard to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Scorecard + * @instance + * @returns {Object.} JSON object + */ + Scorecard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scorecard + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Scorecard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scorecard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Scorecard"; + }; + + Scorecard.GaugeView = (function() { + + /** + * Properties of a GaugeView. + * @memberof google.monitoring.dashboard.v1.Scorecard + * @interface IGaugeView + * @property {number|null} [lowerBound] GaugeView lowerBound + * @property {number|null} [upperBound] GaugeView upperBound + */ + + /** + * Constructs a new GaugeView. + * @memberof google.monitoring.dashboard.v1.Scorecard + * @classdesc Represents a GaugeView. + * @implements IGaugeView + * @constructor + * @param {google.monitoring.dashboard.v1.Scorecard.IGaugeView=} [properties] Properties to set + */ + function GaugeView(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]]; + } + + /** + * GaugeView lowerBound. + * @member {number} lowerBound + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @instance + */ + GaugeView.prototype.lowerBound = 0; + + /** + * GaugeView upperBound. + * @member {number} upperBound + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @instance + */ + GaugeView.prototype.upperBound = 0; + + /** + * Creates a new GaugeView instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.IGaugeView=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Scorecard.GaugeView} GaugeView instance + */ + GaugeView.create = function create(properties) { + return new GaugeView(properties); + }; + + /** + * Encodes the specified GaugeView message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.GaugeView.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.IGaugeView} message GaugeView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GaugeView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.lowerBound); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.upperBound); + return writer; + }; + + /** + * Encodes the specified GaugeView message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.GaugeView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.IGaugeView} message GaugeView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GaugeView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GaugeView message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Scorecard.GaugeView} GaugeView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GaugeView.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Scorecard.GaugeView(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lowerBound = reader.double(); + break; + } + case 2: { + message.upperBound = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GaugeView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Scorecard.GaugeView} GaugeView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GaugeView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GaugeView message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GaugeView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (typeof message.lowerBound !== "number") + return "lowerBound: number expected"; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (typeof message.upperBound !== "number") + return "upperBound: number expected"; + return null; + }; + + /** + * Creates a GaugeView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Scorecard.GaugeView} GaugeView + */ + GaugeView.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Scorecard.GaugeView) + return object; + var message = new $root.google.monitoring.dashboard.v1.Scorecard.GaugeView(); + if (object.lowerBound != null) + message.lowerBound = Number(object.lowerBound); + if (object.upperBound != null) + message.upperBound = Number(object.upperBound); + return message; + }; + + /** + * Creates a plain object from a GaugeView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.GaugeView} message GaugeView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GaugeView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lowerBound = 0; + object.upperBound = 0; + } + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + object.lowerBound = options.json && !isFinite(message.lowerBound) ? String(message.lowerBound) : message.lowerBound; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + object.upperBound = options.json && !isFinite(message.upperBound) ? String(message.upperBound) : message.upperBound; + return object; + }; + + /** + * Converts this GaugeView to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @instance + * @returns {Object.} JSON object + */ + GaugeView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GaugeView + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Scorecard.GaugeView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GaugeView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Scorecard.GaugeView"; + }; + + return GaugeView; + })(); + + Scorecard.SparkChartView = (function() { + + /** + * Properties of a SparkChartView. + * @memberof google.monitoring.dashboard.v1.Scorecard + * @interface ISparkChartView + * @property {google.monitoring.dashboard.v1.SparkChartType|null} [sparkChartType] SparkChartView sparkChartType + * @property {google.protobuf.IDuration|null} [minAlignmentPeriod] SparkChartView minAlignmentPeriod + */ + + /** + * Constructs a new SparkChartView. + * @memberof google.monitoring.dashboard.v1.Scorecard + * @classdesc Represents a SparkChartView. + * @implements ISparkChartView + * @constructor + * @param {google.monitoring.dashboard.v1.Scorecard.ISparkChartView=} [properties] Properties to set + */ + function SparkChartView(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]]; + } + + /** + * SparkChartView sparkChartType. + * @member {google.monitoring.dashboard.v1.SparkChartType} sparkChartType + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @instance + */ + SparkChartView.prototype.sparkChartType = 0; + + /** + * SparkChartView minAlignmentPeriod. + * @member {google.protobuf.IDuration|null|undefined} minAlignmentPeriod + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @instance + */ + SparkChartView.prototype.minAlignmentPeriod = null; + + /** + * Creates a new SparkChartView instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.ISparkChartView=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Scorecard.SparkChartView} SparkChartView instance + */ + SparkChartView.create = function create(properties) { + return new SparkChartView(properties); + }; + + /** + * Encodes the specified SparkChartView message. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.SparkChartView.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.ISparkChartView} message SparkChartView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkChartView.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sparkChartType != null && Object.hasOwnProperty.call(message, "sparkChartType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sparkChartType); + if (message.minAlignmentPeriod != null && Object.hasOwnProperty.call(message, "minAlignmentPeriod")) + $root.google.protobuf.Duration.encode(message.minAlignmentPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SparkChartView message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Scorecard.SparkChartView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.ISparkChartView} message SparkChartView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkChartView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkChartView message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Scorecard.SparkChartView} SparkChartView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkChartView.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sparkChartType = reader.int32(); + break; + } + case 2: { + message.minAlignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkChartView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Scorecard.SparkChartView} SparkChartView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkChartView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkChartView message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkChartView.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sparkChartType != null && message.hasOwnProperty("sparkChartType")) + switch (message.sparkChartType) { + default: + return "sparkChartType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.minAlignmentPeriod); + if (error) + return "minAlignmentPeriod." + error; + } + return null; + }; + + /** + * Creates a SparkChartView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Scorecard.SparkChartView} SparkChartView + */ + SparkChartView.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView) + return object; + var message = new $root.google.monitoring.dashboard.v1.Scorecard.SparkChartView(); + switch (object.sparkChartType) { + case "SPARK_CHART_TYPE_UNSPECIFIED": + case 0: + message.sparkChartType = 0; + break; + case "SPARK_LINE": + case 1: + message.sparkChartType = 1; + break; + case "SPARK_BAR": + case 2: + message.sparkChartType = 2; + break; + } + if (object.minAlignmentPeriod != null) { + if (typeof object.minAlignmentPeriod !== "object") + throw TypeError(".google.monitoring.dashboard.v1.Scorecard.SparkChartView.minAlignmentPeriod: object expected"); + message.minAlignmentPeriod = $root.google.protobuf.Duration.fromObject(object.minAlignmentPeriod); + } + return message; + }; + + /** + * Creates a plain object from a SparkChartView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {google.monitoring.dashboard.v1.Scorecard.SparkChartView} message SparkChartView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkChartView.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sparkChartType = options.enums === String ? "SPARK_CHART_TYPE_UNSPECIFIED" : 0; + object.minAlignmentPeriod = null; + } + if (message.sparkChartType != null && message.hasOwnProperty("sparkChartType")) + object.sparkChartType = options.enums === String ? $root.google.monitoring.dashboard.v1.SparkChartType[message.sparkChartType] : message.sparkChartType; + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) + object.minAlignmentPeriod = $root.google.protobuf.Duration.toObject(message.minAlignmentPeriod, options); + return object; + }; + + /** + * Converts this SparkChartView to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @instance + * @returns {Object.} JSON object + */ + SparkChartView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkChartView + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Scorecard.SparkChartView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkChartView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Scorecard.SparkChartView"; + }; + + return SparkChartView; + })(); + + return Scorecard; + })(); + + v1.TimeSeriesQuery = (function() { + + /** + * Properties of a TimeSeriesQuery. + * @memberof google.monitoring.dashboard.v1 + * @interface ITimeSeriesQuery + * @property {google.monitoring.dashboard.v1.ITimeSeriesFilter|null} [timeSeriesFilter] TimeSeriesQuery timeSeriesFilter + * @property {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio|null} [timeSeriesFilterRatio] TimeSeriesQuery timeSeriesFilterRatio + * @property {string|null} [timeSeriesQueryLanguage] TimeSeriesQuery timeSeriesQueryLanguage + * @property {string|null} [unitOverride] TimeSeriesQuery unitOverride + */ + + /** + * Constructs a new TimeSeriesQuery. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a TimeSeriesQuery. + * @implements ITimeSeriesQuery + * @constructor + * @param {google.monitoring.dashboard.v1.ITimeSeriesQuery=} [properties] Properties to set + */ + function TimeSeriesQuery(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]]; + } + + /** + * TimeSeriesQuery timeSeriesFilter. + * @member {google.monitoring.dashboard.v1.ITimeSeriesFilter|null|undefined} timeSeriesFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + */ + TimeSeriesQuery.prototype.timeSeriesFilter = null; + + /** + * TimeSeriesQuery timeSeriesFilterRatio. + * @member {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio|null|undefined} timeSeriesFilterRatio + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + */ + TimeSeriesQuery.prototype.timeSeriesFilterRatio = null; + + /** + * TimeSeriesQuery timeSeriesQueryLanguage. + * @member {string|null|undefined} timeSeriesQueryLanguage + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + */ + TimeSeriesQuery.prototype.timeSeriesQueryLanguage = null; + + /** + * TimeSeriesQuery unitOverride. + * @member {string} unitOverride + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + */ + TimeSeriesQuery.prototype.unitOverride = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimeSeriesQuery source. + * @member {"timeSeriesFilter"|"timeSeriesFilterRatio"|"timeSeriesQueryLanguage"|undefined} source + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + */ + Object.defineProperty(TimeSeriesQuery.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["timeSeriesFilter", "timeSeriesFilterRatio", "timeSeriesQueryLanguage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimeSeriesQuery instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesQuery=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesQuery} TimeSeriesQuery instance + */ + TimeSeriesQuery.create = function create(properties) { + return new TimeSeriesQuery(properties); + }; + + /** + * Encodes the specified TimeSeriesQuery message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesQuery.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesQuery} message TimeSeriesQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSeriesFilter != null && Object.hasOwnProperty.call(message, "timeSeriesFilter")) + $root.google.monitoring.dashboard.v1.TimeSeriesFilter.encode(message.timeSeriesFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeSeriesFilterRatio != null && Object.hasOwnProperty.call(message, "timeSeriesFilterRatio")) + $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.encode(message.timeSeriesFilterRatio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeSeriesQueryLanguage != null && Object.hasOwnProperty.call(message, "timeSeriesQueryLanguage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSeriesQueryLanguage); + if (message.unitOverride != null && Object.hasOwnProperty.call(message, "unitOverride")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unitOverride); + return writer; + }; + + /** + * Encodes the specified TimeSeriesQuery message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesQuery} message TimeSeriesQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesQuery message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesQuery} TimeSeriesQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeSeriesFilter = $root.google.monitoring.dashboard.v1.TimeSeriesFilter.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeSeriesFilterRatio = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timeSeriesQueryLanguage = reader.string(); + break; + } + case 5: { + message.unitOverride = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesQuery} TimeSeriesQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesQuery message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesQuery.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.timeSeriesFilter != null && message.hasOwnProperty("timeSeriesFilter")) { + properties.source = 1; + { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesFilter.verify(message.timeSeriesFilter); + if (error) + return "timeSeriesFilter." + error; + } + } + if (message.timeSeriesFilterRatio != null && message.hasOwnProperty("timeSeriesFilterRatio")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.verify(message.timeSeriesFilterRatio); + if (error) + return "timeSeriesFilterRatio." + error; + } + } + if (message.timeSeriesQueryLanguage != null && message.hasOwnProperty("timeSeriesQueryLanguage")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.timeSeriesQueryLanguage)) + return "timeSeriesQueryLanguage: string expected"; + } + if (message.unitOverride != null && message.hasOwnProperty("unitOverride")) + if (!$util.isString(message.unitOverride)) + return "unitOverride: string expected"; + return null; + }; + + /** + * Creates a TimeSeriesQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesQuery} TimeSeriesQuery + */ + TimeSeriesQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesQuery) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesQuery(); + if (object.timeSeriesFilter != null) { + if (typeof object.timeSeriesFilter !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesQuery.timeSeriesFilter: object expected"); + message.timeSeriesFilter = $root.google.monitoring.dashboard.v1.TimeSeriesFilter.fromObject(object.timeSeriesFilter); + } + if (object.timeSeriesFilterRatio != null) { + if (typeof object.timeSeriesFilterRatio !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesQuery.timeSeriesFilterRatio: object expected"); + message.timeSeriesFilterRatio = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.fromObject(object.timeSeriesFilterRatio); + } + if (object.timeSeriesQueryLanguage != null) + message.timeSeriesQueryLanguage = String(object.timeSeriesQueryLanguage); + if (object.unitOverride != null) + message.unitOverride = String(object.unitOverride); + return message; + }; + + /** + * Creates a plain object from a TimeSeriesQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesQuery} message TimeSeriesQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.unitOverride = ""; + if (message.timeSeriesFilter != null && message.hasOwnProperty("timeSeriesFilter")) { + object.timeSeriesFilter = $root.google.monitoring.dashboard.v1.TimeSeriesFilter.toObject(message.timeSeriesFilter, options); + if (options.oneofs) + object.source = "timeSeriesFilter"; + } + if (message.timeSeriesFilterRatio != null && message.hasOwnProperty("timeSeriesFilterRatio")) { + object.timeSeriesFilterRatio = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.toObject(message.timeSeriesFilterRatio, options); + if (options.oneofs) + object.source = "timeSeriesFilterRatio"; + } + if (message.timeSeriesQueryLanguage != null && message.hasOwnProperty("timeSeriesQueryLanguage")) { + object.timeSeriesQueryLanguage = message.timeSeriesQueryLanguage; + if (options.oneofs) + object.source = "timeSeriesQueryLanguage"; + } + if (message.unitOverride != null && message.hasOwnProperty("unitOverride")) + object.unitOverride = message.unitOverride; + return object; + }; + + /** + * Converts this TimeSeriesQuery to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesQuery + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesQuery"; + }; + + return TimeSeriesQuery; + })(); + + v1.TimeSeriesFilter = (function() { + + /** + * Properties of a TimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @interface ITimeSeriesFilter + * @property {string|null} [filter] TimeSeriesFilter filter + * @property {google.monitoring.dashboard.v1.IAggregation|null} [aggregation] TimeSeriesFilter aggregation + * @property {google.monitoring.dashboard.v1.IAggregation|null} [secondaryAggregation] TimeSeriesFilter secondaryAggregation + * @property {google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null} [pickTimeSeriesFilter] TimeSeriesFilter pickTimeSeriesFilter + * @property {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null} [statisticalTimeSeriesFilter] TimeSeriesFilter statisticalTimeSeriesFilter + */ + + /** + * Constructs a new TimeSeriesFilter. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a TimeSeriesFilter. + * @implements ITimeSeriesFilter + * @constructor + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilter=} [properties] Properties to set + */ + function TimeSeriesFilter(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]]; + } + + /** + * TimeSeriesFilter filter. + * @member {string} filter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + TimeSeriesFilter.prototype.filter = ""; + + /** + * TimeSeriesFilter aggregation. + * @member {google.monitoring.dashboard.v1.IAggregation|null|undefined} aggregation + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + TimeSeriesFilter.prototype.aggregation = null; + + /** + * TimeSeriesFilter secondaryAggregation. + * @member {google.monitoring.dashboard.v1.IAggregation|null|undefined} secondaryAggregation + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + TimeSeriesFilter.prototype.secondaryAggregation = null; + + /** + * TimeSeriesFilter pickTimeSeriesFilter. + * @member {google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null|undefined} pickTimeSeriesFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + TimeSeriesFilter.prototype.pickTimeSeriesFilter = null; + + /** + * TimeSeriesFilter statisticalTimeSeriesFilter. + * @member {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null|undefined} statisticalTimeSeriesFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + TimeSeriesFilter.prototype.statisticalTimeSeriesFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimeSeriesFilter outputFilter. + * @member {"pickTimeSeriesFilter"|"statisticalTimeSeriesFilter"|undefined} outputFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + */ + Object.defineProperty(TimeSeriesFilter.prototype, "outputFilter", { + get: $util.oneOfGetter($oneOfFields = ["pickTimeSeriesFilter", "statisticalTimeSeriesFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimeSeriesFilter instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilter=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilter} TimeSeriesFilter instance + */ + TimeSeriesFilter.create = function create(properties) { + return new TimeSeriesFilter(properties); + }; + + /** + * Encodes the specified TimeSeriesFilter message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilter.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilter} message TimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.aggregation != null && Object.hasOwnProperty.call(message, "aggregation")) + $root.google.monitoring.dashboard.v1.Aggregation.encode(message.aggregation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.secondaryAggregation != null && Object.hasOwnProperty.call(message, "secondaryAggregation")) + $root.google.monitoring.dashboard.v1.Aggregation.encode(message.secondaryAggregation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pickTimeSeriesFilter != null && Object.hasOwnProperty.call(message, "pickTimeSeriesFilter")) + $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.encode(message.pickTimeSeriesFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.statisticalTimeSeriesFilter != null && Object.hasOwnProperty.call(message, "statisticalTimeSeriesFilter")) + $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.encode(message.statisticalTimeSeriesFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSeriesFilter message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilter} message TimeSeriesFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesFilter message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilter} TimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilter} TimeSeriesFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesFilter message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.aggregation != null && message.hasOwnProperty("aggregation")) { + var error = $root.google.monitoring.dashboard.v1.Aggregation.verify(message.aggregation); + if (error) + return "aggregation." + error; + } + if (message.secondaryAggregation != null && message.hasOwnProperty("secondaryAggregation")) { + var error = $root.google.monitoring.dashboard.v1.Aggregation.verify(message.secondaryAggregation); + if (error) + return "secondaryAggregation." + error; + } + if (message.pickTimeSeriesFilter != null && message.hasOwnProperty("pickTimeSeriesFilter")) { + properties.outputFilter = 1; + { + var error = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify(message.pickTimeSeriesFilter); + if (error) + return "pickTimeSeriesFilter." + error; + } + } + if (message.statisticalTimeSeriesFilter != null && message.hasOwnProperty("statisticalTimeSeriesFilter")) { + if (properties.outputFilter === 1) + return "outputFilter: multiple values"; + properties.outputFilter = 1; + { + var error = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify(message.statisticalTimeSeriesFilter); + if (error) + return "statisticalTimeSeriesFilter." + error; + } + } + return null; + }; + + /** + * Creates a TimeSeriesFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilter} TimeSeriesFilter + */ + TimeSeriesFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesFilter) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilter(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.aggregation != null) { + if (typeof object.aggregation !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilter.aggregation: object expected"); + message.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.fromObject(object.aggregation); + } + if (object.secondaryAggregation != null) { + if (typeof object.secondaryAggregation !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilter.secondaryAggregation: object expected"); + message.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.fromObject(object.secondaryAggregation); + } + if (object.pickTimeSeriesFilter != null) { + if (typeof object.pickTimeSeriesFilter !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilter.pickTimeSeriesFilter: object expected"); + message.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.fromObject(object.pickTimeSeriesFilter); + } + if (object.statisticalTimeSeriesFilter != null) { + if (typeof object.statisticalTimeSeriesFilter !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilter.statisticalTimeSeriesFilter: object expected"); + message.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.fromObject(object.statisticalTimeSeriesFilter); + } + return message; + }; + + /** + * Creates a plain object from a TimeSeriesFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilter} message TimeSeriesFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.aggregation = null; + object.secondaryAggregation = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.aggregation != null && message.hasOwnProperty("aggregation")) + object.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.toObject(message.aggregation, options); + if (message.secondaryAggregation != null && message.hasOwnProperty("secondaryAggregation")) + object.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.toObject(message.secondaryAggregation, options); + if (message.pickTimeSeriesFilter != null && message.hasOwnProperty("pickTimeSeriesFilter")) { + object.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.toObject(message.pickTimeSeriesFilter, options); + if (options.oneofs) + object.outputFilter = "pickTimeSeriesFilter"; + } + if (message.statisticalTimeSeriesFilter != null && message.hasOwnProperty("statisticalTimeSeriesFilter")) { + object.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.toObject(message.statisticalTimeSeriesFilter, options); + if (options.oneofs) + object.outputFilter = "statisticalTimeSeriesFilter"; + } + return object; + }; + + /** + * Converts this TimeSeriesFilter to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesFilter + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesFilter"; + }; + + return TimeSeriesFilter; + })(); + + v1.TimeSeriesFilterRatio = (function() { + + /** + * Properties of a TimeSeriesFilterRatio. + * @memberof google.monitoring.dashboard.v1 + * @interface ITimeSeriesFilterRatio + * @property {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null} [numerator] TimeSeriesFilterRatio numerator + * @property {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null} [denominator] TimeSeriesFilterRatio denominator + * @property {google.monitoring.dashboard.v1.IAggregation|null} [secondaryAggregation] TimeSeriesFilterRatio secondaryAggregation + * @property {google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null} [pickTimeSeriesFilter] TimeSeriesFilterRatio pickTimeSeriesFilter + * @property {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null} [statisticalTimeSeriesFilter] TimeSeriesFilterRatio statisticalTimeSeriesFilter + */ + + /** + * Constructs a new TimeSeriesFilterRatio. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a TimeSeriesFilterRatio. + * @implements ITimeSeriesFilterRatio + * @constructor + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio=} [properties] Properties to set + */ + function TimeSeriesFilterRatio(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]]; + } + + /** + * TimeSeriesFilterRatio numerator. + * @member {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null|undefined} numerator + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + TimeSeriesFilterRatio.prototype.numerator = null; + + /** + * TimeSeriesFilterRatio denominator. + * @member {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart|null|undefined} denominator + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + TimeSeriesFilterRatio.prototype.denominator = null; + + /** + * TimeSeriesFilterRatio secondaryAggregation. + * @member {google.monitoring.dashboard.v1.IAggregation|null|undefined} secondaryAggregation + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + TimeSeriesFilterRatio.prototype.secondaryAggregation = null; + + /** + * TimeSeriesFilterRatio pickTimeSeriesFilter. + * @member {google.monitoring.dashboard.v1.IPickTimeSeriesFilter|null|undefined} pickTimeSeriesFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + TimeSeriesFilterRatio.prototype.pickTimeSeriesFilter = null; + + /** + * TimeSeriesFilterRatio statisticalTimeSeriesFilter. + * @member {google.monitoring.dashboard.v1.IStatisticalTimeSeriesFilter|null|undefined} statisticalTimeSeriesFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + TimeSeriesFilterRatio.prototype.statisticalTimeSeriesFilter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimeSeriesFilterRatio outputFilter. + * @member {"pickTimeSeriesFilter"|"statisticalTimeSeriesFilter"|undefined} outputFilter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + */ + Object.defineProperty(TimeSeriesFilterRatio.prototype, "outputFilter", { + get: $util.oneOfGetter($oneOfFields = ["pickTimeSeriesFilter", "statisticalTimeSeriesFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimeSeriesFilterRatio instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio} TimeSeriesFilterRatio instance + */ + TimeSeriesFilterRatio.create = function create(properties) { + return new TimeSeriesFilterRatio(properties); + }; + + /** + * Encodes the specified TimeSeriesFilterRatio message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio} message TimeSeriesFilterRatio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesFilterRatio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numerator != null && Object.hasOwnProperty.call(message, "numerator")) + $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.encode(message.numerator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.denominator != null && Object.hasOwnProperty.call(message, "denominator")) + $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.encode(message.denominator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.secondaryAggregation != null && Object.hasOwnProperty.call(message, "secondaryAggregation")) + $root.google.monitoring.dashboard.v1.Aggregation.encode(message.secondaryAggregation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pickTimeSeriesFilter != null && Object.hasOwnProperty.call(message, "pickTimeSeriesFilter")) + $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.encode(message.pickTimeSeriesFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.statisticalTimeSeriesFilter != null && Object.hasOwnProperty.call(message, "statisticalTimeSeriesFilter")) + $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.encode(message.statisticalTimeSeriesFilter, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSeriesFilterRatio message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesFilterRatio} message TimeSeriesFilterRatio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesFilterRatio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesFilterRatio message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio} TimeSeriesFilterRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesFilterRatio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.numerator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.decode(reader, reader.uint32()); + break; + } + case 2: { + message.denominator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.decode(reader, reader.uint32()); + break; + } + case 3: { + message.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesFilterRatio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio} TimeSeriesFilterRatio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesFilterRatio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesFilterRatio message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesFilterRatio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.numerator != null && message.hasOwnProperty("numerator")) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify(message.numerator); + if (error) + return "numerator." + error; + } + if (message.denominator != null && message.hasOwnProperty("denominator")) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify(message.denominator); + if (error) + return "denominator." + error; + } + if (message.secondaryAggregation != null && message.hasOwnProperty("secondaryAggregation")) { + var error = $root.google.monitoring.dashboard.v1.Aggregation.verify(message.secondaryAggregation); + if (error) + return "secondaryAggregation." + error; + } + if (message.pickTimeSeriesFilter != null && message.hasOwnProperty("pickTimeSeriesFilter")) { + properties.outputFilter = 1; + { + var error = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.verify(message.pickTimeSeriesFilter); + if (error) + return "pickTimeSeriesFilter." + error; + } + } + if (message.statisticalTimeSeriesFilter != null && message.hasOwnProperty("statisticalTimeSeriesFilter")) { + if (properties.outputFilter === 1) + return "outputFilter: multiple values"; + properties.outputFilter = 1; + { + var error = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.verify(message.statisticalTimeSeriesFilter); + if (error) + return "statisticalTimeSeriesFilter." + error; + } + } + return null; + }; + + /** + * Creates a TimeSeriesFilterRatio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio} TimeSeriesFilterRatio + */ + TimeSeriesFilterRatio.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio(); + if (object.numerator != null) { + if (typeof object.numerator !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.numerator: object expected"); + message.numerator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.fromObject(object.numerator); + } + if (object.denominator != null) { + if (typeof object.denominator !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.denominator: object expected"); + message.denominator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.fromObject(object.denominator); + } + if (object.secondaryAggregation != null) { + if (typeof object.secondaryAggregation !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.secondaryAggregation: object expected"); + message.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.fromObject(object.secondaryAggregation); + } + if (object.pickTimeSeriesFilter != null) { + if (typeof object.pickTimeSeriesFilter !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.pickTimeSeriesFilter: object expected"); + message.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.fromObject(object.pickTimeSeriesFilter); + } + if (object.statisticalTimeSeriesFilter != null) { + if (typeof object.statisticalTimeSeriesFilter !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.statisticalTimeSeriesFilter: object expected"); + message.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.fromObject(object.statisticalTimeSeriesFilter); + } + return message; + }; + + /** + * Creates a plain object from a TimeSeriesFilterRatio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio} message TimeSeriesFilterRatio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesFilterRatio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numerator = null; + object.denominator = null; + object.secondaryAggregation = null; + } + if (message.numerator != null && message.hasOwnProperty("numerator")) + object.numerator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.toObject(message.numerator, options); + if (message.denominator != null && message.hasOwnProperty("denominator")) + object.denominator = $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.toObject(message.denominator, options); + if (message.secondaryAggregation != null && message.hasOwnProperty("secondaryAggregation")) + object.secondaryAggregation = $root.google.monitoring.dashboard.v1.Aggregation.toObject(message.secondaryAggregation, options); + if (message.pickTimeSeriesFilter != null && message.hasOwnProperty("pickTimeSeriesFilter")) { + object.pickTimeSeriesFilter = $root.google.monitoring.dashboard.v1.PickTimeSeriesFilter.toObject(message.pickTimeSeriesFilter, options); + if (options.oneofs) + object.outputFilter = "pickTimeSeriesFilter"; + } + if (message.statisticalTimeSeriesFilter != null && message.hasOwnProperty("statisticalTimeSeriesFilter")) { + object.statisticalTimeSeriesFilter = $root.google.monitoring.dashboard.v1.StatisticalTimeSeriesFilter.toObject(message.statisticalTimeSeriesFilter, options); + if (options.oneofs) + object.outputFilter = "statisticalTimeSeriesFilter"; + } + return object; + }; + + /** + * Converts this TimeSeriesFilterRatio to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesFilterRatio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesFilterRatio + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesFilterRatio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesFilterRatio"; + }; + + TimeSeriesFilterRatio.RatioPart = (function() { + + /** + * Properties of a RatioPart. + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @interface IRatioPart + * @property {string|null} [filter] RatioPart filter + * @property {google.monitoring.dashboard.v1.IAggregation|null} [aggregation] RatioPart aggregation + */ + + /** + * Constructs a new RatioPart. + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio + * @classdesc Represents a RatioPart. + * @implements IRatioPart + * @constructor + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart=} [properties] Properties to set + */ + function RatioPart(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]]; + } + + /** + * RatioPart filter. + * @member {string} filter + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @instance + */ + RatioPart.prototype.filter = ""; + + /** + * RatioPart aggregation. + * @member {google.monitoring.dashboard.v1.IAggregation|null|undefined} aggregation + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @instance + */ + RatioPart.prototype.aggregation = null; + + /** + * Creates a new RatioPart instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} RatioPart instance + */ + RatioPart.create = function create(properties) { + return new RatioPart(properties); + }; + + /** + * Encodes the specified RatioPart message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart} message RatioPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatioPart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.aggregation != null && Object.hasOwnProperty.call(message, "aggregation")) + $root.google.monitoring.dashboard.v1.Aggregation.encode(message.aggregation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RatioPart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.IRatioPart} message RatioPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RatioPart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RatioPart message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} RatioPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatioPart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RatioPart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} RatioPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RatioPart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RatioPart message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RatioPart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.aggregation != null && message.hasOwnProperty("aggregation")) { + var error = $root.google.monitoring.dashboard.v1.Aggregation.verify(message.aggregation); + if (error) + return "aggregation." + error; + } + return null; + }; + + /** + * Creates a RatioPart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} RatioPart + */ + RatioPart.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.aggregation != null) { + if (typeof object.aggregation !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart.aggregation: object expected"); + message.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.fromObject(object.aggregation); + } + return message; + }; + + /** + * Creates a plain object from a RatioPart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart} message RatioPart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RatioPart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.aggregation = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.aggregation != null && message.hasOwnProperty("aggregation")) + object.aggregation = $root.google.monitoring.dashboard.v1.Aggregation.toObject(message.aggregation, options); + return object; + }; + + /** + * Converts this RatioPart to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @instance + * @returns {Object.} JSON object + */ + RatioPart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RatioPart + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RatioPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesFilterRatio.RatioPart"; + }; + + return RatioPart; + })(); + + return TimeSeriesFilterRatio; + })(); + + v1.Threshold = (function() { + + /** + * Properties of a Threshold. + * @memberof google.monitoring.dashboard.v1 + * @interface IThreshold + * @property {string|null} [label] Threshold label + * @property {number|null} [value] Threshold value + * @property {google.monitoring.dashboard.v1.Threshold.Color|null} [color] Threshold color + * @property {google.monitoring.dashboard.v1.Threshold.Direction|null} [direction] Threshold direction + * @property {google.monitoring.dashboard.v1.Threshold.TargetAxis|null} [targetAxis] Threshold targetAxis + */ + + /** + * Constructs a new Threshold. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a Threshold. + * @implements IThreshold + * @constructor + * @param {google.monitoring.dashboard.v1.IThreshold=} [properties] Properties to set + */ + function Threshold(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]]; + } + + /** + * Threshold label. + * @member {string} label + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + */ + Threshold.prototype.label = ""; + + /** + * Threshold value. + * @member {number} value + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + */ + Threshold.prototype.value = 0; + + /** + * Threshold color. + * @member {google.monitoring.dashboard.v1.Threshold.Color} color + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + */ + Threshold.prototype.color = 0; + + /** + * Threshold direction. + * @member {google.monitoring.dashboard.v1.Threshold.Direction} direction + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + */ + Threshold.prototype.direction = 0; + + /** + * Threshold targetAxis. + * @member {google.monitoring.dashboard.v1.Threshold.TargetAxis} targetAxis + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + */ + Threshold.prototype.targetAxis = 0; + + /** + * Creates a new Threshold instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {google.monitoring.dashboard.v1.IThreshold=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Threshold} Threshold instance + */ + Threshold.create = function create(properties) { + return new Threshold(properties); + }; + + /** + * Encodes the specified Threshold message. Does not implicitly {@link google.monitoring.dashboard.v1.Threshold.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {google.monitoring.dashboard.v1.IThreshold} message Threshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Threshold.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + if (message.color != null && Object.hasOwnProperty.call(message, "color")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.color); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.direction); + if (message.targetAxis != null && Object.hasOwnProperty.call(message, "targetAxis")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetAxis); + return writer; + }; + + /** + * Encodes the specified Threshold message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Threshold.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {google.monitoring.dashboard.v1.IThreshold} message Threshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Threshold.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Threshold message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Threshold} Threshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Threshold.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Threshold(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.label = reader.string(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + case 3: { + message.color = reader.int32(); + break; + } + case 4: { + message.direction = reader.int32(); + break; + } + case 5: { + message.targetAxis = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Threshold message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Threshold} Threshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Threshold.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Threshold message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Threshold.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.color != null && message.hasOwnProperty("color")) + switch (message.color) { + default: + return "color: enum value expected"; + case 0: + case 4: + case 6: + break; + } + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targetAxis != null && message.hasOwnProperty("targetAxis")) + switch (message.targetAxis) { + default: + return "targetAxis: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Threshold message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Threshold} Threshold + */ + Threshold.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Threshold) + return object; + var message = new $root.google.monitoring.dashboard.v1.Threshold(); + if (object.label != null) + message.label = String(object.label); + if (object.value != null) + message.value = Number(object.value); + switch (object.color) { + case "COLOR_UNSPECIFIED": + case 0: + message.color = 0; + break; + case "YELLOW": + case 4: + message.color = 4; + break; + case "RED": + case 6: + message.color = 6; + break; + } + switch (object.direction) { + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "ABOVE": + case 1: + message.direction = 1; + break; + case "BELOW": + case 2: + message.direction = 2; + break; + } + switch (object.targetAxis) { + case "TARGET_AXIS_UNSPECIFIED": + case 0: + message.targetAxis = 0; + break; + case "Y1": + case 1: + message.targetAxis = 1; + break; + case "Y2": + case 2: + message.targetAxis = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Threshold message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {google.monitoring.dashboard.v1.Threshold} message Threshold + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Threshold.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.value = 0; + object.color = options.enums === String ? "COLOR_UNSPECIFIED" : 0; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + object.targetAxis = options.enums === String ? "TARGET_AXIS_UNSPECIFIED" : 0; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.color != null && message.hasOwnProperty("color")) + object.color = options.enums === String ? $root.google.monitoring.dashboard.v1.Threshold.Color[message.color] : message.color; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.monitoring.dashboard.v1.Threshold.Direction[message.direction] : message.direction; + if (message.targetAxis != null && message.hasOwnProperty("targetAxis")) + object.targetAxis = options.enums === String ? $root.google.monitoring.dashboard.v1.Threshold.TargetAxis[message.targetAxis] : message.targetAxis; + return object; + }; + + /** + * Converts this Threshold to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Threshold + * @instance + * @returns {Object.} JSON object + */ + Threshold.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Threshold + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Threshold + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Threshold.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Threshold"; + }; + + /** + * Color enum. + * @name google.monitoring.dashboard.v1.Threshold.Color + * @enum {number} + * @property {number} COLOR_UNSPECIFIED=0 COLOR_UNSPECIFIED value + * @property {number} YELLOW=4 YELLOW value + * @property {number} RED=6 RED value + */ + Threshold.Color = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COLOR_UNSPECIFIED"] = 0; + values[valuesById[4] = "YELLOW"] = 4; + values[valuesById[6] = "RED"] = 6; + return values; + })(); + + /** + * Direction enum. + * @name google.monitoring.dashboard.v1.Threshold.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} ABOVE=1 ABOVE value + * @property {number} BELOW=2 BELOW value + */ + Threshold.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ABOVE"] = 1; + values[valuesById[2] = "BELOW"] = 2; + return values; + })(); + + /** + * TargetAxis enum. + * @name google.monitoring.dashboard.v1.Threshold.TargetAxis + * @enum {number} + * @property {number} TARGET_AXIS_UNSPECIFIED=0 TARGET_AXIS_UNSPECIFIED value + * @property {number} Y1=1 Y1 value + * @property {number} Y2=2 Y2 value + */ + Threshold.TargetAxis = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_AXIS_UNSPECIFIED"] = 0; + values[valuesById[1] = "Y1"] = 1; + values[valuesById[2] = "Y2"] = 2; + return values; + })(); + + return Threshold; + })(); + + /** + * SparkChartType enum. + * @name google.monitoring.dashboard.v1.SparkChartType + * @enum {number} + * @property {number} SPARK_CHART_TYPE_UNSPECIFIED=0 SPARK_CHART_TYPE_UNSPECIFIED value + * @property {number} SPARK_LINE=1 SPARK_LINE value + * @property {number} SPARK_BAR=2 SPARK_BAR value + */ + v1.SparkChartType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPARK_CHART_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPARK_LINE"] = 1; + values[valuesById[2] = "SPARK_BAR"] = 2; + return values; + })(); + + v1.TimeSeriesTable = (function() { + + /** + * Properties of a TimeSeriesTable. + * @memberof google.monitoring.dashboard.v1 + * @interface ITimeSeriesTable + * @property {Array.|null} [dataSets] TimeSeriesTable dataSets + */ + + /** + * Constructs a new TimeSeriesTable. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a TimeSeriesTable. + * @implements ITimeSeriesTable + * @constructor + * @param {google.monitoring.dashboard.v1.ITimeSeriesTable=} [properties] Properties to set + */ + function TimeSeriesTable(properties) { + this.dataSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSeriesTable dataSets. + * @member {Array.} dataSets + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @instance + */ + TimeSeriesTable.prototype.dataSets = $util.emptyArray; + + /** + * Creates a new TimeSeriesTable instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesTable=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable} TimeSeriesTable instance + */ + TimeSeriesTable.create = function create(properties) { + return new TimeSeriesTable(properties); + }; + + /** + * Encodes the specified TimeSeriesTable message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesTable} message TimeSeriesTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSets != null && message.dataSets.length) + for (var i = 0; i < message.dataSets.length; ++i) + $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.encode(message.dataSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSeriesTable message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {google.monitoring.dashboard.v1.ITimeSeriesTable} message TimeSeriesTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesTable message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable} TimeSeriesTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesTable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSets && message.dataSets.length)) + message.dataSets = []; + message.dataSets.push($root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable} TimeSeriesTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesTable message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSets != null && message.hasOwnProperty("dataSets")) { + if (!Array.isArray(message.dataSets)) + return "dataSets: array expected"; + for (var i = 0; i < message.dataSets.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.verify(message.dataSets[i]); + if (error) + return "dataSets." + error; + } + } + return null; + }; + + /** + * Creates a TimeSeriesTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable} TimeSeriesTable + */ + TimeSeriesTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesTable) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesTable(); + if (object.dataSets) { + if (!Array.isArray(object.dataSets)) + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.dataSets: array expected"); + message.dataSets = []; + for (var i = 0; i < object.dataSets.length; ++i) { + if (typeof object.dataSets[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.dataSets: object expected"); + message.dataSets[i] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.fromObject(object.dataSets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimeSeriesTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable} message TimeSeriesTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSets = []; + if (message.dataSets && message.dataSets.length) { + object.dataSets = []; + for (var j = 0; j < message.dataSets.length; ++j) + object.dataSets[j] = $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.toObject(message.dataSets[j], options); + } + return object; + }; + + /** + * Converts this TimeSeriesTable to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesTable + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesTable"; + }; + + TimeSeriesTable.TableDataSet = (function() { + + /** + * Properties of a TableDataSet. + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @interface ITableDataSet + * @property {google.monitoring.dashboard.v1.ITimeSeriesQuery|null} [timeSeriesQuery] TableDataSet timeSeriesQuery + * @property {string|null} [tableTemplate] TableDataSet tableTemplate + * @property {google.protobuf.IDuration|null} [minAlignmentPeriod] TableDataSet minAlignmentPeriod + * @property {google.monitoring.dashboard.v1.ITableDisplayOptions|null} [tableDisplayOptions] TableDataSet tableDisplayOptions + */ + + /** + * Constructs a new TableDataSet. + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable + * @classdesc Represents a TableDataSet. + * @implements ITableDataSet + * @constructor + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet=} [properties] Properties to set + */ + function TableDataSet(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]]; + } + + /** + * TableDataSet timeSeriesQuery. + * @member {google.monitoring.dashboard.v1.ITimeSeriesQuery|null|undefined} timeSeriesQuery + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @instance + */ + TableDataSet.prototype.timeSeriesQuery = null; + + /** + * TableDataSet tableTemplate. + * @member {string} tableTemplate + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @instance + */ + TableDataSet.prototype.tableTemplate = ""; + + /** + * TableDataSet minAlignmentPeriod. + * @member {google.protobuf.IDuration|null|undefined} minAlignmentPeriod + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @instance + */ + TableDataSet.prototype.minAlignmentPeriod = null; + + /** + * TableDataSet tableDisplayOptions. + * @member {google.monitoring.dashboard.v1.ITableDisplayOptions|null|undefined} tableDisplayOptions + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @instance + */ + TableDataSet.prototype.tableDisplayOptions = null; + + /** + * Creates a new TableDataSet instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet} TableDataSet instance + */ + TableDataSet.create = function create(properties) { + return new TableDataSet(properties); + }; + + /** + * Encodes the specified TableDataSet message. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet} message TableDataSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableDataSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSeriesQuery != null && Object.hasOwnProperty.call(message, "timeSeriesQuery")) + $root.google.monitoring.dashboard.v1.TimeSeriesQuery.encode(message.timeSeriesQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tableTemplate != null && Object.hasOwnProperty.call(message, "tableTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableTemplate); + if (message.minAlignmentPeriod != null && Object.hasOwnProperty.call(message, "minAlignmentPeriod")) + $root.google.protobuf.Duration.encode(message.minAlignmentPeriod, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tableDisplayOptions != null && Object.hasOwnProperty.call(message, "tableDisplayOptions")) + $root.google.monitoring.dashboard.v1.TableDisplayOptions.encode(message.tableDisplayOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableDataSet message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.ITableDataSet} message TableDataSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableDataSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableDataSet message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet} TableDataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableDataSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tableTemplate = reader.string(); + break; + } + case 3: { + message.minAlignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tableDisplayOptions = $root.google.monitoring.dashboard.v1.TableDisplayOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableDataSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet} TableDataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableDataSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableDataSet message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableDataSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.verify(message.timeSeriesQuery); + if (error) + return "timeSeriesQuery." + error; + } + if (message.tableTemplate != null && message.hasOwnProperty("tableTemplate")) + if (!$util.isString(message.tableTemplate)) + return "tableTemplate: string expected"; + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.minAlignmentPeriod); + if (error) + return "minAlignmentPeriod." + error; + } + if (message.tableDisplayOptions != null && message.hasOwnProperty("tableDisplayOptions")) { + var error = $root.google.monitoring.dashboard.v1.TableDisplayOptions.verify(message.tableDisplayOptions); + if (error) + return "tableDisplayOptions." + error; + } + return null; + }; + + /** + * Creates a TableDataSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet} TableDataSet + */ + TableDataSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet) + return object; + var message = new $root.google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet(); + if (object.timeSeriesQuery != null) { + if (typeof object.timeSeriesQuery !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.timeSeriesQuery: object expected"); + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.fromObject(object.timeSeriesQuery); + } + if (object.tableTemplate != null) + message.tableTemplate = String(object.tableTemplate); + if (object.minAlignmentPeriod != null) { + if (typeof object.minAlignmentPeriod !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.minAlignmentPeriod: object expected"); + message.minAlignmentPeriod = $root.google.protobuf.Duration.fromObject(object.minAlignmentPeriod); + } + if (object.tableDisplayOptions != null) { + if (typeof object.tableDisplayOptions !== "object") + throw TypeError(".google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet.tableDisplayOptions: object expected"); + message.tableDisplayOptions = $root.google.monitoring.dashboard.v1.TableDisplayOptions.fromObject(object.tableDisplayOptions); + } + return message; + }; + + /** + * Creates a plain object from a TableDataSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet} message TableDataSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableDataSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeSeriesQuery = null; + object.tableTemplate = ""; + object.minAlignmentPeriod = null; + object.tableDisplayOptions = null; + } + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) + object.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.toObject(message.timeSeriesQuery, options); + if (message.tableTemplate != null && message.hasOwnProperty("tableTemplate")) + object.tableTemplate = message.tableTemplate; + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) + object.minAlignmentPeriod = $root.google.protobuf.Duration.toObject(message.minAlignmentPeriod, options); + if (message.tableDisplayOptions != null && message.hasOwnProperty("tableDisplayOptions")) + object.tableDisplayOptions = $root.google.monitoring.dashboard.v1.TableDisplayOptions.toObject(message.tableDisplayOptions, options); + return object; + }; + + /** + * Converts this TableDataSet to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @instance + * @returns {Object.} JSON object + */ + TableDataSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableDataSet + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableDataSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TimeSeriesTable.TableDataSet"; + }; + + return TableDataSet; + })(); + + return TimeSeriesTable; + })(); + + v1.TableDisplayOptions = (function() { + + /** + * Properties of a TableDisplayOptions. + * @memberof google.monitoring.dashboard.v1 + * @interface ITableDisplayOptions + * @property {Array.|null} [shownColumns] TableDisplayOptions shownColumns + */ + + /** + * Constructs a new TableDisplayOptions. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a TableDisplayOptions. + * @implements ITableDisplayOptions + * @constructor + * @param {google.monitoring.dashboard.v1.ITableDisplayOptions=} [properties] Properties to set + */ + function TableDisplayOptions(properties) { + this.shownColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableDisplayOptions shownColumns. + * @member {Array.} shownColumns + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @instance + */ + TableDisplayOptions.prototype.shownColumns = $util.emptyArray; + + /** + * Creates a new TableDisplayOptions instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {google.monitoring.dashboard.v1.ITableDisplayOptions=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.TableDisplayOptions} TableDisplayOptions instance + */ + TableDisplayOptions.create = function create(properties) { + return new TableDisplayOptions(properties); + }; + + /** + * Encodes the specified TableDisplayOptions message. Does not implicitly {@link google.monitoring.dashboard.v1.TableDisplayOptions.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {google.monitoring.dashboard.v1.ITableDisplayOptions} message TableDisplayOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableDisplayOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shownColumns != null && message.shownColumns.length) + for (var i = 0; i < message.shownColumns.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.shownColumns[i]); + return writer; + }; + + /** + * Encodes the specified TableDisplayOptions message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.TableDisplayOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {google.monitoring.dashboard.v1.ITableDisplayOptions} message TableDisplayOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableDisplayOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableDisplayOptions message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.TableDisplayOptions} TableDisplayOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableDisplayOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.TableDisplayOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.shownColumns && message.shownColumns.length)) + message.shownColumns = []; + message.shownColumns.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableDisplayOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.TableDisplayOptions} TableDisplayOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableDisplayOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableDisplayOptions message. + * @function verify + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableDisplayOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shownColumns != null && message.hasOwnProperty("shownColumns")) { + if (!Array.isArray(message.shownColumns)) + return "shownColumns: array expected"; + for (var i = 0; i < message.shownColumns.length; ++i) + if (!$util.isString(message.shownColumns[i])) + return "shownColumns: string[] expected"; + } + return null; + }; + + /** + * Creates a TableDisplayOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.TableDisplayOptions} TableDisplayOptions + */ + TableDisplayOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.TableDisplayOptions) + return object; + var message = new $root.google.monitoring.dashboard.v1.TableDisplayOptions(); + if (object.shownColumns) { + if (!Array.isArray(object.shownColumns)) + throw TypeError(".google.monitoring.dashboard.v1.TableDisplayOptions.shownColumns: array expected"); + message.shownColumns = []; + for (var i = 0; i < object.shownColumns.length; ++i) + message.shownColumns[i] = String(object.shownColumns[i]); + } + return message; + }; + + /** + * Creates a plain object from a TableDisplayOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {google.monitoring.dashboard.v1.TableDisplayOptions} message TableDisplayOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableDisplayOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.shownColumns = []; + if (message.shownColumns && message.shownColumns.length) { + object.shownColumns = []; + for (var j = 0; j < message.shownColumns.length; ++j) + object.shownColumns[j] = message.shownColumns[j]; + } + return object; + }; + + /** + * Converts this TableDisplayOptions to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @instance + * @returns {Object.} JSON object + */ + TableDisplayOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableDisplayOptions + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.TableDisplayOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableDisplayOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.TableDisplayOptions"; + }; + + return TableDisplayOptions; + })(); + + v1.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.monitoring.dashboard.v1 + * @interface IText + * @property {string|null} [content] Text content + * @property {google.monitoring.dashboard.v1.Text.Format|null} [format] Text format + */ + + /** + * Constructs a new Text. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.monitoring.dashboard.v1.IText=} [properties] Properties to set + */ + function Text(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]]; + } + + /** + * Text content. + * @member {string} content + * @memberof google.monitoring.dashboard.v1.Text + * @instance + */ + Text.prototype.content = ""; + + /** + * Text format. + * @member {google.monitoring.dashboard.v1.Text.Format} format + * @memberof google.monitoring.dashboard.v1.Text + * @instance + */ + Text.prototype.format = 0; + + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {google.monitoring.dashboard.v1.IText=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.monitoring.dashboard.v1.Text.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {google.monitoring.dashboard.v1.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format); + return writer; + }; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {google.monitoring.dashboard.v1.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Text message. + * @function verify + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.Text} Text + */ + Text.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.Text) + return object; + var message = new $root.google.monitoring.dashboard.v1.Text(); + if (object.content != null) + message.content = String(object.content); + switch (object.format) { + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "MARKDOWN": + case 1: + message.format = 1; + break; + case "RAW": + case 2: + message.format = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {google.monitoring.dashboard.v1.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.monitoring.dashboard.v1.Text.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Text + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.Text + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Text.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.Text"; + }; + + /** + * Format enum. + * @name google.monitoring.dashboard.v1.Text.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} MARKDOWN=1 MARKDOWN value + * @property {number} RAW=2 RAW value + */ + Text.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MARKDOWN"] = 1; + values[valuesById[2] = "RAW"] = 2; + return values; + })(); + + return Text; + })(); + + v1.XyChart = (function() { + + /** + * Properties of a XyChart. + * @memberof google.monitoring.dashboard.v1 + * @interface IXyChart + * @property {Array.|null} [dataSets] XyChart dataSets + * @property {google.protobuf.IDuration|null} [timeshiftDuration] XyChart timeshiftDuration + * @property {Array.|null} [thresholds] XyChart thresholds + * @property {google.monitoring.dashboard.v1.XyChart.IAxis|null} [xAxis] XyChart xAxis + * @property {google.monitoring.dashboard.v1.XyChart.IAxis|null} [yAxis] XyChart yAxis + * @property {google.monitoring.dashboard.v1.XyChart.IAxis|null} [y2Axis] XyChart y2Axis + * @property {google.monitoring.dashboard.v1.IChartOptions|null} [chartOptions] XyChart chartOptions + */ + + /** + * Constructs a new XyChart. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a XyChart. + * @implements IXyChart + * @constructor + * @param {google.monitoring.dashboard.v1.IXyChart=} [properties] Properties to set + */ + function XyChart(properties) { + this.dataSets = []; + this.thresholds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * XyChart dataSets. + * @member {Array.} dataSets + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.dataSets = $util.emptyArray; + + /** + * XyChart timeshiftDuration. + * @member {google.protobuf.IDuration|null|undefined} timeshiftDuration + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.timeshiftDuration = null; + + /** + * XyChart thresholds. + * @member {Array.} thresholds + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.thresholds = $util.emptyArray; + + /** + * XyChart xAxis. + * @member {google.monitoring.dashboard.v1.XyChart.IAxis|null|undefined} xAxis + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.xAxis = null; + + /** + * XyChart yAxis. + * @member {google.monitoring.dashboard.v1.XyChart.IAxis|null|undefined} yAxis + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.yAxis = null; + + /** + * XyChart y2Axis. + * @member {google.monitoring.dashboard.v1.XyChart.IAxis|null|undefined} y2Axis + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.y2Axis = null; + + /** + * XyChart chartOptions. + * @member {google.monitoring.dashboard.v1.IChartOptions|null|undefined} chartOptions + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + */ + XyChart.prototype.chartOptions = null; + + /** + * Creates a new XyChart instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {google.monitoring.dashboard.v1.IXyChart=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.XyChart} XyChart instance + */ + XyChart.create = function create(properties) { + return new XyChart(properties); + }; + + /** + * Encodes the specified XyChart message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {google.monitoring.dashboard.v1.IXyChart} message XyChart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XyChart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSets != null && message.dataSets.length) + for (var i = 0; i < message.dataSets.length; ++i) + $root.google.monitoring.dashboard.v1.XyChart.DataSet.encode(message.dataSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeshiftDuration != null && Object.hasOwnProperty.call(message, "timeshiftDuration")) + $root.google.protobuf.Duration.encode(message.timeshiftDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.thresholds != null && message.thresholds.length) + for (var i = 0; i < message.thresholds.length; ++i) + $root.google.monitoring.dashboard.v1.Threshold.encode(message.thresholds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.xAxis != null && Object.hasOwnProperty.call(message, "xAxis")) + $root.google.monitoring.dashboard.v1.XyChart.Axis.encode(message.xAxis, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.yAxis != null && Object.hasOwnProperty.call(message, "yAxis")) + $root.google.monitoring.dashboard.v1.XyChart.Axis.encode(message.yAxis, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.chartOptions != null && Object.hasOwnProperty.call(message, "chartOptions")) + $root.google.monitoring.dashboard.v1.ChartOptions.encode(message.chartOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.y2Axis != null && Object.hasOwnProperty.call(message, "y2Axis")) + $root.google.monitoring.dashboard.v1.XyChart.Axis.encode(message.y2Axis, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified XyChart message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {google.monitoring.dashboard.v1.IXyChart} message XyChart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XyChart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a XyChart message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.XyChart} XyChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XyChart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.XyChart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSets && message.dataSets.length)) + message.dataSets = []; + message.dataSets.push($root.google.monitoring.dashboard.v1.XyChart.DataSet.decode(reader, reader.uint32())); + break; + } + case 4: { + message.timeshiftDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.thresholds && message.thresholds.length)) + message.thresholds = []; + message.thresholds.push($root.google.monitoring.dashboard.v1.Threshold.decode(reader, reader.uint32())); + break; + } + case 6: { + message.xAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.decode(reader, reader.uint32()); + break; + } + case 7: { + message.yAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.decode(reader, reader.uint32()); + break; + } + case 9: { + message.y2Axis = $root.google.monitoring.dashboard.v1.XyChart.Axis.decode(reader, reader.uint32()); + break; + } + case 8: { + message.chartOptions = $root.google.monitoring.dashboard.v1.ChartOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a XyChart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.XyChart} XyChart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XyChart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a XyChart message. + * @function verify + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + XyChart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSets != null && message.hasOwnProperty("dataSets")) { + if (!Array.isArray(message.dataSets)) + return "dataSets: array expected"; + for (var i = 0; i < message.dataSets.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.XyChart.DataSet.verify(message.dataSets[i]); + if (error) + return "dataSets." + error; + } + } + if (message.timeshiftDuration != null && message.hasOwnProperty("timeshiftDuration")) { + var error = $root.google.protobuf.Duration.verify(message.timeshiftDuration); + if (error) + return "timeshiftDuration." + error; + } + if (message.thresholds != null && message.hasOwnProperty("thresholds")) { + if (!Array.isArray(message.thresholds)) + return "thresholds: array expected"; + for (var i = 0; i < message.thresholds.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Threshold.verify(message.thresholds[i]); + if (error) + return "thresholds." + error; + } + } + if (message.xAxis != null && message.hasOwnProperty("xAxis")) { + var error = $root.google.monitoring.dashboard.v1.XyChart.Axis.verify(message.xAxis); + if (error) + return "xAxis." + error; + } + if (message.yAxis != null && message.hasOwnProperty("yAxis")) { + var error = $root.google.monitoring.dashboard.v1.XyChart.Axis.verify(message.yAxis); + if (error) + return "yAxis." + error; + } + if (message.y2Axis != null && message.hasOwnProperty("y2Axis")) { + var error = $root.google.monitoring.dashboard.v1.XyChart.Axis.verify(message.y2Axis); + if (error) + return "y2Axis." + error; + } + if (message.chartOptions != null && message.hasOwnProperty("chartOptions")) { + var error = $root.google.monitoring.dashboard.v1.ChartOptions.verify(message.chartOptions); + if (error) + return "chartOptions." + error; + } + return null; + }; + + /** + * Creates a XyChart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.XyChart} XyChart + */ + XyChart.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.XyChart) + return object; + var message = new $root.google.monitoring.dashboard.v1.XyChart(); + if (object.dataSets) { + if (!Array.isArray(object.dataSets)) + throw TypeError(".google.monitoring.dashboard.v1.XyChart.dataSets: array expected"); + message.dataSets = []; + for (var i = 0; i < object.dataSets.length; ++i) { + if (typeof object.dataSets[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.dataSets: object expected"); + message.dataSets[i] = $root.google.monitoring.dashboard.v1.XyChart.DataSet.fromObject(object.dataSets[i]); + } + } + if (object.timeshiftDuration != null) { + if (typeof object.timeshiftDuration !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.timeshiftDuration: object expected"); + message.timeshiftDuration = $root.google.protobuf.Duration.fromObject(object.timeshiftDuration); + } + if (object.thresholds) { + if (!Array.isArray(object.thresholds)) + throw TypeError(".google.monitoring.dashboard.v1.XyChart.thresholds: array expected"); + message.thresholds = []; + for (var i = 0; i < object.thresholds.length; ++i) { + if (typeof object.thresholds[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.thresholds: object expected"); + message.thresholds[i] = $root.google.monitoring.dashboard.v1.Threshold.fromObject(object.thresholds[i]); + } + } + if (object.xAxis != null) { + if (typeof object.xAxis !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.xAxis: object expected"); + message.xAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.fromObject(object.xAxis); + } + if (object.yAxis != null) { + if (typeof object.yAxis !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.yAxis: object expected"); + message.yAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.fromObject(object.yAxis); + } + if (object.y2Axis != null) { + if (typeof object.y2Axis !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.y2Axis: object expected"); + message.y2Axis = $root.google.monitoring.dashboard.v1.XyChart.Axis.fromObject(object.y2Axis); + } + if (object.chartOptions != null) { + if (typeof object.chartOptions !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.chartOptions: object expected"); + message.chartOptions = $root.google.monitoring.dashboard.v1.ChartOptions.fromObject(object.chartOptions); + } + return message; + }; + + /** + * Creates a plain object from a XyChart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {google.monitoring.dashboard.v1.XyChart} message XyChart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + XyChart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSets = []; + object.thresholds = []; + } + if (options.defaults) { + object.timeshiftDuration = null; + object.xAxis = null; + object.yAxis = null; + object.chartOptions = null; + object.y2Axis = null; + } + if (message.dataSets && message.dataSets.length) { + object.dataSets = []; + for (var j = 0; j < message.dataSets.length; ++j) + object.dataSets[j] = $root.google.monitoring.dashboard.v1.XyChart.DataSet.toObject(message.dataSets[j], options); + } + if (message.timeshiftDuration != null && message.hasOwnProperty("timeshiftDuration")) + object.timeshiftDuration = $root.google.protobuf.Duration.toObject(message.timeshiftDuration, options); + if (message.thresholds && message.thresholds.length) { + object.thresholds = []; + for (var j = 0; j < message.thresholds.length; ++j) + object.thresholds[j] = $root.google.monitoring.dashboard.v1.Threshold.toObject(message.thresholds[j], options); + } + if (message.xAxis != null && message.hasOwnProperty("xAxis")) + object.xAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.toObject(message.xAxis, options); + if (message.yAxis != null && message.hasOwnProperty("yAxis")) + object.yAxis = $root.google.monitoring.dashboard.v1.XyChart.Axis.toObject(message.yAxis, options); + if (message.chartOptions != null && message.hasOwnProperty("chartOptions")) + object.chartOptions = $root.google.monitoring.dashboard.v1.ChartOptions.toObject(message.chartOptions, options); + if (message.y2Axis != null && message.hasOwnProperty("y2Axis")) + object.y2Axis = $root.google.monitoring.dashboard.v1.XyChart.Axis.toObject(message.y2Axis, options); + return object; + }; + + /** + * Converts this XyChart to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.XyChart + * @instance + * @returns {Object.} JSON object + */ + XyChart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for XyChart + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.XyChart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + XyChart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.XyChart"; + }; + + XyChart.DataSet = (function() { + + /** + * Properties of a DataSet. + * @memberof google.monitoring.dashboard.v1.XyChart + * @interface IDataSet + * @property {google.monitoring.dashboard.v1.ITimeSeriesQuery|null} [timeSeriesQuery] DataSet timeSeriesQuery + * @property {google.monitoring.dashboard.v1.XyChart.DataSet.PlotType|null} [plotType] DataSet plotType + * @property {string|null} [legendTemplate] DataSet legendTemplate + * @property {google.protobuf.IDuration|null} [minAlignmentPeriod] DataSet minAlignmentPeriod + * @property {google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis|null} [targetAxis] DataSet targetAxis + */ + + /** + * Constructs a new DataSet. + * @memberof google.monitoring.dashboard.v1.XyChart + * @classdesc Represents a DataSet. + * @implements IDataSet + * @constructor + * @param {google.monitoring.dashboard.v1.XyChart.IDataSet=} [properties] Properties to set + */ + function DataSet(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]]; + } + + /** + * DataSet timeSeriesQuery. + * @member {google.monitoring.dashboard.v1.ITimeSeriesQuery|null|undefined} timeSeriesQuery + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + */ + DataSet.prototype.timeSeriesQuery = null; + + /** + * DataSet plotType. + * @member {google.monitoring.dashboard.v1.XyChart.DataSet.PlotType} plotType + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + */ + DataSet.prototype.plotType = 0; + + /** + * DataSet legendTemplate. + * @member {string} legendTemplate + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + */ + DataSet.prototype.legendTemplate = ""; + + /** + * DataSet minAlignmentPeriod. + * @member {google.protobuf.IDuration|null|undefined} minAlignmentPeriod + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + */ + DataSet.prototype.minAlignmentPeriod = null; + + /** + * DataSet targetAxis. + * @member {google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis} targetAxis + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + */ + DataSet.prototype.targetAxis = 0; + + /** + * Creates a new DataSet instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IDataSet=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.XyChart.DataSet} DataSet instance + */ + DataSet.create = function create(properties) { + return new DataSet(properties); + }; + + /** + * Encodes the specified DataSet message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.DataSet.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IDataSet} message DataSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeSeriesQuery != null && Object.hasOwnProperty.call(message, "timeSeriesQuery")) + $root.google.monitoring.dashboard.v1.TimeSeriesQuery.encode(message.timeSeriesQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.plotType != null && Object.hasOwnProperty.call(message, "plotType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.plotType); + if (message.legendTemplate != null && Object.hasOwnProperty.call(message, "legendTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.legendTemplate); + if (message.minAlignmentPeriod != null && Object.hasOwnProperty.call(message, "minAlignmentPeriod")) + $root.google.protobuf.Duration.encode(message.minAlignmentPeriod, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.targetAxis != null && Object.hasOwnProperty.call(message, "targetAxis")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetAxis); + return writer; + }; + + /** + * Encodes the specified DataSet message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.DataSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IDataSet} message DataSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSet message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.XyChart.DataSet} DataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.XyChart.DataSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.plotType = reader.int32(); + break; + } + case 3: { + message.legendTemplate = reader.string(); + break; + } + case 4: { + message.minAlignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.targetAxis = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.XyChart.DataSet} DataSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSet message. + * @function verify + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) { + var error = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.verify(message.timeSeriesQuery); + if (error) + return "timeSeriesQuery." + error; + } + if (message.plotType != null && message.hasOwnProperty("plotType")) + switch (message.plotType) { + default: + return "plotType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.legendTemplate != null && message.hasOwnProperty("legendTemplate")) + if (!$util.isString(message.legendTemplate)) + return "legendTemplate: string expected"; + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.minAlignmentPeriod); + if (error) + return "minAlignmentPeriod." + error; + } + if (message.targetAxis != null && message.hasOwnProperty("targetAxis")) + switch (message.targetAxis) { + default: + return "targetAxis: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DataSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.XyChart.DataSet} DataSet + */ + DataSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.XyChart.DataSet) + return object; + var message = new $root.google.monitoring.dashboard.v1.XyChart.DataSet(); + if (object.timeSeriesQuery != null) { + if (typeof object.timeSeriesQuery !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.DataSet.timeSeriesQuery: object expected"); + message.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.fromObject(object.timeSeriesQuery); + } + switch (object.plotType) { + case "PLOT_TYPE_UNSPECIFIED": + case 0: + message.plotType = 0; + break; + case "LINE": + case 1: + message.plotType = 1; + break; + case "STACKED_AREA": + case 2: + message.plotType = 2; + break; + case "STACKED_BAR": + case 3: + message.plotType = 3; + break; + case "HEATMAP": + case 4: + message.plotType = 4; + break; + } + if (object.legendTemplate != null) + message.legendTemplate = String(object.legendTemplate); + if (object.minAlignmentPeriod != null) { + if (typeof object.minAlignmentPeriod !== "object") + throw TypeError(".google.monitoring.dashboard.v1.XyChart.DataSet.minAlignmentPeriod: object expected"); + message.minAlignmentPeriod = $root.google.protobuf.Duration.fromObject(object.minAlignmentPeriod); + } + switch (object.targetAxis) { + case "TARGET_AXIS_UNSPECIFIED": + case 0: + message.targetAxis = 0; + break; + case "Y1": + case 1: + message.targetAxis = 1; + break; + case "Y2": + case 2: + message.targetAxis = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {google.monitoring.dashboard.v1.XyChart.DataSet} message DataSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeSeriesQuery = null; + object.plotType = options.enums === String ? "PLOT_TYPE_UNSPECIFIED" : 0; + object.legendTemplate = ""; + object.minAlignmentPeriod = null; + object.targetAxis = options.enums === String ? "TARGET_AXIS_UNSPECIFIED" : 0; + } + if (message.timeSeriesQuery != null && message.hasOwnProperty("timeSeriesQuery")) + object.timeSeriesQuery = $root.google.monitoring.dashboard.v1.TimeSeriesQuery.toObject(message.timeSeriesQuery, options); + if (message.plotType != null && message.hasOwnProperty("plotType")) + object.plotType = options.enums === String ? $root.google.monitoring.dashboard.v1.XyChart.DataSet.PlotType[message.plotType] : message.plotType; + if (message.legendTemplate != null && message.hasOwnProperty("legendTemplate")) + object.legendTemplate = message.legendTemplate; + if (message.minAlignmentPeriod != null && message.hasOwnProperty("minAlignmentPeriod")) + object.minAlignmentPeriod = $root.google.protobuf.Duration.toObject(message.minAlignmentPeriod, options); + if (message.targetAxis != null && message.hasOwnProperty("targetAxis")) + object.targetAxis = options.enums === String ? $root.google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis[message.targetAxis] : message.targetAxis; + return object; + }; + + /** + * Converts this DataSet to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @instance + * @returns {Object.} JSON object + */ + DataSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSet + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.XyChart.DataSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.XyChart.DataSet"; + }; + + /** + * PlotType enum. + * @name google.monitoring.dashboard.v1.XyChart.DataSet.PlotType + * @enum {number} + * @property {number} PLOT_TYPE_UNSPECIFIED=0 PLOT_TYPE_UNSPECIFIED value + * @property {number} LINE=1 LINE value + * @property {number} STACKED_AREA=2 STACKED_AREA value + * @property {number} STACKED_BAR=3 STACKED_BAR value + * @property {number} HEATMAP=4 HEATMAP value + */ + DataSet.PlotType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLOT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINE"] = 1; + values[valuesById[2] = "STACKED_AREA"] = 2; + values[valuesById[3] = "STACKED_BAR"] = 3; + values[valuesById[4] = "HEATMAP"] = 4; + return values; + })(); + + /** + * TargetAxis enum. + * @name google.monitoring.dashboard.v1.XyChart.DataSet.TargetAxis + * @enum {number} + * @property {number} TARGET_AXIS_UNSPECIFIED=0 TARGET_AXIS_UNSPECIFIED value + * @property {number} Y1=1 Y1 value + * @property {number} Y2=2 Y2 value + */ + DataSet.TargetAxis = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_AXIS_UNSPECIFIED"] = 0; + values[valuesById[1] = "Y1"] = 1; + values[valuesById[2] = "Y2"] = 2; + return values; + })(); + + return DataSet; + })(); + + XyChart.Axis = (function() { + + /** + * Properties of an Axis. + * @memberof google.monitoring.dashboard.v1.XyChart + * @interface IAxis + * @property {string|null} [label] Axis label + * @property {google.monitoring.dashboard.v1.XyChart.Axis.Scale|null} [scale] Axis scale + */ + + /** + * Constructs a new Axis. + * @memberof google.monitoring.dashboard.v1.XyChart + * @classdesc Represents an Axis. + * @implements IAxis + * @constructor + * @param {google.monitoring.dashboard.v1.XyChart.IAxis=} [properties] Properties to set + */ + function Axis(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]]; + } + + /** + * Axis label. + * @member {string} label + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @instance + */ + Axis.prototype.label = ""; + + /** + * Axis scale. + * @member {google.monitoring.dashboard.v1.XyChart.Axis.Scale} scale + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @instance + */ + Axis.prototype.scale = 0; + + /** + * Creates a new Axis instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IAxis=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.XyChart.Axis} Axis instance + */ + Axis.create = function create(properties) { + return new Axis(properties); + }; + + /** + * Encodes the specified Axis message. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.Axis.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IAxis} message Axis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Axis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.scale); + return writer; + }; + + /** + * Encodes the specified Axis message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.XyChart.Axis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {google.monitoring.dashboard.v1.XyChart.IAxis} message Axis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Axis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Axis message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.XyChart.Axis} Axis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Axis.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.XyChart.Axis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.label = reader.string(); + break; + } + case 2: { + message.scale = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Axis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.XyChart.Axis} Axis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Axis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Axis message. + * @function verify + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Axis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + switch (message.scale) { + default: + return "scale: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Axis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.XyChart.Axis} Axis + */ + Axis.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.XyChart.Axis) + return object; + var message = new $root.google.monitoring.dashboard.v1.XyChart.Axis(); + if (object.label != null) + message.label = String(object.label); + switch (object.scale) { + case "SCALE_UNSPECIFIED": + case 0: + message.scale = 0; + break; + case "LINEAR": + case 1: + message.scale = 1; + break; + case "LOG10": + case 2: + message.scale = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Axis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {google.monitoring.dashboard.v1.XyChart.Axis} message Axis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Axis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.scale = options.enums === String ? "SCALE_UNSPECIFIED" : 0; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.scale != null && message.hasOwnProperty("scale")) + object.scale = options.enums === String ? $root.google.monitoring.dashboard.v1.XyChart.Axis.Scale[message.scale] : message.scale; + return object; + }; + + /** + * Converts this Axis to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @instance + * @returns {Object.} JSON object + */ + Axis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Axis + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.XyChart.Axis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Axis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.XyChart.Axis"; + }; + + /** + * Scale enum. + * @name google.monitoring.dashboard.v1.XyChart.Axis.Scale + * @enum {number} + * @property {number} SCALE_UNSPECIFIED=0 SCALE_UNSPECIFIED value + * @property {number} LINEAR=1 LINEAR value + * @property {number} LOG10=2 LOG10 value + */ + Axis.Scale = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCALE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR"] = 1; + values[valuesById[2] = "LOG10"] = 2; + return values; + })(); + + return Axis; + })(); + + return XyChart; + })(); + + v1.ChartOptions = (function() { + + /** + * Properties of a ChartOptions. + * @memberof google.monitoring.dashboard.v1 + * @interface IChartOptions + * @property {google.monitoring.dashboard.v1.ChartOptions.Mode|null} [mode] ChartOptions mode + */ + + /** + * Constructs a new ChartOptions. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a ChartOptions. + * @implements IChartOptions + * @constructor + * @param {google.monitoring.dashboard.v1.IChartOptions=} [properties] Properties to set + */ + function ChartOptions(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]]; + } + + /** + * ChartOptions mode. + * @member {google.monitoring.dashboard.v1.ChartOptions.Mode} mode + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @instance + */ + ChartOptions.prototype.mode = 0; + + /** + * Creates a new ChartOptions instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {google.monitoring.dashboard.v1.IChartOptions=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.ChartOptions} ChartOptions instance + */ + ChartOptions.create = function create(properties) { + return new ChartOptions(properties); + }; + + /** + * Encodes the specified ChartOptions message. Does not implicitly {@link google.monitoring.dashboard.v1.ChartOptions.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {google.monitoring.dashboard.v1.IChartOptions} message ChartOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChartOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified ChartOptions message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ChartOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {google.monitoring.dashboard.v1.IChartOptions} message ChartOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChartOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChartOptions message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.ChartOptions} ChartOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChartOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.ChartOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChartOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.ChartOptions} ChartOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChartOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChartOptions message. + * @function verify + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChartOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ChartOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.ChartOptions} ChartOptions + */ + ChartOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.ChartOptions) + return object; + var message = new $root.google.monitoring.dashboard.v1.ChartOptions(); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "COLOR": + case 1: + message.mode = 1; + break; + case "X_RAY": + case 2: + message.mode = 2; + break; + case "STATS": + case 3: + message.mode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ChartOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {google.monitoring.dashboard.v1.ChartOptions} message ChartOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChartOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.monitoring.dashboard.v1.ChartOptions.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this ChartOptions to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @instance + * @returns {Object.} JSON object + */ + ChartOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChartOptions + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.ChartOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChartOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.ChartOptions"; + }; + + /** + * Mode enum. + * @name google.monitoring.dashboard.v1.ChartOptions.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} COLOR=1 COLOR value + * @property {number} X_RAY=2 X_RAY value + * @property {number} STATS=3 STATS value + */ + ChartOptions.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COLOR"] = 1; + values[valuesById[2] = "X_RAY"] = 2; + values[valuesById[3] = "STATS"] = 3; + return values; + })(); + + return ChartOptions; + })(); + + v1.DashboardsService = (function() { + + /** + * Constructs a new DashboardsService service. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a DashboardsService + * @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 DashboardsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DashboardsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DashboardsService; + + /** + * Creates new DashboardsService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @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 {DashboardsService} RPC service. Useful where requests and/or responses are streamed. + */ + DashboardsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|createDashboard}. + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @typedef CreateDashboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.dashboard.v1.Dashboard} [response] Dashboard + */ + + /** + * Calls CreateDashboard. + * @function createDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest} request CreateDashboardRequest message or plain object + * @param {google.monitoring.dashboard.v1.DashboardsService.CreateDashboardCallback} callback Node-style callback called with the error, if any, and Dashboard + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DashboardsService.prototype.createDashboard = function createDashboard(request, callback) { + return this.rpcCall(createDashboard, $root.google.monitoring.dashboard.v1.CreateDashboardRequest, $root.google.monitoring.dashboard.v1.Dashboard, request, callback); + }, "name", { value: "CreateDashboard" }); + + /** + * Calls CreateDashboard. + * @function createDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest} request CreateDashboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|listDashboards}. + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @typedef ListDashboardsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.dashboard.v1.ListDashboardsResponse} [response] ListDashboardsResponse + */ + + /** + * Calls ListDashboards. + * @function listDashboards + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest} request ListDashboardsRequest message or plain object + * @param {google.monitoring.dashboard.v1.DashboardsService.ListDashboardsCallback} callback Node-style callback called with the error, if any, and ListDashboardsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DashboardsService.prototype.listDashboards = function listDashboards(request, callback) { + return this.rpcCall(listDashboards, $root.google.monitoring.dashboard.v1.ListDashboardsRequest, $root.google.monitoring.dashboard.v1.ListDashboardsResponse, request, callback); + }, "name", { value: "ListDashboards" }); + + /** + * Calls ListDashboards. + * @function listDashboards + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest} request ListDashboardsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|getDashboard}. + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @typedef GetDashboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.dashboard.v1.Dashboard} [response] Dashboard + */ + + /** + * Calls GetDashboard. + * @function getDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest} request GetDashboardRequest message or plain object + * @param {google.monitoring.dashboard.v1.DashboardsService.GetDashboardCallback} callback Node-style callback called with the error, if any, and Dashboard + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DashboardsService.prototype.getDashboard = function getDashboard(request, callback) { + return this.rpcCall(getDashboard, $root.google.monitoring.dashboard.v1.GetDashboardRequest, $root.google.monitoring.dashboard.v1.Dashboard, request, callback); + }, "name", { value: "GetDashboard" }); + + /** + * Calls GetDashboard. + * @function getDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest} request GetDashboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|deleteDashboard}. + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @typedef DeleteDashboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDashboard. + * @function deleteDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest} request DeleteDashboardRequest message or plain object + * @param {google.monitoring.dashboard.v1.DashboardsService.DeleteDashboardCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DashboardsService.prototype.deleteDashboard = function deleteDashboard(request, callback) { + return this.rpcCall(deleteDashboard, $root.google.monitoring.dashboard.v1.DeleteDashboardRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDashboard" }); + + /** + * Calls DeleteDashboard. + * @function deleteDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest} request DeleteDashboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.dashboard.v1.DashboardsService|updateDashboard}. + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @typedef UpdateDashboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.dashboard.v1.Dashboard} [response] Dashboard + */ + + /** + * Calls UpdateDashboard. + * @function updateDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest} request UpdateDashboardRequest message or plain object + * @param {google.monitoring.dashboard.v1.DashboardsService.UpdateDashboardCallback} callback Node-style callback called with the error, if any, and Dashboard + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DashboardsService.prototype.updateDashboard = function updateDashboard(request, callback) { + return this.rpcCall(updateDashboard, $root.google.monitoring.dashboard.v1.UpdateDashboardRequest, $root.google.monitoring.dashboard.v1.Dashboard, request, callback); + }, "name", { value: "UpdateDashboard" }); + + /** + * Calls UpdateDashboard. + * @function updateDashboard + * @memberof google.monitoring.dashboard.v1.DashboardsService + * @instance + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest} request UpdateDashboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DashboardsService; + })(); + + v1.CreateDashboardRequest = (function() { + + /** + * Properties of a CreateDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @interface ICreateDashboardRequest + * @property {string|null} [parent] CreateDashboardRequest parent + * @property {google.monitoring.dashboard.v1.IDashboard|null} [dashboard] CreateDashboardRequest dashboard + * @property {boolean|null} [validateOnly] CreateDashboardRequest validateOnly + */ + + /** + * Constructs a new CreateDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a CreateDashboardRequest. + * @implements ICreateDashboardRequest + * @constructor + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest=} [properties] Properties to set + */ + function CreateDashboardRequest(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]]; + } + + /** + * CreateDashboardRequest parent. + * @member {string} parent + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @instance + */ + CreateDashboardRequest.prototype.parent = ""; + + /** + * CreateDashboardRequest dashboard. + * @member {google.monitoring.dashboard.v1.IDashboard|null|undefined} dashboard + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @instance + */ + CreateDashboardRequest.prototype.dashboard = null; + + /** + * CreateDashboardRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @instance + */ + CreateDashboardRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateDashboardRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.CreateDashboardRequest} CreateDashboardRequest instance + */ + CreateDashboardRequest.create = function create(properties) { + return new CreateDashboardRequest(properties); + }; + + /** + * Encodes the specified CreateDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.CreateDashboardRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest} message CreateDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDashboardRequest.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.dashboard != null && Object.hasOwnProperty.call(message, "dashboard")) + $root.google.monitoring.dashboard.v1.Dashboard.encode(message.dashboard, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.CreateDashboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.ICreateDashboardRequest} message CreateDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDashboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDashboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.CreateDashboardRequest} CreateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDashboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.CreateDashboardRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDashboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.CreateDashboardRequest} CreateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDashboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDashboardRequest message. + * @function verify + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDashboardRequest.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.dashboard != null && message.hasOwnProperty("dashboard")) { + var error = $root.google.monitoring.dashboard.v1.Dashboard.verify(message.dashboard); + if (error) + return "dashboard." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.CreateDashboardRequest} CreateDashboardRequest + */ + CreateDashboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.CreateDashboardRequest) + return object; + var message = new $root.google.monitoring.dashboard.v1.CreateDashboardRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dashboard != null) { + if (typeof object.dashboard !== "object") + throw TypeError(".google.monitoring.dashboard.v1.CreateDashboardRequest.dashboard: object expected"); + message.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.fromObject(object.dashboard); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateDashboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.CreateDashboardRequest} message CreateDashboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDashboardRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dashboard = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dashboard != null && message.hasOwnProperty("dashboard")) + object.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.toObject(message.dashboard, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateDashboardRequest to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDashboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDashboardRequest + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.CreateDashboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDashboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.CreateDashboardRequest"; + }; + + return CreateDashboardRequest; + })(); + + v1.ListDashboardsRequest = (function() { + + /** + * Properties of a ListDashboardsRequest. + * @memberof google.monitoring.dashboard.v1 + * @interface IListDashboardsRequest + * @property {string|null} [parent] ListDashboardsRequest parent + * @property {number|null} [pageSize] ListDashboardsRequest pageSize + * @property {string|null} [pageToken] ListDashboardsRequest pageToken + */ + + /** + * Constructs a new ListDashboardsRequest. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a ListDashboardsRequest. + * @implements IListDashboardsRequest + * @constructor + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest=} [properties] Properties to set + */ + function ListDashboardsRequest(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]]; + } + + /** + * ListDashboardsRequest parent. + * @member {string} parent + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @instance + */ + ListDashboardsRequest.prototype.parent = ""; + + /** + * ListDashboardsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @instance + */ + ListDashboardsRequest.prototype.pageSize = 0; + + /** + * ListDashboardsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @instance + */ + ListDashboardsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDashboardsRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.ListDashboardsRequest} ListDashboardsRequest instance + */ + ListDashboardsRequest.create = function create(properties) { + return new ListDashboardsRequest(properties); + }; + + /** + * Encodes the specified ListDashboardsRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest} message ListDashboardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDashboardsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDashboardsRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsRequest} message ListDashboardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDashboardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDashboardsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.ListDashboardsRequest} ListDashboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDashboardsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.ListDashboardsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDashboardsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.ListDashboardsRequest} ListDashboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDashboardsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDashboardsRequest message. + * @function verify + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDashboardsRequest.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.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 ListDashboardsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.ListDashboardsRequest} ListDashboardsRequest + */ + ListDashboardsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.ListDashboardsRequest) + return object; + var message = new $root.google.monitoring.dashboard.v1.ListDashboardsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDashboardsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {google.monitoring.dashboard.v1.ListDashboardsRequest} message ListDashboardsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDashboardsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 ListDashboardsRequest to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDashboardsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDashboardsRequest + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.ListDashboardsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDashboardsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.ListDashboardsRequest"; + }; + + return ListDashboardsRequest; + })(); + + v1.ListDashboardsResponse = (function() { + + /** + * Properties of a ListDashboardsResponse. + * @memberof google.monitoring.dashboard.v1 + * @interface IListDashboardsResponse + * @property {Array.|null} [dashboards] ListDashboardsResponse dashboards + * @property {string|null} [nextPageToken] ListDashboardsResponse nextPageToken + */ + + /** + * Constructs a new ListDashboardsResponse. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a ListDashboardsResponse. + * @implements IListDashboardsResponse + * @constructor + * @param {google.monitoring.dashboard.v1.IListDashboardsResponse=} [properties] Properties to set + */ + function ListDashboardsResponse(properties) { + this.dashboards = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDashboardsResponse dashboards. + * @member {Array.} dashboards + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @instance + */ + ListDashboardsResponse.prototype.dashboards = $util.emptyArray; + + /** + * ListDashboardsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @instance + */ + ListDashboardsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDashboardsResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsResponse=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.ListDashboardsResponse} ListDashboardsResponse instance + */ + ListDashboardsResponse.create = function create(properties) { + return new ListDashboardsResponse(properties); + }; + + /** + * Encodes the specified ListDashboardsResponse message. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsResponse} message ListDashboardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDashboardsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dashboards != null && message.dashboards.length) + for (var i = 0; i < message.dashboards.length; ++i) + $root.google.monitoring.dashboard.v1.Dashboard.encode(message.dashboards[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 ListDashboardsResponse message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.ListDashboardsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {google.monitoring.dashboard.v1.IListDashboardsResponse} message ListDashboardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDashboardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDashboardsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.ListDashboardsResponse} ListDashboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDashboardsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.ListDashboardsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dashboards && message.dashboards.length)) + message.dashboards = []; + message.dashboards.push($root.google.monitoring.dashboard.v1.Dashboard.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDashboardsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.ListDashboardsResponse} ListDashboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDashboardsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDashboardsResponse message. + * @function verify + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDashboardsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dashboards != null && message.hasOwnProperty("dashboards")) { + if (!Array.isArray(message.dashboards)) + return "dashboards: array expected"; + for (var i = 0; i < message.dashboards.length; ++i) { + var error = $root.google.monitoring.dashboard.v1.Dashboard.verify(message.dashboards[i]); + if (error) + return "dashboards." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDashboardsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.ListDashboardsResponse} ListDashboardsResponse + */ + ListDashboardsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.ListDashboardsResponse) + return object; + var message = new $root.google.monitoring.dashboard.v1.ListDashboardsResponse(); + if (object.dashboards) { + if (!Array.isArray(object.dashboards)) + throw TypeError(".google.monitoring.dashboard.v1.ListDashboardsResponse.dashboards: array expected"); + message.dashboards = []; + for (var i = 0; i < object.dashboards.length; ++i) { + if (typeof object.dashboards[i] !== "object") + throw TypeError(".google.monitoring.dashboard.v1.ListDashboardsResponse.dashboards: object expected"); + message.dashboards[i] = $root.google.monitoring.dashboard.v1.Dashboard.fromObject(object.dashboards[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDashboardsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {google.monitoring.dashboard.v1.ListDashboardsResponse} message ListDashboardsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDashboardsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dashboards = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dashboards && message.dashboards.length) { + object.dashboards = []; + for (var j = 0; j < message.dashboards.length; ++j) + object.dashboards[j] = $root.google.monitoring.dashboard.v1.Dashboard.toObject(message.dashboards[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDashboardsResponse to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDashboardsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDashboardsResponse + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.ListDashboardsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDashboardsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.ListDashboardsResponse"; + }; + + return ListDashboardsResponse; + })(); + + v1.GetDashboardRequest = (function() { + + /** + * Properties of a GetDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @interface IGetDashboardRequest + * @property {string|null} [name] GetDashboardRequest name + */ + + /** + * Constructs a new GetDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a GetDashboardRequest. + * @implements IGetDashboardRequest + * @constructor + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest=} [properties] Properties to set + */ + function GetDashboardRequest(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]]; + } + + /** + * GetDashboardRequest name. + * @member {string} name + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @instance + */ + GetDashboardRequest.prototype.name = ""; + + /** + * Creates a new GetDashboardRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.GetDashboardRequest} GetDashboardRequest instance + */ + GetDashboardRequest.create = function create(properties) { + return new GetDashboardRequest(properties); + }; + + /** + * Encodes the specified GetDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.GetDashboardRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest} message GetDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDashboardRequest.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 GetDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.GetDashboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IGetDashboardRequest} message GetDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDashboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDashboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.GetDashboardRequest} GetDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDashboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.GetDashboardRequest(); + 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 GetDashboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.GetDashboardRequest} GetDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDashboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDashboardRequest message. + * @function verify + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDashboardRequest.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 GetDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.GetDashboardRequest} GetDashboardRequest + */ + GetDashboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.GetDashboardRequest) + return object; + var message = new $root.google.monitoring.dashboard.v1.GetDashboardRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDashboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.GetDashboardRequest} message GetDashboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDashboardRequest.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 GetDashboardRequest to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @instance + * @returns {Object.} JSON object + */ + GetDashboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDashboardRequest + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.GetDashboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDashboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.GetDashboardRequest"; + }; + + return GetDashboardRequest; + })(); + + v1.DeleteDashboardRequest = (function() { + + /** + * Properties of a DeleteDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @interface IDeleteDashboardRequest + * @property {string|null} [name] DeleteDashboardRequest name + */ + + /** + * Constructs a new DeleteDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents a DeleteDashboardRequest. + * @implements IDeleteDashboardRequest + * @constructor + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest=} [properties] Properties to set + */ + function DeleteDashboardRequest(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]]; + } + + /** + * DeleteDashboardRequest name. + * @member {string} name + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @instance + */ + DeleteDashboardRequest.prototype.name = ""; + + /** + * Creates a new DeleteDashboardRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.DeleteDashboardRequest} DeleteDashboardRequest instance + */ + DeleteDashboardRequest.create = function create(properties) { + return new DeleteDashboardRequest(properties); + }; + + /** + * Encodes the specified DeleteDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.DeleteDashboardRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest} message DeleteDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDashboardRequest.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 DeleteDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.DeleteDashboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IDeleteDashboardRequest} message DeleteDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDashboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDashboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.DeleteDashboardRequest} DeleteDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDashboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.DeleteDashboardRequest(); + 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 DeleteDashboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.DeleteDashboardRequest} DeleteDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDashboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDashboardRequest message. + * @function verify + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDashboardRequest.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 DeleteDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.DeleteDashboardRequest} DeleteDashboardRequest + */ + DeleteDashboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.DeleteDashboardRequest) + return object; + var message = new $root.google.monitoring.dashboard.v1.DeleteDashboardRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDashboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.DeleteDashboardRequest} message DeleteDashboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDashboardRequest.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 DeleteDashboardRequest to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDashboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDashboardRequest + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.DeleteDashboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDashboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.DeleteDashboardRequest"; + }; + + return DeleteDashboardRequest; + })(); + + v1.UpdateDashboardRequest = (function() { + + /** + * Properties of an UpdateDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @interface IUpdateDashboardRequest + * @property {google.monitoring.dashboard.v1.IDashboard|null} [dashboard] UpdateDashboardRequest dashboard + * @property {boolean|null} [validateOnly] UpdateDashboardRequest validateOnly + */ + + /** + * Constructs a new UpdateDashboardRequest. + * @memberof google.monitoring.dashboard.v1 + * @classdesc Represents an UpdateDashboardRequest. + * @implements IUpdateDashboardRequest + * @constructor + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest=} [properties] Properties to set + */ + function UpdateDashboardRequest(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]]; + } + + /** + * UpdateDashboardRequest dashboard. + * @member {google.monitoring.dashboard.v1.IDashboard|null|undefined} dashboard + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @instance + */ + UpdateDashboardRequest.prototype.dashboard = null; + + /** + * UpdateDashboardRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @instance + */ + UpdateDashboardRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateDashboardRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest=} [properties] Properties to set + * @returns {google.monitoring.dashboard.v1.UpdateDashboardRequest} UpdateDashboardRequest instance + */ + UpdateDashboardRequest.create = function create(properties) { + return new UpdateDashboardRequest(properties); + }; + + /** + * Encodes the specified UpdateDashboardRequest message. Does not implicitly {@link google.monitoring.dashboard.v1.UpdateDashboardRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest} message UpdateDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDashboardRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dashboard != null && Object.hasOwnProperty.call(message, "dashboard")) + $root.google.monitoring.dashboard.v1.Dashboard.encode(message.dashboard, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateDashboardRequest message, length delimited. Does not implicitly {@link google.monitoring.dashboard.v1.UpdateDashboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.IUpdateDashboardRequest} message UpdateDashboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDashboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDashboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.dashboard.v1.UpdateDashboardRequest} UpdateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDashboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.dashboard.v1.UpdateDashboardRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDashboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.dashboard.v1.UpdateDashboardRequest} UpdateDashboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDashboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDashboardRequest message. + * @function verify + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDashboardRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dashboard != null && message.hasOwnProperty("dashboard")) { + var error = $root.google.monitoring.dashboard.v1.Dashboard.verify(message.dashboard); + if (error) + return "dashboard." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDashboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.dashboard.v1.UpdateDashboardRequest} UpdateDashboardRequest + */ + UpdateDashboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.dashboard.v1.UpdateDashboardRequest) + return object; + var message = new $root.google.monitoring.dashboard.v1.UpdateDashboardRequest(); + if (object.dashboard != null) { + if (typeof object.dashboard !== "object") + throw TypeError(".google.monitoring.dashboard.v1.UpdateDashboardRequest.dashboard: object expected"); + message.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.fromObject(object.dashboard); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateDashboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {google.monitoring.dashboard.v1.UpdateDashboardRequest} message UpdateDashboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDashboardRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dashboard = null; + object.validateOnly = false; + } + if (message.dashboard != null && message.hasOwnProperty("dashboard")) + object.dashboard = $root.google.monitoring.dashboard.v1.Dashboard.toObject(message.dashboard, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateDashboardRequest to JSON. + * @function toJSON + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDashboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDashboardRequest + * @function getTypeUrl + * @memberof google.monitoring.dashboard.v1.UpdateDashboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDashboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.monitoring.dashboard.v1.UpdateDashboardRequest"; + }; + + return UpdateDashboardRequest; + })(); + + return v1; + })(); + + return dashboard; + })(); + + return monitoring; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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; + })(); + + 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; + })(); + + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + 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"; + }; + + 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 2: + case 3: + 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) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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) { + 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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] : 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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 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.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.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[".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.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 {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.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 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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.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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : 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.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]] : 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates 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.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 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.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.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 (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 {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 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.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 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.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.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; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {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 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.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 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * 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 {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new 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 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"] = ""; + + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * 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 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates 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.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @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 {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 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.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 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.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) { + 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.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[".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] : message.idempotencyLevel; + 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.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) { + 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] : 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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-monitoring-dashboard/protos/protos.json b/packages/google-monitoring-dashboard/protos/protos.json new file mode 100644 index 000000000000..5ecf5c2d874a --- /dev/null +++ b/packages/google-monitoring-dashboard/protos/protos.json @@ -0,0 +1,2221 @@ +{ + "nested": { + "google": { + "nested": { + "monitoring": { + "nested": { + "dashboard": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Monitoring.Dashboard.V1", + "go_package": "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard", + "java_multiple_files": true, + "java_outer_classname": "ServiceMonitoringProto", + "java_package": "com.google.monitoring.dashboard.v1", + "php_namespace": "Google\\Cloud\\Monitoring\\Dashboard\\V1", + "ruby_package": "Google::Cloud::Monitoring::Dashboard::V1" + }, + "nested": { + "AlertChart": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/AlertPolicy", + "(google.api.resource).pattern": "projects/{project}/alertPolicies/{alert_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CollapsibleGroup": { + "fields": { + "collapsed": { + "type": "bool", + "id": 1 + } + } + }, + "Aggregation": { + "fields": { + "alignmentPeriod": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "perSeriesAligner": { + "type": "Aligner", + "id": 2 + }, + "crossSeriesReducer": { + "type": "Reducer", + "id": 4 + }, + "groupByFields": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "Aligner": { + "values": { + "ALIGN_NONE": 0, + "ALIGN_DELTA": 1, + "ALIGN_RATE": 2, + "ALIGN_INTERPOLATE": 3, + "ALIGN_NEXT_OLDER": 4, + "ALIGN_MIN": 10, + "ALIGN_MAX": 11, + "ALIGN_MEAN": 12, + "ALIGN_COUNT": 13, + "ALIGN_SUM": 14, + "ALIGN_STDDEV": 15, + "ALIGN_COUNT_TRUE": 16, + "ALIGN_COUNT_FALSE": 24, + "ALIGN_FRACTION_TRUE": 17, + "ALIGN_PERCENTILE_99": 18, + "ALIGN_PERCENTILE_95": 19, + "ALIGN_PERCENTILE_50": 20, + "ALIGN_PERCENTILE_05": 21, + "ALIGN_PERCENT_CHANGE": 23 + } + }, + "Reducer": { + "values": { + "REDUCE_NONE": 0, + "REDUCE_MEAN": 1, + "REDUCE_MIN": 2, + "REDUCE_MAX": 3, + "REDUCE_SUM": 4, + "REDUCE_STDDEV": 5, + "REDUCE_COUNT": 6, + "REDUCE_COUNT_TRUE": 7, + "REDUCE_COUNT_FALSE": 15, + "REDUCE_FRACTION_TRUE": 8, + "REDUCE_PERCENTILE_99": 9, + "REDUCE_PERCENTILE_95": 10, + "REDUCE_PERCENTILE_50": 11, + "REDUCE_PERCENTILE_05": 12 + } + } + } + }, + "PickTimeSeriesFilter": { + "fields": { + "rankingMethod": { + "type": "Method", + "id": 1 + }, + "numTimeSeries": { + "type": "int32", + "id": 2 + }, + "direction": { + "type": "Direction", + "id": 3 + } + }, + "nested": { + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "METHOD_MEAN": 1, + "METHOD_MAX": 2, + "METHOD_MIN": 3, + "METHOD_SUM": 4, + "METHOD_LATEST": 5 + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "TOP": 1, + "BOTTOM": 2 + } + } + } + }, + "StatisticalTimeSeriesFilter": { + "fields": { + "rankingMethod": { + "type": "Method", + "id": 1 + }, + "numTimeSeries": { + "type": "int32", + "id": 2 + } + }, + "nested": { + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "METHOD_CLUSTER_OUTLIER": 1 + } + } + } + }, + "Dashboard": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/Dashboard", + "(google.api.resource).pattern": "projects/{project}/dashboards/{dashboard}" + }, + "oneofs": { + "layout": { + "oneof": [ + "gridLayout", + "mosaicLayout", + "rowLayout", + "columnLayout" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 4 + }, + "gridLayout": { + "type": "GridLayout", + "id": 5 + }, + "mosaicLayout": { + "type": "MosaicLayout", + "id": 6 + }, + "rowLayout": { + "type": "RowLayout", + "id": 8 + }, + "columnLayout": { + "type": "ColumnLayout", + "id": 9 + }, + "dashboardFilters": { + "rule": "repeated", + "type": "DashboardFilter", + "id": 11 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 12 + } + } + }, + "DashboardFilter": { + "oneofs": { + "defaultValue": { + "oneof": [ + "stringValue" + ] + } + }, + "fields": { + "labelKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "templateVariable": { + "type": "string", + "id": 3 + }, + "stringValue": { + "type": "string", + "id": 4 + }, + "filterType": { + "type": "FilterType", + "id": 5 + } + }, + "nested": { + "FilterType": { + "values": { + "FILTER_TYPE_UNSPECIFIED": 0, + "RESOURCE_LABEL": 1, + "METRIC_LABEL": 2, + "USER_METADATA_LABEL": 3, + "SYSTEM_METADATA_LABEL": 4, + "GROUP": 5 + } + } + } + }, + "GridLayout": { + "fields": { + "columns": { + "type": "int64", + "id": 1 + }, + "widgets": { + "rule": "repeated", + "type": "Widget", + "id": 2 + } + } + }, + "MosaicLayout": { + "fields": { + "columns": { + "type": "int32", + "id": 1 + }, + "tiles": { + "rule": "repeated", + "type": "Tile", + "id": 3 + } + }, + "nested": { + "Tile": { + "fields": { + "xPos": { + "type": "int32", + "id": 1 + }, + "yPos": { + "type": "int32", + "id": 2 + }, + "width": { + "type": "int32", + "id": 3 + }, + "height": { + "type": "int32", + "id": 4 + }, + "widget": { + "type": "Widget", + "id": 5 + } + } + } + } + }, + "RowLayout": { + "fields": { + "rows": { + "rule": "repeated", + "type": "Row", + "id": 1 + } + }, + "nested": { + "Row": { + "fields": { + "weight": { + "type": "int64", + "id": 1 + }, + "widgets": { + "rule": "repeated", + "type": "Widget", + "id": 2 + } + } + } + } + }, + "ColumnLayout": { + "fields": { + "columns": { + "rule": "repeated", + "type": "Column", + "id": 1 + } + }, + "nested": { + "Column": { + "fields": { + "weight": { + "type": "int64", + "id": 1 + }, + "widgets": { + "rule": "repeated", + "type": "Widget", + "id": 2 + } + } + } + } + }, + "Widget": { + "oneofs": { + "content": { + "oneof": [ + "xyChart", + "scorecard", + "text", + "blank", + "alertChart", + "timeSeriesTable", + "collapsibleGroup", + "logsPanel" + ] + } + }, + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "xyChart": { + "type": "XyChart", + "id": 2 + }, + "scorecard": { + "type": "Scorecard", + "id": 3 + }, + "text": { + "type": "Text", + "id": 4 + }, + "blank": { + "type": "google.protobuf.Empty", + "id": 5 + }, + "alertChart": { + "type": "AlertChart", + "id": 7 + }, + "timeSeriesTable": { + "type": "TimeSeriesTable", + "id": 8 + }, + "collapsibleGroup": { + "type": "CollapsibleGroup", + "id": 9 + }, + "logsPanel": { + "type": "LogsPanel", + "id": 10 + } + } + }, + "LogsPanel": { + "fields": { + "filter": { + "type": "string", + "id": 1 + }, + "resourceNames": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Scorecard": { + "oneofs": { + "dataView": { + "oneof": [ + "gaugeView", + "sparkChartView" + ] + } + }, + "fields": { + "timeSeriesQuery": { + "type": "TimeSeriesQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gaugeView": { + "type": "GaugeView", + "id": 4 + }, + "sparkChartView": { + "type": "SparkChartView", + "id": 5 + }, + "thresholds": { + "rule": "repeated", + "type": "Threshold", + "id": 6 + } + }, + "nested": { + "GaugeView": { + "fields": { + "lowerBound": { + "type": "double", + "id": 1 + }, + "upperBound": { + "type": "double", + "id": 2 + } + } + }, + "SparkChartView": { + "fields": { + "sparkChartType": { + "type": "SparkChartType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "minAlignmentPeriod": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + } + } + }, + "TimeSeriesQuery": { + "oneofs": { + "source": { + "oneof": [ + "timeSeriesFilter", + "timeSeriesFilterRatio", + "timeSeriesQueryLanguage" + ] + } + }, + "fields": { + "timeSeriesFilter": { + "type": "TimeSeriesFilter", + "id": 1 + }, + "timeSeriesFilterRatio": { + "type": "TimeSeriesFilterRatio", + "id": 2 + }, + "timeSeriesQueryLanguage": { + "type": "string", + "id": 3 + }, + "unitOverride": { + "type": "string", + "id": 5 + } + } + }, + "TimeSeriesFilter": { + "oneofs": { + "outputFilter": { + "oneof": [ + "pickTimeSeriesFilter", + "statisticalTimeSeriesFilter" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "aggregation": { + "type": "Aggregation", + "id": 2 + }, + "secondaryAggregation": { + "type": "Aggregation", + "id": 3 + }, + "pickTimeSeriesFilter": { + "type": "PickTimeSeriesFilter", + "id": 4 + }, + "statisticalTimeSeriesFilter": { + "type": "StatisticalTimeSeriesFilter", + "id": 5, + "options": { + "deprecated": true + } + } + } + }, + "TimeSeriesFilterRatio": { + "oneofs": { + "outputFilter": { + "oneof": [ + "pickTimeSeriesFilter", + "statisticalTimeSeriesFilter" + ] + } + }, + "fields": { + "numerator": { + "type": "RatioPart", + "id": 1 + }, + "denominator": { + "type": "RatioPart", + "id": 2 + }, + "secondaryAggregation": { + "type": "Aggregation", + "id": 3 + }, + "pickTimeSeriesFilter": { + "type": "PickTimeSeriesFilter", + "id": 4 + }, + "statisticalTimeSeriesFilter": { + "type": "StatisticalTimeSeriesFilter", + "id": 5, + "options": { + "deprecated": true + } + } + }, + "nested": { + "RatioPart": { + "fields": { + "filter": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "aggregation": { + "type": "Aggregation", + "id": 2 + } + } + } + } + }, + "Threshold": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "value": { + "type": "double", + "id": 2 + }, + "color": { + "type": "Color", + "id": 3 + }, + "direction": { + "type": "Direction", + "id": 4 + }, + "targetAxis": { + "type": "TargetAxis", + "id": 5 + } + }, + "nested": { + "Color": { + "values": { + "COLOR_UNSPECIFIED": 0, + "YELLOW": 4, + "RED": 6 + } + }, + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "ABOVE": 1, + "BELOW": 2 + } + }, + "TargetAxis": { + "values": { + "TARGET_AXIS_UNSPECIFIED": 0, + "Y1": 1, + "Y2": 2 + } + } + } + }, + "SparkChartType": { + "values": { + "SPARK_CHART_TYPE_UNSPECIFIED": 0, + "SPARK_LINE": 1, + "SPARK_BAR": 2 + } + }, + "TimeSeriesTable": { + "fields": { + "dataSets": { + "rule": "repeated", + "type": "TableDataSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "TableDataSet": { + "fields": { + "timeSeriesQuery": { + "type": "TimeSeriesQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableTemplate": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minAlignmentPeriod": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tableDisplayOptions": { + "type": "TableDisplayOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "TableDisplayOptions": { + "fields": { + "shownColumns": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Text": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "format": { + "type": "Format", + "id": 2 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "MARKDOWN": 1, + "RAW": 2 + } + } + } + }, + "XyChart": { + "fields": { + "dataSets": { + "rule": "repeated", + "type": "DataSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeshiftDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "thresholds": { + "rule": "repeated", + "type": "Threshold", + "id": 5 + }, + "xAxis": { + "type": "Axis", + "id": 6 + }, + "yAxis": { + "type": "Axis", + "id": 7 + }, + "y2Axis": { + "type": "Axis", + "id": 9 + }, + "chartOptions": { + "type": "ChartOptions", + "id": 8 + } + }, + "nested": { + "DataSet": { + "fields": { + "timeSeriesQuery": { + "type": "TimeSeriesQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "plotType": { + "type": "PlotType", + "id": 2 + }, + "legendTemplate": { + "type": "string", + "id": 3 + }, + "minAlignmentPeriod": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetAxis": { + "type": "TargetAxis", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PlotType": { + "values": { + "PLOT_TYPE_UNSPECIFIED": 0, + "LINE": 1, + "STACKED_AREA": 2, + "STACKED_BAR": 3, + "HEATMAP": 4 + } + }, + "TargetAxis": { + "values": { + "TARGET_AXIS_UNSPECIFIED": 0, + "Y1": 1, + "Y2": 2 + } + } + } + }, + "Axis": { + "fields": { + "label": { + "type": "string", + "id": 1 + }, + "scale": { + "type": "Scale", + "id": 2 + } + }, + "nested": { + "Scale": { + "values": { + "SCALE_UNSPECIFIED": 0, + "LINEAR": 1, + "LOG10": 2 + } + } + } + } + } + }, + "ChartOptions": { + "fields": { + "mode": { + "type": "Mode", + "id": 1 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "COLOR": 1, + "X_RAY": 2, + "STATS": 3 + } + } + } + }, + "DashboardsService": { + "options": { + "(google.api.default_host)": "monitoring.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read,https://www.googleapis.com/auth/monitoring.write" + }, + "methods": { + "CreateDashboard": { + "requestType": "CreateDashboardRequest", + "responseType": "Dashboard", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/dashboards", + "(google.api.http).body": "dashboard" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/dashboards", + "body": "dashboard" + } + } + ] + }, + "ListDashboards": { + "requestType": "ListDashboardsRequest", + "responseType": "ListDashboardsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/dashboards" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/dashboards" + } + } + ] + }, + "GetDashboard": { + "requestType": "GetDashboardRequest", + "responseType": "Dashboard", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/dashboards/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/dashboards/*}" + } + } + ] + }, + "DeleteDashboard": { + "requestType": "DeleteDashboardRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/dashboards/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/dashboards/*}" + } + } + ] + }, + "UpdateDashboard": { + "requestType": "UpdateDashboardRequest", + "responseType": "Dashboard", + "options": { + "(google.api.http).patch": "/v1/{dashboard.name=projects/*/dashboards/*}", + "(google.api.http).body": "dashboard" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dashboard.name=projects/*/dashboards/*}", + "body": "dashboard" + } + } + ] + } + } + }, + "CreateDashboardRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dashboard": { + "type": "Dashboard", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + }, + "ListDashboardsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDashboardsResponse": { + "fields": { + "dashboards": { + "rule": "repeated", + "type": "Dashboard", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetDashboardRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/Dashboard" + } + } + } + }, + "DeleteDashboardRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/Dashboard" + } + } + } + }, + "UpdateDashboardRequest": { + "fields": { + "dashboard": { + "type": "Dashboard", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + } + } + }, + "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 + } + } + }, + "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": "string", + "id": 13 + } + } + }, + "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 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 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 + }, + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "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" + } + }, + "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 + } + } + } + } + }, + "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": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-monitoring-dashboard/samples/README.md b/packages/google-monitoring-dashboard/samples/README.md new file mode 100644 index 000000000000..37e75562193a --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/README.md @@ -0,0 +1,158 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Monitoring Dashboards: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Dashboards_service.create_dashboard](#dashboards_service.create_dashboard) + * [Dashboards_service.delete_dashboard](#dashboards_service.delete_dashboard) + * [Dashboards_service.get_dashboard](#dashboards_service.get_dashboard) + * [Dashboards_service.list_dashboards](#dashboards_service.list_dashboards) + * [Dashboards_service.update_dashboard](#dashboards_service.update_dashboard) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Dashboards_service.create_dashboard + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js` + + +----- + + + + +### Dashboards_service.delete_dashboard + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js` + + +----- + + + + +### Dashboards_service.get_dashboard + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js` + + +----- + + + + +### Dashboards_service.list_dashboards + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js` + + +----- + + + + +### Dashboards_service.update_dashboard + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-monitoring-dashboard/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-monitoring-dashboard/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-monitoring-dashboard/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/monitoring/docs diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js new file mode 100644 index 000000000000..23ba816dbfb3 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.create_dashboard.js @@ -0,0 +1,73 @@ +// Copyright 2022 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'; + +function main(parent, dashboard) { + // [START monitoring_v1_generated_DashboardsService_CreateDashboard_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project on which to execute the request. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + * The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name. + */ + // const parent = 'abc123' + /** + * Required. The initial dashboard specification. + */ + // const dashboard = {} + /** + * If set, validate the request and preview the review, but do not actually + * save it. + */ + // const validateOnly = true + + // Imports the Dashboard library + const {DashboardsServiceClient} = require('@google-cloud/monitoring-dashboards').v1; + + // Instantiates a client + const dashboardClient = new DashboardsServiceClient(); + + async function callCreateDashboard() { + // Construct request + const request = { + parent, + dashboard, + }; + + // Run request + const response = await dashboardClient.createDashboard(request); + console.log(response); + } + + callCreateDashboard(); + // [END monitoring_v1_generated_DashboardsService_CreateDashboard_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js new file mode 100644 index 000000000000..9f1b5cd2fb05 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.delete_dashboard.js @@ -0,0 +1,62 @@ +// Copyright 2022 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'; + +function main(name) { + // [START monitoring_v1_generated_DashboardsService_DeleteDashboard_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Dashboard. The format is: + * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] + */ + // const name = 'abc123' + + // Imports the Dashboard library + const {DashboardsServiceClient} = require('@google-cloud/monitoring-dashboards').v1; + + // Instantiates a client + const dashboardClient = new DashboardsServiceClient(); + + async function callDeleteDashboard() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dashboardClient.deleteDashboard(request); + console.log(response); + } + + callDeleteDashboard(); + // [END monitoring_v1_generated_DashboardsService_DeleteDashboard_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js new file mode 100644 index 000000000000..bb5aff74bd7e --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.get_dashboard.js @@ -0,0 +1,64 @@ +// Copyright 2022 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'; + +function main(name) { + // [START monitoring_v1_generated_DashboardsService_GetDashboard_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Dashboard. The format is one of: + * - `dashboards/[DASHBOARD_ID]` (for system dashboards) + * - `projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]` + * (for custom dashboards). + */ + // const name = 'abc123' + + // Imports the Dashboard library + const {DashboardsServiceClient} = require('@google-cloud/monitoring-dashboards').v1; + + // Instantiates a client + const dashboardClient = new DashboardsServiceClient(); + + async function callGetDashboard() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dashboardClient.getDashboard(request); + console.log(response); + } + + callGetDashboard(); + // [END monitoring_v1_generated_DashboardsService_GetDashboard_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js new file mode 100644 index 000000000000..e2079fc137d2 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.list_dashboards.js @@ -0,0 +1,75 @@ +// Copyright 2022 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'; + +function main(parent) { + // [START monitoring_v1_generated_DashboardsService_ListDashboards_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The scope of the dashboards to list. The format is: + * projects/[PROJECT_ID_OR_NUMBER] + */ + // const parent = 'abc123' + /** + * A positive number that is the maximum number of results to return. + * If unspecified, a default of 1000 is used. + */ + // const pageSize = 1234 + /** + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + */ + // const pageToken = 'abc123' + + // Imports the Dashboard library + const {DashboardsServiceClient} = require('@google-cloud/monitoring-dashboards').v1; + + // Instantiates a client + const dashboardClient = new DashboardsServiceClient(); + + async function callListDashboards() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dashboardClient.listDashboardsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDashboards(); + // [END monitoring_v1_generated_DashboardsService_ListDashboards_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js new file mode 100644 index 000000000000..37edb0b76b75 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/dashboards_service.update_dashboard.js @@ -0,0 +1,66 @@ +// Copyright 2022 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'; + +function main(dashboard) { + // [START monitoring_v1_generated_DashboardsService_UpdateDashboard_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The dashboard that will replace the existing dashboard. + */ + // const dashboard = {} + /** + * If set, validate the request and preview the review, but do not actually + * save it. + */ + // const validateOnly = true + + // Imports the Dashboard library + const {DashboardsServiceClient} = require('@google-cloud/monitoring-dashboards').v1; + + // Instantiates a client + const dashboardClient = new DashboardsServiceClient(); + + async function callUpdateDashboard() { + // Construct request + const request = { + dashboard, + }; + + // Run request + const response = await dashboardClient.updateDashboard(request); + console.log(response); + } + + callUpdateDashboard(); + // [END monitoring_v1_generated_DashboardsService_UpdateDashboard_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-monitoring-dashboard/samples/generated/v1/snippet_metadata.google.monitoring.dashboard.v1.json b/packages/google-monitoring-dashboard/samples/generated/v1/snippet_metadata.google.monitoring.dashboard.v1.json new file mode 100644 index 000000000000..33e5628281f3 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/generated/v1/snippet_metadata.google.monitoring.dashboard.v1.json @@ -0,0 +1,235 @@ +{ + "clientLibrary": { + "name": "nodejs-dashboard", + "version": "2.7.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.monitoring.dashboard.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "monitoring_v1_generated_DashboardsService_CreateDashboard_async", + "title": "DashboardsService createDashboard Sample", + "origin": "API_DEFINITION", + "description": " Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam).", + "canonical": true, + "file": "dashboards_service.create_dashboard.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.CreateDashboard", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dashboard", + "type": ".google.monitoring.dashboard.v1.Dashboard" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.monitoring.dashboard.v1.Dashboard", + "client": { + "shortName": "DashboardsServiceClient", + "fullName": "google.monitoring.dashboard.v1.DashboardsServiceClient" + }, + "method": { + "shortName": "CreateDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.CreateDashboard", + "service": { + "shortName": "DashboardsService", + "fullName": "google.monitoring.dashboard.v1.DashboardsService" + } + } + } + }, + { + "regionTag": "monitoring_v1_generated_DashboardsService_ListDashboards_async", + "title": "DashboardsService listDashboards Sample", + "origin": "API_DEFINITION", + "description": " Lists the existing dashboards. This method requires the `monitoring.dashboards.list` permission on the specified project. For more information, see [Cloud Identity and Access Management](https://cloud.google.com/iam).", + "canonical": true, + "file": "dashboards_service.list_dashboards.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDashboards", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.ListDashboards", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.monitoring.dashboard.v1.ListDashboardsResponse", + "client": { + "shortName": "DashboardsServiceClient", + "fullName": "google.monitoring.dashboard.v1.DashboardsServiceClient" + }, + "method": { + "shortName": "ListDashboards", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.ListDashboards", + "service": { + "shortName": "DashboardsService", + "fullName": "google.monitoring.dashboard.v1.DashboardsService" + } + } + } + }, + { + "regionTag": "monitoring_v1_generated_DashboardsService_GetDashboard_async", + "title": "DashboardsService getDashboard Sample", + "origin": "API_DEFINITION", + "description": " Fetches a specific dashboard. This method requires the `monitoring.dashboards.get` permission on the specified dashboard. For more information, see [Cloud Identity and Access Management](https://cloud.google.com/iam).", + "canonical": true, + "file": "dashboards_service.get_dashboard.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.GetDashboard", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.monitoring.dashboard.v1.Dashboard", + "client": { + "shortName": "DashboardsServiceClient", + "fullName": "google.monitoring.dashboard.v1.DashboardsServiceClient" + }, + "method": { + "shortName": "GetDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.GetDashboard", + "service": { + "shortName": "DashboardsService", + "fullName": "google.monitoring.dashboard.v1.DashboardsService" + } + } + } + }, + { + "regionTag": "monitoring_v1_generated_DashboardsService_DeleteDashboard_async", + "title": "DashboardsService deleteDashboard Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing custom dashboard. This method requires the `monitoring.dashboards.delete` permission on the specified dashboard. For more information, see [Cloud Identity and Access Management](https://cloud.google.com/iam).", + "canonical": true, + "file": "dashboards_service.delete_dashboard.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.DeleteDashboard", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DashboardsServiceClient", + "fullName": "google.monitoring.dashboard.v1.DashboardsServiceClient" + }, + "method": { + "shortName": "DeleteDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.DeleteDashboard", + "service": { + "shortName": "DashboardsService", + "fullName": "google.monitoring.dashboard.v1.DashboardsService" + } + } + } + }, + { + "regionTag": "monitoring_v1_generated_DashboardsService_UpdateDashboard_async", + "title": "DashboardsService updateDashboard Sample", + "origin": "API_DEFINITION", + "description": " Replaces an existing custom dashboard with a new definition. This method requires the `monitoring.dashboards.update` permission on the specified dashboard. For more information, see [Cloud Identity and Access Management](https://cloud.google.com/iam).", + "canonical": true, + "file": "dashboards_service.update_dashboard.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.UpdateDashboard", + "async": true, + "parameters": [ + { + "name": "dashboard", + "type": ".google.monitoring.dashboard.v1.Dashboard" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.monitoring.dashboard.v1.Dashboard", + "client": { + "shortName": "DashboardsServiceClient", + "fullName": "google.monitoring.dashboard.v1.DashboardsServiceClient" + }, + "method": { + "shortName": "UpdateDashboard", + "fullName": "google.monitoring.dashboard.v1.DashboardsService.UpdateDashboard", + "service": { + "shortName": "DashboardsService", + "fullName": "google.monitoring.dashboard.v1.DashboardsService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-monitoring-dashboard/samples/package.json b/packages/google-monitoring-dashboard/samples/package.json new file mode 100644 index 000000000000..ee1da3b4b23a --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "monitoring-dashboards-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/monitoring-dashboards": "^2.7.1" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-monitoring-dashboard/samples/quickstart.js b/packages/google-monitoring-dashboard/samples/quickstart.js new file mode 100644 index 000000000000..2276954b8b6c --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/quickstart.js @@ -0,0 +1,46 @@ +// Copyright 2020 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. +// + +'use strict'; + +async function quickstart( + parent = 'projects/my-project' // Project to list dashboards for. +) { + // [START monitoring_dashboards_quickstart] + // Imports the Google Cloud client library + const { + DashboardsServiceClient, + } = require('@google-cloud/monitoring-dashboards'); + + // Creates a client + const ds = new DashboardsServiceClient(); + + // parent = 'projects/my-project', // Project to list dashboards for. + + async function listDashboards() { + const [dashboards] = await ds.listDashboards({ + parent, + }); + console.info('Listing Dashboards:'); + for (const dashboard of dashboards) { + console.info(`\t${dashboard.displayName}`); + } + } + listDashboards(); + // [END monitoring_dashboards_quickstart] +} + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); diff --git a/packages/google-monitoring-dashboard/samples/test/quickstart.js b/packages/google-monitoring-dashboard/samples/test/quickstart.js new file mode 100644 index 000000000000..095a1c9f6020 --- /dev/null +++ b/packages/google-monitoring-dashboard/samples/test/quickstart.js @@ -0,0 +1,44 @@ +// Copyright 2020 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. +// + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const { + DashboardsServiceClient, +} = require('@google-cloud/monitoring-dashboards'); + +// Creates a client +const ds = new DashboardsServiceClient(); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Sample Integration Tests', () => { + let projectId; + before(async () => { + projectId = await ds.getProjectId(); + }); + it('should run quickstart.js', async () => { + const stdout = execSync(`node ./quickstart.js projects/${projectId}`, { + cwd, + }); + // build should have exited with success status. + assert.include(stdout, 'Listing Dashboards'); + }); +}); diff --git a/packages/google-monitoring-dashboard/src/index.ts b/packages/google-monitoring-dashboard/src/index.ts new file mode 100644 index 000000000000..ada7f73ea2a8 --- /dev/null +++ b/packages/google-monitoring-dashboard/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const DashboardsServiceClient = v1.DashboardsServiceClient; +type DashboardsServiceClient = v1.DashboardsServiceClient; + +export {v1, DashboardsServiceClient}; +export default {v1, DashboardsServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts new file mode 100644 index 000000000000..09fa08ad6454 --- /dev/null +++ b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client.ts @@ -0,0 +1,1067 @@ +// Copyright 2022 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, +} 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/dashboards_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dashboards_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages Stackdriver dashboards. A dashboard is an arrangement of data display + * widgets in a specific layout. + * @class + * @memberof v1 + */ +export class DashboardsServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + dashboardsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DashboardsServiceClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 DashboardsServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DashboardsServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') { + 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 = { + alertPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + dashboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/dashboards/{dashboard}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listDashboards: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dashboards' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.monitoring.dashboard.v1.DashboardsService', + 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.dashboardsServiceStub) { + return this.dashboardsServiceStub; + } + + // Put together the "service stub" for + // google.monitoring.dashboard.v1.DashboardsService. + this.dashboardsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.monitoring.dashboard.v1.DashboardsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.monitoring.dashboard.v1 + .DashboardsService, + 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 dashboardsServiceStubMethods = [ + 'createDashboard', + 'listDashboards', + 'getDashboard', + 'deleteDashboard', + 'updateDashboard', + ]; + for (const methodName of dashboardsServiceStubMethods) { + const callPromise = this.dashboardsServiceStub.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.dashboardsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * 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/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + } + + 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 new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard). + * This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project on which to execute the request. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * + * The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name. + * @param {google.monitoring.dashboard.v1.Dashboard} request.dashboard + * Required. The initial dashboard specification. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * save it. + * @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 [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dashboards_service.create_dashboard.js + * region_tag:monitoring_v1_generated_DashboardsService_CreateDashboard_async + */ + createDashboard( + request?: protos.google.monitoring.dashboard.v1.ICreateDashboardRequest, + options?: CallOptions + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.ICreateDashboardRequest | undefined, + {} | undefined + ] + >; + createDashboard( + request: protos.google.monitoring.dashboard.v1.ICreateDashboardRequest, + options: CallOptions, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.ICreateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDashboard( + request: protos.google.monitoring.dashboard.v1.ICreateDashboardRequest, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.ICreateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDashboard( + request?: protos.google.monitoring.dashboard.v1.ICreateDashboardRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.ICreateDashboardRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.ICreateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.ICreateDashboardRequest | 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.createDashboard(request, options, callback); + } + /** + * Fetches a specific dashboard. + * + * This method requires the `monitoring.dashboards.get` permission + * on the specified dashboard. For more information, see + * [Cloud Identity and Access Management](https://cloud.google.com/iam). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Dashboard. The format is one of: + * + * - `dashboards/[DASHBOARD_ID]` (for system dashboards) + * - `projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]` + * (for custom dashboards). + * @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 [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dashboards_service.get_dashboard.js + * region_tag:monitoring_v1_generated_DashboardsService_GetDashboard_async + */ + getDashboard( + request?: protos.google.monitoring.dashboard.v1.IGetDashboardRequest, + options?: CallOptions + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.IGetDashboardRequest | undefined, + {} | undefined + ] + >; + getDashboard( + request: protos.google.monitoring.dashboard.v1.IGetDashboardRequest, + options: CallOptions, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IGetDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDashboard( + request: protos.google.monitoring.dashboard.v1.IGetDashboardRequest, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IGetDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDashboard( + request?: protos.google.monitoring.dashboard.v1.IGetDashboardRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IGetDashboardRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IGetDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.IGetDashboardRequest | 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.getDashboard(request, options, callback); + } + /** + * Deletes an existing custom dashboard. + * + * This method requires the `monitoring.dashboards.delete` permission + * on the specified dashboard. For more information, see + * [Cloud Identity and Access Management](https://cloud.google.com/iam). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Dashboard. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] + * @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 [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dashboards_service.delete_dashboard.js + * region_tag:monitoring_v1_generated_DashboardsService_DeleteDashboard_async + */ + deleteDashboard( + request?: protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest | undefined, + {} | undefined + ] + >; + deleteDashboard( + request: protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDashboard( + request: protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDashboard( + request?: protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.monitoring.dashboard.v1.IDeleteDashboardRequest | 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.deleteDashboard(request, options, callback); + } + /** + * Replaces an existing custom dashboard with a new definition. + * + * This method requires the `monitoring.dashboards.update` permission + * on the specified dashboard. For more information, see + * [Cloud Identity and Access Management](https://cloud.google.com/iam). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.monitoring.dashboard.v1.Dashboard} request.dashboard + * Required. The dashboard that will replace the existing dashboard. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * save it. + * @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 [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/dashboards_service.update_dashboard.js + * region_tag:monitoring_v1_generated_DashboardsService_UpdateDashboard_async + */ + updateDashboard( + request?: protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest, + options?: CallOptions + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest | undefined, + {} | undefined + ] + >; + updateDashboard( + request: protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest, + options: CallOptions, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDashboard( + request: protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest, + callback: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDashboard( + request?: protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.monitoring.dashboard.v1.IDashboard, + | protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard, + protos.google.monitoring.dashboard.v1.IUpdateDashboardRequest | 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({ + 'dashboard.name': request.dashboard!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDashboard(request, options, callback); + } + + /** + * Lists the existing dashboards. + * + * This method requires the `monitoring.dashboards.list` permission + * on the specified project. For more information, see + * [Cloud Identity and Access Management](https://cloud.google.com/iam). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The scope of the dashboards to list. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * If unspecified, a default of 1000 is used. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @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 [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard}. + * 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 `listDashboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDashboards( + request?: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard[], + protos.google.monitoring.dashboard.v1.IListDashboardsRequest | null, + protos.google.monitoring.dashboard.v1.IListDashboardsResponse + ] + >; + listDashboards( + request: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + | protos.google.monitoring.dashboard.v1.IListDashboardsResponse + | null + | undefined, + protos.google.monitoring.dashboard.v1.IDashboard + > + ): void; + listDashboards( + request: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + callback: PaginationCallback< + protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + | protos.google.monitoring.dashboard.v1.IListDashboardsResponse + | null + | undefined, + protos.google.monitoring.dashboard.v1.IDashboard + > + ): void; + listDashboards( + request?: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + | protos.google.monitoring.dashboard.v1.IListDashboardsResponse + | null + | undefined, + protos.google.monitoring.dashboard.v1.IDashboard + >, + callback?: PaginationCallback< + protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + | protos.google.monitoring.dashboard.v1.IListDashboardsResponse + | null + | undefined, + protos.google.monitoring.dashboard.v1.IDashboard + > + ): Promise< + [ + protos.google.monitoring.dashboard.v1.IDashboard[], + protos.google.monitoring.dashboard.v1.IListDashboardsRequest | null, + protos.google.monitoring.dashboard.v1.IListDashboardsResponse + ] + > | 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.listDashboards(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 scope of the dashboards to list. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * If unspecified, a default of 1000 is used. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @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 [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard} 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 `listDashboardsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDashboardsStream( + request?: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + 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['listDashboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDashboards.createStream( + this.innerApiCalls.listDashboards as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDashboards`, 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 scope of the dashboards to list. The format is: + * + * projects/[PROJECT_ID_OR_NUMBER] + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * If unspecified, a default of 1000 is used. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Dashboard]{@link google.monitoring.dashboard.v1.Dashboard}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/dashboards_service.list_dashboards.js + * region_tag:monitoring_v1_generated_DashboardsService_ListDashboards_async + */ + listDashboardsAsync( + request?: protos.google.monitoring.dashboard.v1.IListDashboardsRequest, + 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['listDashboards']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDashboards.asyncIterate( + this.innerApiCalls['listDashboards'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified alertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + alertPolicyPath(project: string, alertPolicy: string) { + return this.pathTemplates.alertPolicyPathTemplate.render({ + project: project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from AlertPolicy resource. + * + * @param {string} alertPolicyName + * A fully-qualified path representing AlertPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertPolicyName(alertPolicyName: string) { + return this.pathTemplates.alertPolicyPathTemplate.match(alertPolicyName) + .project; + } + + /** + * Parse the alert_policy from AlertPolicy resource. + * + * @param {string} alertPolicyName + * A fully-qualified path representing AlertPolicy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromAlertPolicyName(alertPolicyName: string) { + return this.pathTemplates.alertPolicyPathTemplate.match(alertPolicyName) + .alert_policy; + } + + /** + * Return a fully-qualified dashboard resource name string. + * + * @param {string} project + * @param {string} dashboard + * @returns {string} Resource name string. + */ + dashboardPath(project: string, dashboard: string) { + return this.pathTemplates.dashboardPathTemplate.render({ + project: project, + dashboard: dashboard, + }); + } + + /** + * Parse the project from Dashboard resource. + * + * @param {string} dashboardName + * A fully-qualified path representing Dashboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDashboardName(dashboardName: string) { + return this.pathTemplates.dashboardPathTemplate.match(dashboardName) + .project; + } + + /** + * Parse the dashboard from Dashboard resource. + * + * @param {string} dashboardName + * A fully-qualified path representing Dashboard resource. + * @returns {string} A string representing the dashboard. + */ + matchDashboardFromDashboardName(dashboardName: string) { + return this.pathTemplates.dashboardPathTemplate.match(dashboardName) + .dashboard; + } + + /** + * 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; + } + + /** + * 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.dashboardsServiceStub && !this._terminated) { + return this.dashboardsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-monitoring-dashboard/src/v1/dashboards_service_client_config.json b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client_config.json new file mode 100644 index 000000000000..1b2f284ce9ff --- /dev/null +++ b/packages/google-monitoring-dashboard/src/v1/dashboards_service_client_config.json @@ -0,0 +1,64 @@ +{ + "interfaces": { + "google.monitoring.dashboard.v1.DashboardsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unknown_unavailable": [ + "UNKNOWN", + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateDashboard": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDashboards": { + "timeout_millis": 30000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDashboard": { + "timeout_millis": 30000, + "retry_codes_name": "unknown_unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteDashboard": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDashboard": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-monitoring-dashboard/src/v1/dashboards_service_proto_list.json b/packages/google-monitoring-dashboard/src/v1/dashboards_service_proto_list.json new file mode 100644 index 000000000000..c084fbb63f9b --- /dev/null +++ b/packages/google-monitoring-dashboard/src/v1/dashboards_service_proto_list.json @@ -0,0 +1,19 @@ +[ + "../../protos/google/monitoring/dashboard/v1/alertchart.proto", + "../../protos/google/monitoring/dashboard/v1/collapsible_group.proto", + "../../protos/google/monitoring/dashboard/v1/common.proto", + "../../protos/google/monitoring/dashboard/v1/dashboard.proto", + "../../protos/google/monitoring/dashboard/v1/dashboard_filter.proto", + "../../protos/google/monitoring/dashboard/v1/dashboards_service.proto", + "../../protos/google/monitoring/dashboard/v1/drilldowns.proto", + "../../protos/google/monitoring/dashboard/v1/layouts.proto", + "../../protos/google/monitoring/dashboard/v1/logs_panel.proto", + "../../protos/google/monitoring/dashboard/v1/metrics.proto", + "../../protos/google/monitoring/dashboard/v1/scorecard.proto", + "../../protos/google/monitoring/dashboard/v1/service.proto", + "../../protos/google/monitoring/dashboard/v1/table.proto", + "../../protos/google/monitoring/dashboard/v1/table_display_options.proto", + "../../protos/google/monitoring/dashboard/v1/text.proto", + "../../protos/google/monitoring/dashboard/v1/widget.proto", + "../../protos/google/monitoring/dashboard/v1/xychart.proto" +] diff --git a/packages/google-monitoring-dashboard/src/v1/gapic_metadata.json b/packages/google-monitoring-dashboard/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..b310e5783de6 --- /dev/null +++ b/packages/google-monitoring-dashboard/src/v1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.monitoring.dashboard.v1", + "libraryPackage": "@google-cloud/monitoring-dashboards", + "services": { + "DashboardsService": { + "clients": { + "grpc": { + "libraryClient": "DashboardsServiceClient", + "rpcs": { + "CreateDashboard": { + "methods": [ + "createDashboard" + ] + }, + "GetDashboard": { + "methods": [ + "getDashboard" + ] + }, + "DeleteDashboard": { + "methods": [ + "deleteDashboard" + ] + }, + "UpdateDashboard": { + "methods": [ + "updateDashboard" + ] + }, + "ListDashboards": { + "methods": [ + "listDashboards", + "listDashboardsStream", + "listDashboardsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DashboardsServiceClient", + "rpcs": { + "CreateDashboard": { + "methods": [ + "createDashboard" + ] + }, + "GetDashboard": { + "methods": [ + "getDashboard" + ] + }, + "DeleteDashboard": { + "methods": [ + "deleteDashboard" + ] + }, + "UpdateDashboard": { + "methods": [ + "updateDashboard" + ] + }, + "ListDashboards": { + "methods": [ + "listDashboards", + "listDashboardsStream", + "listDashboardsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-monitoring-dashboard/src/v1/index.ts b/packages/google-monitoring-dashboard/src/v1/index.ts new file mode 100644 index 000000000000..da11575d59a8 --- /dev/null +++ b/packages/google-monitoring-dashboard/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 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 {DashboardsServiceClient} from './dashboards_service_client'; diff --git a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..7a6f8ae0e47c --- /dev/null +++ b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 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. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dashboard = require('@google-cloud/monitoring-dashboards'); + +function main() { + const dashboardsServiceClient = new dashboard.DashboardsServiceClient(); +} + +main(); diff --git a/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..5522c74da564 --- /dev/null +++ b/packages/google-monitoring-dashboard/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 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 {DashboardsServiceClient} from '@google-cloud/monitoring-dashboards'; + +// check that the client class type name can be used +function doStuffWithDashboardsServiceClient(client: DashboardsServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dashboardsServiceClient = new DashboardsServiceClient(); + doStuffWithDashboardsServiceClient(dashboardsServiceClient); +} + +main(); diff --git a/packages/google-monitoring-dashboard/system-test/install.ts b/packages/google-monitoring-dashboard/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-monitoring-dashboard/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts b/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts new file mode 100644 index 000000000000..c117824f3e81 --- /dev/null +++ b/packages/google-monitoring-dashboard/test/gapic_dashboards_service_v1.ts @@ -0,0 +1,1220 @@ +// Copyright 2022 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 dashboardsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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.DashboardsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + dashboardsserviceModule.v1.DashboardsServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + dashboardsserviceModule.v1.DashboardsServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = dashboardsserviceModule.v1.DashboardsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dashboardsServiceStub, undefined); + await client.initialize(); + assert(client.dashboardsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dashboardsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dashboardsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + 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 dashboardsserviceModule.v1.DashboardsServiceClient({ + 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('createDashboard', () => { + it('invokes createDashboard without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.CreateDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.CreateDashboardRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.createDashboard = stubSimpleCall(expectedResponse); + const [response] = await client.createDashboard(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDashboard without error using callback', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.CreateDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.CreateDashboardRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.createDashboard = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDashboard( + request, + ( + err?: Error | null, + result?: protos.google.monitoring.dashboard.v1.IDashboard | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDashboard with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.CreateDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.CreateDashboardRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDashboard = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDashboard(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDashboard with closed client', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.CreateDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.CreateDashboardRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDashboard(request), expectedError); + }); + }); + + describe('getDashboard', () => { + it('invokes getDashboard without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.GetDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.GetDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.getDashboard = stubSimpleCall(expectedResponse); + const [response] = await client.getDashboard(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDashboard without error using callback', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.GetDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.GetDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.getDashboard = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDashboard( + request, + ( + err?: Error | null, + result?: protos.google.monitoring.dashboard.v1.IDashboard | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDashboard with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.GetDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.GetDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDashboard = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDashboard(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDashboard with closed client', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.GetDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.GetDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDashboard(request), expectedError); + }); + }); + + describe('deleteDashboard', () => { + it('invokes deleteDashboard without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.DeleteDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.DeleteDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDashboard = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDashboard(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDashboard without error using callback', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.DeleteDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.DeleteDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDashboard = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDashboard( + 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.deleteDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDashboard with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.DeleteDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.DeleteDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDashboard = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDashboard(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDashboard with closed client', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.DeleteDashboardRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.DeleteDashboardRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDashboard(request), expectedError); + }); + }); + + describe('updateDashboard', () => { + it('invokes updateDashboard without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.UpdateDashboardRequest() + ); + request.dashboard ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.UpdateDashboardRequest', + ['dashboard', 'name'] + ); + request.dashboard.name = defaultValue1; + const expectedHeaderRequestParams = `dashboard.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.updateDashboard = stubSimpleCall(expectedResponse); + const [response] = await client.updateDashboard(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDashboard without error using callback', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.UpdateDashboardRequest() + ); + request.dashboard ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.UpdateDashboardRequest', + ['dashboard', 'name'] + ); + request.dashboard.name = defaultValue1; + const expectedHeaderRequestParams = `dashboard.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ); + client.innerApiCalls.updateDashboard = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDashboard( + request, + ( + err?: Error | null, + result?: protos.google.monitoring.dashboard.v1.IDashboard | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDashboard with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.UpdateDashboardRequest() + ); + request.dashboard ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.UpdateDashboardRequest', + ['dashboard', 'name'] + ); + request.dashboard.name = defaultValue1; + const expectedHeaderRequestParams = `dashboard.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDashboard = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDashboard(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDashboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDashboard with closed client', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.UpdateDashboardRequest() + ); + request.dashboard ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.UpdateDashboardRequest', + ['dashboard', 'name'] + ); + request.dashboard.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDashboard(request), expectedError); + }); + }); + + describe('listDashboards', () => { + it('invokes listDashboards without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + ]; + client.innerApiCalls.listDashboards = stubSimpleCall(expectedResponse); + const [response] = await client.listDashboards(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDashboards without error using callback', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + ]; + client.innerApiCalls.listDashboards = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDashboards( + request, + ( + err?: Error | null, + result?: protos.google.monitoring.dashboard.v1.IDashboard[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDashboards with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDashboards = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDashboards(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDashboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDashboardsStream without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + ]; + client.descriptors.page.listDashboards.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDashboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.monitoring.dashboard.v1.Dashboard[] = []; + stream.on( + 'data', + (response: protos.google.monitoring.dashboard.v1.Dashboard) => { + 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.listDashboards.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDashboards, request) + ); + assert( + (client.descriptors.page.listDashboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDashboardsStream with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDashboards.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDashboardsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.monitoring.dashboard.v1.Dashboard[] = []; + stream.on( + 'data', + (response: protos.google.monitoring.dashboard.v1.Dashboard) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDashboards.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDashboards, request) + ); + assert( + (client.descriptors.page.listDashboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDashboards without error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + generateSampleMessage( + new protos.google.monitoring.dashboard.v1.Dashboard() + ), + ]; + client.descriptors.page.listDashboards.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.monitoring.dashboard.v1.IDashboard[] = []; + const iterable = client.listDashboardsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDashboards.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDashboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDashboards with error', async () => { + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.monitoring.dashboard.v1.ListDashboardsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.monitoring.dashboard.v1.ListDashboardsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDashboards.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDashboardsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.monitoring.dashboard.v1.IDashboard[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDashboards.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDashboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('alertPolicy', () => { + const fakePath = '/rendered/path/alertPolicy'; + const expectedParameters = { + project: 'projectValue', + alert_policy: 'alertPolicyValue', + }; + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertPolicyPath', () => { + const result = client.alertPolicyPath( + 'projectValue', + 'alertPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertPolicyName', () => { + const result = client.matchProjectFromAlertPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAlertPolicyFromAlertPolicyName', () => { + const result = client.matchAlertPolicyFromAlertPolicyName(fakePath); + assert.strictEqual(result, 'alertPolicyValue'); + assert( + (client.pathTemplates.alertPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dashboard', () => { + const fakePath = '/rendered/path/dashboard'; + const expectedParameters = { + project: 'projectValue', + dashboard: 'dashboardValue', + }; + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dashboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dashboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dashboardPath', () => { + const result = client.dashboardPath('projectValue', 'dashboardValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dashboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDashboardName', () => { + const result = client.matchProjectFromDashboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dashboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDashboardFromDashboardName', () => { + const result = client.matchDashboardFromDashboardName(fakePath); + assert.strictEqual(result, 'dashboardValue'); + assert( + (client.pathTemplates.dashboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new dashboardsserviceModule.v1.DashboardsServiceClient({ + 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) + ); + }); + }); + }); +}); diff --git a/packages/google-monitoring-dashboard/tsconfig.json b/packages/google-monitoring-dashboard/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-monitoring-dashboard/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/packages/google-monitoring-dashboard/webpack.config.js b/packages/google-monitoring-dashboard/webpack.config.js new file mode 100644 index 000000000000..86d3aea79a8f --- /dev/null +++ b/packages/google-monitoring-dashboard/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: 'DashboardsService', + filename: './dashboards-service.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/release-please-config.json b/release-please-config.json index b3e61f3718e5..e349fe645287 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -7,13 +7,37 @@ "packages/google-cloud-beyondcorp-appgateways": {}, "packages/google-cloud-beyondcorp-clientconnectorservices": {}, "packages/google-cloud-beyondcorp-clientgateways": {}, + "packages/google-cloud-bigquery-analyticshub": {}, + "packages/google-cloud-bigquery-dataexchange": {}, + "packages/google-cloud-bigquery-datapolicies": {}, + "packages/google-cloud-bigquery-datatransfer": {}, + "packages/google-cloud-bigquery-reservation": {}, + "packages/google-cloud-gkeconnect-gateway": {}, + "packages/google-cloud-deploy": {}, + "packages/google-cloud-dataplex": {}, + "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-gkemulticloud": {}, + "packages/google-cloud-language": {}, + "packages/google-cloud-memcache": {}, + "packages/google-cloud-oslogin": {}, + "packages/google-cloud-phishingprotection": {}, + "packages/google-cloud-policytroubleshooter": {}, + "packages/google-cloud-recommender": {}, "packages/google-cloud-redis": {}, + "packages/google-cloud-resourcemanager": {}, "packages/google-cloud-security-publicca": {}, + "packages/google-cloud-shell": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-iam": {}, - "packages/typeless-sample-bot": {}, - "packages/google-cloud-bigquery-analyticshub": {} + "packages/google-maps-routing": {}, + "packages/google-monitoring-dashboard": {}, + "packages/typeless-sample-bot": {} }, - "release-type": "node" + "plugins": [ + { + "type": "sentence-case" + } + ], + "release-type": "node", + "initial-version": "0.1.0" } \ No newline at end of file